From c2943d4c365e6a4719fbd5fedf89f8c2232cf88e Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期一, 25 三月 2024 18:16:27 +0800 Subject: [PATCH] qxtj --- src/views/hosp/order/index.vue | 626 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 389 insertions(+), 237 deletions(-) diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue index 8aabe19..20ea617 100644 --- a/src/views/hosp/order/index.vue +++ b/src/views/hosp/order/index.vue @@ -412,7 +412,7 @@ <el-dialog :title="title" :visible.sync="Projectopen" - width="1200px" + width="1500px" style="height: 860px" append-to-body > @@ -428,12 +428,14 @@ <div class="tab3"> <div class="outside1"> <el-tree + class="filter-tree" v-loading="loading" :data="Treedata" + :props="defaultProps" show-checkbox node-key="proId" - :props="defaultProps" @check-change="handleCurrentChecked" + :default-checked-keys="checkedkey" :filter-node-method="filterNode" ref="tree" > @@ -441,125 +443,149 @@ </div> </div> </el-col> - <div> - <el-col :span="18"> - <div class="grid-content bg-purple"> - <template> - <el-form :model="form"> - <el-form-item label="浣撴绫诲瀷" prop="tjType"> - <el-radio-group v-model="form.tjType"> - <el-radio :label="1">鍥㈤槦</el-radio> - <el-radio :label="2">涓汉</el-radio> - </el-radio-group> - </el-form-item> - </el-form> - </template> - - <div class="outside"> - <el-form :inline="true" class="outside1"> - <el-form-item label="鍘熶环"> - <el-input - placeholder="鍘熶环" - :value="TotalPrice1" - disabled - style="width: 90px" - ></el-input> - </el-form-item> - <el-form-item label="鎶樻墸璁惧畾"> - <el-input - style="width: 90px" - type="number" - v-model="discount" - :value="discount" - ></el-input> - </el-form-item> - <el-form-item label="搴斾粯閲戦"> - <el-input - placeholder="搴斾粯閲戦" - :value="TotalPrice1 * (discount / 10)" - style="width: 90px" - ></el-input> - </el-form-item> - <el-form-item label="浠樻绫诲瀷" prop="payType"> - <el-select - style="width: 120px" - v-model="payType" - placeholder="璇烽�夋嫨浠樻绫诲瀷" - > - <el-option - v-for="dict in dict.type.dict_pay_type" - :key="dict.value" - :label="dict.label" - :value="dict.value" - ></el-option> - </el-select> - </el-form-item> - <el-form-item> - <el-button - type="primary" - @click="submitPrice" - :disabled="confirm" - style="margin-top: 34px" - >鏀惰垂</el-button - > - </el-form-item> - </el-form> - </div> - <div style="text-align: center; margin-bottom: 10px"> - 宸查�夐」鐩垪琛� - </div> - <div - style=" - padding: 0px 6px; - border: 1px solid #e6ebf5; - max-height: 420px; - overflow: auto; - " + <el-col :span="4"> + <div + style="text-align: center; margin-bottom: 10px; margin-top: 10px" + > + 椤圭洰鍒楄〃 + </div> + <div class="tab3"> + <div class="outside1"> + <el-tree + class="filter-tree" + v-loading="loading" + :data="TreedataList" + node-key="proId" + :props="defaultProps" + :filter-node-method="filterNode" + show-checkbox + @check-change="handleCurrentChecked1" + :default-checked-keys="checkedListkey" > - <el-collapse v-model="activeName" accordion> - <div v-for="(item, index) in DataList" :key="index"> - <el-collapse-item> - <template slot="title"> - {{ item.proName + "(" + "鍘熶环" + item.proPrice + ")" }} - </template> - <el-table - :data="item.tjProjectList" - border - style="width: 100%" - height="250" - > - <el-table-column - prop="proName" - label="椤圭洰" - width="180" - > - </el-table-column> - <el-table-column prop="proPrice" label="鍘熶环"> - </el-table-column> - </el-table> - </el-collapse-item> - </div> - </el-collapse> - <el-collapse v-model="activeName" accordion v-if="list1"> - <div> - <el-collapse-item title="璇烽�夋嫨椤圭洰"> - <el-table :data="DataList" border style="width: 100%"> - <el-table-column - prop="proName" - label="椤圭洰" - width="180" - > - </el-table-column> - <el-table-column prop="ordPrice" label="鍘熶环"> - </el-table-column> - </el-table> - </el-collapse-item> - </div> - </el-collapse> - </div> + </el-tree> </div> - </el-col> - </div> + </div> + </el-col> + <el-col :span="12"> + <div class="grid-content bg-purple"> + <div style="text-align: center; margin-bottom: 10px"> + 宸查�夐」鐩垪琛� + </div> + <div + style=" + padding: 0px 6px; + border: 1px solid #e6ebf5; + max-height: 420px; + overflow: auto; + " + > + <el-table + :data="DataList" + border + style="width: 100%" + height="250" + > + <el-table-column prop="propinName" label="鐖堕」"> + </el-table-column> + <el-table-column prop="proName" label="椤圭洰" width="180"> + </el-table-column> + <el-table-column prop="proPrice" label="鍘熶环"> + </el-table-column> + + <el-table-column + label="鎿嶄綔" + align="center" + fixed="right" + class-name="small-padding fixed-width" + width="80px" + > + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + >鍒犻櫎</el-button + > + </template> + </el-table-column> + </el-table> + <el-collapse v-model="activeName" accordion v-if="list1"> + <div> + <el-collapse-item title="璇烽�夋嫨椤圭洰"> + <el-table :data="DataList" border style="width: 100%"> + <el-table-column prop="proName" label="椤圭洰" width="180"> + </el-table-column> + <el-table-column prop="ordPrice" label="鍘熶环"> + </el-table-column> + </el-table> + </el-collapse-item> + </div> + </el-collapse> + </div> + <template> + <el-form :model="form"> + <el-form-item label="浣撴绫诲瀷" prop="tjType"> + <el-radio-group v-model="form.tjType"> + <el-radio :label="1">鍥㈤槦</el-radio> + <el-radio :label="2">涓汉</el-radio> + </el-radio-group> + </el-form-item> + </el-form> + </template> + + <div class="outside"> + <el-form :inline="true" class="outside1"> + <el-form-item label="鍘熶环"> + <el-input + placeholder="鍘熶环" + :value="TotalPrice1" + disabled + style="width: 90px" + ></el-input> + </el-form-item> + <el-form-item label="鎶樻墸璁惧畾"> + <el-input + style="width: 90px" + type="number" + v-model="discount" + :value="discount" + ></el-input> + </el-form-item> + <el-form-item label="搴斾粯閲戦"> + <el-input + placeholder="搴斾粯閲戦" + :value="TotalPrice1 * (discount / 10)" + style="width: 90px" + ></el-input> + </el-form-item> + <el-form-item label="浠樻绫诲瀷" prop="payType"> + <el-select + style="width: 120px" + v-model="payType" + placeholder="璇烽�夋嫨浠樻绫诲瀷" + > + <el-option + v-for="dict in dict.type.dict_pay_type" + :key="dict.value" + :label="dict.label" + :value="dict.value" + ></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-button + type="primary" + @click="submitPrice" + :disabled="confirm" + style="margin-top: 34px" + >鏀惰垂</el-button + > + </el-form-item> + </el-form> + </div> + </div> + </el-col> </el-row> </el-dialog> @@ -567,12 +593,12 @@ <el-dialog :title="title" :visible.sync="Projectopen1" - width="1200px" + width="1500px" style="height: 860px" append-to-body > <el-row type="flex" class="row-bg" justify="space-around"> - <el-col :span="8"> + <el-col :span="6"> <div style="text-align: center; margin-bottom: 10px; margin-top: 10px" > @@ -586,10 +612,11 @@ class="filter-tree" v-loading="loading" :data="Treedata" + :props="defaultProps" show-checkbox node-key="proId" - :props="defaultProps" - @check-change="handleCurrentChecked" + @check="handleCurrentChecked" + :default-checked-keys="checkedkey" :filter-node-method="filterNode" ref="tree" > @@ -597,9 +624,86 @@ </div> </div> </el-col> - - <el-col :span="15"> + <el-col :span="4"> + <div + style="text-align: center; margin-bottom: 10px; margin-top: 10px" + > + 椤圭洰鍒楄〃 + </div> + <div class="tab3"> + <div class="outside1"> + <el-tree + class="filter-tree" + v-loading="loading" + :data="TreedataList" + node-key="proId" + :props="defaultProps" + :filter-node-method="filterNode" + show-checkbox + @check-change="handleCurrentChecked1" + :default-checked-keys="checkedListkey" + > + </el-tree> + </div> + </div> + </el-col> + <el-col :span="12"> <div class="grid-content bg-purple"> + <div style="text-align: center; margin-bottom: 10px"> + 宸查�夐」鐩垪琛� + </div> + <div + style=" + padding: 0px 6px; + border: 1px solid #e6ebf5; + max-height: 420px; + overflow: auto; + " + > + <el-table + :data="DataList" + border + style="width: 100%" + height="250" + > + <el-table-column prop="propinName" label="妫�鏌ラ」鐩�"> + </el-table-column> + <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="180"> + </el-table-column> + <el-table-column prop="proPrice" label="鍘熶环"> + </el-table-column> + + <el-table-column + label="鎿嶄綔" + align="center" + fixed="right" + class-name="small-padding fixed-width" + width="80px" + > + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + title="鍒犻櫎" + ></el-button> + </template> + </el-table-column> + </el-table> + <el-collapse v-model="activeName" accordion v-if="list1"> + <div> + <el-collapse-item title="璇烽�夋嫨椤圭洰"> + <el-table :data="DataList" border style="width: 100%"> + <el-table-column prop="proName" label="椤圭洰" width="180"> + </el-table-column> + <el-table-column prop="ordPrice" label="鍘熶环"> + </el-table-column> + </el-table> + </el-collapse-item> + </div> + </el-collapse> + </div> <template> <el-form :model="form"> <el-form-item label="浣撴绫诲瀷" prop="tjType"> @@ -661,50 +765,6 @@ </el-form-item> </el-form> </div> - <div style="text-align: center; margin-bottom: 10px"> - 宸查�夐」鐩垪琛� - </div> - <div - style=" - padding: 0px 6px; - border: 1px solid #e6ebf5; - max-height: 420px; - overflow: auto; - " - > - <el-collapse v-model="activeName" accordion> - <div v-for="(item, index) in DataList" :key="index"> - <el-collapse-item> - <template slot="title"> - {{ item.proName + "(" + "鍘熶环" + item.proPrice + ")" }} - </template> - <el-table - :data="item.tjProjectList" - border - style="width: 100%" - height="250" - > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proPrice" label="鍘熶环"> - </el-table-column> - </el-table> - </el-collapse-item> - </div> - </el-collapse> - <el-collapse v-model="activeName" accordion v-if="list1"> - <div> - <el-collapse-item title="璇烽�夋嫨椤圭洰"> - <el-table :data="DataList" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="鍘熶环"> - </el-table-column> - </el-table> - </el-collapse-item> - </div> - </el-collapse> - </div> </div> </el-col> </el-row> @@ -763,7 +823,12 @@ import moment from "moment"; import { getwater } from "@/api/hosp/customer"; import ViewPdf from "@/components/ViewPdf"; -import { projectGetList, getaddtTransition } from "@/api/system/tijian"; +import { + projectGetList, + getaddtTransition, + getProParentIdDxList, + getProSonDxList, +} from "@/api/system/tijian"; export default { components: { ViewPdf, @@ -794,10 +859,13 @@ flag: true, bill: null, Treedata: [], + checkedkey: [], + checkedListkey: [], defaultProps: { - children: "tjProjectList", + children: [], label: "proName", }, + TreedataList: [], discount: 10, DataList: [], // 濂楅鎻愪氦鎸夐挳 @@ -888,7 +956,7 @@ }, created() { // this.getNowTime(); - + this.getdate(); }, mounted() { @@ -899,14 +967,13 @@ methods: { getdate() { getNewDateList().then((res) => { - if(res.data){ + if (res.data) { this.createTimeList = [ moment(res.data).format("YYYY-MM-DD 00:00:00"), - moment(res.data).format("YYYY-MM-DD 23:59:00") + moment(res.data).format("YYYY-MM-DD 23:59:00"), ]; this.getList(); } - }); }, filterNode(value, data) { @@ -955,9 +1022,12 @@ if (this.startTime) { this.queryParams.djbeginTime = this.startTime[0]; this.queryParams.djendTime = this.startTime[1]; - }else{ - this.queryParams.djbeginTime = this.createTimeList[0]; + } else if (this.createTimeList) { + this.queryParams.djbeginTime = this.createTimeList[0]; this.queryParams.djendTime = this.createTimeList[1]; + } else if (this.createTimeList == null) { + this.queryParams.djbeginTime = null; + this.queryParams.djendTime = null; } if (this.startTime1) { this.queryParams.bgbeginTime = this.startTime1[0]; @@ -1064,7 +1134,6 @@ }, // 琛ㄥ崟閲嶇疆 reset() { - this.form = { orderId: null, userId: null, @@ -1102,9 +1171,9 @@ }, /** 閲嶇疆鎸夐挳鎿嶄綔 */ resetQuery() { - this.startTime = [] - this.startTime1 = [] - this.createTimeList = [] + this.startTime = []; + this.startTime1 = []; + this.createTimeList = []; this.resetForm("queryForm"); this.handleQuery(); }, @@ -1158,6 +1227,7 @@ // 琛ュ綍椤圭洰 handleProject(row) { this.loading = true; + this.DataList = []; this.orderId = row.orderId; this.cusId = row.tjCusIdCard; this.userId = row.userId; @@ -1173,16 +1243,41 @@ this.form.tjType = 0; } /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.Treedata = response.data.list; - this.loading = false; - }); + this.getDataList(); this.Projectopen = true; this.title = "琛ュ綍椤圭洰"; }, + + getDataList() { + getProParentIdDxList().then((response) => { + this.Treedata = response.data.list; + this.checkedkey.push(this.Treedata[0].proId); + let proId = this.Treedata[0].proId; + getProSonDxList(proId).then((res) => { + this.TreedataList = res.data.list; + this.TreedataList.forEach((item) => { + this.checkedListkey.push(item.proId); + this.DataList.push(item); + this.DataList.forEach((item) => { + item.propinName = this.Treedata[0].proName; + }); + }); + this.TotalPrice1 = 0; + + if (this.DataList.length != 0) { + this.list1 = false; + this.DataList.forEach((item) => { + this.TotalPrice1 = item.proPrice + this.TotalPrice1; + }); + } + }); + this.loading = false; + }); + }, // 琛ュ綍椤圭洰 - handleProject1(row) { + handleProject1() { this.loading = true; + this.DataList = []; this.orderId = this.ids; this.cusId = this.cusIds; this.userId = this.userIds; @@ -1192,59 +1287,119 @@ cusPhone: this.cusPhone, cusSex: this.cusSex, }; - if (row.tjType) { - this.form.tjType = parseInt(row.tjType); - } else { - this.form.tjType = 0; - } + // if (row.tjType) { + // this.form.tjType = parseInt(row.tjType); + // } else { + // this.form.tjType = 0; + // } /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.Treedata = response.data.list; - this.loading = false; - }); + this.getDataList(); this.Projectopen1 = true; this.title = "琛ュ綍椤圭洰"; }, // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐� handleCurrentChecked(data, checked, checkedNodes) { - if (!data.tjProjectList) { - return; - } - if (checked === true) { - this.DataList.push(data); - } else { - this.DataList.pop(data); - this.list1 = true; - } - // let DataList = selectedobj.checkedNodes - // if (DataList.length>0) { - // DataList.forEach(item => { - // if (nodeobj.proId === item.proId) { - // this.DataList = [] - // this.DataList.push(item) - - // this.list1 = false; - // } - // }) - // }else{ - // this.DataList = [] - // this.list1 = true; - // } - this.TotalPrice1 = 0; - this.proIds = []; - if (this.DataList.length != 0) { - this.list1 = false; - this.DataList.forEach((item) => { - this.TotalPrice1 = item.proPrice + this.TotalPrice1; - item.tjProjectList.forEach((item1) => { - this.proIds.push(item1.proId); + console.log(data, checked, checkedNodes); + console.log(this.DataList,22222); + if (checked.checkedNodes.length != 0) { + this.$refs.tree.setCheckedKeys([data.proId]); + let proId = data.proId; + getProSonDxList(proId).then((res) => { + this.TreedataList = res.data.list; + this.TreedataList.forEach((item) => { + this.checkedListkey.push(item.proId); + this.DataList.push(item); + this.DataList.forEach((item1) => { + if (item1.proParentId == data.proId) { + item1.propinName = data.proName; + } + }); }); + this.spliceData(this.DataList); + this.TotalPrice1 = 0; + if (this.DataList.length != 0) { + this.list1 = false; + this.DataList.forEach((item) => { + this.TotalPrice1 = item.proPrice + this.TotalPrice1; + }); + } + }); + } else if (checked.checkedNodes.length == 0) { + let proId = data.proId; + getProSonDxList(proId).then((res) => { + this.TreedataList = res.data.list; + this.DataList.forEach((item, index) => { + this.TreedataList.forEach((item1) => { + if (item.proId == item1.proId) { + this.DataList.splice(index, this.TreedataList.length); + this.TotalPrice1 = 0; + this.DataList.forEach((item1) => { + this.TotalPrice1 = item1.proPrice + this.TotalPrice1; + }); + } + }); + }); + }); + this.checkedListkey = []; + console.log(this.DataList,1111) + } + }, + + spliceData(row) { + for (var i = 0; i < row.length; i++) { + for (var j = i + 1; j < row.length; j++) { + if (row[i].proId == row[j].proId) { + //濡傛灉绗竴涓瓑浜庣浜屼釜锛宻plice鏂规硶鍒犻櫎绗簩涓� + row.splice(j, 1); + j--; + } + } + } + return row; + }, + + // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐� + handleCurrentChecked1(data, checked, checkedNodes) { + if (checked == false) { + this.DataList.forEach((item, index) => { + if (item.proId == data.proId) { + this.DataList.splice(index, 1); + this.TotalPrice1 = 0; + this.DataList.forEach((item1) => { + this.TotalPrice1 = item1.proPrice + this.TotalPrice1; + }); + } + }); + } else if (checked == true) { + this.DataList.push(data); + this.TotalPrice1 = 0; + this.DataList.forEach((item1) => { + this.TotalPrice1 = item1.proPrice + this.TotalPrice1; }); } }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + this.DataList.forEach((item, index) => { + if (item.proId == row.proId) { + this.DataList.splice(index, 1); + this.TotalPrice1 = 0; + this.DataList.forEach((item1) => { + this.TotalPrice1 = item1.proPrice + this.TotalPrice1; + }); + } + }); + }, + // 鏀惰垂鎸夐挳 submitPrice() { + this.proIds = []; + if (this.DataList.length != 0) { + this.DataList.forEach((item) => { + this.proIds.push(item.proId); + }); + } let data = { cusId: this.cusId, proIds: this.proIds, @@ -1280,6 +1435,12 @@ }, // 鏀惰垂鎸夐挳 submitPrice1() { + this.proIds = []; + if (this.DataList.length != 0) { + this.DataList.forEach((item) => { + this.proIds.push(item.proId); + }); + } let data = { cusId: this.cusIds, proIds: this.proIds, @@ -1334,16 +1495,7 @@ // } // }); // }, - /** 鍒犻櫎鎸夐挳鎿嶄綔 */ - // handleDelete(row) { - // const orderIds = row.orderId || this.ids; - // this.$modal.confirm('鏄惁纭鍒犻櫎浣撴璁板綍缂栧彿涓�"' + orderIds + '"鐨勬暟鎹」锛�').then(function() { - // return delOrder(orderIds); - // }).then(() => { - // this.getList(); - // this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - // }).catch(() => {}); - // }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { this.download( @@ -1421,7 +1573,7 @@ } .outside1 { - width: 700px; + width: 500px; display: flex; margin-top: 8px; } -- Gitblit v1.8.0