From bbd8b70f2544e07ce6ce4247ebb13f892dd86112 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期四, 27 六月 2024 15:11:51 +0800 Subject: [PATCH] qxtj --- src/views/reservation/reservations/index.vue | 247 ++++++++++++++++++++++++++---------------------- 1 files changed, 133 insertions(+), 114 deletions(-) diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue index 01742b9..61d3bf0 100644 --- a/src/views/reservation/reservations/index.vue +++ b/src/views/reservation/reservations/index.vue @@ -29,7 +29,7 @@ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> </el-form-item> </el-form> - <el-row :gutter="10" class="mb8"> + <el-row :gutter="10" style="margin: 10px 15px;"> <el-col :span="1.5"> <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="multiple" @click="batch" v-hasPermi="['reservation:reservation:remove']">鎾ら攢棰勭害</el-button> @@ -42,13 +42,14 @@ </el-row> <el-table border v-loading="loading" :data="reservationList" @selection-change="handleSelectionChange" - :default-sort="{ prop: 'reservationTime', order: 'descending' }" highlight-current-row> + :default-sort="{ prop: 'reservationTime', order: 'descending' }" highlight-current-row style="margin-left: 15px;"> <el-table-column type="selection" width="40px" align="center" fixed="left" :selectable="selectHandle" /> <el-table-column label="濮撳悕" align="center" prop="name" width="90px" :show-overflow-tooltip="true" fixed="left" /> <el-table-column label="鎬у埆" align="center" prop="sex" width="60px" :show-overflow-tooltip="true"> <template slot-scope="scope"> <span v-if="scope.row.sex == '0'">鐢�</span> <span v-if="scope.row.sex == '1'">濂�</span> + <span v-if="scope.row.sex == '2'">鏈煡</span> </template> </el-table-column> <el-table-column label="骞撮緞" align="center" prop="age" width="60px" :show-overflow-tooltip="true" /> @@ -67,7 +68,11 @@ <span>{{ parseTime(scope.row.reservationTime, "{y}-{m}-{d}") }}</span> </template> </el-table-column> - <el-table-column label="浣撴绫诲瀷" align="center" prop="tjType" width="80px" :show-overflow-tooltip="true" /> + <el-table-column label="浣撴绫诲瀷" align="center" prop="tjType" width="80px" :show-overflow-tooltip="true"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.dict_team" :value="scope.row.tjType" /> + </template> + </el-table-column> <el-table-column label="濠氬Щ" align="center" prop="marriage" width="60px" :show-overflow-tooltip="true"> <template slot-scope="scope"> <dict-tag :options="dict.type.dict_user_marry" :value="scope.row.marriage" /> @@ -161,10 +166,10 @@ <el-input v-model="formIn.address" placeholder="璇疯緭鍏ョ幇灞呬綇鍦板潃" style="width: 410px" /> </el-form-item> <el-form-item label="浣撴绫诲埆" prop="tjCategory"> - <el-select style="width: 150px" v-model="formIn.tjCategory" placeholder="璇烽�夋嫨浣撴绫诲埆"> - <el-option v-for="dict in dict.type.dict_tjtype" :key="dict.value" :label="dict.label" - :value="dict.value"></el-option> - </el-select> + <el-select style="width: 140px" v-model="formIn.tjCategory" placeholder="璇烽�夋嫨浣撴绫诲埆"> + <el-option v-for="dict in dict.type.dict_tjtype" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> </el-form-item> <el-form-item label="閮ㄩ棬" prop="department"> <el-input v-model="formIn.department" placeholder="璇疯緭鍏ラ儴闂�" style="width: 160px" /> @@ -241,9 +246,12 @@ <el-tab-pane label="鍗曢」"> <div class="tab3"> <div class="tab2"> - <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" - @check-change="handleCurrentChecked"> - </el-tree> + <v-tree-transfer :treeData="treedataList" + :defaultProps="{ children: 'tjProjectList', label: 'proName' }" :defaultKeys="defaultKeys" + @changeKeys="changeCategoryKeys" :key="datekey"></v-tree-transfer> + <!-- <el-tree :data="data" show-checkbox node-key="proId" :props="defaultProps" + @check-change="handleCurrentChecked"> + </el-tree>--> </div> </div> </el-tab-pane> @@ -269,7 +277,7 @@ <!-- <div class="tab1"> --> <!-- <el-form :inline="true" class="tab1"> --> <el-form-item label="搴旀敹閲戦"> - <el-input placeholder="搴旀敹閲戦" :value="TotalPrice1 + '.00'" disabled style="width: 160px"></el-input> + <el-input placeholder="搴旀敹閲戦" :value="TotalPrice1 " disabled style="width: 160px"></el-input> </el-form-item> <el-form-item label="浼樻儬鎶樻墸"> <!-- <el-input style="width: 100px" type="number" v-model="discount" :value="discount"></el-input> --> @@ -277,7 +285,7 @@ :step="0.1" :max="10" :min="1" @change="numberChange" :disabled="isfalse"></el-input-number> </el-form-item> <el-form-item label="瀹炴敹閲戦"> - <el-input placeholder="瀹炴敹閲戦" v-model="TotalPrice" style="width: 120px"></el-input> + <el-input placeholder="瀹炴敹閲戦" v-model="TotalPrice" style="width: 120px" disabled></el-input> </el-form-item> <el-form-item> @@ -308,9 +316,9 @@ item.parentName + " (搴旀敹閲戦:" + item.ordPrice + - ".00鍏� / 瀹炴敹閲戦:" + + " / 瀹炴敹閲戦:" + item.nowPrice + - ".00鍏�)" + "鍏�)" }} </template> <el-table :data="item.list" border style="width: 100%" height="270"> @@ -341,7 +349,7 @@ </el-table-column> <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> </el-table-column> </el-table> @@ -361,7 +369,7 @@ </el-table-column> <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> </el-table-column> </el-table> @@ -515,7 +523,7 @@ <el-form-item label="鍗″彿" prop="indexCard"> <el-input v-model="formIn.indexCard" placeholder="璇疯緭鍏ュ崱鍙�" style="width: 190px" /> </el-form-item> - <el-button type="primary" @click="taocan = true" size="mini">閫夋嫨濂楅</el-button> + <!-- <el-button type="primary" @click="Package" size="mini">閫夋嫨濂楅</el-button> --> </el-form> </div> @@ -539,6 +547,7 @@ <template slot="empty">鏁版嵁姝e湪鍔犺浇涓�</template> <el-table-column type="selection" width="40px" align="center" label="閫夋嫨" /> <el-table-column label="濂楅鍚嶇О" align="center" prop="pacName" width="120px" /> + <el-table-column label="濂楅浠锋牸" align="center" prop="price" width="120px" /> <el-table-column label="濂楅鏄庣粏" align="center" prop="allProName" :show-overflow-tooltip="true" /> </el-table> </div> @@ -607,7 +616,7 @@ <!-- <div class="tab1"> --> <!-- <el-form :inline="true" class="tab1"> --> <el-form-item label="搴旀敹閲戦"> - <el-input placeholder="搴旀敹閲戦" :value="TotalPrice1 + '.00'" disabled style="width: 160px"></el-input> + <el-input placeholder="搴旀敹閲戦" :value="TotalPrice1" disabled style="width: 160px"></el-input> </el-form-item> <el-form-item label="浼樻儬鎶樻墸"> <!-- <el-input style="width: 100px" type="number" v-model="discount" :value="discount"></el-input> --> @@ -619,7 +628,7 @@ </el-form-item> <el-form-item> - <el-button type="primary" @click="submitPrice" :disabled="confirm" size="mini">绛惧埌鐧昏</el-button> + <el-button type="primary" @click="submitPrice" :disabled="confirm" size="mini">棰勭害淇敼</el-button> </el-form-item> <!-- </el-form> --> <!-- </div> --> @@ -659,7 +668,7 @@ </el-table-column> <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> </el-table-column> </el-table> @@ -682,7 +691,7 @@ </el-table-column> <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> </el-table-column> </el-table> @@ -702,7 +711,7 @@ </el-table-column> <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> </el-table-column> </el-table> @@ -726,17 +735,32 @@ </template> <script> -import { listReservation, gettjCancel, tjReappoint, tjCancelTj, } from "@/api/reservation/reservation"; +import { listReservation, gettjCancel, tjReappoint, tjCancelTj, getReservation } from "@/api/reservation/reservation"; import printJS from "print-js"; import { deptTreeSelect, projectGetList, getPackageListName, getaddtTransition, getTransitionList, } from "@/api/system/tijian"; import { getCompany, queryCompany } from "@/api/team/tuanti"; import user from "@/store/modules/user"; +import VTreeTransfer from '../../system/tijian/TreeTransfer.vue' export default { + components: { + VTreeTransfer + }, name: "Reservation", dicts: ["dict_user_national", "dict_user_national", "dict_user_marry", "sys_yes_no", "sys_user_sex", "dict_team", "tj_time_region", "dict_tjtype", "dict_job", "dict_user_cardtype", "dict_ageunit",], data() { + let checkPhoneNum = (rule, value, callback) => { + console.log( value) + let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/); + if (value == "" && value == undefined && !value) { + return callback(''); + } else if(value != undefined && value != ""){ + return callback(); + }else if (!patter.test(value)) { + return callback(''); + } + }; return { isfalse: false, tijiao1: true, @@ -750,6 +774,7 @@ }, }, taocan: false, + defaultKeys: [], value1: "", pacName: "", hides: false, @@ -769,6 +794,8 @@ thisCancas: null, thisContext: null, thisVideo: null, + datekey: Date.now(), + treedataList: [], list: [], activeName: "1", // 閬僵灞� @@ -861,24 +888,24 @@ fmobj: {}, // 琛ㄥ崟鏍¢獙 rules: { - cusName: [{ required: true, message: "濮撳悕涓嶈兘涓虹┖", trigger: "blur" }], + cusName: [{ required: true, validator: checkPhoneNum, trigger: "blur" }], cusSex: [ - { required: true, message: "鎬у埆涓嶈兘涓虹┖", trigger: "change" }, + { required: true, validator: checkPhoneNum, trigger: "change" }, ], cusBrithday: [ - { required: true, message: "鍑虹敓鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: checkPhoneNum, trigger: "blur" }, ], // cusAddr: [ // { required: true, message: "鐜板眳浣忓湴鍧�涓嶈兘涓虹┖", trigger: "blur" }, // ], cusPhone: [ - { required: true, message: "鑱旂郴鐢佃瘽涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: checkPhoneNum, trigger: "blur" }, ], reservationTime: [ - { required: true, message: "棰勭害鏃ユ湡涓嶈兘涓虹┖", trigger: "change" }, + { required: true, validator: checkPhoneNum, trigger: "change" }, ], timeRegion: [ - { required: true, message: "鏃堕棿涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: checkPhoneNum, trigger: "blur" }, ], }, options: [ @@ -932,21 +959,21 @@ name: [ { required: true, - message: "濮撳悕涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], idCard: [ { required: true, - message: "韬唤璇佸彿涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], phoe: [ { required: true, - message: "鑱旂郴鐢佃瘽涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], @@ -972,30 +999,6 @@ // response.rows.forEach((item, index) => // {item.newID =(this.queryParams.pageNum - 1) * this.queryParams.pageSize +index +1; // }); - this.reservationList.forEach((item) => { - if (item.tjType === "2") { - item.tjType = "涓汉"; - } else { - item.tjType = "鍥㈤槦"; - } - if (item.tjCategory === "01") { - item.tjCategory = "鍋ュ悍浣撴"; - } else if (item.tjCategory === "02") { - item.tjCategory = "鑱屼笟鐥呬綋妫�"; - } else if (item.tjCategory === "03") { - item.tjCategory = "鍏崼浣撴"; - } else if (item.tjCategory === "04") { - item.tjCategory = "鍏ヨ亴浣撴"; - } else if (item.tjCategory === "05") { - item.tjCategory = "鍏姟鍛樹綋妫�"; - } else if (item.tjCategory === "06") { - item.tjCategory = "鍖讳繚浣撴"; - } else if (item.tjCategory === "07") { - item.tjCategory = "濠氭"; - } else if (item.tjCategory === "09") { - item.tjCategory = "鍑哄叆澧冧綋妫�"; - } - }); this.total = response.total; this.loading = false; }); @@ -1070,8 +1073,8 @@ }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { - selection.forEach(item =>{ - this.fmobj = item + selection.forEach(item => { + this.fmobj = item }) console.log(this.fmobj) this.ids = selection.map((item) => item.id); @@ -1090,6 +1093,7 @@ handleUpdate(row) { this.title = "淇敼浣撴棰勭害"; this.formIn = row; + this.form.tjType = this.formIn.tjType if (this.formIn.timeRegion === 0) { this.formIn.timeRegion = "8:00-9:00"; } @@ -1110,60 +1114,66 @@ let cusSex = this.formIn.sex; deptTreeSelect(cusSex).then((response) => { this.newpacName = response.rows; - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$refs.tb.toggleRowSelection(item3, true); - throw Error(); - } - }); - }); - }); + // this.newpacName.forEach((item3) => { + // this.tableData1.forEach((item4) => { + // item4.list.forEach((item6) => { + // if (item6.pacName === item3.pacName) { + // this.$refs.tb.toggleRowSelection(item3, true); + // throw Error(); + // } + // }); + // }); + // }); this.loading = false; }); } else { deptTreeSelect().then((response) => { this.newpacName = response.rows; - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); - }); - throw Error(); - } - }); - }); - }); + // this.newpacName.forEach((item3) => { + // this.tableData1.forEach((item4) => { + // item4.list.forEach((item6) => { + // if (item6.pacName === item3.pacName) { + // this.$nextTick(() => { + // this.$refs.tb.toggleRowSelection(item3, true); + // }); + // throw Error(); + // } + // }); + // }); + // }); this.loading = false; }); } - let cusId = this.formIn.idCard; + let id = this.formIn.id; this.list1 = true; (this.tableData1 = []), (this.newpacName = []), - getTransitionList(cusId).then((response) => { + getReservation(id).then((response) => { if (response.data) { - this.tableData1 = response.data; - if (this.tableData1.length != 0) { - this.TotalPrice1 = 0; - this.tableData1.forEach((item) => { - this.TotalPrice1 += item.nowPrice; - this.TotalPrice = ( - this.TotalPrice1 * - (this.discount / 10) - ).toFixed(2); - if (item.pacName === null) { - item.pacName = "鍗曢」"; + let cusId = response.data.idCard; + getTransitionList(cusId).then((response) => { + if (response.data) { + this.tableData1 = response.data; + if (this.tableData1.length != 0) { + this.TotalPrice1 = 0; + this.tableData1.forEach((item) => { + this.TotalPrice1 += item.nowPrice; + this.TotalPrice = ( + this.TotalPrice1 * + (this.discount / 10) + ).toFixed(2); + if (item.pacName === null) { + item.pacName = "鍗曢」"; + } + }); + this.list1 = false; + this.list3 = true; + } else { + this.list1 = true; } - }); - this.list1 = false; - this.list3 = true; - } else { - this.list1 = true; - } + } + }) + } else { this.tableData1 = []; this.list3 = false; @@ -1171,15 +1181,19 @@ } }); - /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.data = response.data.list; - this.dXData = response.data; - return; - }); + // /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ + // projectGetList().then((response) => { + // this.treedataList = response.data.list; + // this.dXData = response.data.list; + // return; + // }); } else { this.$message.warning("宸茶繃鏈熻閲嶆柊棰勭害"); } + }, + changeCategoryKeys(val) { + this.proIds = []; + this.proIds = val }, /** 淇敼璇︾粏鎸夐挳鎿嶄綔 */ handleUpdate1(row) { @@ -1272,8 +1286,8 @@ /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ projectGetList().then((response) => { - this.data = response.data.list; - this.dXData = response.data; + this.treedataList = response.data.list; + this.dXData = response.data.list; return; }); }, @@ -1282,6 +1296,11 @@ numberChange(currentValue, oldValue) { this.discount = currentValue; this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2); + }, + + Package() { + this.taocan = true; + this.datekey = Date.now() }, /** 鎼滅储鎿嶄綔 */ @@ -1312,9 +1331,9 @@ this.multiple = !selection.length; if (selection[0]) { this.DataList = []; - this.data = JSON.parse(JSON.stringify(this.dXData)); + this.treedataList = JSON.parse(JSON.stringify(this.dXData)); selection[0].tjProjectList.forEach((selectionitem) => { - this.data.forEach((item) => { + this.treedataList.forEach((item) => { if (selectionitem.proName == item.proName) { item.disabled = true; item.tjProjectList = []; @@ -1338,7 +1357,7 @@ }); }); } else { - this.data = JSON.parse(JSON.stringify(this.dXData)); + this.treedataList = JSON.parse(JSON.stringify(this.dXData)); return; } }, @@ -1436,7 +1455,7 @@ // 鏈�鍚庢彁浜ゆ寜閽� submitPrice() { let _this = this; - if (_this.tableData1.length > 0) { + // if (_this.tableData1.length > 0) { if (this.tableData[0]) { var pacId = this.tableData[0].pacId; } @@ -1518,9 +1537,9 @@ }); this.getList(); this.$tab.refreshPage(); - } else { - this.$message.warning("璇烽�夋嫨鎮ㄨ浣撴鐨勫唴瀹�"); - } + // } else { + // this.$message.warning("璇烽�夋嫨鎮ㄨ浣撴鐨勫唴瀹�"); + // } }, // 鏈�鍚庢彁浜ゆ寜閽� submitPrice1() { -- Gitblit v1.8.0