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

This commit is contained in:
zds
2024-08-19 09:35:42 +08:00
parent 63be654b92
commit 9c1c722142
16 changed files with 370 additions and 375 deletions

View File

@@ -105,8 +105,7 @@
:max="10000"
:step="10"
size="mini"
>
</el-input-number>
/>
</el-form-item>
<rrOperation />
</el-form>
@@ -137,20 +136,22 @@
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
:cell-style="cellStyle"
style="width: 100%;"
@selection-change="handleSelectionChange"
height="550">
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
:cell-style="cellStyle"
style="width: 100%;"
height="550"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<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="subTray" label="子托编码" :min-width="flexWidth('subTray',crud.data,'子托编码')" />
<el-table-column prop="motherTray" label="母托编码" :min-width="flexWidth('motherTray',crud.data,'母托编码')" />
<!-- <el-table-column prop="somtOrderNo" label="出库单号" :min-width="flexWidth('somtOrderNo',crud.data,'出库单号')" />-->
<!-- <el-table-column prop="somtOrderNo" label="出库单号" :min-width="flexWidth('somtOrderNo',crud.data,'出库单号')" />-->
<el-table-column prop="moname" label="生产工单" :min-width="flexWidth('moname',crud.data,'生产工单')" />
<el-table-column prop="status" label="工单状态" :formatter="format_work_order_two_status" :min-width="flexWidth('status',crud.data,'工单状态')" />
<el-table-column prop="supplierName" label="供应商名称" :min-width="flexWidth('supplierName',crud.data,'供应商名称')" />
@@ -176,7 +177,7 @@ import pagination from '@crud/Pagination'
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
export default {
name: 'outdetail',
name: 'Outdetail',
dicts: ['work_order_two_status'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()],
@@ -232,28 +233,28 @@ export default {
}
// 获取选中行的托盘号 subTray
const palletSNs = this.rows.map(row => row.subTray);
const palletSNs = this.rows.map(row => row.subTray)
// 弹出输入回温时间和回温模式的对话框
this.$prompt('请输入回温模式0-普通模式1-快速模式)', '提示', {
inputPattern: /^[0-1]$/,
inputErrorMessage: '输入内容必须是 0 或 1',
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value: mode }) => {
// 提交数据给后台接口
this.$axios.post('/api/workorder/batchChange', {
pointCodes : palletSNs,
mode : mode,
status : '1'
}).then(response => {
// 提交成功处理
this.$message.success('出库提交成功!');
this.crud.toQuery()
}).catch(error => {
// 提交失败处理
this.$message.error('出库提交失败,请重试');
});
this.$prompt('请输入回温模式0-普通模式1-快速模式)', '提示', {
inputPattern: /^[0-1]$/,
inputErrorMessage: '输入内容必须是 0 或 1',
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value: mode }) => {
// 提交数据给后台接口
this.$axios.post('/api/workorder/batchChange', {
pointCodes: palletSNs,
mode: mode,
status: '1'
}).then(response => {
// 提交成功处理
this.$message.success('出库提交成功!')
this.crud.toQuery()
}).catch(error => {
// 提交失败处理
this.$message.error('出库提交失败,请重试')
})
})
},
cancle() {
this.rows = this.$refs.table.selection
@@ -262,33 +263,33 @@ export default {
return
}
// 获取选中行的托盘号 subTray
const palletSNs = this.rows.map(row => row.subTray);
// 提交数据给后台接口
this.$axios.post('/api/workorder/batchChange', {
pointCodes : palletSNs,
mode : '0',
status : '0'
}).then(response => {
// 提交成功处理
this.$message.success('出库取消成功!');
this.crud.toQuery()
}).catch(error => {
// 提交失败处理
this.$message.error('出库取消失败,请重试');
});
const palletSNs = this.rows.map(row => row.subTray)
// 提交数据给后台接口
this.$axios.post('/api/workorder/batchChange', {
pointCodes: palletSNs,
mode: '0',
status: '0'
}).then(response => {
// 提交成功处理
this.$message.success('出库取消成功!')
this.crud.toQuery()
}).catch(error => {
// 提交失败处理
this.$message.error('出库取消失败,请重试')
})
},
handleSelectionChange(val, row) {
this.rows = this.$refs.table.selection
var strs = '';
var strs = ''
this.handleCurrentChange(null)
if (this.rows.length > 0) {
this.rows.forEach(now => {
strs += now.status
})
if(strs.indexOf('1') != -1){
if (strs.indexOf('1') != -1) {
this.confirm_flag = true
}
if(strs.indexOf('0') != -1){
if (strs.indexOf('0') != -1) {
this.cancle_flag = true
}
}
@@ -302,19 +303,19 @@ export default {
cellStyle({ row, column, rowIndex, columnIndex }) {
const status = row.status
if (column.property === 'status') {
if (status == '1') {
return 'background: #13ce66'
}else {
return 'background: #FFBA00'
}
if (column.property === 'status') {
if (status == '1') {
return 'background: #13ce66'
} else {
return 'background: #FFBA00'
}
}
},
format_work_order_two_status(row, column) {
return this.dict.label.work_order_two_status[row.status]
},
getPointList() { // 获取点位列表
crudSchBasePoint.getPointsByRegionCodes("YL,YLHC,KJHC").then(res => {
crudSchBasePoint.getPointsByRegionCodes('YL,YLHC,KJHC').then(res => {
this.pointList = res
})
},