订单管理管理模块(维护)

master
wws 1 year ago
parent 7344c017fd
commit b2297f323e

@ -35,9 +35,9 @@ export function getConvert() {
}
// 获取线体
export function getprodLineShift() {
export function getprodLineShift(orderType) {
return request({
url: '/mes/order/getProdLineShift',
url: '/mes/order/getProdLineShift/'+'?type='+orderType,
method: 'get',
})
}

@ -33,16 +33,24 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="拆分状态" prop="prodDesc">
<el-select v-model="queryParams.status" placeholder="请选择">
<el-form-item label="拆分状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择拆分状态" clearable>
<el-option
v-for="item in statusOptions"
:key="item.key"
:label="item.value"
:value="item.key">
</el-option>
v-for="dict in dict.type.order_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label-width="100px" label="计划生产日期" prop="planProDate">
<el-date-picker clearable
v-model="queryParams.planProDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择计划生产日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -51,6 +59,16 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="dialogVisible = true"
v-hasPermi="['order:order:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -130,6 +148,85 @@
</el-table-column>
</el-table>
<!-- 新增模块 -->
<el-dialog title="新增订单" :visible.sync="dialogVisible" width="900px" append-to-body :before-close="handleClose">
<el-form ref="form" :model="form" :rules="addrules" label-width="80px">
<!-- 第一行 -->
<el-row>
<!-- 第一列 -->
<el-col :offset="1" :span="8">
<el-form-item label-width="100px" label="物料号" prop="prodCode">
<el-input v-model="form.prodCode" placeholder="请输入物料号" />
</el-form-item>
</el-col>
<!-- 第二列 -->
<el-col :offset="2" :span="8">
<el-form-item label-width="100px" label="计划生产日期" prop="planProDate">
<el-date-picker clearable
v-model="form.planProDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择计划生产日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
<!-- 第一列 -->
<el-col :offset="1" :span="8">
<el-form-item label-width="100px" label="物料名称" prop="prodDesc">
<el-input v-model="form.prodDesc" placeholder="请输入物料名称" />
</el-form-item>
</el-col>
<!-- 第二列 -->
<el-col :offset="2" :span="8">
<el-form-item label-width="100px" label="计划完成日期" prop="planComplete">
<el-date-picker clearable
v-model="form.planComplete"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择计划完成日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 第三行 -->
<el-row>
<!-- 第一列 -->
<el-col :offset="1" :span="8">
<el-form-item label-width="100px" label="订单数量" prop="quantity">
<el-input v-model="form.quantity" placeholder="请输入订单数量" />
</el-form-item>
</el-col>
<!-- 第二列 -->
<el-col :offset="2" :span="9">
<el-form-item label-width="100px" label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :offset="1" :span="8">
<el-form-item label-width="100px" label="产品类型" prop="prodType">
<el-select v-model="form.prodType" placeholder="请选择产品类型">
<el-option
v-for="dict in dict.type.product_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 拆分模块 -->
<el-dialog :title="title" :visible.sync="splitOpen" width="1000px" append-to-body>
<!-- 拆分头pro -->
@ -252,19 +349,16 @@
export default {
name: "Order",
dicts: ['product_type', 'order_status'],
components: {
Treeselect
},
data() {
return {
//
statusOptions:[{
key:1,
value:"已拆分"
},{
key:0,
value:"未拆分"
}],
//
form: {},
//
dialogVisible: false,
//
productList:[],
//
@ -312,7 +406,6 @@
refreshTable: true,
//
queryParams: {
status: null,
planFactoryCode: null,
orderType: null,
orderCode: null,
@ -345,23 +438,62 @@
};
},
created() {
this.getList();
var now = new Date();
//
const year = now.getFullYear(); //
const month = String(now.getMonth() + 1).padStart(2, '0'); //
const day = String(now.getDate()).padStart(2, '0'); //
const date = `${year}-${month}-${day}`;
this.loading = true;
this.queryParams.status = 'o0';
this.queryParams.planProDate = date;
listOrder(this.queryParams).then(response => {
this.orderList = this.handleTree(response.data, "orderCode", "parentOrder");
this.loading = false;
});
},
methods: {
//
checkNull(entity) {
if (entity !== undefined && entity !== '' && entity !== null){
return 1;
}
return 0;
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.reset();
done();
})
.catch(_ => {});
},
/** 提交按钮 */
submitForm() {
//
if (this.checkNull(this.form.prodCode) == 0 || this.checkNull(this.form.planProDate) == 0 || this.checkNull(this.form.prodDesc) == 0 || this.checkNull(this.form.planComplete) == 0 || this.checkNull(this.form.quantity) == 0 || this.checkNull(this.form.unit) == 0 || this.checkNull(this.form.prodType) == 0){
this.$message({
message:'数据不能为空!',
type:'warning'
})
return;
}
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.dialogVisible = false;
this.reset();
this.getList();
});
} else {
addOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.dialogVisible = false;
this.reset();
this.getList();
});
}
@ -370,16 +502,19 @@
},
/** 检验批次编码是否重复 */
batchCodeChange(e){
for (let i = 1; i < this.formFields.length;i++){
if (this.formFields[this.formFields.length-1].batchCode == this.formFields[i].batchCode){
this.$message({
message: '批次号不能重复',
type: 'warning'
})
this.formFields = [{
batchCode: '',
batchQuantity: ''
}]
if (this.formFields.length>1){
for (let i = 0; i < this.formFields.length-1; i++){
if (this.formFields[this.formFields.length-1].batchCode == this.formFields[i].batchCode){
this.$message({
message:'批次号不能重复!',
type:'warning'
})
this.formFields = [{
batchCode: '',
batchQuantity: ''
}]
return;
}
}
}
},
@ -420,6 +555,7 @@
})
return;
}
//
this.splitForm.formFields = this.formFields;
//
@ -457,22 +593,6 @@
batchCode: '',
batchQuantity: ''
}],
//
getOrderList(id).then(response => {
if(response.code == 500){
this.$modal.msgError(response.msg);
};
//
this.productData[0] = response.data;
//
this.proLoading = true; // true
this.refreshProTable = false; // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true; // refreshProTabletrue
this.proLoading = false; // false
});
})
//
getWorkOrderList(id).then(response => {
@ -493,23 +613,12 @@
if (check){
setTimeout(() => {
this.resetQuery();
this.getList();
// 1
this.splitOpen = false;
}, 500);
}
},
//
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
/** 动态添加表单 */
addField() {
//
@ -564,13 +673,13 @@
},
//
cancel() {
this.splitOpen = false;
this.dialogVisible = false;
this.open = false;
this.reset();
},
//
reset() {
this.splitForm = {
this.form = {
id: null,
planFactoryCode: null,
orderType: null,
@ -626,7 +735,7 @@
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
/** 拆分按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
@ -694,7 +803,7 @@
//
this.splitForm.productDate = new Date();
//
getprodLineShift().then(response => {
getprodLineShift(row.orderType).then(response => {
this.proline = response.data.lines;
this.workShift = response.data.shifts;
});

Loading…
Cancel
Save