Browse Source

原材料库优化问题点0808:前端优化代码

master
张东升 10 months ago
parent
commit
9c1c722142
  1. 32
      lms/nladmin-ui/src/views/wms/hw/detail/index.vue
  2. 6
      lms/nladmin-ui/src/views/wms/hw/in/index.vue
  3. 5
      lms/nladmin-ui/src/views/wms/hw/inpending/index.vue
  4. 5
      lms/nladmin-ui/src/views/wms/hw/out/index.vue
  5. 5
      lms/nladmin-ui/src/views/wms/hw/outpending/index.vue
  6. 37
      lms/nladmin-ui/src/views/wms/pdm/workerorder/PointDetailDialog.vue
  7. 6
      lms/nladmin-ui/src/views/wms/pdm/workerorder/WorkOrderDetailDialog.vue
  8. 4
      lms/nladmin-ui/src/views/wms/pdm/workerordertwo/index.vue
  9. 42
      lms/nladmin-ui/src/views/wms/sch/point/index.vue
  10. 4
      lms/nladmin-ui/src/views/wms/ycl/detail/index.vue
  11. 31
      lms/nladmin-ui/src/views/wms/ycl/outdetail/index.vue

32
lms/nladmin-ui/src/views/wms/hw/detail/index.vue

@ -99,8 +99,7 @@
:max="10000" :max="10000"
:step="10" :step="10"
size="mini" size="mini"
> />
</el-input-number>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -108,7 +107,7 @@
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler" height="300"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" height="300" @selection-change="crud.selectionChangeHandler">
<el-table-column v-permission="[]" label="操作" width="80px" align="center" fixed="right"> <el-table-column v-permission="[]" label="操作" width="80px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -148,7 +147,7 @@
:key="item.point_code" :key="item.point_code"
:label="item.point_code" :label="item.point_code"
:value="item.point_code" :value="item.point_code"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -228,7 +227,7 @@ export default {
return true return true
}, },
getPointList() { // getPointList() { //
crudSchBasePoint.getPointsByRegionCodes("HW").then(res => { crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
this.pointList = res this.pointList = res
}) })
}, },
@ -248,32 +247,31 @@ export default {
}) })
}, },
handleButtonClick(row) { handleButtonClick(row) {
this.selectedRow = row; this.selectedRow = row
this.dialogVisible = true; this.dialogVisible = true
this.fetchPoints(); this.fetchPoints()
}, },
fetchPoints() { fetchPoints() {
crudSchBasePoint.getCBPointList().then(res => { crudSchBasePoint.getCBPointList().then(res => {
this.points = res; this.points = res
}) })
}, },
submitSelectedPoint() { submitSelectedPoint() {
const selectedPoint = this.form.selectedPoint; const selectedPoint = this.form.selectedPoint
if (!selectedPoint) { if (!selectedPoint) {
this.$message.warning('请选择一个点位'); this.$message.warning('请选择一个点位')
return; return
} }
// Submit the selected point to the backend // Submit the selected point to the backend
this.$axios.post('/api/pda/task', { this.$axios.post('/api/pda/task', {
start_point: this.selectedRow.pointCode, start_point: this.selectedRow.pointCode,
next_point: selectedPoint next_point: selectedPoint
}).then(response => { }).then(response => {
this.$message.success('提交成功'); this.$message.success('提交成功')
this.dialogVisible = false; this.dialogVisible = false
}).catch(error => { }).catch(error => {
this.$message.error('提交失败'); this.$message.error('提交失败')
}); })
} }
} }
} }

6
lms/nladmin-ui/src/views/wms/hw/in/index.vue

@ -99,8 +99,7 @@
:max="10000" :max="10000"
:step="10" :step="10"
size="mini" size="mini"
> />
</el-input-number>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -136,7 +135,6 @@ import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint' import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
export default { export default {
name: 'HwIn', name: 'HwIn',
components: { pagination, crudOperation, rrOperation, udOperation }, components: { pagination, crudOperation, rrOperation, udOperation },
@ -184,7 +182,7 @@ export default {
return true return true
}, },
getPointList() { // getPointList() { //
crudSchBasePoint.getPointsByRegionCodes("YL,YLHC,KJHC").then(res => { crudSchBasePoint.getPointsByRegionCodes('YL,YLHC,KJHC').then(res => {
this.pointList = res this.pointList = res
}) })
}, },

5
lms/nladmin-ui/src/views/wms/hw/inpending/index.vue

