| | |
| | | <el-form-item label="相关附件" prop="file"> |
| | | <div class="table-between"> |
| | | <el-input v-model="acceptance.file" style="width: 80%;" disabled></el-input> |
| | | <el-upload |
| | | ref="upload" |
| | | style="float: right;" |
| | | :headers="uploadHeader" |
| | | :action="action" |
| | | :show-file-list="false" |
| | | :on-success="onSuccess" |
| | | > |
| | | <el-upload ref="upload" style="float: right;" :headers="uploadHeader" :action="action" |
| | | :show-file-list="false" :on-success="onSuccess"> |
| | | <el-button type="primary"> |
| | | 附件上传 |
| | | </el-button> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="清单" prop="substanceId" |
| | | :rule="[{ required: true, message: '请选择清单', trigger: 'change' }]"> |
| | | <el-form-item label="清单" prop="substanceId" :rule="[{ required: true, message: '请选择清单', trigger: 'change' }]"> |
| | | <el-select v-model="acceptance.substanceId" placeholder="请选择" style="width: 100%"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="到货日期" prop="arriveDate"> |
| | | <el-date-picker |
| | | v-model="acceptance.arriveDate" |
| | | align="right" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | style="width: 100%" |
| | | value-format="yyyy-MM-dd" |
| | | > |
| | | <el-date-picker v-model="acceptance.arriveDate" align="right" type="date" placeholder="选择日期" |
| | | style="width: 100%" value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | }, |
| | | methods: { |
| | | openDialog(id) { |
| | | if(id) { |
| | | if (id) { |
| | | this.getDetail(id) |
| | | } else { |
| | | this.clearForm() |
| | |
| | | }, |
| | | getDetail(id) { |
| | | this.loading = true |
| | | getAcceptanceDetails({id: id}).then(res => { |
| | | getAcceptanceDetails({ id: id }).then(res => { |
| | | this.acceptance = res.data.acceptance |
| | | this.list = res.data.list |
| | | this.loading = false |
| | |
| | | } |
| | | this.acceptance.list = this.HaveJson(this.list) |
| | | this.submitLoading = true |
| | | if(this.acceptance.id) { |
| | | updateAcceptance({acceptance: this.acceptance, list: this.list}).then(res => { |
| | | if (this.acceptance.id) { |
| | | updateAcceptance({ acceptance: this.acceptance, list: this.list }).then(res => { |
| | | this.$message.success('编辑成功') |
| | | this.submitLoading = false |
| | | this.closeDialog() |
| | |
| | | this.submitLoading = false |
| | | }) |
| | | } else { |
| | | addAcceptance({acceptance: this.acceptance, list: this.list}).then(res => { |
| | | addAcceptance({ acceptance: this.acceptance, list: this.list }).then(res => { |
| | | this.$message.success('新增成功') |
| | | this.closeDialog() |
| | | this.$emit('submit') |