|
|
|
@ -125,11 +125,15 @@
|
|
|
|
|
<el-table v-loading="loading" :data="productOrderList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
|
|
<el-table-column label="主键标识" align="center" prop="productOrderId" v-if="columns[0].visible"/>
|
|
|
|
|
<el-table-column label="工单编号" align="center" prop="orderCode" v-if="columns[1].visible" width="100"/>
|
|
|
|
|
<el-table-column label="销售类型" align="center" prop="saleType" v-if="columns[28].visible" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.mes_sale_type" :value="scope.row.saleType"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[2].visible" width="100"/>
|
|
|
|
|
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[3].visible" width="100"/>
|
|
|
|
|
<el-table-column label="销售订单行号" align="center" prop="saleorderLinenumber" v-if="columns[4].visible" width="110"/>
|
|
|
|
|
<el-table-column label="项目编号" align="center" prop="projectNo" v-if="columns[5].visible"/>
|
|
|
|
|
<el-table-column label="工单编号" align="center" prop="orderCode" v-if="columns[1].visible" width="100"/>
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[6].visible" width="100"/>
|
|
|
|
|
<el-table-column label="物料BOM" align="center" prop="materialBomDesc" v-if="columns[7].visible" width="120"/>
|
|
|
|
|
<el-table-column label="派工类型" align="center" prop="dispatchType" v-if="columns[8].visible">
|
|
|
|
@ -157,7 +161,8 @@
|
|
|
|
|
<span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180" v-if="columns[26].visible">
|
|
|
|
|
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180"
|
|
|
|
|
v-if="columns[26].visible">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
@ -260,26 +265,38 @@
|
|
|
|
|
<el-form-item label="工单编号" prop="orderCode">
|
|
|
|
|
<el-input v-model="form.orderCode" placeholder="请输入工单编号" :disabled="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="销售类型" prop="saleType">
|
|
|
|
|
<el-radio-group v-model="form.saleType" @input="changeSaleType">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in dict.type.mes_sale_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.value"
|
|
|
|
|
>{{ dict.label }}
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item label="销售订单ID" prop="saleOrderId">-->
|
|
|
|
|
<!-- <el-input v-model="form.saleOrderId" placeholder="请输入销售订单ID" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="销售订单编号" prop="saleorderCode">
|
|
|
|
|
<el-input v-model="form.saleorderCode" placeholder="请点击右侧检索销售订单编号" readonly>
|
|
|
|
|
<el-input v-model="form.saleorderCode" placeholder="请点击右侧检索销售订单编号" :disabled="saleOrderDisabled" readonly>
|
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleSaleOrderAdd"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="销售订单行号" prop="saleorderLinenumber">
|
|
|
|
|
<el-input v-model="form.saleorderLinenumber" placeholder="请输入销售订单行号" :disabled="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="项目编号" prop="projectNo">-->
|
|
|
|
|
<!-- <el-input v-model="form.projectNo" placeholder="请输入项目编号" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="物料ID" prop="materialId" >-->
|
|
|
|
|
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" :disabled="true"/>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="物料名称" prop="materialId">
|
|
|
|
|
<el-input v-model="form.materialName" placeholder="请输入物料名称" :disabled="true"/>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="物料名称" prop="materialName">
|
|
|
|
|
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" :disabled="materialDisabled" readonly>
|
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="物料BOM" prop="materialBomId">
|
|
|
|
|
<el-select v-model="form.materialBomId" placeholder="请选择物料BOM">
|
|
|
|
|
<el-option
|
|
|
|
@ -346,9 +363,16 @@
|
|
|
|
|
<el-form-item label="工单编号" prop="orderCode">
|
|
|
|
|
<el-input v-model="form.orderCode" :disabled="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="项目编号" prop="projectNo">-->
|
|
|
|
|
<!-- <el-input v-model="form.projectNo" placeholder="请输入项目编号"/>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="销售类型" prop="saleType">
|
|
|
|
|
<el-radio-group v-model="form.saleType">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in dict.type.mes_sale_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.value"
|
|
|
|
|
>{{ dict.label }}
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料名称" prop="materialName">
|
|
|
|
|
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" readonly>
|
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
|
|
|
|
@ -452,7 +476,7 @@ import router from "@//router";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "ProductOrder",
|
|
|
|
|
dicts: ['active_flag', 'plan_status', 'dispatch_type'],
|
|
|
|
|
dicts: ['active_flag', 'plan_status', 'dispatch_type', 'mes_sale_type'],
|
|
|
|
|
components: {
|
|
|
|
|
'add-SaleOrder': addSaleOrder,
|
|
|
|
|
'add-bom': addBom
|
|
|
|
@ -525,11 +549,14 @@ export default {
|
|
|
|
|
saleOrderId: [
|
|
|
|
|
{required: true, message: "销售订单ID不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
saleType: [
|
|
|
|
|
{required: true, message: "销售类型不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
saleorderCode: [
|
|
|
|
|
{required: true, message: "销售订单编号不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
materialId: [
|
|
|
|
|
{required: true, message: "物料ID不能为空", trigger: "blur"}
|
|
|
|
|
materialName: [
|
|
|
|
|
{required: true, message: "物料名称不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
materialBomId: [
|
|
|
|
|
{required: true, message: "物料BOM不能为空", trigger: "blur"}
|
|
|
|
@ -593,11 +620,20 @@ export default {
|
|
|
|
|
{key: 25, label: `更新时间`, visible: false},
|
|
|
|
|
{key: 26, label: `计划交货日期`, visible: true},
|
|
|
|
|
{key: 27, label: `单位时间`, visible: true},
|
|
|
|
|
{key: 28, label: `销售类型`, visible: true},
|
|
|
|
|
],
|
|
|
|
|
//物料BOM选项
|
|
|
|
|
materialBomList: [],
|
|
|
|
|
//工艺路线选项
|
|
|
|
|
routeList: [],
|
|
|
|
|
|
|
|
|
|
saleOrderDisabled: true,
|
|
|
|
|
materialDisabled: true,
|
|
|
|
|
//销售类型
|
|
|
|
|
MES_SALE_TYPE: {
|
|
|
|
|
MES_SALE_TYPE_EXTERNAL: '1',//外部销售
|
|
|
|
|
MES_SALE_TYPE_INTERNAL: '2',//对内生产
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -609,6 +645,7 @@ export default {
|
|
|
|
|
this.routeList = response.data;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询生产工单列表 */
|
|
|
|
|
getList() {
|
|
|
|
@ -671,6 +708,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleSaleOrderAdd() {
|
|
|
|
|
if(this.form.saleType===null || this.form.saleType===undefined || this.form.saleType===''){
|
|
|
|
|
this.$modal.msgWarning("请先选择销售类型!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.saleOrderOpen = true;
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
@ -709,28 +750,64 @@ export default {
|
|
|
|
|
this.form.saleOrderId = selectedRow.saleOrderId;
|
|
|
|
|
this.form.saleorderCode = selectedRow.saleorderCode;
|
|
|
|
|
this.form.saleorderLinenumber = selectedRow.saleorderLinenumber;
|
|
|
|
|
this.form.materialId = selectedRow.materialId;
|
|
|
|
|
this.form.materialCode = selectedRow.materialCode;
|
|
|
|
|
this.form.materialName = selectedRow.materialName;
|
|
|
|
|
this.form.saleAmount = selectedRow.orderAmount;
|
|
|
|
|
this.form.planBeginTime = selectedRow.beginDate == null ? null : selectedRow.beginDate + " 00:00:00";
|
|
|
|
|
this.form.planEndTime = selectedRow.endDate == null ? null : selectedRow.endDate + " 00:00:00";
|
|
|
|
|
this.form.planDeliveryDate = selectedRow.planDeliveryDate == null ? null : selectedRow.planDeliveryDate + " 00:00:00";
|
|
|
|
|
this.form.saleOrderFlag = '1';
|
|
|
|
|
getMaterialVisionList(selectedRow.materialId).then(response => {
|
|
|
|
|
if (selectedRow.materialId === null || selectedRow.materialId === undefined || selectedRow.materialId === "") {
|
|
|
|
|
this.$modal.msgError("该销售订单销售成品信息不存在!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.saleType && this.form.saleType === this.MES_SALE_TYPE.MES_SALE_TYPE_EXTERNAL) {
|
|
|
|
|
this.form.materialId = selectedRow.materialId;
|
|
|
|
|
this.form.materialCode = selectedRow.materialCode;
|
|
|
|
|
this.form.materialName = selectedRow.materialName;
|
|
|
|
|
this.getMaterialVisionList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.saleOrderOpen = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
changeSaleType(value) {
|
|
|
|
|
this.form.saleOrderId =null;
|
|
|
|
|
this.form.saleorderCode = null;
|
|
|
|
|
this.form.saleorderLinenumber = null;
|
|
|
|
|
this.form.materialId = null;
|
|
|
|
|
this.form.materialCode = null;
|
|
|
|
|
this.form.materialName = null;
|
|
|
|
|
this.form.saleAmount = null;
|
|
|
|
|
this.form.planBeginTime = null;
|
|
|
|
|
this.form.planEndTime = null;
|
|
|
|
|
this.form.planDeliveryDate = null;
|
|
|
|
|
this.form.materialBomId = null;
|
|
|
|
|
this.form.dispatchId = null;
|
|
|
|
|
this.form.saleOrderFlag = '1';//销售订单新增
|
|
|
|
|
|
|
|
|
|
this.saleOrderDisabled = false;
|
|
|
|
|
if (value == this.MES_SALE_TYPE.MES_SALE_TYPE_EXTERNAL) {
|
|
|
|
|
this.materialDisabled = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.materialDisabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getMaterialVisionList() {
|
|
|
|
|
getMaterialVisionList(this.form.materialId).then(response => {
|
|
|
|
|
this.materialBomList = response.data
|
|
|
|
|
if (this.materialBomList.length !== 0) {
|
|
|
|
|
this.form.materialBomId = this.materialBomList[0].materialBomId;
|
|
|
|
|
} else {
|
|
|
|
|
this.form.materialBomId = null;
|
|
|
|
|
this.$modal.msgError("该销售订单物料未维护BOM信息!");
|
|
|
|
|
this.$modal.msgError("该物料未维护BOM信息!");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.saleOrderOpen = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.materialDisabled = true;
|
|
|
|
|
this.reset();
|
|
|
|
|
getOrderCode().then(response => {
|
|
|
|
|
this.form.orderCode = response.msg;
|
|
|
|
@ -741,11 +818,14 @@ export default {
|
|
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleMaterialAdd() {
|
|
|
|
|
if (!this.materialDisabled) {
|
|
|
|
|
this.materialOpen = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 无订单新增按钮操作 */
|
|
|
|
|
handleNoOrderAdd() {
|
|
|
|
|
this.materialDisabled = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
getOrderCode().then(response => {
|
|
|
|
|
this.form.orderCode = response.msg;
|
|
|
|
|