@ -99,8 +99,7 @@
:max="10000" :max="10000"
:step="10" :step="10"
size="mini" size="mini"
> />
</el-input-number>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -181,7 +180,7 @@ export default {
return true return true
}, },
getPointList() { // getPointList() { //
crudSchBasePoint.getPointsByRegionCodes("YL,YLHC,KJHC").then(res => { crudSchBasePoint.getPointsByRegionCodes('YL,YLHC,KJHC').then(res => {
this.pointList = res this.pointList = res
}) })
}, },

5
lms/nladmin-ui/src/views/wms/hw/out/index.vue

@ -98,8 +98,7 @@
:max="10000" :max="10000"
:step="10" :step="10"
size="mini" size="mini"
> />
</el-input-number>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -191,7 +190,7 @@ export default {
return true return true
}, },
getPointList() { // getPointList() { //
crudSchBasePoint.getPointsByRegionCodes("HW").then(res => { crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
this.pointList = res this.pointList = res
}) })
}, },

5
lms/nladmin-ui/src/views/wms/hw/outpending/index.vue

@ -99,8 +99,7 @@
:max="10000" :max="10000"
:step="10" :step="10"
size="mini" size="mini"
> />
</el-input-number>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -182,7 +181,7 @@ export default {
return true return true
}, },
getPointList() { // getPointList() { //
crudSchBasePoint.getPointsByRegionCodes("HW").then(res => { crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
this.pointList = res this.pointList = res
}) })
}, },

37
lms/nladmin-ui/src/views/wms/pdm/workerorder/PointDetailDialog.vue

@ -50,7 +50,8 @@
<pagination /> <pagination />
<el-button <el-button
type="primary" type="primary"
@click="submitSelectedRows"> @click="submitSelectedRows"
>
原材料出库 原材料出库
</el-button> </el-button>
</el-dialog> </el-dialog>
@ -79,7 +80,7 @@
productname: { productname: {
type: String, type: String,
default: '' default: ''
},workorder_code: { }, workorderCode: {
type: String, type: String,
default: '' default: ''
} }
@ -99,12 +100,12 @@
}, },
productname(newVal) { productname(newVal) {
// //
this.query.productname = newVal; this.query.productname = newVal
this.executeQuery(); this.executeQuery()
}, },
workorder_code(newVal) { workorder_code(newVal) {
// //
this.workorder_code = newVal; this.workorder_code = newVal
} }
}, },
methods: { methods: {
@ -115,17 +116,17 @@
this.$emit('update:dialogShow', false) this.$emit('update:dialogShow', false)
}, },
executeQuery() { executeQuery() {
this.crud.toQuery(); this.crud.toQuery()
}, },
submitSelectedRows() { submitSelectedRows() {
const selectedRows = this.$refs.table.selection; const selectedRows = this.$refs.table.selection
if (selectedRows.length === 0) { if (selectedRows.length === 0) {
this.$message.error('请至少选择一行数据'); this.$message.error('请至少选择一行数据')
return; return
} }
// point_code // point_code
const pointCodes = selectedRows.map(row => row.point_code); const pointCodes = selectedRows.map(row => row.point_code)
// //
this.$prompt('请输入回温时间', '提示', { this.$prompt('请输入回温时间', '提示', {
@ -146,27 +147,27 @@
workorder_code: this.workorder_code // 使workorder_code workorder_code: this.workorder_code // 使workorder_code
}).then(response => { }).then(response => {
// //
this.$message.success('提交成功!'); this.$message.success('提交成功!')
// //
this.dialogVisible = false; this.dialogVisible = false
}).catch(error => { }).catch(error => {
// //
this.$message.error('提交失败,请重试'); this.$message.error('提交失败,请重试')
}); })
}).catch(() => { }).catch(() => {
// //
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消提交操作' message: '已取消提交操作'
}); })
}); })
}).catch(() => { }).catch(() => {
// //
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消提交操作' message: '已取消提交操作'
}); })
}); })
} }
} }

6
lms/nladmin-ui/src/views/wms/pdm/workerorder/WorkOrderDetailDialog.vue

