|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px">
|
|
|
+ <el-dialog :title="title" :visible.sync="dialogFormVisible" width="750px">
|
|
|
<el-form ref="form" label-position="top" :model="form" :rules="rules">
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="24">
|
|
|
@@ -29,6 +29,16 @@
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col v-if="progress.progressType == '30'" :span="24">
|
|
|
+ <el-form-item label="产品">
|
|
|
+ <el-table ref="productTable" :data="products" style="width: 100%">
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column label="产品名称" prop="productName" />
|
|
|
+ <el-table-column label="产品编号" prop="productCode" />
|
|
|
+ <el-table-column label="数量" prop="productNum" />
|
|
|
+ </el-table>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" placeholder="请输入备注" :rows="5" show-word-limit type="textarea" />
|
|
|
@@ -45,6 +55,7 @@
|
|
|
|
|
|
<script>
|
|
|
import deliverWorkApi from '@/api/work/deliverWork'
|
|
|
+ import orderWorkApi from '@/api/work/deliver'
|
|
|
import to from 'await-to-js'
|
|
|
import axios from 'axios'
|
|
|
import asyncUploadFile from '@/utils/uploadajax'
|
|
|
@@ -60,6 +71,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ products: [],
|
|
|
form: {
|
|
|
date: '',
|
|
|
fileUrl: '',
|
|
|
@@ -102,8 +114,23 @@
|
|
|
if (this.$refs.uploadRef) {
|
|
|
this.$refs.uploadRef.clearFiles() //去掉文件列表
|
|
|
}
|
|
|
+ this.getProgressProducts()
|
|
|
this.dialogFormVisible = true
|
|
|
},
|
|
|
+ // 获取产品
|
|
|
+ async getProgressProducts() {
|
|
|
+ let temp = []
|
|
|
+ const [err, res] = await to(orderWorkApi.getDeliverOrder({ id: this.progress.deliverOrderId }))
|
|
|
+ if (err) return
|
|
|
+ if (res.code == 200 && res.data && res.data.progressProducts) {
|
|
|
+ for (let item of res.data.progressProducts) {
|
|
|
+ if (item.installProgressId == this.progress.id) {
|
|
|
+ temp.push(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.products = temp
|
|
|
+ },
|
|
|
// 上传附件
|
|
|
beforeAvatarUpload(file) {
|
|
|
let flag1 = file.size < this.fileSettings.fileSize
|
|
|
@@ -187,6 +214,22 @@
|
|
|
this.$emit('fetch-data')
|
|
|
}
|
|
|
} else if (this.progress.progressType == '30') {
|
|
|
+ if (!this.$refs.productTable.selection || this.$refs.productTable.selection == 0) {
|
|
|
+ this.$baseMessage('未选中任何产品', 'error', 'vab-hey-message-error')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let idMap = {}
|
|
|
+ let idArr = []
|
|
|
+ let unIdArr = []
|
|
|
+ for (let item of this.$refs.productTable.selection) {
|
|
|
+ idMap[item.id] = item.id
|
|
|
+ idArr.push(item.id)
|
|
|
+ }
|
|
|
+ for (let item of this.products) {
|
|
|
+ if (!idMap[item.id]) {
|
|
|
+ unIdArr.push(item.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
const [err, res] = await to(
|
|
|
deliverWorkApi.completeInstall({
|
|
|
id: this.progress.id,
|
|
|
@@ -194,6 +237,8 @@
|
|
|
installCheckFileUrl: this.form.fileUrl,
|
|
|
fileName: this.form.fileName,
|
|
|
remark: this.form.remark,
|
|
|
+ installProductIdArr: idArr,
|
|
|
+ uninstallProductIdArr: unIdArr,
|
|
|
})
|
|
|
)
|
|
|
if (err) return
|