From fcbba75febaa36d23c6c49473ab5bcee0e1a2c04 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 08 四月 2025 09:37:11 +0800
Subject: [PATCH] 检验项目新增是否委托要求字段
---
src/views/business/outsourcedParts/index.vue | 117 +++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 78 insertions(+), 39 deletions(-)
diff --git a/src/views/business/outsourcedParts/index.vue b/src/views/business/outsourcedParts/index.vue
index eaecbd8..74b3fa2 100644
--- a/src/views/business/outsourcedParts/index.vue
+++ b/src/views/business/outsourcedParts/index.vue
@@ -20,57 +20,63 @@
</el-form>
<div>
<el-button size="mini" type="primary">鑾峰彇璁㈠崟</el-button>
- <el-button size="mini" type="primary" @click="openAdd('鏂板')">鏂板</el-button>
+ <!-- <el-button size="mini" type="primary" @click="openAdd('鏂板')">鏂板</el-button> -->
</div>
</div>
- <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 220px)'"
+ <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 240px)'"
:page="page" @pagination="pagination"></lims-table>
<!-- 鏂板/缂栬緫 -->
<el-dialog :title="title" :visible.sync="addDia" width="500px">
<el-form :model="addForm" v-if="addDia" ref="addForm" :rules="addRules" label-position="right"
label-width="120px">
<el-form-item label="浜у搧" prop="name">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.name"
- :disabled="title == '妫�楠�'"></el-input>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.name" disabled></el-input>
</el-form-item>
<el-form-item label="鏉ユ枡鏁伴噺" prop="num">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.num" :disabled="title == '妫�楠�'">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.num" disabled>
</el-input>
</el-form-item>
<el-form-item label="渚涜揣鍘傚" prop="supplier">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.supplier" :disabled="title == '妫�楠�'">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.supplier" disabled>
</el-input>
</el-form-item>
<el-form-item label="璁㈠崟鍙�" prop="orderNum">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.orderNum" :disabled="title == '妫�楠�'">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.orderNum" disabled>
</el-input>
</el-form-item>
<el-form-item label="SP鍙�" prop="spNum">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.spNum" :disabled="title == '妫�楠�'">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.spNum" disabled>
</el-input>
</el-form-item>
<el-form-item label="澶囨敞" prop="remark">
<el-input size="small" placeholder="璇疯緭鍏�" type="textarea" :rows="2" clearable v-model="addForm.remark"
- :disabled="title == '妫�楠�'">
+ disabled>
</el-input>
</el-form-item>
- <el-form-item label="澶栬" prop="inspectionItems" v-if="title == '妫�楠�'">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.inspectionItems">
+ <el-form-item label="澶栬" prop="inspectionItems">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.inspectionItems"
+ :disabled="title != '妫�楠�'">
</el-input>
</el-form-item>
- <el-form-item label="妫�娴嬬粨鏋�" prop="result" v-if="title == '妫�楠�'">
- <el-switch v-model="addForm.result" active-text="鍚堟牸" inactive-text="涓嶅悎鏍�" active-value="鍚堟牸"
- inactive-value="涓嶅悎鏍�">
- </el-switch>
+ <el-form-item label="妫�娴嬬粨鏋�" prop="result">
+ <el-select v-model="addForm.result" placeholder="璇烽�夋嫨" :disabled="title != '妫�楠�'">
+ <el-option label="鍚堟牸" value="鍚堟牸">
+ </el-option>
+ <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�">
+ </el-option>
+ <el-option label="涓嶅垽鏂�" value="涓嶅垽鏂�">
+ </el-option>
+ </el-select>
</el-form-item>
- <el-form-item label="娴嬭瘯鏂囦欢" prop="file" v-if="title == '妫�楠�'">
- <el-upload action="#" :auto-upload="false" :multiple="false"
+ <el-form-item label="娴嬭瘯鏂囦欢" prop="file">
+ <el-upload action="#" :auto-upload="false" :multiple="false" v-if="title == '妫�楠�'"
accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.pdf,' :on-change="handleChangeUpload">
<el-button size="mini" type="primary">涓婁紶闄勪欢</el-button>
</el-upload>
+ <a @click="handleDown(addForm)" v-else style="color: #3a7bfa;">{{ addForm.fileName }}</a>
</el-form-item>
</el-form>
- <span slot="footer" class="dialog-footer">
+ <span slot="footer" class="dialog-footer" v-if="title == '妫�楠�'">
<el-button @click="addDia = false">鍙� 娑�</el-button>
<el-button :loading="uploading" type="primary" @click="submitProduct('addForm')">纭� 璁�</el-button>
</span>
@@ -80,13 +86,14 @@
<script>
import limsTable from "@/components/Table/lims-table.vue";
-import { selectInspection, addOrUpdateInspection, delInspection } from '@/api/business/outsourcedParts.js'
+import { selectInspection, addOrUpdateInspection, delInspection, updateInspection } from '@/api/business/outsourcedParts.js'
export default {
components: { limsTable },
data() {
return {
queryParams: {},
tableData: [],
+ value: '',
column: [
{ label: "濮旀墭缂栧彿", prop: "entrustmentNo" },
{ label: "浜у搧", prop: "name" },
@@ -120,28 +127,38 @@
dataType: "action",
label: "鎿嶄綔",
operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- this.openAdd("缂栬緫", row);
- },
- },
- {
- name: "鍒犻櫎",
- type: "text",
- clickFun: (row) => {
- this.handleDelete(row);
- },
- disabled: (row) => {
- return !!row.ratifyUser
- },
- },
+ // {
+ // name: "缂栬緫",
+ // type: "text",
+ // clickFun: (row) => {
+ // this.openAdd("缂栬緫", row);
+ // },
+ // },
+ // {
+ // name: "鍒犻櫎",
+ // type: "text",
+ // clickFun: (row) => {
+ // this.handleDelete(row);
+ // },
+ // disabled: (row) => {
+ // return !!row.ratifyUser
+ // },
+ // },
{
name: "妫�楠�",
type: "text",
clickFun: (row) => {
this.openAdd('妫�楠�', row);
+ },
+ disabled: (row) => {
+ return row.inspectionStatus > 0
+ },
+ },
+ {
+ name: "鏌ョ湅",
+ type: "text",
+ clickFun: (row) => {
+ this.openAdd('鏌ョ湅', row);
},
},
],
@@ -171,6 +188,9 @@
inspectionItems: [
{ required: true, message: "璇疯緭鍏ュ瑙�", trigger: "blur" },
],
+ result: [
+ { required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change" },
+ ],
},
uploading: false,
inspectionTaskState: []
@@ -180,6 +200,7 @@
this.getDicts("inspection_task_state").then((response) => {
this.inspectionTaskState = this.dictToValue(response.data);
});
+ this.getList()
},
methods: {
getList() {
@@ -246,9 +267,24 @@
// 妫�楠�
let fd = new FormData();
//鏂囦欢淇℃伅涓璻aw鎵嶆槸鐪熺殑鏂囦欢
- if (this.file) {
- fd.append("file", this.file.raw);
+ if (this.addForm.file) {
+ fd.append("file", this.addForm.file.raw);
}
+ fd.append("inspectionItems", this.addForm.inspectionItems);
+ fd.append("result", this.addForm.result);
+ fd.append("id", this.addForm.id); // 娣诲姞id鍙傛暟
+ updateInspection(fd)
+ .then(res => {
+ this.uploading = false;
+ if (res.code === 200) {
+ this.$message.success("妫�楠屾彁浜ゆ垚鍔�");
+ this.refresh();
+ this.addDia = false;
+ }
+ })
+ .catch(err => {
+ this.uploading = false;
+ });
}
} else {
return false;
@@ -275,7 +311,10 @@
handleChangeUpload(file, fileLists) {
this.addForm.file = file
},
-
+ // 涓嬭浇闄勪欢鐨勬枃浠�
+ handleDown(row) {
+ this.$download.saveAs(row.fileUrl, row.fileName);
+ },
}
}
</script>
--
Gitblit v1.9.3