@ -107,8 +107,8 @@
}, },
message(newVal) { message(newVal) {
// //
this.query.workorder_code = newVal; this.query.workorder_code = newVal
this.executeQuery(); this.executeQuery()
} }
}, },
methods: { methods: {
@ -120,7 +120,7 @@
this.$emit('update:dialogShow', false) this.$emit('update:dialogShow', false)
}, },
executeQuery() { executeQuery() {
this.crud.toQuery(); this.crud.toQuery()
}, },
doOperate(row) { doOperate(row) {
this.productname = row.matnr this.productname = row.matnr

4
lms/nladmin-ui/src/views/wms/pdm/workerordertwo/index.vue

@ -100,7 +100,7 @@ import pagination from '@crud/Pagination'
import PointDetailDialog from '@/views/wms/pdm/workerordertwo/PointDetailDialog.vue' import PointDetailDialog from '@/views/wms/pdm/workerordertwo/PointDetailDialog.vue'
export default { export default {
name: 'workorder', name: 'Workorder',
components: { PointDetailDialog, pagination, crudOperation, rrOperation, udOperation }, components: { PointDetailDialog, pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
cruds() { cruds() {
@ -115,7 +115,7 @@ export default {
del: false, del: false,
download: false, download: false,
reset: false reset: false
}, }
}) })
}, },
data() { data() {

42
lms/nladmin-ui/src/views/wms/sch/point/index.vue

@ -17,7 +17,7 @@
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -480,7 +480,7 @@ export default {
] ]
}, reasonDialogVisible: false, }, reasonDialogVisible: false,
reasonForm: { reasonForm: {
reason: "" reason: ''
}, },
workShopList: [], workShopList: [],
regionList: [], regionList: [],
@ -489,7 +489,7 @@ export default {
pointStatusDialogList: [], pointStatusDialogList: [],
pointTypesDialogList: [], pointTypesDialogList: [],
pointDialog: false, pointDialog: false,
dialogVisible: false, dialogVisible: false
} }
}, },
created() { created() {
@ -589,50 +589,50 @@ export default {
this.hand() this.hand()
}, openReasonDialog(row) { }, openReasonDialog(row) {
// //
this.reasonDialogVisible = true; this.reasonDialogVisible = true
// rowdata便使 // rowdata便使
this.selectedRow = row; this.selectedRow = row
}, closeReasonDialog() { }, closeReasonDialog() {
// //
this.reasonDialogVisible = false; this.reasonDialogVisible = false
this.$refs["reasonForm"].resetFields(); this.$refs['reasonForm'].resetFields()
}, submitReason() { }, submitReason() {
// //
const data = { const data = {
reason: this.reasonForm.reason, reason: this.reasonForm.reason,
device_code: this.selectedRow.point_code device_code: this.selectedRow.point_code
}; }
// //
// 使axiosPOST // 使axiosPOST
this.$axios this.$axios
.post("/api/schBasePoint/outbound", data) .post('/api/schBasePoint/outbound', data)
.then(response => { .then(response => {
// //
console.log("提交成功", response); console.log('提交成功', response)
this.$message.success("提交成功"); this.$message.success('提交成功')
this.closeReasonDialog(); this.closeReasonDialog()
}) })
.catch(error => { .catch(error => {
// //
console.error("提交失败,废包材位有货", error); console.error('提交失败,废包材位有货', error)
this.$message.error("提交失败,废包材位有货"); this.$message.error('提交失败,废包材位有货')
}); })
}, showConfirmationDialog() { }, showConfirmationDialog() {
this.dialogVisible = true; this.dialogVisible = true
}, },
confirmMove() { confirmMove() {
this.$axios.post('/api/schBaseTask/move', { }) this.$axios.post('/api/schBaseTask/move', { })
.then(response => { .then(response => {
console.log(response.data); console.log(response.data)
}) })
.catch(error => { .catch(error => {
// Handle error response // Handle error response
console.error(error); console.error(error)
}) })
.finally(() => { .finally(() => {
this.dialogVisible = false; // Close the dialog this.dialogVisible = false // Close the dialog
}); })
}, }
} }
} }
</script> </script>

4
lms/nladmin-ui/src/views/wms/ycl/detail/index.vue

@ -93,7 +93,7 @@
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler" height="550"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" height="550" @selection-change="crud.selectionChangeHandler">
<el-table-column prop="pointCode" label="点位编码" :min-width="flexWidth('pointCode',crud.data,'点位编码')" /> <el-table-column prop="pointCode" label="点位编码" :min-width="flexWidth('pointCode',crud.data,'点位编码')" />
<el-table-column prop="pointName" label="点位名称" :min-width="flexWidth('pointName',crud.data,'点位名称')" /> <el-table-column prop="pointName" label="点位名称" :min-width="flexWidth('pointName',crud.data,'点位名称')" />
<el-table-column v-if="false" prop="regionCode" label="区域编码" :min-width="flexWidth('regionCode',crud.data,'区域编码')" /> <el-table-column v-if="false" prop="regionCode" label="区域编码" :min-width="flexWidth('regionCode',crud.data,'区域编码')" />
@ -200,7 +200,7 @@ export default {
}) })
}, },
getEffectiveLength(row) { getEffectiveLength(row) {
return (row.incomingLength - row.incomingchipping).toFixed(2); return (row.incomingLength - row.incomingchipping).toFixed(2)
} }
} }
} }

