|
@@ -1,11 +1,6 @@
|
|
|
<!-- 订单新增或修改 -->
|
|
|
<template>
|
|
|
<div>
|
|
|
- <!-- <el-dialog
|
|
|
- :title="!id ? '新增': display ? '详情' : '修改'"
|
|
|
- width="70%"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :visible.sync="visible"> -->
|
|
|
<div class="my-title">{{ !id ? '新增': display ? '详情' : '修改' }}</div>
|
|
|
<!-- 工作流 -->
|
|
|
<div v-show="display && dataForm.workFlowBusinessExt">
|
|
@@ -62,22 +57,14 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="批次号" prop="batchNumber">
|
|
|
- <el-input v-model="dataForm.batchNumber" placeholder="批次号" :disabled="display || addType === 2"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
-<!-- <el-row class="my-row">-->
|
|
|
-<!-- <upload-component :display="display" :title="'合同扫描件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>-->
|
|
|
-<!-- </el-row>-->
|
|
|
<el-row class="my-row">
|
|
|
<el-form-item label="备注说明" prop="notes">
|
|
|
<el-input type="textarea" v-model="dataForm.notes" :disabled="display || addType === 2" placeholder="备注说明" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row class="my-row">
|
|
|
- <div class="title"><span style="color: red">*</span> 任务单产品明细</div>
|
|
|
+ <div class="title"><span style="color: red">*</span> 物料清单明细</div>
|
|
|
<el-table
|
|
|
:data="productDetails"
|
|
|
border
|
|
@@ -94,7 +81,7 @@
|
|
|
align="center"
|
|
|
min-width="120"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
- label="产品名称">
|
|
|
+ label="物料名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="productSpecifications"
|
|
@@ -111,6 +98,13 @@
|
|
|
min-width="100"
|
|
|
label="数量">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="cnt"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ min-width="100"
|
|
|
+ label="单位">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="productNumber"
|
|
|
header-align="center"
|
|
@@ -181,7 +175,7 @@
|
|
|
<el-row class="my-row">
|
|
|
<div class="title"><span style="color: red">*</span> 任务工单派发</div>
|
|
|
<el-table
|
|
|
- :data="productDetails"
|
|
|
+ :data="workInfoDetails"
|
|
|
border
|
|
|
style="width: 100%;">
|
|
|
<el-table-column
|
|
@@ -277,16 +271,13 @@
|
|
|
<el-button @click="onChose">取消</el-button>
|
|
|
<el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
</span>
|
|
|
- <!-- </el-dialog> -->
|
|
|
<add-or-update v-if="productListVisible" ref="productList" @addItem="addItem" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- // import templateChose from '../product/template-chose'
|
|
|
import { getOrderDetail } from '@/api/sale'
|
|
|
import UserComponent from '../common/user-component'
|
|
|
- // import {toNumber} from '@/utils/common'
|
|
|
import UploadComponent from '../common/upload-component'
|
|
|
import { dealStepData, dealStepLogs } from '@/api/util'
|
|
|
import CusComponent from '../common/cus-component'
|
|
@@ -309,10 +300,10 @@
|
|
|
fileList: [],
|
|
|
dataList: [],
|
|
|
id: 0,
|
|
|
- productDetails: [],
|
|
|
+ productDetails: [], // 任务单物料明细
|
|
|
+ workInfoDetails: [], // 任务工单派发列表
|
|
|
dataForm: {},
|
|
|
dataRule: {
|
|
|
- // contractNumber: [{ required: true, message: '合同号不能为空', trigger: 'blur' }],
|
|
|
customerId: [{ required: true, message: '客户名称不能为空', trigger: 'change' }],
|
|
|
salesmanId: [{ required: true, message: '业务员不能为空', trigger: 'change' }],
|
|
|
deliveryDate: [{ required: true, message: '合同交期不能为空', trigger: 'change' }]
|
|
@@ -357,12 +348,18 @@
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- // 订单产品明细
|
|
|
- if (data.data.saleROrderProductList) {
|
|
|
- data.data.saleROrderProductList.forEach((item) => {
|
|
|
+ // 任务单物料明细
|
|
|
+ if (data.data.saleROrderProductParamsList) {
|
|
|
+ data.data.saleROrderProductParamsList.forEach((item) => {
|
|
|
this.addItem(item)
|
|
|
})
|
|
|
}
|
|
|
+ // 任务工单派发
|
|
|
+ if (data.data.workInfoList) {
|
|
|
+ data.data.workInfoList.forEach((item) => {
|
|
|
+ this.addWorkItem(item)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -379,6 +376,16 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ addWorkItem (item) {
|
|
|
+ if (!item.recordId) {
|
|
|
+ item.recordId = Math.round(Math.random() * 1000000)
|
|
|
+ }
|
|
|
+ if (this.workInfoDetails.findIndex(item1 => item1.recordId === item.recordId) === -1) {
|
|
|
+ this.workInfoDetails.push({
|
|
|
+ ...item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
validateField (type) {
|
|
|
this.$refs.dataForm.validateField(type)
|
|
|
},
|
|
@@ -397,16 +404,20 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- // 订单产品明细
|
|
|
+ // 任务单物料明细
|
|
|
let pList = this.productDetails
|
|
|
if (pList.length > 0) {
|
|
|
this.dataForm.saleROrderProductParamsList = pList
|
|
|
- // // rate百分比转换
|
|
|
- // this.dataForm.saleROrderProductParamsList.forEach((item) => {
|
|
|
- // item.rate = toNumber(item.rateVal)
|
|
|
- // })
|
|
|
} else {
|
|
|
- this.$message.error('请添加订单产品明细')
|
|
|
+ this.$message.error('请添加任务单物料明细')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 任务工单派发列表
|
|
|
+ let pList2 = this.workInfoDetails
|
|
|
+ if (pList2.length > 0) {
|
|
|
+ this.dataForm.workInfoList = pList2
|
|
|
+ } else {
|
|
|
+ this.$message.error('请添加任务工单派发')
|
|
|
return
|
|
|
}
|
|
|
this.$http({
|
|
@@ -457,8 +468,8 @@
|
|
|
deleteProductHandle (recordId) {
|
|
|
this.productDetails.splice(this.productDetails.findIndex((item) => item.recordId === recordId), 1)
|
|
|
},
|
|
|
- //添加任务工单派发
|
|
|
- addProductV2 () {
|
|
|
+ // 添加任务工单
|
|
|
+ addWorkItemHandle () {
|
|
|
|
|
|
}
|
|
|
}
|