From c87a6f7310ca992d7f058a8f286b095c9a632c90 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 21 九月 2023 16:51:58 +0800 Subject: [PATCH] 位置+产品类型的接口联调+业务类型的字段添加 --- src/views/warehouseManage/bussinessType/AddBussinessType.vue | 59 ++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/views/warehouseManage/bussinessType/AddBussinessType.vue b/src/views/warehouseManage/bussinessType/AddBussinessType.vue index 4d907a1..772ae8a 100644 --- a/src/views/warehouseManage/bussinessType/AddBussinessType.vue +++ b/src/views/warehouseManage/bussinessType/AddBussinessType.vue @@ -15,8 +15,7 @@ <span>鎵撳嵃</span> </span> <span class="btn" style="margin-left: 15px"> - <i class="el-icon-s-tools"></i> - <span>鍔ㄤ綔</span> + <el-button plain size="mini" style="margin-left: 15px" @click="deleteClick">鍒犻櫎</el-button> </span> <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button> </div> @@ -37,10 +36,10 @@ <el-row> <el-col :span="24"> <div style="margin-left: 20px">鍏ュ簱绫诲瀷</div> - <el-form-item label="" prop="client_name" label-width="20px"> + <el-form-item label="" prop="name" label-width="20px"> <el-input - v-model="editConfig.infomation.client_name" - placeholder="" + v-model="editConfig.infomation.name" + placeholder="璇峰~鍐�" :disabled="!showFooter" style="width: 85%" ></el-input> @@ -61,9 +60,9 @@ </el-select> </el-form-item> - <el-form-item label="搴忓彿鍓嶇紑" prop="client_name" :label-width="labelWidth"> + <el-form-item label="搴忓彿鍓嶇紑" prop="prefix" :label-width="labelWidth"> <el-input - v-model="editConfig.infomation.client_name" + v-model="editConfig.infomation.prefix" placeholder="" :disabled="!showFooter" style="width: 85%" @@ -149,9 +148,9 @@ <el-form-item v-if="editConfig.infomation.baseOperationType === 1" label="棰勫~鍐欎綔涓氳鎯�" - prop="showOperations" + prop="earlyOperations" > - <el-checkbox v-model="editConfig.infomation.showOperations"></el-checkbox> + <el-checkbox v-model="editConfig.infomation.earlyOperations"></el-checkbox> </el-form-item> </div> </div> @@ -171,7 +170,7 @@ style="width: 85%" :disabled="!showFooter" > - <el-option v-for="item in locationList" :key="item.id" :label="item.username" :value="item.id"> + <el-option v-for="item in positionlist" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -183,7 +182,7 @@ style="width: 85%" :disabled="!showFooter" > - <el-option v-for="item in locationList" :key="item.id" :label="item.username" :value="item.id"> + <el-option v-for="item in positionlist" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -204,7 +203,7 @@ </template> <script> -import { addOperationType,updateOperationType,getWarehouseList,deleteOperationType} from "@/api/warehouseManage/warehouse" +import { addOperationType,updateOperationType,getWarehouseList,deleteOperationType,getLocationList} from "@/api/warehouseManage/warehouse" import { getDataByType } from "@/api/data"; export default { name: "AddBussinessType", @@ -228,9 +227,9 @@ editConfig: this.editCommonConfig, rules: { // 鍏ュ簱绫诲瀷 - client_name: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }], + name: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }], // 鍓嶇紑 - number: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }], + prefix: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }], baseOperationType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], }, // 浣嶇疆 @@ -248,7 +247,8 @@ showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳 isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑� showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨 - labelWidth: "90px" + labelWidth: "90px", + positionlist:[], } }, created() { @@ -258,6 +258,16 @@ methods: { // 浠撳簱 async getWarehouse() { + await getLocationList({ + keyword:'', + page: 0, + pageSize: 0 + }).then((res) => { + if (res.code === 200) { + this.positionlist = res.data?res.data:[] + this.$forceUpdate() + } + }) await getWarehouseList({ keyword: '', page: 0, @@ -292,9 +302,11 @@ deleteOperationType({ id: data.id }).then((res) => { if (res.code === 200) { this.editConfig.visible = false; - this.$message.success("鍒櫎鎴愬姛"); + this.$message.success("鍒櫎鎴愬姛!"); this.$emit("refresh"); - } + } else { + this.$message.warning(res.msg?res.msg:"鍒犻櫎澶辫触!") + } }); }, // 缂栬緫 @@ -307,6 +319,10 @@ let data =JSON.parse(JSON.stringify(this.editConfig.infomation)); let params = { + // 鍏ュ簱绫诲瀷 + name:data.name, + // 鍓嶇紑 + prefix:data.prefix, // 浣滀笟绫诲瀷 baseOperationType:data.baseOperationType, // 閫�璐х被鍨� @@ -317,6 +333,7 @@ warehouseId:data.warehouseId, // 鏄剧ず浣滀笟璇︽儏 showOperations:data.showOperations, + earlyOperations:data.earlyOperations, // 淇濈暀鏂瑰紡 reservationMethod:data.reservationMethod, // 榛樿鍘熶綅缃� @@ -338,16 +355,20 @@ addOperationType(params).then((res) => { if (res.code === 200) { this.editConfig.visible = false; - this.$message.success("娣诲姞鎴愬姛"); + this.$message.success("娣诲姞鎴愬姛!"); this.$emit('refresh') + } else { + this.$message.warning(res.msg?res.msg:"娣诲姞澶辫触!") } }); } else { updateOperationType(params).then((res) => { if (res.code === 200) { this.editConfig.visible = false; - this.$message.success("缂栬緫鎴愬姛"); + this.$message.success("缂栬緫鎴愬姛!"); this.$emit('refresh') + } else { + this.$message.warning(res.msg?res.msg:"缂栬緫澶辫触!") } }); } -- Gitblit v1.8.0