|
|
|
@ -33,6 +33,16 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="拆分状态" prop="prodDesc">
|
|
|
|
|
<el-select v-model="queryParams.status" placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in statusOptions"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
:label="item.value"
|
|
|
|
|
:value="item.key">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
@ -52,16 +62,7 @@
|
|
|
|
|
>SAP同步
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!--
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['order:order:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
@ -94,27 +95,27 @@
|
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="订单号" align="center" prop="orderCode" width="100"/>
|
|
|
|
|
<el-table-column label="物料号" align="center" prop="prodCode" width="100"/>
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="prodDesc" width="100"/>
|
|
|
|
|
<el-table-column label="订单数量" align="center" prop="quantity"/>
|
|
|
|
|
<el-table-column label="单位" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column label="任务清单" align="center" prop="workerOrder" width="100"/>
|
|
|
|
|
<el-table-column label="计划生产日期" align="center" prop="planProDate" width="100">
|
|
|
|
|
<el-table-column width="150" label="订单号" align="center" prop="orderCode" />
|
|
|
|
|
<el-table-column width="180" label="物料号" align="center" prop="prodCode" />
|
|
|
|
|
<el-table-column width="200" label="物料名称" align="center" prop="prodDesc" />
|
|
|
|
|
<el-table-column width="90" label="订单数量" align="center" prop="quantity"/>
|
|
|
|
|
<el-table-column width="70" label="单位" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column label="任务清单" align="center" prop="workerOrder" />
|
|
|
|
|
<el-table-column width="120" label="计划生产日期" align="center" prop="planProDate" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.planProDate, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划完成日期" align="center" prop="planComplete" width="100">
|
|
|
|
|
<el-table-column width="120" label="计划完成日期" align="center" prop="planComplete" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.planComplete, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="订单状态" align="center" prop="status"/>
|
|
|
|
|
<el-table-column label="计划工厂编码" prop="planFactoryCode" width="100px"/>
|
|
|
|
|
<el-table-column width="100" align="center" label="计划工厂编码" prop="planFactoryCode"/>
|
|
|
|
|
<el-table-column label="订单类型" align="center" prop="orderType"/>
|
|
|
|
|
<el-table-column label="产品类型" align="center" prop="prodType"/>
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
@ -129,9 +130,8 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改订单对话框 -->
|
|
|
|
|
<!-- 拆分模块 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
|
|
|
|
<el-dialog :title="title" :visible.sync="splitOpen" width="1000px" append-to-body>
|
|
|
|
|
<!-- 拆分头pro -->
|
|
|
|
|
<el-table
|
|
|
|
|
border
|
|
|
|
@ -144,18 +144,19 @@
|
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
|
<el-table-column width="150" label="订单编号" prop="orderCode"/>
|
|
|
|
|
<el-table-column width="380" label="产品名称" align="center" prop="prodDesc"/>
|
|
|
|
|
<el-table-column width="60" label="单位" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column width="130" label="产品数量" align="center" prop="quantity"/>
|
|
|
|
|
<el-table-column label="已拆分数量" align="center" prop="quantitySplit"/>
|
|
|
|
|
<el-table-column label="拆分数量" align="center" prop="atrr1"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-form class="my-margin" :model="form" ref="dynamicForm" label-width="80px">
|
|
|
|
|
<el-form class="my-margin" :model="splitForm" ref="dynamicForm" label-width="80px">
|
|
|
|
|
<!-- 编辑框 -->
|
|
|
|
|
<!-- 第一行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<!-- 选择产线 -->
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="选择机型:">
|
|
|
|
|
<el-select size="small" v-model="form.prodLineCode" placeholder="请选择成型机">
|
|
|
|
|
<el-select size="small" v-model="splitForm.prodLineCode" placeholder="请选择成型机">
|
|
|
|
|
<el-option v-for="item in proline" :key="item.key" :label="item.label" :value="item.key"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -163,13 +164,13 @@
|
|
|
|
|
<!-- 拆分数量 -->
|
|
|
|
|
<el-col :offset="2" :span="7">
|
|
|
|
|
<el-form-item size="small" label="拆分数量:">
|
|
|
|
|
<el-input required type="number" @input="splitNumChange" v-model="form.splitNum"></el-input>
|
|
|
|
|
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 工单日期 -->
|
|
|
|
|
<el-col :offset="1" :span="5">
|
|
|
|
|
<el-form-item size="small" label="工单日期: ">
|
|
|
|
|
<el-date-picker @change="checkDate" v-model="form.productDate" type="date" placeholder="选择日期"></el-date-picker>
|
|
|
|
|
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -178,7 +179,7 @@
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<!-- 选择班次 -->
|
|
|
|
|
<el-form-item size="small" label="选择班次:" class="my-select my-first">
|
|
|
|
|
<el-select v-model="form.shiftId" placeholder="请选择班次">
|
|
|
|
|
<el-select v-model="splitForm.shiftId" placeholder="请选择班次">
|
|
|
|
|
<el-option v-for="item in workShift" :key="item.shiftId" :label="item.shiftDesc"
|
|
|
|
|
:value="item.shiftId"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
@ -207,12 +208,6 @@
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第四行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :offset="11" :span="8">
|
|
|
|
|
<el-button @click="batchBtn" type="primary">提交</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- 拆分尾 -->
|
|
|
|
|
<el-table
|
|
|
|
@ -227,12 +222,13 @@
|
|
|
|
|
<el-table-column width="300" align="center" prop="workorderCode" label="工单号"></el-table-column>
|
|
|
|
|
<el-table-column width="120" align="center" prop="prodLineCode" label="成型机"></el-table-column>
|
|
|
|
|
<el-table-column width="120" align="center" prop="quantitySplit" label="数量"></el-table-column>
|
|
|
|
|
<el-table-column width="60" label="单位" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column align="center" prop="batchCodeList" label="批次号"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 测试 -->
|
|
|
|
|
<!-- 操作按钮 -->
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="cancel">关 闭</el-button>
|
|
|
|
|
<el-button type="primary" @click="batchBtn">提 交</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
@ -244,7 +240,6 @@
|
|
|
|
|
getWorkOrderList,
|
|
|
|
|
getOrderList,
|
|
|
|
|
subSplitOrder,
|
|
|
|
|
getConvert,
|
|
|
|
|
getprodLineShift,
|
|
|
|
|
listOrder,
|
|
|
|
|
getOrder,
|
|
|
|
@ -262,7 +257,14 @@
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
|
|
// 拆分状态选择
|
|
|
|
|
statusOptions:[{
|
|
|
|
|
key:1,
|
|
|
|
|
value:"已拆分"
|
|
|
|
|
},{
|
|
|
|
|
key:0,
|
|
|
|
|
value:"未拆分"
|
|
|
|
|
}],
|
|
|
|
|
//以下为新内容
|
|
|
|
|
productList:[],
|
|
|
|
|
//工单遮罩层
|
|
|
|
@ -292,8 +294,6 @@
|
|
|
|
|
batchCode: '',
|
|
|
|
|
batchQuantity: ''
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
@ -305,13 +305,14 @@
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
splitOpen: false,
|
|
|
|
|
// 是否展开,默认全部展开
|
|
|
|
|
isExpandAll: true,
|
|
|
|
|
// 重新渲染表格状态
|
|
|
|
|
refreshTable: true,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
status: null,
|
|
|
|
|
planFactoryCode: null,
|
|
|
|
|
orderType: null,
|
|
|
|
|
orderCode: null,
|
|
|
|
@ -330,7 +331,7 @@
|
|
|
|
|
prodType: null
|
|
|
|
|
},
|
|
|
|
|
// 拆分表单参数
|
|
|
|
|
form: {
|
|
|
|
|
splitForm: {
|
|
|
|
|
id: null,
|
|
|
|
|
prodLineCode: null,
|
|
|
|
|
splitNum: null,
|
|
|
|
@ -339,13 +340,34 @@
|
|
|
|
|
formFields: [],
|
|
|
|
|
},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {}
|
|
|
|
|
rules: {},
|
|
|
|
|
addrules: {}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateOrder(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addOrder(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 检验批次编码是否重复 */
|
|
|
|
|
batchCodeChange(e){
|
|
|
|
|
for (let i = 1; i < this.formFields.length;i++){
|
|
|
|
@ -366,13 +388,13 @@
|
|
|
|
|
var now = new Date();
|
|
|
|
|
if (e < now){
|
|
|
|
|
e = now;
|
|
|
|
|
this.form.productDate = now;
|
|
|
|
|
this.splitForm.productDate = now;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 拆分提交按钮 */
|
|
|
|
|
batchBtn() {
|
|
|
|
|
// 判断数据不能为空
|
|
|
|
|
if (this.form.splitNum == null || this.form.shiftId == null || this.form.prodLineCode == null){
|
|
|
|
|
if (this.splitForm.splitNum == null || this.splitForm.shiftId == null || this.splitForm.prodLineCode == null){
|
|
|
|
|
this.$message({
|
|
|
|
|
message:'数据不能为空!',
|
|
|
|
|
type:'warning'
|
|
|
|
@ -399,15 +421,15 @@
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//整理订单传入到后端
|
|
|
|
|
this.form.formFields = this.formFields;
|
|
|
|
|
this.splitForm.formFields = this.formFields;
|
|
|
|
|
//整理数据往后端发送
|
|
|
|
|
//下面是请求处理
|
|
|
|
|
const data = {
|
|
|
|
|
formFields : this.formFields,
|
|
|
|
|
prodLineCode : this.form.prodLineCode,
|
|
|
|
|
productDate : this.form.productDate,
|
|
|
|
|
shiftId : this.form.shiftId,
|
|
|
|
|
splitNum : this.form.splitNum,
|
|
|
|
|
prodLineCode : this.splitForm.prodLineCode,
|
|
|
|
|
productDate : this.splitForm.productDate,
|
|
|
|
|
shiftId : this.splitForm.shiftId,
|
|
|
|
|
splitNum : this.splitForm.splitNum,
|
|
|
|
|
product : this.productData[0],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -423,7 +445,7 @@
|
|
|
|
|
|
|
|
|
|
let id = this.productData[0].id;
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.form = {
|
|
|
|
|
this.splitForm = {
|
|
|
|
|
id: null,
|
|
|
|
|
prodLineCode: null,
|
|
|
|
|
splitNum: null,
|
|
|
|
@ -471,8 +493,9 @@
|
|
|
|
|
|
|
|
|
|
if (check){
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.resetQuery();
|
|
|
|
|
// 等待1秒后执行的代码
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.splitOpen = false;
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -487,22 +510,6 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
removeDomain(item) {
|
|
|
|
|
var index = this.dynamicValidateForm.domains.indexOf(item)
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
this.dynamicValidateForm.domains.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
addDomain() {
|
|
|
|
|
this.dynamicValidateForm.domains1.push({
|
|
|
|
|
value: '',
|
|
|
|
|
key: Date.now()
|
|
|
|
|
})
|
|
|
|
|
this.dynamicValidateForm.domains.push({
|
|
|
|
|
value: '',
|
|
|
|
|
key: Date.now()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 动态添加表单 */
|
|
|
|
|
addField() {
|
|
|
|
|
//如果批次数量大于等于拆分数量则不允许拆分
|
|
|
|
@ -557,12 +564,13 @@
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.splitOpen = false;
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
this.splitForm = {
|
|
|
|
|
id: null,
|
|
|
|
|
planFactoryCode: null,
|
|
|
|
|
orderType: null,
|
|
|
|
@ -589,7 +597,7 @@
|
|
|
|
|
},
|
|
|
|
|
/** 拆分表单重置 */
|
|
|
|
|
resetBatch() {
|
|
|
|
|
this.form = {
|
|
|
|
|
this.splitForm = {
|
|
|
|
|
id: null,
|
|
|
|
|
prodLineCode: null,
|
|
|
|
|
splitNum: null,
|
|
|
|
@ -623,11 +631,11 @@
|
|
|
|
|
this.reset();
|
|
|
|
|
this.getTreeselect();
|
|
|
|
|
if (row != null && row.orderCode) {
|
|
|
|
|
this.form.parentOrder = row.orderCode;
|
|
|
|
|
this.splitForm.parentOrder = row.orderCode;
|
|
|
|
|
} else {
|
|
|
|
|
this.form.parentOrder = 0;
|
|
|
|
|
this.splitForm.parentOrder = 0;
|
|
|
|
|
}
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.splitOpen = true;
|
|
|
|
|
this.title = "拆分";
|
|
|
|
|
},
|
|
|
|
|
/** 展开/折叠操作 */
|
|
|
|
@ -643,44 +651,14 @@
|
|
|
|
|
this.reset();
|
|
|
|
|
this.getTreeselect();
|
|
|
|
|
if (row != null) {
|
|
|
|
|
this.form.parentOrder = row.orderCode;
|
|
|
|
|
this.splitForm.parentOrder = row.orderCode;
|
|
|
|
|
}
|
|
|
|
|
getOrder(row.id).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.splitForm = response.data;
|
|
|
|
|
this.splitOpen = true;
|
|
|
|
|
this.title = "修改订单";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitFormbak() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateOrder(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addOrder(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDeletebak(row) {
|
|
|
|
|
this.$modal.confirm('是否确认删除订单编号为"' + row.id + '"的数据项?').then(function () {
|
|
|
|
|
return delOrder(row.id);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 拆分按钮操作 */
|
|
|
|
|
splitBtn(row) {
|
|
|
|
|
//数据初始化
|
|
|
|
@ -706,7 +684,7 @@
|
|
|
|
|
//将数据放入到productData中
|
|
|
|
|
this.productData.push(row);
|
|
|
|
|
//存放id
|
|
|
|
|
this.form.id = row.id;
|
|
|
|
|
this.splitForm.id = row.id;
|
|
|
|
|
this.refreshProTable = false; // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
@ -714,22 +692,28 @@
|
|
|
|
|
this.proLoading = false; // 设置加载状态为false,表示加载完成
|
|
|
|
|
});
|
|
|
|
|
//初始化日期为默认今天
|
|
|
|
|
this.form.productDate = new Date();
|
|
|
|
|
this.splitForm.productDate = new Date();
|
|
|
|
|
//获取成型机和班次
|
|
|
|
|
getprodLineShift().then(response => {
|
|
|
|
|
this.proline = response.data.lines;
|
|
|
|
|
this.workShift = response.data.shifts;
|
|
|
|
|
});
|
|
|
|
|
//获取换算值
|
|
|
|
|
getConvert().then(response => {
|
|
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
|
|
if (response.data[i].dictSort == 2) {
|
|
|
|
|
this.secConvert = response.data[i];
|
|
|
|
|
} else if (response.data[i].dictSort == 3) {
|
|
|
|
|
this.thiConvert = response.data[i];
|
|
|
|
|
}
|
|
|
|
|
if (row.children !== undefined){
|
|
|
|
|
this.secConvert = Number(row.children[0].quantity) / Number(row.quantity);
|
|
|
|
|
if (row.children[0].children !== undefined){
|
|
|
|
|
this.thiConvert = Number(row.children[0].children[0].quantity) / Number(row.quantity);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// getConvert().then(response => {
|
|
|
|
|
// for (let i = 0; i < response.data.length; i++) {
|
|
|
|
|
// if (response.data[i].dictSort == 2) {
|
|
|
|
|
// this.secConvert = response.data[i];
|
|
|
|
|
// } else if (response.data[i].dictSort == 3) {
|
|
|
|
|
// this.thiConvert = response.data[i];
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取工单
|
|
|
|
@ -745,7 +729,7 @@
|
|
|
|
|
this.splitData = data;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.splitOpen = true;
|
|
|
|
|
this.title = "拆分";
|
|
|
|
|
},
|
|
|
|
|
/** 拆分数量方法 */
|
|
|
|
@ -754,7 +738,7 @@
|
|
|
|
|
//不能为负数
|
|
|
|
|
if (e <= 0) {
|
|
|
|
|
e = 1;
|
|
|
|
|
this.form.splitNum = 1;
|
|
|
|
|
this.splitForm.splitNum = 1;
|
|
|
|
|
}
|
|
|
|
|
if (e != '' && e > 0) {
|
|
|
|
|
let max = Number(this.productData[0].quantity) - Number(this.productData[0].quantitySplit);
|
|
|
|
@ -763,21 +747,21 @@
|
|
|
|
|
message: "最大值不能超过" + max + "!",
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
this.form.splitNum = max;
|
|
|
|
|
this.splitForm.splitNum = max;
|
|
|
|
|
}
|
|
|
|
|
//前端数据同步
|
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
|
this.proLoading = true; // 设置加载状态为true,表示正在加载
|
|
|
|
|
//一级
|
|
|
|
|
this.productData[0].atrr1 = this.form.splitNum;
|
|
|
|
|
this.productData[0].atrr1 = this.splitForm.splitNum;
|
|
|
|
|
//二级
|
|
|
|
|
if (this.productData[0].children !== undefined) {
|
|
|
|
|
for (let i = 0; i < this.productData[0].children.length; i++) {
|
|
|
|
|
this.productData[0].children[i].atrr1 = Number(this.form.splitNum) * Number(this.secConvert.dictValue);
|
|
|
|
|
this.productData[0].children[i].atrr1 = Number(this.splitForm.splitNum) * Number(this.secConvert);
|
|
|
|
|
//三级
|
|
|
|
|
if (this.productData[0].children[i].children !== undefined) {
|
|
|
|
|
for (let j = 0; j < this.productData[0].children[i].children.length; j++) {
|
|
|
|
|
this.productData[0].children[i].children[j].atrr1 = Number(this.form.splitNum) * Number(this.secConvert.dictValue) * Number(this.thiConvert.dictValue);
|
|
|
|
|
this.productData[0].children[i].children[j].atrr1 = Number(this.splitForm.splitNum) * Number(this.secConvert) * Number(this.thiConvert);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|