31
lms/nladmin-ui/src/views/wms/ycl/outdetail/index.vue

@ -105,8 +105,7 @@
:max="10000" :max="10000"
:step="10" :step="10"
size="mini" size="mini"
> />
</el-input-number>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -137,14 +136,16 @@
</el-button> </el-button>
</crudOperation> </crudOperation>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" <el-table
ref="table"
v-loading="crud.loading" v-loading="crud.loading"
:data="crud.data" :data="crud.data"
size="mini" size="mini"
:cell-style="cellStyle" :cell-style="cellStyle"
style="width: 100%;" style="width: 100%;"
height="550"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
height="550"> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="pointCode" label="点位名称" :min-width="flexWidth('pointCode',crud.data,'点位名称')" /> <el-table-column prop="pointCode" label="点位名称" :min-width="flexWidth('pointCode',crud.data,'点位名称')" />
<el-table-column prop="regionName" label="区域名称" :min-width="flexWidth('regionName',crud.data,'区域名称')" /> <el-table-column prop="regionName" label="区域名称" :min-width="flexWidth('regionName',crud.data,'区域名称')" />
@ -176,7 +177,7 @@ import pagination from '@crud/Pagination'
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint' import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
export default { export default {
name: 'outdetail', name: 'Outdetail',
dicts: ['work_order_two_status'], dicts: ['work_order_two_status'],
components: { pagination, crudOperation, rrOperation, udOperation }, components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
@ -232,7 +233,7 @@ export default {
} }
// subTray // subTray
const palletSNs = this.rows.map(row => row.subTray); const palletSNs = this.rows.map(row => row.subTray)
// //
this.$prompt('请输入回温模式(0-普通模式,1-快速模式)', '提示', { this.$prompt('请输入回温模式(0-普通模式,1-快速模式)', '提示', {
inputPattern: /^[0-1]$/, inputPattern: /^[0-1]$/,
@ -247,12 +248,12 @@ export default {
status: '1' status: '1'
}).then(response => { }).then(response => {
// //
this.$message.success('出库提交成功!'); this.$message.success('出库提交成功!')
this.crud.toQuery() this.crud.toQuery()
}).catch(error => { }).catch(error => {
// //
this.$message.error('出库提交失败,请重试'); this.$message.error('出库提交失败,请重试')
}); })
}) })
}, },
cancle() { cancle() {
@ -262,7 +263,7 @@ export default {
return return
} }
// subTray // subTray
const palletSNs = this.rows.map(row => row.subTray); const palletSNs = this.rows.map(row => row.subTray)
// //
this.$axios.post('/api/workorder/batchChange', { this.$axios.post('/api/workorder/batchChange', {
pointCodes: palletSNs, pointCodes: palletSNs,
@ -270,16 +271,16 @@ export default {
status: '0' status: '0'
}).then(response => { }).then(response => {
// //
this.$message.success('出库取消成功!'); this.$message.success('出库取消成功!')
this.crud.toQuery() this.crud.toQuery()
}).catch(error => { }).catch(error => {
// //
this.$message.error('出库取消失败,请重试'); this.$message.error('出库取消失败,请重试')
}); })
}, },
handleSelectionChange(val, row) { handleSelectionChange(val, row) {
this.rows = this.$refs.table.selection this.rows = this.$refs.table.selection
var strs = ''; var strs = ''
this.handleCurrentChange(null) this.handleCurrentChange(null)
if (this.rows.length > 0) { if (this.rows.length > 0) {
this.rows.forEach(now => { this.rows.forEach(now => {
@ -314,7 +315,7 @@ export default {
return this.dict.label.work_order_two_status[row.status] return this.dict.label.work_order_two_status[row.status]
}, },
getPointList() { // getPointList() { //
crudSchBasePoint.getPointsByRegionCodes("YL,YLHC,KJHC").then(res => { crudSchBasePoint.getPointsByRegionCodes('YL,YLHC,KJHC').then(res => {
this.pointList = res this.pointList = res
}) })
}, },

Loading…
Cancel
Save