原材料库优化问题点0808:前端优化代码
This commit is contained in:
@@ -99,8 +99,7 @@
|
||||
:max="10000"
|
||||
:step="10"
|
||||
size="mini"
|
||||
>
|
||||
</el-input-number>
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -108,7 +107,7 @@
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@@ -148,7 +147,7 @@
|
||||
:key="item.point_code"
|
||||
:label="item.point_code"
|
||||
:value="item.point_code"
|
||||
></el-option>
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -228,7 +227,7 @@ export default {
|
||||
return true
|
||||
},
|
||||
getPointList() { // 获取点位列表
|
||||
crudSchBasePoint.getPointsByRegionCodes("HW").then(res => {
|
||||
crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
|
||||
this.pointList = res
|
||||
})
|
||||
},
|
||||
@@ -248,32 +247,31 @@ export default {
|
||||
})
|
||||
},
|
||||
handleButtonClick(row) {
|
||||
this.selectedRow = row;
|
||||
this.dialogVisible = true;
|
||||
this.fetchPoints();
|
||||
this.selectedRow = row
|
||||
this.dialogVisible = true
|
||||
this.fetchPoints()
|
||||
},
|
||||
fetchPoints() {
|
||||
crudSchBasePoint.getCBPointList().then(res => {
|
||||
this.points = res;
|
||||
this.points = res
|
||||
})
|
||||
|
||||
},
|
||||
submitSelectedPoint() {
|
||||
const selectedPoint = this.form.selectedPoint;
|
||||
const selectedPoint = this.form.selectedPoint
|
||||
if (!selectedPoint) {
|
||||
this.$message.warning('请选择一个点位');
|
||||
return;
|
||||
this.$message.warning('请选择一个点位')
|
||||
return
|
||||
}
|
||||
// Submit the selected point to the backend
|
||||
this.$axios.post('/api/pda/task', {
|
||||
start_point: this.selectedRow.pointCode,
|
||||
next_point: selectedPoint
|
||||
}).then(response => {
|
||||
this.$message.success('提交成功');
|
||||
this.dialogVisible = false;
|
||||
this.$message.success('提交成功')
|
||||
this.dialogVisible = false
|
||||
}).catch(error => {
|
||||
this.$message.error('提交失败');
|
||||
});
|
||||
this.$message.error('提交失败')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,7 @@
|
||||
:max="10000"
|
||||
:step="10"
|
||||
size="mini"
|
||||
>
|
||||
</el-input-number>
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -136,7 +135,6 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'HwIn',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
@@ -184,7 +182,7 @@ export default {
|
||||
return true
|
||||
},
|
||||
getPointList() { // 获取点位列表
|
||||
crudSchBasePoint.getPointsByRegionCodes("YL,YLHC,KJHC").then(res => {
|
||||
crudSchBasePoint.getPointsByRegionCodes('YL,YLHC,KJHC').then(res => {
|
||||
this.pointList = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -99,8 +99,7 @@
|
||||
:max="10000"
|
||||
:step="10"
|
||||
size="mini"
|
||||
>
|
||||
</el-input-number>
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -181,7 +180,7 @@ export default {
|
||||
return true
|
||||
},
|
||||
getPointList() { // 获取点位列表
|
||||
crudSchBasePoint.getPointsByRegionCodes("YL,YLHC,KJHC").then(res => {
|
||||
crudSchBasePoint.getPointsByRegionCodes('YL,YLHC,KJHC').then(res => {
|
||||
this.pointList = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -98,8 +98,7 @@
|
||||
:max="10000"
|
||||
:step="10"
|
||||
size="mini"
|
||||
>
|
||||
</el-input-number>
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -191,7 +190,7 @@ export default {
|
||||
return true
|
||||
},
|
||||
getPointList() { // 获取点位列表
|
||||
crudSchBasePoint.getPointsByRegionCodes("HW").then(res => {
|
||||
crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
|
||||
this.pointList = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -99,8 +99,7 @@
|
||||
:max="10000"
|
||||
:step="10"
|
||||
size="mini"
|
||||
>
|
||||
</el-input-number>
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -182,7 +181,7 @@ export default {
|
||||
return true
|
||||
},
|
||||
getPointList() { // 获取点位列表
|
||||
crudSchBasePoint.getPointsByRegionCodes("HW").then(res => {
|
||||
crudSchBasePoint.getPointsByRegionCodes('HW').then(res => {
|
||||
this.pointList = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -50,7 +50,8 @@
|
||||
<pagination />
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitSelectedRows">
|
||||
@click="submitSelectedRows"
|
||||
>
|
||||
原材料出库
|
||||
</el-button>
|
||||
</el-dialog>
|
||||
@@ -79,7 +80,7 @@
|
||||
productname: {
|
||||
type: String,
|
||||
default: ''
|
||||
},workorder_code: {
|
||||
}, workorderCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
@@ -99,12 +100,12 @@
|
||||
},
|
||||
productname(newVal) {
|
||||
// 监听传递的值变化,并在变化时执行赋值操作
|
||||
this.query.productname = newVal;
|
||||
this.executeQuery();
|
||||
this.query.productname = newVal
|
||||
this.executeQuery()
|
||||
},
|
||||
workorder_code(newVal) {
|
||||
// 监听传递的值变化,并在变化时执行赋值操作
|
||||
this.workorder_code = newVal;
|
||||
this.workorder_code = newVal
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -115,17 +116,17 @@
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
executeQuery() {
|
||||
this.crud.toQuery();
|
||||
this.crud.toQuery()
|
||||
},
|
||||
submitSelectedRows() {
|
||||
const selectedRows = this.$refs.table.selection;
|
||||
const selectedRows = this.$refs.table.selection
|
||||
if (selectedRows.length === 0) {
|
||||
this.$message.error('请至少选择一行数据');
|
||||
return;
|
||||
this.$message.error('请至少选择一行数据')
|
||||
return
|
||||
}
|
||||
|
||||
// 获取选中行的 point_code
|
||||
const pointCodes = selectedRows.map(row => row.point_code);
|
||||
const pointCodes = selectedRows.map(row => row.point_code)
|
||||
|
||||
// 弹出输入回温时间和回温模式的对话框
|
||||
this.$prompt('请输入回温时间', '提示', {
|
||||
@@ -146,27 +147,27 @@
|
||||
workorder_code: this.workorder_code // 使用workorder_code属性
|
||||
}).then(response => {
|
||||
// 提交成功处理
|
||||
this.$message.success('提交成功!');
|
||||
this.$message.success('提交成功!')
|
||||
// 关闭当前对话框
|
||||
this.dialogVisible = false;
|
||||
this.dialogVisible = false
|
||||
}).catch(error => {
|
||||
// 提交失败处理
|
||||
this.$message.error('提交失败,请重试');
|
||||
});
|
||||
this.$message.error('提交失败,请重试')
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户点击了取消按钮
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消提交操作'
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户点击了取消按钮
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消提交操作'
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
},
|
||||
message(newVal) {
|
||||
// 监听传递的值变化,并在变化时执行赋值操作
|
||||
this.query.workorder_code = newVal;
|
||||
this.executeQuery();
|
||||
this.query.workorder_code = newVal
|
||||
this.executeQuery()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -120,7 +120,7 @@
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
executeQuery() {
|
||||
this.crud.toQuery();
|
||||
this.crud.toQuery()
|
||||
},
|
||||
doOperate(row) {
|
||||
this.productname = row.matnr
|
||||
|
||||
@@ -100,7 +100,7 @@ import pagination from '@crud/Pagination'
|
||||
import PointDetailDialog from '@/views/wms/pdm/workerordertwo/PointDetailDialog.vue'
|
||||
|
||||
export default {
|
||||
name: 'workorder',
|
||||
name: 'Workorder',
|
||||
components: { PointDetailDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
},
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -480,7 +480,7 @@ export default {
|
||||
]
|
||||
}, reasonDialogVisible: false,
|
||||
reasonForm: {
|
||||
reason: ""
|
||||
reason: ''
|
||||
},
|
||||
workShopList: [],
|
||||
regionList: [],
|
||||
@@ -489,7 +489,7 @@ export default {
|
||||
pointStatusDialogList: [],
|
||||
pointTypesDialogList: [],
|
||||
pointDialog: false,
|
||||
dialogVisible: false,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -589,50 +589,50 @@ export default {
|
||||
this.hand()
|
||||
}, openReasonDialog(row) {
|
||||
// 打开选择原因的对话框
|
||||
this.reasonDialogVisible = true;
|
||||
this.reasonDialogVisible = true
|
||||
// 这里可以将row存储到data中,以便在提交时使用
|
||||
this.selectedRow = row;
|
||||
this.selectedRow = row
|
||||
}, closeReasonDialog() {
|
||||
// 关闭选择原因的对话框
|
||||
this.reasonDialogVisible = false;
|
||||
this.$refs["reasonForm"].resetFields();
|
||||
this.reasonDialogVisible = false
|
||||
this.$refs['reasonForm'].resetFields()
|
||||
}, submitReason() {
|
||||
// 提交选择的原因到后端接口
|
||||
const data = {
|
||||
reason: this.reasonForm.reason,
|
||||
device_code: this.selectedRow.point_code
|
||||
};
|
||||
}
|
||||
// 调用后端接口提交数据
|
||||
// 这里假设使用axios库发送POST请求
|
||||
this.$axios
|
||||
.post("/api/schBasePoint/outbound", data)
|
||||
.post('/api/schBasePoint/outbound', data)
|
||||
.then(response => {
|
||||
// 处理后端返回的数据
|
||||
console.log("提交成功", response);
|
||||
this.$message.success("提交成功");
|
||||
this.closeReasonDialog();
|
||||
console.log('提交成功', response)
|
||||
this.$message.success('提交成功')
|
||||
this.closeReasonDialog()
|
||||
})
|
||||
.catch(error => {
|
||||
// 处理错误情况
|
||||
console.error("提交失败,废包材位有货", error);
|
||||
this.$message.error("提交失败,废包材位有货");
|
||||
});
|
||||
console.error('提交失败,废包材位有货', error)
|
||||
this.$message.error('提交失败,废包材位有货')
|
||||
})
|
||||
}, showConfirmationDialog() {
|
||||
this.dialogVisible = true;
|
||||
this.dialogVisible = true
|
||||
},
|
||||
confirmMove() {
|
||||
this.$axios.post('/api/schBaseTask/move', { })
|
||||
.then(response => {
|
||||
console.log(response.data);
|
||||
console.log(response.data)
|
||||
})
|
||||
.catch(error => {
|
||||
// Handle error response
|
||||
console.error(error);
|
||||
console.error(error)
|
||||
})
|
||||
.finally(() => {
|
||||
this.dialogVisible = false; // Close the dialog
|
||||
});
|
||||
},
|
||||
this.dialogVisible = false // Close the dialog
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<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="pointName" label="点位名称" :min-width="flexWidth('pointName',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) {
|
||||
return (row.incomingLength - row.incomingchipping).toFixed(2);
|
||||
return (row.incomingLength - row.incomingchipping).toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@
|
||||
:max="10000"
|
||||
:step="10"
|
||||
size="mini"
|
||||
>
|
||||
</el-input-number>
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -137,14 +136,16 @@
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table"
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
:cell-style="cellStyle"
|
||||
style="width: 100%;"
|
||||
height="550"
|
||||
@selection-change="handleSelectionChange"
|
||||
height="550">
|
||||
>
|
||||
<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,'区域名称')" />
|
||||
@@ -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,7 +233,7 @@ 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]$/,
|
||||
@@ -247,12 +248,12 @@ export default {
|
||||
status: '1'
|
||||
}).then(response => {
|
||||
// 提交成功处理
|
||||
this.$message.success('出库提交成功!');
|
||||
this.$message.success('出库提交成功!')
|
||||
this.crud.toQuery()
|
||||
}).catch(error => {
|
||||
// 提交失败处理
|
||||
this.$message.error('出库提交失败,请重试');
|
||||
});
|
||||
this.$message.error('出库提交失败,请重试')
|
||||
})
|
||||
})
|
||||
},
|
||||
cancle() {
|
||||
@@ -262,7 +263,7 @@ export default {
|
||||
return
|
||||
}
|
||||
// 获取选中行的托盘号 subTray
|
||||
const palletSNs = this.rows.map(row => row.subTray);
|
||||
const palletSNs = this.rows.map(row => row.subTray)
|
||||
// 提交数据给后台接口
|
||||
this.$axios.post('/api/workorder/batchChange', {
|
||||
pointCodes: palletSNs,
|
||||
@@ -270,16 +271,16 @@ export default {
|
||||
status: '0'
|
||||
}).then(response => {
|
||||
// 提交成功处理
|
||||
this.$message.success('出库取消成功!');
|
||||
this.$message.success('出库取消成功!')
|
||||
this.crud.toQuery()
|
||||
}).catch(error => {
|
||||
// 提交失败处理
|
||||
this.$message.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 => {
|
||||
@@ -314,7 +315,7 @@ export default {
|
||||
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
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user