|
|
@@ -48,7 +48,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="开始/截止时间" prop="date">
|
|
|
+ <el-form-item label="开始/截止日期" prop="date">
|
|
|
<el-date-picker
|
|
|
v-model="form.date"
|
|
|
:disabled="!editable"
|
|
|
@@ -56,16 +56,27 @@
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始时间"
|
|
|
style="width: 100%"
|
|
|
- type="datetimerange"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-table ref="productTable" :data="products" style="width: 100%">
|
|
|
- <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column :selectable="selectable" type="selection" width="55" />
|
|
|
<el-table-column label="产品名称" prop="productName" />
|
|
|
<el-table-column label="产品编号" prop="productCode" />
|
|
|
- <el-table-column label="数量" prop="productNum" />
|
|
|
+ <el-table-column v-if="!workId" label="数量" prop="num" />
|
|
|
+ <el-table-column v-if="form.progressType == '10'" label="组装/采购数量" prop="productNum">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ v-model="scope.row.productNum"
|
|
|
+ controls-position="right"
|
|
|
+ :disabled="!productEditable"
|
|
|
+ :max="scope.row.max"
|
|
|
+ :min="1" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if="form.progressType != '10'" label="数量" prop="productNum" />
|
|
|
<el-table-column v-if="form.progressType == '10'" label="获取方式">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
|
@@ -223,11 +234,15 @@
|
|
|
} else {
|
|
|
this.title = '新建工作项'
|
|
|
this.form.progressType = type
|
|
|
+ this.form.progressTitle = ''
|
|
|
this.workId = 0
|
|
|
}
|
|
|
this.getOrderDetails()
|
|
|
this.dialogFormVisible = true
|
|
|
},
|
|
|
+ selectable(row, index) {
|
|
|
+ return row.max > 0 && !this.workId
|
|
|
+ },
|
|
|
close() {
|
|
|
this.$refs['form'].resetFields()
|
|
|
this.form = this.$options.data().form
|
|
|
@@ -330,6 +345,7 @@
|
|
|
async getOrderDetails() {
|
|
|
this.products = []
|
|
|
this.allProducts = []
|
|
|
+ let progressProducts = []
|
|
|
this.deliverProducts = []
|
|
|
this.installProducts = []
|
|
|
this.selfProducts = []
|
|
|
@@ -338,23 +354,50 @@
|
|
|
if (err) return
|
|
|
if (res.code == 200 && res.data) {
|
|
|
this.allProducts = res.data.product
|
|
|
+ progressProducts = res.data.progressProducts ? res.data.progressProducts : []
|
|
|
+ }
|
|
|
+ if (this.form.progressType == '10') {
|
|
|
+ orderWorkApi
|
|
|
+ .getHardwareUserInfo({ name: '丁岳嵩' })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ this.form.principalPersonId = res.data.id
|
|
|
+ this.form.principalPerson = res.data.nickName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ if (!this.form.progressTitle) {
|
|
|
+ this.form.progressTitle =
|
|
|
+ '[' + res.data.contractCode + '][' + res.data.projectName + ']发货任务单-' + res.data.number
|
|
|
+ }
|
|
|
}
|
|
|
for (let p of this.allProducts) {
|
|
|
- p = JSON.parse(JSON.stringify(p))
|
|
|
- if (p.isDeliver != '20') {
|
|
|
- this.deliverProducts.push(p)
|
|
|
+ p.max = p.productNum - p.completeNum
|
|
|
+ p.num = p.completeNum + '/' + p.productNum
|
|
|
+ if (p.max > 0) {
|
|
|
+ p.productNum = 1
|
|
|
+ } else {
|
|
|
+ p.productNum = 0
|
|
|
}
|
|
|
+ p.productId = p.id
|
|
|
+ p = JSON.parse(JSON.stringify(p))
|
|
|
+ this.deliverProducts.push(p)
|
|
|
+ }
|
|
|
+ for (let p of progressProducts) {
|
|
|
+ p = JSON.parse(JSON.stringify(p))
|
|
|
// 10发货任务单/20组装任务单/30部署安装单
|
|
|
if (
|
|
|
- (p.deliverProgressId && p.deliverProgressId != 0 && this.form.progressType == '10') ||
|
|
|
- (p.assembleProgressId && p.assembleProgressId != 0 && this.form.progressType == '20') ||
|
|
|
- (p.installProgressId && p.installProgressId != 0 && this.form.progressType == '30')
|
|
|
+ (p.deliverProgressId == this.workId && this.form.progressType == '10') ||
|
|
|
+ (p.assembleProgressId == this.workId && this.form.progressType == '20') ||
|
|
|
+ (p.installProgressId == this.workId && this.form.progressType == '30')
|
|
|
) {
|
|
|
this.selfProducts.push(p)
|
|
|
}
|
|
|
- if (p.isComplete == '20') {
|
|
|
- this.installProducts.push(p)
|
|
|
- }
|
|
|
+ // if (p.isComplete == '20') {
|
|
|
+ // this.installProducts.push(p)
|
|
|
+ // }
|
|
|
}
|
|
|
this.$forceUpdate()
|
|
|
if (this.workId != 0) {
|
|
|
@@ -363,9 +406,10 @@
|
|
|
if (this.form.progressType == '10') {
|
|
|
this.productEditable = true
|
|
|
this.products = this.deliverProducts
|
|
|
- } else if (this.form.progressType == '30') {
|
|
|
- this.products = this.installProducts
|
|
|
}
|
|
|
+ // else if (this.form.progressType == '30') {
|
|
|
+ // this.products = this.installProducts
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
},
|