订单管理管理模块(优化显示问题)

yangwl
wws 1 year ago
parent 18a9ecf921
commit 7344c017fd

@ -1,5 +1,21 @@
import request from '@/utils/request'
// 通过计划日期获取已分配的料罐、物料、班次信息list
export function getBMSList(planTime) {
return request({
url:'mes/plan/getBMSList/'+'?planTime='+planTime,
method:'get'
})
}
// 获取物料信息list
export function getProductList() {
return request({
url:'/mes/plan/getProductList',
method:'get'
})
}
// 获取料罐信息list
export function getBucketList() {
return request({

@ -120,53 +120,96 @@
<!-- 添加或修改湿料计划管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<!-- 选择工单生产日期 -->
<el-row>
<el-col :offset="8" :span="8">
<el-date-picker
@change="workOrderTimeChange"
v-model="workOrderTime"
type="date"
placeholder="工单日期">
</el-date-picker>
</el-col>
</el-row>
<!-- 工单列表 -->
<el-row>
<el-table
ref="multipleTable"
v-if="refreshWorkTable"
v-loading="workLoading"
:data="workOrderList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
<el-table-column prop="workorderCode" label="工单编码" width="120"></el-table-column>
<el-table-column prop="productName" label="产品名称" width="120"></el-table-column>
<el-table-column prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
<el-table-column prop="shiftDesc" label="班次" show-overflow-tooltip></el-table-column>
<el-table-column prop="" label="料罐" show-overflow-tooltip></el-table-column>
<el-table-column prop="" label="物料" show-overflow-tooltip></el-table-column>
</el-table>
</el-row>
<!-- 料罐-物料-计划日期的选择 -->
<el-form :model="form" ref="dynamicForm" label-width="80px">
<el-row>
<!-- 选择料罐 -->
<el-col :span="8">
<el-form-item size="small" label="选择料罐:">
<el-select v-model="form.bucketId" placeholder="请选择料罐">
<el-option v-for="item in selectBucketList" :key="item.bucketId" :label="item.bucketName"
:value="item.bucketId"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 选择工单生产日期 -->
<el-row>
<el-col :span="8">
<el-form-item size="small" label="工单日期: ">
<el-date-picker
@change="workOrderTimeChange"
v-model="workOrderTime"
type="date"
placeholder="工单日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 工单列表 -->
<el-row>
<el-table
ref="multipleTable"
v-if="refreshWorkTable"
v-loading="workLoading"
:data="workOrderList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
<el-table-column prop="workorderCode" label="工单编码" width="120"></el-table-column>
<el-table-column prop="productName" label="产品名称" width="120"></el-table-column>
<el-table-column prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
<el-table-column prop="shiftDesc" label="班次" show-overflow-tooltip></el-table-column>
<el-table-column prop="" label="料罐" show-overflow-tooltip></el-table-column>
<el-table-column prop="" label="物料" show-overflow-tooltip></el-table-column>
</el-table>
</el-row>
<!-- 料罐-物料-计划日期的选择 -->
<el-row>
<!-- 选择料罐 -->
<el-col :span="8">
<el-form-item size="small" label="选择料罐:">
<el-select v-model="form.bucketId" placeholder="请选择料罐">
<el-option v-for="item in selectBucketList" :key="item.bucketId" :label="item.bucketName"
:value="item.bucketId"></el-option>
</el-select>
</el-form-item>
</el-col>
<!--选择物料 -->
<el-col :span="8">
<el-form-item size="small" label="选择物料:">
<el-select v-model="form.productId" placeholder="请选择物料">
<el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"
:value="item.productId"></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- 选择日期 -->
<el-col :span="8">
<el-form-item size="small" label="计划日期: ">
<el-date-picker @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"></el-date-picker>
</el-form-item>
</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-row>
<el-table
ref="multipleTable"
v-if="refreshWorkTable"
v-loading="workLoading"
:data="newWorkOrderList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
<el-table-column prop="workorderCode" label="工单编码" width="120"></el-table-column>
<el-table-column prop="productName" label="产品名称" width="120"></el-table-column>
<el-table-column prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
<el-table-column prop="shiftDesc" label="班次" show-overflow-tooltip></el-table-column>
<el-table-column prop="bucketName" label="料罐" show-overflow-tooltip></el-table-column>
<el-table-column prop="materialName" label="物料" show-overflow-tooltip></el-table-column>
</el-table>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm"></el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -174,12 +217,22 @@
</template>
<script>
import { getBucketList,getWorkOrderList,listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/mes/plan";
import { getBMSList,getProductList,getBucketList,getWorkOrderList,listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/mes/plan";
export default {
name: "Plan",
data() {
return {
//
checkSelect: true,
// selectList
selectList: null,
// BMS
bmsList: null,
//
newWorkOrderList: null,
// list
selectProductList: null,
// list
selectBucketList: null,
//
@ -222,6 +275,8 @@ export default {
//
form: {
bucketId: null,
productId: null,
planTime: null,
},
//
rules: {
@ -232,8 +287,130 @@ export default {
this.getList();
},
methods: {
/** 新增-提交按钮 */
batchBtn() {
console.log(this.selectProductList)
//
if (this.selectList == null || this.selectList === undefined){
this.$message({
message: '请选择工单!',
type: 'warning'
})
return;
}
if (this.form.bucketId == null || this.form.productId == null){
this.$message({
message: '数据不能为空!',
type: 'warning'
})
return;
}
//
if (this.checkSelect === false){
this.$message({
message: '班次冲突请重新选择!',
type: 'warning'
})
return;
}
//
var bmsList = this.bmsList;
bmsList.push({
bucketId: this.form.bucketId,
materialId: this.form.productId,
shiftId: this.selectList[0].shiftId,
});
for (let i = 0;i<bmsList.length-1;i++){
for (let j = i;j < bmsList.length-1;j++){
if (bmsList[i].shiftId == bmsList[j].shiftId && bmsList[i].bucketId == bmsList[j].bucketId && bmsList[i].materialId != bmsList[j].materialId){
this.$message({
message: '同班次下-同料罐下:不能混料!',
type: 'warning'
})
return;
}
}
}
//
console.log("这里是你先要的数据")
console.log(this.selectList)
console.log(this.selectBucketList)
console.log(this.selectProductList)
//
var bucket;
for (let i = 0;i < this.selectBucketList.length-1;i++){
if (this.form.bucketId == this.selectBucketList[i].bucketId){
bucket = this.selectBucketList[i];
}
}
//
var material;
for (let i = 0;i < this.selectProductList.length-1;i++){
if (this.form.productId == this.selectProductList[i].productId){
material = this.selectProductList[i];
}
}
this.newWorkOrderList = this.selectList;
for (let i = 0; i < this.newWorkOrderList.length-1;i++){
// this.newWorkOrderList[i].
}
// 湿
// var wetMaterialDetail = {
// workorderId: null,
// workorderCode: null,
// productName: null,
// workorderTime: null,
// shiftId: null,
// shiftCode: null,
// shiftDesc: null,
// bucketId: bucket.bucketId,
// bucketCode: bucket.bucketCode,
// bucketName: bucket.bucketName,
// materialId: material.productId,
// materialName: material.productDesc,
// };
// for (let i = 0; i < this.selectList.length-1;i++){
// var workOrder = this.selectList[i];
// wetMaterialDetail.workorderId = workOrder.workorderId;
// wetMaterialDetail.workorderCode = workOrder.workorderCode;
// wetMaterialDetail.productName = workOrder.productName;
// wetMaterialDetail.workorderTime = workOrder.productDate;
// wetMaterialDetail.shiftId = workOrder.shiftId;
// wetMaterialDetail.shiftDesc = workOrder.shiftDesc;
//
// this.wetMaterialDetailList.push(workOrder);
// }
console.log("看这里!!!!")
console.log(this.wetMaterialDetailList)
this.bmsList = bmsList;
this.$message('点击了提交按钮!');
},
/** 校验计划日期 */
checkDate(e){
var now = new Date();
if (e < now){
this.$message({
message: '日期不得早于今天',
type: 'warning'
})
e = now;
this.form.planTime = now;
}
},
/** 新增-选择工单日期 */
workOrderTimeChange(e) {
//
var now = new Date();
if (e < now){
this.form.planTime = now;
}else {
this.form.planTime = e;
}
//
const year = e.getFullYear(); //
const month = String(e.getMonth() + 1).padStart(2, '0'); //
@ -241,6 +418,8 @@ export default {
const productDate = `${year}-${month}-${day}`;
getWorkOrderList(productDate).then(response => {
console.log("这里是你要的数据")
console.log(response.data)
this.workOrderList = response.data;
//
//
@ -293,11 +472,11 @@ export default {
};
this.resetForm("form");
},
/** 搜索按钮操作 */
/** 首-搜索按钮操作 */
handleQuery() {
console.log("这里是你要的数据");
console.log(this.timeList);
if (this.timeList.length>1){
if (this.timeList.length-1>1){
//
const year = this.timeList[0].getFullYear(); //
const month = String(this.timeList[0].getMonth() + 1).padStart(2, '0'); //
@ -320,7 +499,7 @@ export default {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
/** 首-重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.timeList = [];
@ -328,9 +507,23 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
//
this.checkSelect = true;
//
for (let i = 0; i < selection.length-1; i++){
if (selection[0].shiftId != selection[i].shiftId){
this.$message({
message: '班次冲突!',
type: 'warning'
});
this.checkSelect = false;
}
}
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
// selectList
this.selectList = selection;
},
/** 新增按钮操作 */
handleAdd() {
@ -339,12 +532,41 @@ export default {
this.selectBucketList = null;
this.workOrderTime = null;
this.workOrderList = [];
this.selectProductList = null;
this.newWorkOrderList = null;
this.bmapId = null;
//
this.workOrderTime = new Date();
this.form.planTime = new Date();
// list
//
const year = this.workOrderTime.getFullYear(); //
const month = String(this.workOrderTime.getMonth() + 1).padStart(2, '0'); //
const day = String(this.workOrderTime.getDate()).padStart(2, '0'); //
const productDate = `${year}-${month}-${day}`;
getWorkOrderList(productDate).then(response => {
this.workOrderList = response.data;
//
//
this.workLoading = true; // true
this.refreshWorkTable = false; // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkTable = true; // refreshProTabletrue
this.workLoading = false; // false
});
})
getBMSList(productDate).then(response => {
this.bmsList = response.data;
})
//
// list
getBucketList().then(response => {
this.selectBucketList = response.data;
})
// list
getProductList().then(response => {
this.selectProductList = response.data;
})
this.open = true;
this.title = "新增湿料计划";

@ -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; // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
@ -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);
}
}
}

Loading…
Cancel
Save