From fc188397419e76da8e97c0782599f757fb34bd30 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期四, 14 十二月 2023 16:13:26 +0800 Subject: [PATCH] 增加编码规范功能及新建供应商和采购页面增加编码 --- src/views/supplierManage/supplier/AddSupplier.vue | 93 +++++++++++++++++++++++++++++++--------------- 1 files changed, 63 insertions(+), 30 deletions(-) diff --git a/src/views/supplierManage/supplier/AddSupplier.vue b/src/views/supplierManage/supplier/AddSupplier.vue index c8dbfa4..37b31a4 100644 --- a/src/views/supplierManage/supplier/AddSupplier.vue +++ b/src/views/supplierManage/supplier/AddSupplier.vue @@ -25,7 +25,21 @@ <el-row> <el-col :span="12"> <el-form-item label="渚涘簲鍟嗙紪鍙�" prop="number"> - <el-input v-model="editConfig.infomation.number"></el-input> + <!-- <el-input v-model="editConfig.infomation.number"></el-input> --> + <el-input + style="width: 85%" + v-if=" + editConfig.title == '淇敼' || + (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled)) + " + :disabled="editConfig.title != '鏂板缓'" + v-model="editConfig.infomation.number" + placeholder="璇疯緭鍏ョ紪鐮�" + > + </el-input> + <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c; width: 85%" + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span + > </el-form-item> </el-col> <el-col :span="12"> @@ -100,8 +114,8 @@ style="width: 63%" > <el-option - v-for="item in memberOptions" - :key="item.id" + v-for="(item, index) in memberOptions" + :key="index" :label="item.username" :value="item.userName" > @@ -211,7 +225,7 @@ createContract, updateSupplier, getIndustryList, - getSupplierTypeList, + getSupplierTypeList // downloadContract // previewContract } from "@/api/supplierManage/supplier" @@ -220,8 +234,10 @@ import download from "downloadjs" // import { renderAsync } from "docx-preview" import axios from "axios" +import codeMixin from "@/components/mixin/codeMixin" export default { name: "AddSupplierDialog", + mixins: [codeMixin], props: { addCommonConfig: { type: Object, @@ -237,7 +253,8 @@ components: { EditDropdownDialog }, computed: { headers() { - const authorization = "Bearer "+document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1")|| '' + const authorization = + "Bearer " + document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1") || "" return { authorization } } }, @@ -264,7 +281,8 @@ message: "璇疯緭鍏ユ纭殑閭鏍煎紡", trigger: "blur" } - ] + ], + number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }] }, supplierTypeOptions: [{ id: 1, name: "渚涘簲鍟嗙被鍨�1" }], // 渚涘簲鍟嗙被鍨� industryOptions: [{ id: 1, name: "鎵�灞炶涓�1" }], // 鎵�灞炶涓� @@ -288,8 +306,17 @@ if (this.editConfig.title === "淇敼") { // this.previewContract() } + this.formInfo() }, methods: { + formInfo() { + this.objCode.type = "渚涘簲鍟嗙紪鐮�" + this.objCode.codeStandID = "" + if (this.editConfig.infomation.codeStandardID) { + this.objCode.codeStandID = this.editConfig.infomation.codeStandardID + } + this.getRCodeStandardList() + }, // 閿�鍞礋璐d汉 async getMemberList() { await getMemberListFromGrpc({ @@ -365,12 +392,13 @@ detailAddress: data.detailAddress || "", email: data.email || "", fileId: this.file_id || 0, - id: data.ID || 0, + id: data.id || 0, industry: data.industry || "", name: data.name || "", number: data.number || "", phone: data.phone || "", - responsiblePersonName: data.responsiblePersonName || document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1"), + responsiblePersonName: + data.responsiblePersonName || document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1"), status: data.status || 0, supplierType: data.supplierType || "", url: data.url || "" @@ -453,29 +481,34 @@ // window.open(routeUrl.href, "_blank") // } // } - async previewClick() { - this.previewUrl = "/api/previewContract?id=" + this.file_id - if (this.file_name.includes("pdf")) { + async previewClick() { + this.previewUrl = "/api/previewContract?id=" + this.file_id + if (this.file_name.includes("pdf")) { console.log("鏄痯df鏂囦欢") - await axios.get(this.previewUrl, { headers: { "Authorization":"Bearer "+ document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1")} }) - .then(response => { - window.open(this.previewUrl, "_blank") - console.log("response",response,this.previewUrl) - }) - .catch(error => { - console.error(error); - }); - } else { - console.log(this.previewUrl,"鐪嬬湅鏄暐瀛�") - let routeUrl = this.$router.resolve({ - path: "/PreviewFile", - query: { - //瑕佷紶鐨勫弬鏁� - previewUrl: this.previewUrl - } - }) - window.open(routeUrl.href, "_blank") - } + await axios + .get(this.previewUrl, { + headers: { + Authorization: "Bearer " + document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1") + } + }) + .then((response) => { + window.open(this.previewUrl, "_blank") + console.log("response", response, this.previewUrl) + }) + .catch((error) => { + console.error(error) + }) + } else { + console.log(this.previewUrl, "鐪嬬湅鏄暐瀛�") + let routeUrl = this.$router.resolve({ + path: "/PreviewFile", + query: { + //瑕佷紶鐨勫弬鏁� + previewUrl: this.previewUrl + } + }) + window.open(routeUrl.href, "_blank") + } } } } -- Gitblit v1.8.0