From c70ffa07e49c0711b79156f00f80b1883d07450f Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期二, 15 四月 2025 10:44:35 +0800 Subject: [PATCH] 11 --- src/views/reservation/reservations/index.vue | 1645 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 1,265 insertions(+), 380 deletions(-) diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue index b3b4a1c..a9cb9a9 100644 --- a/src/views/reservation/reservations/index.vue +++ b/src/views/reservation/reservations/index.vue @@ -1,5 +1,96 @@ <template> <div class="app-container"> + <el-dialog + :title="title" + :visible.sync="open1" + width="1000px" + append-to-body + > + <el-form + ref="form1" + :model="form1" + :rules="rules1" + label-width="100px" + :inline="true" + > + <el-form-item label="鍗曚綅鍚嶇О" prop="cnName"> + <el-input v-model="form1.cnName" placeholder="璇疯緭鍏ヤ腑鏂囧悕绉�" /> + </el-form-item> + <el-form-item label="鑱旂郴浜�" prop="contactPerson"> + <el-input v-model="form1.contactPerson" placeholder="璇疯緭鍏ヨ仈绯讳汉" /> + </el-form-item> + <el-form-item label="鑱旂郴鐢佃瘽" prop="contactPhone"> + <el-input v-model="form1.contactPhone" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" /> + </el-form-item> + <el-form-item label="绋庡彿" prop="taxNumber"> + <el-input v-model="form1.taxNumber" placeholder="璇疯緭鍏ョ◣鍙�" /> + </el-form-item> + <el-form-item label="娉曚汉" prop="legalPerson"> + <el-input v-model="form1.legalPerson" placeholder="璇疯緭鍏ユ硶浜�" /> + </el-form-item> + <el-form-item label="娉ㄥ唽鍦板潃" prop="registerAddress"> + <el-input + v-model="form1.registerAddress" + placeholder="璇疯緭鍏ユ敞鍐屽湴鍧�" + /> + </el-form-item> + <el-form-item label="閫氳鍦板潃" prop="mailingAddress"> + <el-input + v-model="form1.mailingAddress" + placeholder="璇疯緭鍏ラ�氳鍦板潃" + /> + </el-form-item> + <el-form-item label="寮�鎴烽摱琛�" prop="bankAccount"> + <el-input v-model="form1.bankAccount" placeholder="璇疯緭鍏ュ紑鎴烽摱琛�" /> + </el-form-item> + <el-form-item label="閾惰璐︽埛" prop="countNum"> + <el-input v-model="form1.countNum" placeholder="璇疯緭鍏ラ摱琛岃处鎴�" /> + </el-form-item> + <el-form-item label="閭" prop="email"> + <el-input v-model="form1.email" placeholder="璇疯緭鍏ラ偖绠�" /> + </el-form-item> + <el-form-item label="璐熻矗浜�" prop="principal"> + <el-input v-model="form1.principal" placeholder="璇疯緭鍏ヨ礋璐d汉" /> + </el-form-item> + <el-form-item label="缃戝潃" prop="url"> + <el-input v-model="form1.url" placeholder="璇疯緭鍏ョ綉鍧�" /> + </el-form-item> + <el-form-item label="浼犵湡" prop="faxNumber"> + <el-input v-model="form1.faxNumber" placeholder="璇疯緭鍏ヤ紶鐪�" /> + </el-form-item> + <el-form-item label="琛屾斂鍖哄垝鍚嶇О" prop="areaName"> + <el-input v-model="form1.areaName" placeholder="璇疯緭鍏ヨ鏀垮尯鍒掑悕绉�" /> + </el-form-item> + <el-form-item label="鎺掑簭" prop="orderNum"> + <el-input v-model="form1.orderNum" placeholder="璇疯緭鍏ユ帓搴�" /> + </el-form-item> + <el-form-item label="鏈夋晥鏃堕棿" prop="validTime"> + <el-date-picker + clearable + v-model="form1.validTime" + type="date" + value-format="yyyy-MM-dd" + placeholder="璇烽�夋嫨鏈夋晥鏃堕棿" + > + </el-date-picker> </el-form-item + ><br /> + <el-form-item label="澶囨敞" prop="remark"> + <el-input + v-model="form1.remark" + type="textarea" + placeholder="璇疯緭鍏ュ唴瀹�" + :rows="2" + label-width="400px" + style="width: 830px" + resize="none" + ></el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer2"> + <el-button type="primary" @click="submitFormS">纭� 瀹�</el-button> + <el-button @click="cancel1">鍙� 娑�</el-button> + </div> + </el-dialog> <el-form :model="queryParams" ref="queryForm" @@ -38,20 +129,23 @@ <el-select :remote-method="getRemoteData" v-model="queryParams.company" - value-key="drugManufacturerId" remote + default-first-option + allow-create filterable + style="width: 200px" placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" clearable - @change="searchSelect" + @change="idFn1" > <el-option v-for="dict in CompanyList" - :key="dict.drugManufacturerId" + :key="dict.cnName" :label="dict.cnName" - :value="dict.cnName" + :value="dict.drugManufacturerId" /> </el-select> + <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> </el-form-item> <el-form-item label="棰勭害瓒呮湡" prop="isExpire"> <el-select @@ -81,7 +175,7 @@ > </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" @@ -89,9 +183,29 @@ size="mini" :disabled="multiple" @click="batch" - v-hasPermi="['reservation:reservation:remove']" >鎾ら攢棰勭害</el-button > + <!-- v-hasPermi="['reservation:reservation:remove']" --> + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" + size="mini" + :disabled="single" + @click="receipt" + >琛ユ墦灏忕エ</el-button + > + <!-- v-hasPermi="['reservation:reservation:remove']" --> + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" + size="mini" + :disabled="multiple" + @click="Groupsignin" + >鍥綋绛惧埌</el-button + > + <!-- v-hasPermi="['reservation:reservation:remove']" --> </el-col> <right-toolbar :showSearch.sync="showSearch" @@ -106,6 +220,7 @@ @selection-change="handleSelectionChange" :default-sort="{ prop: 'reservationTime', order: 'descending' }" highlight-current-row + style="margin-left: 15px" > <el-table-column type="selection" @@ -132,6 +247,7 @@ <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 @@ -166,20 +282,7 @@ width="110px" :show-overflow-tooltip="true" /> - <el-table-column - label="閭" - align="center" - prop="email" - :show-overflow-tooltip="true" - width="160px" - /> - <el-table-column - label="鍦板潃" - align="center" - prop="address" - :show-overflow-tooltip="true" - width="160px" - /> + <el-table-column label="棰勭害鏃堕棿" align="center" @@ -198,7 +301,11 @@ 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" @@ -247,6 +354,20 @@ prop="company" :show-overflow-tooltip="true" /> + <el-table-column + label="閭" + align="center" + prop="email" + :show-overflow-tooltip="true" + width="160px" + /> + <el-table-column + label="鍦板潃" + align="center" + prop="address" + :show-overflow-tooltip="true" + width="160px" + /> <el-table-column label="鎿嶄綔" align="center" width="90px" fixed="right"> <template slot-scope="scope"> <el-button @@ -254,17 +375,17 @@ type="text" icon="el-icon-s-order" @click="handleUpdate1(scope.row)" - v-hasPermi="['reservation:reservation:edit']" title="棰勭害璇︾粏" ></el-button> + <!-- v-hasPermi="['reservation:reservation:edit']" --> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" - v-hasPermi="['reservation:reservation:edit']" title="淇敼" ></el-button> + <!-- v-hasPermi="['reservation:reservation:edit']" --> <el-button size="mini" type="text" @@ -414,7 +535,7 @@ </el-form-item> <el-form-item label="浣撴绫诲埆" prop="tjCategory"> <el-select - style="width: 150px" + style="width: 140px" v-model="formIn.tjCategory" placeholder="璇烽�夋嫨浣撴绫诲埆" > @@ -433,12 +554,27 @@ style="width: 160px" /> </el-form-item> - <el-form-item label="宸ヤ綔鍗曚綅" prop="company"> - <el-input + <el-form-item label="鍗曚綅鍚嶇О" prop="company"> + <el-select + :remote-method="getRemoteData" v-model="formIn.company" - placeholder="璇疯緭鍏ュ伐浣滃崟浣�" - style="width: 410px" - /> + remote + default-first-option + allow-create + filterable + style="width: 200px" + placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" + clearable + @change="idFn1" + > + <el-option + v-for="dict in CompanyList" + :key="dict.cnName" + :label="dict.cnName" + :value="dict.drugManufacturerId" + /> + </el-select> + <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> </el-form-item> <el-form-item label="鑱屼笟" prop="career"> <el-select @@ -594,31 +730,20 @@ <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> - <!-- <el-button - style=" - width: 20px; - height: 100px; - margin-left: 10px; - margin-top: 20%; - font-size: 10px; - " - type="primary" - size="mini" - @click="submit" - ><i - style="font-size: 18px" - class="el-icon-d-arrow-right" - ></i - ></el-button> --> </div> </el-tab-pane> </el-tabs> @@ -653,7 +778,7 @@ <el-form-item label="搴旀敹閲戦"> <el-input placeholder="搴旀敹閲戦" - :value="TotalPrice1 + '.00'" + :value="TotalPrice1" disabled style="width: 160px" ></el-input> @@ -677,6 +802,7 @@ placeholder="瀹炴敹閲戦" v-model="TotalPrice" style="width: 120px" + disabled ></el-input> </el-form-item> @@ -695,18 +821,136 @@ </el-form> </template> - <div style="text-align: center; margin-bottom: 10px"> + <div + style=" + display: flex; + align-items: center; + justify-content: flex-start; + width: 100%; + " + > + <div + style=" + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-left: 46px; + font-size: 16px; + margin-right: 20px; + " + > + 宸查�夐」鐩潯鏁帮細<span + style="font-weight: 700; color: red; margin-right: 5px" + >{{ this.tableData1.length || 0 }}</span + >鏉� + </div> 宸查�夐」鐩垪琛� </div> <div style=" padding: 0px 6px; border: 1px solid #e6ebf5; + max-height: 650%; + overflow: auto; + width: 916px; + margin-left: 35px; + " + > + <el-table :data="tableData1" border style="width: 100%"> + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + align="center" + > + </el-table-column> + <el-table-column + prop="proType" + label="鎬у埆" + width="50" + align="center" + > + <template slot-scope="scope"> + <template v-if="isAll(scope.row.proType)"> + 鍏ㄩ儴 + </template> + <template v-else> + <dict-tag + :options="dict.type.sys_user_sex" + :value="scope.row.proType" + /> + </template> + </template> + </el-table-column> + + <el-table-column + prop="ordPrice" + label="搴旀敹閲戦" + align="center" + > + </el-table-column> + <el-table-column label="鎶樻墸" width="160px" align="center"> + <template slot-scope="scope"> + <el-input-number + v-model.number="scope.row.discount" + @input="validateDiscount(scope.row)" + placeholder="杈撳叆鎶樻墸" + size="small" + type="number" + :precision="1" + :step="0.1" + :max="10" + :min="0" + :disabled="true" + > + </el-input-number> + </template> + </el-table-column> + <el-table-column + prop="nowPrice" + label="瀹炴敹閲戦" + align="center" + > + </el-table-column> + <el-table-column + prop="proCheckMethod" + label="鏄惁绌鸿吂" + align="center" + > + <template slot-scope="scope"> + <dict-tag + :options="dict.type.sys_yes_no" + :value="scope.row.proCheckMethod" + /> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" align="center" width="80px"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete1(scope.row)" + title="鍒犻櫎" + > + </el-button> + </template> + </el-table-column> + </el-table> + </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="index" accordion v-if="list3"> + > --> + <!-- <el-collapse v-model="index" accordion v-if="list3"> <div class="info1" v-for="(item, index) in tableData1" @@ -720,10 +964,20 @@ item.parentName + " (搴旀敹閲戦:" + item.ordPrice + - ".00鍏� / 瀹炴敹閲戦:" + + " / 瀹炴敹閲戦:" + item.nowPrice + - ".00鍏�)" + "鍏�)" }} + <div style="font-size: 16px; margin-left: 20px"> + 宸查�夐」鐩潯鏁帮細<span + style=" + font-weight: 700 !important; + color: red; + margin-right: 5px; + " + >{{ item.list.length || 0 }}</span + >鏉� + </div> </template> <el-table :data="item.list" @@ -739,12 +993,40 @@ </el-table-column> <el-table-column prop="ordPrice" label="搴旀敹閲戦"> </el-table-column> - <el-table-column - prop="nowPrice" - label="瀹炴敹閲戦" - > + <el-table-column label="鎶樻墸"> + <template slot-scope="scope"> + <el-input-number + v-model.number="scope.row.discount" + @input="validateDiscount(scope.row)" + placeholder="杈撳叆鎶樻墸" + size="small" + type="number" + :precision="1" + :step="0.1" + :max="10" + :min="0" + > + </el-input-number> + </template> </el-table-column> - + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column + label="鎿嶄綔" + align="center" + width="80px" + > + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete1(scope.row)" + title="鍒犻櫎" + > + </el-button> + </template> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -766,17 +1048,24 @@ style="width: 100%" height="250" > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -786,22 +1075,29 @@ <div> <el-collapse-item title="璇烽�夋嫨椤圭洰"> <el-table :data="list" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> - </el-collapse> - </div> + </el-collapse> --> + <!-- </div> --> </div> </el-col> </el-row> @@ -823,6 +1119,86 @@ </div> </template> </el-drawer> + + <el-dialog + title="PDF 棰勮" + :visible.sync="dialogVisible" + :close-on-click-modal="false" + > + <div class="main"> + <iframe + id="printIframe" + :src="url" + frameborder="0" + style="width: 100%; height: 100%" + ></iframe> + </div> + </el-dialog> + + <el-dialog + :title="title" + :visible.sync="open2" + width="800px" + append-to-body + > + <el-form ref="form" :model="forms" label-width="100px" :inline="true"> + <el-form-item label="浣撴绫诲埆"> + <el-select + style="width: 150px" + v-model="forms.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> + <div slot="footer" class="dialog-footer2"> + <el-button type="primary" @click="submitType">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + + <div + style=" + position: absolute; + bottom: 100px; + left: 500px; + width: 700px; + display: none; + " + > + <div id="printBill"> + <div style="font-size: 13px; color: #000000"> + <div style="width: 48%; margin-top: 10px">濮撳悕锛歿{ fmobj.name }}</div> + <div style="width: 48%; margin-top: 10px"> + 鎬у埆锛歿{ fmobj.sex === 0 ? "鐢�" : "濂�" }} + </div> + <div style="width: 48%; margin-top: 10px">鐢佃瘽:{{ fmobj.phoe }}</div> + <div style="width: 48%; margin-top: 10px"> + 鏃ユ湡:{{ fmobj.reservationTime }} + </div> + <div style="width: 58%; margin-top: 10px">濂楅锛歿{ pacName }}</div> + <div style="width: 100%; margin-top: 10px">娓╅Θ鎻愮ず锛�</div> + <div style="width: 100%">1銆侀噰琛�锛岃吂閮ㄥ僵瓒呮鏌ュ悗鏂瑰彲鐢ㄩ銆�</div> + <div style="width: 100%"> + 2銆佽繎鏈熻嫢鏈夌敓鑲茶鍒掑強鏈垚骞翠汉锛屼笉瀹滆繘琛岃兏鐗囥�佸弻鑳介瀵嗗害绛夋斁灏勬鏌ャ�� + </div> + <div style="width: 100%"> + 3銆佹��瀛曟垨鍙兘宸插彈瀛曠殑濂冲+锛岃繕搴旈伩鍏嶅绉戙�佹斁灏勭鍙婇槾寮忚秴澹版鏌ャ�� + </div> + <div style="width: 100%">4銆佺粡鏈熷コ鎬т笉瀹滆繘琛屽绉戝強灏垮父瑙勬鏌ャ��</div> + <div style="width: 100%"> + 5銆佽嫢鎮ㄥ湪绛夊緟妫�鏌ヨ繃绋嬩腑鏈夌枒闂紝璇峰強鏃惰仈绯诲妫�鎶ゅ+銆� + </div> + <div style="width: 100%">6銆佷綋妫�缁撴潫鍚庤灏嗗妫�鍗曚氦杩樿嚦鍓嶅彴銆�</div> + </div> + </div> + </div> <!-- 淇敼棰勭害鐧昏淇℃伅瀵硅瘽妗� --> <el-drawer title="棰勭害淇℃伅缁存姢" :visible.sync="drawer" size="55%"> @@ -969,12 +1345,27 @@ style="width: 160px" /> </el-form-item> - <el-form-item label="宸ヤ綔鍗曚綅" prop="company"> - <el-input + <el-form-item label="鍗曚綅鍚嶇О" prop="company"> + <el-select + :remote-method="getRemoteData" v-model="formIn.company" - placeholder="璇疯緭鍏ュ伐浣滃崟浣�" - style="width: 410px" - /> + remote + default-first-option + allow-create + filterable + style="width: 200px" + placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" + clearable + @change="idFn1" + > + <el-option + v-for="dict in CompanyList" + :key="dict.cnName" + :label="dict.cnName" + :value="dict.drugManufacturerId" + /> + </el-select> + <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> </el-form-item> <el-form-item label="鑱屼笟" prop="career"> <el-select @@ -1024,9 +1415,7 @@ 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> @@ -1095,6 +1484,12 @@ label="濂楅鍚嶇О" align="center" prop="pacName" + width="120px" + /> + <el-table-column + label="濂楅浠锋牸" + align="center" + prop="price" width="120px" /> <el-table-column @@ -1179,19 +1574,15 @@ ></el-option> </el-select> </el-form-item> - - <!-- <div class="tab1"> --> - <!-- <el-form :inline="true" class="tab1"> --> <el-form-item label="搴旀敹閲戦"> <el-input placeholder="搴旀敹閲戦" - :value="TotalPrice1 + '.00'" + :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> --> <el-input-number ref="inputNumber" style="width: 130px" @@ -1218,7 +1609,7 @@ @click="submitPrice" :disabled="confirm" size="mini" - >绛惧埌鐧昏</el-button + >棰勭害淇敼</el-button > </el-form-item> <!-- </el-form> --> @@ -1229,7 +1620,101 @@ <div style="text-align: center; margin-bottom: 10px"> 宸查�夐」鐩垪琛� </div> + <div + style=" + padding: 0px 6px; + border: 1px solid #e6ebf5; + max-height: 650%; + overflow: auto; + width: 916px; + margin-left: 35px; + " + > + <el-table :data="tableData1" border style="width: 100%"> + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + align="center" + > + </el-table-column> + <el-table-column + prop="proType" + label="鎬у埆" + width="50" + align="center" + > + <template slot-scope="scope"> + <template v-if="isAll(scope.row.proType)"> + 鍏ㄩ儴 + </template> + <template v-else> + <dict-tag + :options="dict.type.sys_user_sex" + :value="scope.row.proType" + /> + </template> + </template> + </el-table-column> + + <el-table-column + prop="ordPrice" + label="搴旀敹閲戦" + align="center" + > + </el-table-column> + <el-table-column label="鎶樻墸" width="160px" align="center"> + <template slot-scope="scope"> + <el-input-number + v-model.number="scope.row.discount" + @input="validateDiscount(scope.row)" + placeholder="杈撳叆鎶樻墸" + size="small" + type="number" + :precision="1" + :step="0.1" + :max="10" + :min="0" + :disabled="true" + > + </el-input-number> + </template> + </el-table-column> + <el-table-column + prop="nowPrice" + label="瀹炴敹閲戦" + align="center" + > + </el-table-column> + <el-table-column + prop="proCheckMethod" + label="鏄惁绌鸿吂" + align="center" + > + <template slot-scope="scope"> + <dict-tag + :options="dict.type.sys_yes_no" + :value="scope.row.proCheckMethod" + /> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" align="center" width="80px"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete1(scope.row)" + title="鍒犻櫎" + > + </el-button> + </template> + </el-table-column> + </el-table> + </div> + + <!-- <div style=" padding: 0px 6px; border: 1px solid #e6ebf5; @@ -1237,6 +1722,14 @@ overflow: auto; " > + <div + style=" + padding: 0px 6px; + border: 1px solid #e6ebf5; + max-height: 420px; + overflow: auto; + " + ></div> <el-collapse v-model="index" accordion v-if="list3"> <div class="info1" @@ -1255,24 +1748,58 @@ item.nowPrice + ".00鍏�)" }} + <div style="font-size: 16px; margin-left: 20px"> + 宸查�夐」鐩潯鏁帮細<span + style=" + font-weight: 700 !important; + color: red; + margin-right: 5px; + " + >{{ item.list.length || 0 }}</span + >鏉� + </div> </template> + <el-table :data="item.list" border style="width: 100%" height="270" > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column label="鎶樻墸"> + <template slot-scope="scope"> + <el-input-number + v-model.number="scope.row.discount" + @input="validateDiscount(scope.row)" + placeholder="杈撳叆鎶樻墸" + size="small" + type="number" + :precision="1" + :step="0.1" + :max="10" + :min="0" + > + </el-input-number> + </template> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -1294,17 +1821,24 @@ style="width: 100%" height="250" > - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> @@ -1314,22 +1848,29 @@ <div> <el-collapse-item title="璇烽�夋嫨椤圭洰"> <el-table :data="list" border style="width: 100%"> - <el-table-column prop="proName" label="椤圭洰" width="180"> - </el-table-column> - <el-table-column prop="proSex" label="鎬у埆" width="180"> - </el-table-column> - <el-table-column prop="ordPrice" label="搴旀敹閲戦"> - </el-table-column> - <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> - </el-table-column> - <el-table-column prop="isEat" label="绌鸿吂"> - </el-table-column> - + <el-table-column + prop="proName" + label="椤圭洰" + width="180" + > + </el-table-column> + <el-table-column + prop="proSex" + label="鎬у埆" + width="180" + > + </el-table-column> + <el-table-column prop="ordPrice" label="搴旀敹閲戦"> + </el-table-column> + <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + </el-table-column> + <el-table-column prop="proCheckMethod" label="绌鸿吂"> + </el-table-column> </el-table> </el-collapse-item> </div> </el-collapse> - </div> + </div> --> </div> </el-col> </el-row> @@ -1355,27 +1896,34 @@ </template> <script> +import { addComp, addPlOrderAndDetail } from "@/api/system/comp"; +import Big from "big.js"; +import { Loading } from "element-ui"; import { listReservation, gettjCancel, tjReappoint, tjCancelTj, + getReservation, } from "@/api/reservation/reservation"; import printJS from "print-js"; import { deptTreeSelect, projectGetList, - getOrder, - getCusIdcard, getPackageListName, getaddtTransition, getTransitionList, - getGuide, - getaddTj, + getconfigKey, + delTbBycusCardIdAndProId, + getTransitionList1, } 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", @@ -1391,8 +1939,18 @@ "dict_ageunit", ], data() { + let checkPhoneNum = (rule, value, callback) => { + 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, + isfalse: false, tijiao1: true, index: 0, proIds: "", @@ -1403,7 +1961,10 @@ return time.getTime() < Date.now() - 8.64e7; // 涓嶅彲閫夊巻鍙插ぉ銆佷笉鍙�夊綋鍓嶅ぉ銆佸彲閫夋湭鏉ュぉ }, }, + discount: 10, taocan: false, + webSocket: null, + defaultKeys: [], value1: "", pacName: "", hides: false, @@ -1413,6 +1974,10 @@ dialogVisibles: false, src: "", url: "", + open2: false, + forms: { + tjCategory: "12", + }, dialogVisible: false, /** 鐓х浉鏈哄脊绐楁ā鍧�-start */ videoWidth: 200, @@ -1423,6 +1988,8 @@ thisCancas: null, thisContext: null, thisVideo: null, + datekey: Date.now(), + treedataList: [], list: [], activeName: "1", // 閬僵灞� @@ -1466,8 +2033,9 @@ multiple: true, nodeobj: {}, // 鏄惁鏄剧ず寮瑰嚭灞� - Seachopen: false, + pacId: "", + cusIds: [], // 缁撴灉 result: "", proIds: [], @@ -1511,27 +2079,68 @@ cusNumber: null, cusIsvip: null, }, - formIn: {}, + formIn: { + name: "", + age: "", + idCard: "", + remark: null, + pacName: "", + cusaddr: null, + idType: null, + ageUnit: null, + sex: null, + phoe: "", + nation: null, + email: "", + marriage: null, + address: "", + tjCategory: null, + company: "", + career: null, + reservationTime: null, + timeRegion: null, + indexCard: "", + department: "", + }, + fmobj: {}, // 琛ㄥ崟鏍¢獙 + form1: {}, + open1: false, + rules1: { + cnName: [{ required: true, trigger: "blur" }], + contactPerson: [{ required: true, trigger: "blur" }], + contactPhone: [ + { + required: true, + trigger: "blur", + }, + { + pattern: /^1[3-9]\d{9}$/, + trigger: "blur", + }, + ], + }, 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: [ @@ -1561,6 +2170,7 @@ reservationList: [], // 寮瑰嚭灞傛爣棰� title: "", + valueUrls: "ws://127.0.0.1:6789/websocket", drawer: false, drawer1: false, // 鏌ヨ鍙傛暟 @@ -1585,21 +2195,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", }, ], @@ -1617,6 +2227,117 @@ this.getList(); }, methods: { + isAll(value) { + return value === "" || value === null; + }, + validateDiscount(row) { + if (row.discount == null || isNaN(row.discount)) { + row.discount = 10; + } + if (row.discount > 10) { + row.discount = 10; // 寮哄埗灏嗗�艰缃负鏈�澶у�� + } else if (row.discount < 0) { + row.discount = 0; // 寮哄埗灏嗗�艰缃负鏈�灏忓�� + } + this.updateProPrice(row); // 鏇存柊浠锋牸鎴栧叾浠栭�昏緫 + }, + updateProPrice(row) { + const ordPrice = new Big(row.ordPrice || 0); + const discount = new Big(row.discount || 0); + const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10) + row.nowPrice = result.toNumber(); + this.TotalPrice = this.tableData1.reduce((sum, item) => { + return sum.plus(new Big(item.nowPrice || "0")); + }, new Big(0)); + + this.discount = + (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; + }, + + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete1(row) { + // console.log(row); + let data = { + cusCardId: row.cusId, + proId: row.parentProId, + }; + this.$modal + .confirm("鏄惁纭鍒犻櫎锛�") + .then(() => { + return delTbBycusCardIdAndProId(data); + }) + .then(() => { + this.TotalPrice1 = 0; + getTransitionList1(row.cusId).then((response) => { + this.tableData1 = response.data; + + this.tableData1.forEach((item) => { + this.TotalPrice1 += item.ordPrice; + this.TotalPrice += item.nowPrice; + }); + this.TotalPrice = this.tableData1.reduce((sum, item) => { + return sum.plus(new Big(item.nowPrice || "0")); + }, new Big(0)); + this.discount = + (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * + 10; + }); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }) + .catch(() => {}); + }, + getCompanyList() { + this.loading = true; + getconfigKey("team_reservation_default_day").then((res) => { + this.queryParams.yxts = res.msg; + }); + getCompany(this.queryParam).then((response) => { + this.CompanyList = response.data; + this.total = response.total; + this.loading = false; + }); + }, + cancel1() { + this.open1 = false; + this.reset1(); + }, + submitFormS() { + this.$refs["form1"].validate((valid) => { + if (valid) { + addComp(this.form1).then((response) => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open1 = false; + this.getCompanyList(); + }); + } + }); + }, + reset1() { + this.form1 = { + company: "", + payType: "", + name: "", + phoe: "", + signingPic: "", + discount: "", + }; + }, + handleAdd1() { + this.reset1(); + this.open1 = true; + this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢"; + }, + idFn1(value) { + if (value) { + this.form.dictCompId = value; + this.CompanyList.forEach((item) => { + if (item.drugManufacturerId == this.form.dictCompId) { + this.form.compName = item.cnName; + this.queryParams.company = item.cnName; + } + }); + } + }, /** 鏌ヨ浣撴棰勭害鍒楄〃 */ getList() { this.loading = true; @@ -1625,30 +2346,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; }); @@ -1660,6 +2357,7 @@ // 鍙栨秷鎸夐挳 cancel() { this.open = false; + this.open2 = false; this.reset(); }, @@ -1723,6 +2421,10 @@ }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { + this.cusIds = selection.map((item) => item.idCard); + selection.forEach((item) => { + this.fmobj = item; + }); this.ids = selection.map((item) => item.id); this.single = selection.length !== 1; this.multiple = !selection.length; @@ -1739,6 +2441,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"; } @@ -1753,66 +2456,74 @@ } if (this.formIn.isExpire === 2) { this.drawer = true; - this.discount = this.formIn.discount; + if (this.formIn.discount != null) { + this.discount = this.formIn.discount; + } + //鍏ㄩ儴濂楅 if (this.formIn.sex != null) { 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; + getTransitionList1(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; @@ -1820,15 +2531,19 @@ } }); - /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.data = response.data; - 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) { @@ -1846,91 +2561,104 @@ if (row.timeRegion === 3) { this.formIn.timeRegion = "11:00-12:00"; } - if (this.formIn.isExpire === 1) { - this.tijiao1 = false; - } - this.drawer1 = true; + if (this.formIn.isExpire === 1) { + this.tijiao1 = false; + } + this.drawer1 = true; + if (this.formIn.discount != null) { this.discount = this.formIn.discount; - //鍏ㄩ儴濂楅 - if (this.formIn.sex != null) { - 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.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); - }); - throw Error(); - } - }); + } + //鍏ㄩ儴濂楅 + if (this.formIn.sex != null) { + 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.$nextTick(() => { + 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.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.loading = false; }); - } - let cusId = this.formIn.idCard; - this.list1 = true; - (this.tableData1 = []), - (this.newpacName = []), - 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; + this.loading = false; + }); + } + let id = this.formIn.id; + this.list1 = true; + (this.tableData1 = []), + (this.newpacName = []), + getReservation(id).then((response) => { + if (response.data) { + let cusId = response.data.idCard; + getTransitionList1(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; + } } else { + this.tableData1 = []; + this.list3 = false; this.list1 = true; } - } else { - this.tableData1 = []; - this.list3 = false; - this.list1 = true; - } - }); - - /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - projectGetList().then((response) => { - this.data = response.data; - this.dXData = response.data; - return; + }); + } }); + + /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ + projectGetList().then((response) => { + this.treedataList = response.data.list; + this.dXData = response.data.list; + return; + }); }, // 鎶樻墸 numberChange(currentValue, oldValue) { this.discount = currentValue; this.TotalPrice = (this.TotalPrice1 * (this.discount / 10)).toFixed(2); + }, + + Package() { + this.taocan = true; + this.datekey = Date.now(); }, /** 鎼滅储鎿嶄綔 */ @@ -1961,9 +2689,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 = []; @@ -1987,9 +2715,146 @@ }); }); } else { - this.data = JSON.parse(JSON.stringify(this.dXData)); + this.treedataList = JSON.parse(JSON.stringify(this.dXData)); return; } + }, + + Groupsignin() { + this.open2 = true; + }, + + submitType() { + // let cusIds = []; + // this.selectList.forEach((item) => { + // cusIds.push(item.idCard); + // }); + let loadingInstance1 = Loading.service({ + fullscreen: true, + text: "绛惧埌涓�", + }); + let data = { + cusIds: this.cusIds, + tjCategory: this.forms.tjCategory, + }; + this.open2 = false; + addPlOrderAndDetail(data).then((res) => { + if (res.code == 200) { + this.open2 = false; + this.$modal.msgSuccess("绛惧埌鎴愬姛"); + if (res.file) { + let base64 = res.file; + this.base64ToBlob({ + b64data: base64, + contentType: "application/pdf", + }).then((res) => { + this.dialogVisible = true; + // 杞悗鍚庣殑blob瀵硅薄 + try { + this.url = res.preview; + } catch (error) { + this.url = window.webkitURL.createObjectURL(res.preview); + } + }); + } else { + let _this = this; + this.$nextTick(() => { + // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + loadingInstance1.close(); + }); + var websocket = null; + var url = _this.valueUrls; + if ("WebSocket" in window) { + websocket = new WebSocket(url); + } else if ("MozWebSocket" in window) { + websocket = new MozWebSocket(url); + } else { + } + if (websocket == null) { + alert("11111"); + } + websocket.onopen = function () { + console.log('res',res); + + try { + // 杩炴帴璁惧 + var jsonObjs = { + type: 4, + data: res, + }; + var jStrs = JSON.stringify(jsonObjs); + websocket.send(jStrs); + } catch (err) { + var tryTime = 0; + // 閲嶈瘯10娆★紝姣忔涔嬮棿闂撮殧3绉� + if (tryTime < 1) { + var t1 = setTimeout(function () { + tryTime++; + var jsonObjs = { + type: 4, + data: res, + }; + var jStrs = JSON.stringify(jsonObjs); + websocket.send(jStrs); + }, 1 * 1000); + } else { + console.error("閲嶈繛澶辫触."); + } + } + }; + websocket.onclose = function () { + alert("杩炴帴鍏抽棴"); + }; + websocket.onmessage = function (event) { + var resultObj = JSON.parse(event.data); + _this.cardreader = false; + }; + + //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉� + websocket.onerror = function () { + alert("璇锋鏌ヨ繛鎺ユ槸鍚︽甯�"); + }; + + this.getList(); + } + } else { + this.$nextTick(() => { + // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + loadingInstance1.close(); + }); + } + }); + }, + + base64ToBlob({ b64data = "", contentType = "", sliceSize = 512 } = {}) { + return new Promise((resolve, reject) => { + // 浣跨敤 atob() 鏂规硶灏嗘暟鎹В鐮� + let byteCharacters = atob(b64data); + let byteArrays = []; + for ( + let offset = 0; + offset < byteCharacters.length; + offset += sliceSize + ) { + let slice = byteCharacters.slice(offset, offset + sliceSize); + let byteNumbers = []; + for (let i = 0; i < slice.length; i++) { + byteNumbers.push(slice.charCodeAt(i)); + } + // 8 浣嶆棤绗﹀彿鏁存暟鍊肩殑绫诲瀷鍖栨暟缁勩�傚唴瀹瑰皢鍒濆鍖栦负 0銆� + // 濡傛灉鏃犳硶鍒嗛厤璇锋眰鏁扮洰鐨勫瓧鑺傦紝鍒欏皢寮曞彂寮傚父銆� + byteArrays.push(new Uint8Array(byteNumbers)); + } + let result = new Blob(byteArrays, { + type: contentType, + }); + result = Object.assign(result, { + // jartto: 杩欓噷涓�瀹氳澶勭悊涓�涓� URL.createObjectURL + preview: URL.createObjectURL(result), + // name: `鍥剧墖绀轰緥.png`, + }); + resolve(result); + }); }, // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐� @@ -2007,6 +2872,20 @@ } else { this.proIds = []; } + }, + + receipt() { + setTimeout(function () { + const style = "@media print { @page{margin:0 10mm,size:4mm 6mm;}};"; //鎵撳嵃鏃跺幓鎺夌湁椤电湁灏� + printJS({ + printable: "printBill", // 鏍囩鍏冪礌id + type: "html", + header: "", + targetStyles: ["*"], + scanStyles: false, //鎵撳嵃蹇呴』鍔犱笂锛屼笉鐒堕〉闈笂鐨刢ss鏍峰紡鏃犳晥 + style, + }); + }, 100); }, // 椤圭洰鎻愪氦 @@ -2070,91 +2949,91 @@ // 鏈�鍚庢彁浜ゆ寜閽� submitPrice() { let _this = this; - if (_this.tableData1.length > 0) { - if (this.tableData[0]) { - var pacId = this.tableData[0].pacId; - } - // let copeWith = this.TotalPrice1; - // let paidIn = this.TotalPrice; - // let discount = this.discount; - // this.tjFlowingWater = { copeWith, paidIn, discount }; - if (this.formIn.timeRegion === "8:00-9:00") { - this.formIn.timeRegion = 0; - } - if (this.formIn.timeRegion === "9:00-10:00") { - this.formIn.timeRegion = 1; - } - if (this.formIn.timeRegion === "10:00-11:00") { - this.formIn.timeRegion = 2; - } - if (this.formIn.timeRegion === "11:00-12:00") { - this.formIn.timeRegion = 3; - } - let data; - if (pacId) { - data = { - id: this.formIn.id, - isExpire: this.formIn.isExpire, - address: this.formIn.address, - company: this.formIn.company, - department: this.formIn.department, - discount: this.discount, - email: this.formIn.email, - idCard: this.formIn.idCard, - marriage: this.formIn.marriage, - name: this.formIn.name, - nation: this.formIn.nation, - pacId, - phoe: this.formIn.cusPhone, - reservationTime: this.formIn.reservationTime, - sex: this.formIn.sex, - timeRegion: this.formIn.timeRegion, - tjCategory: this.formIn.tjCategory, - // tjFlowingWater: this.tjFlowingWater, - tjType: this.formIn.tjType, - idType: this.formIn.idType, - age: this.formIn.age, - ageUnit: this.formIn.ageUnit, - career: this.formIn.career, - }; - } else { - data = { - id: this.formIn.id, - isExpire: this.formIn.isExpire, - address: this.formIn.address, - company: this.formIn.company, - department: this.formIn.department, - discount: this.discount, - email: this.formIn.email, - idCard: this.formIn.idCard, - marriage: this.formIn.marriage, - name: this.formIn.name, - nation: this.formIn.nation, - pacId, - phoe: this.formIn.phoe, - reservationTime: this.formIn.reservationTime, - sex: this.formIn.sex, - timeRegion: this.formIn.timeRegion, - tjCategory: this.formIn.tjCategory, - // tjFlowingWater: this.tjFlowingWater, - tjType: this.formIn.tjType, - idType: this.formIn.idType, - age: this.formIn.age, - ageUnit: this.formIn.ageUnit, - career: this.formIn.career, - }; - } - tjReappoint(data).then((res) => { - if (res.code === 200) { - this.$modal.msgSuccess("鐧昏鎴愬姛"); - } - _this.drawer = false; - }); - this.getList(); - this.$tab.refreshPage(); - } else { - this.$message.warning("璇烽�夋嫨鎮ㄨ浣撴鐨勫唴瀹�"); + // if (_this.tableData1.length > 0) { + if (this.tableData[0]) { + var pacId = this.tableData[0].pacId; } + // let copeWith = this.TotalPrice1; + // let paidIn = this.TotalPrice; + // let discount = this.discount; + // this.tjFlowingWater = { copeWith, paidIn, discount }; + if (this.formIn.timeRegion === "8:00-9:00") { + this.formIn.timeRegion = 0; + } + if (this.formIn.timeRegion === "9:00-10:00") { + this.formIn.timeRegion = 1; + } + if (this.formIn.timeRegion === "10:00-11:00") { + this.formIn.timeRegion = 2; + } + if (this.formIn.timeRegion === "11:00-12:00") { + this.formIn.timeRegion = 3; + } + let data; + if (pacId) { + data = { + id: this.formIn.id, + isExpire: this.formIn.isExpire, + address: this.formIn.address, + company: this.formIn.company, + department: this.formIn.department, + discount: this.discount, + email: this.formIn.email, + idCard: this.formIn.idCard, + marriage: this.formIn.marriage, + name: this.formIn.name, + nation: this.formIn.nation, + pacId, + phoe: this.formIn.cusPhone, + reservationTime: this.formIn.reservationTime, + sex: this.formIn.sex, + timeRegion: this.formIn.timeRegion, + tjCategory: this.formIn.tjCategory, + // tjFlowingWater: this.tjFlowingWater, + tjType: this.formIn.tjType, + idType: this.formIn.idType, + age: this.formIn.age, + ageUnit: this.formIn.ageUnit, + career: this.formIn.career, + }; + } else { + data = { + id: this.formIn.id, + isExpire: this.formIn.isExpire, + address: this.formIn.address, + company: this.formIn.company, + department: this.formIn.department, + discount: this.discount, + email: this.formIn.email, + idCard: this.formIn.idCard, + marriage: this.formIn.marriage, + name: this.formIn.name, + nation: this.formIn.nation, + pacId, + phoe: this.formIn.phoe, + reservationTime: this.formIn.reservationTime, + sex: this.formIn.sex, + timeRegion: this.formIn.timeRegion, + tjCategory: this.formIn.tjCategory, + // tjFlowingWater: this.tjFlowingWater, + tjType: this.formIn.tjType, + idType: this.formIn.idType, + age: this.formIn.age, + ageUnit: this.formIn.ageUnit, + career: this.formIn.career, + }; + } + tjReappoint(data).then((res) => { + if (res.code === 200) { + this.$modal.msgSuccess("棰勭害鎴愬姛"); + } + _this.drawer = false; + }); + this.getList(); + this.$tab.refreshPage(); + // } else { + // this.$message.warning("璇烽�夋嫨鎮ㄨ浣撴鐨勫唴瀹�"); + // } }, // 鏈�鍚庢彁浜ゆ寜閽� submitPrice1() { @@ -2384,7 +3263,12 @@ -moz-border-radius: 2em; border-radius: 2em; } - +.dialog-footer2 { + width: 960px; + height: 36px; + display: flex; + justify-content: center; +} /* 淇敼 婊戝潡 */ #printIframe::-webkit-scrollbar-thumb { background-color: #dcdfe6; @@ -2398,6 +3282,7 @@ width: 300px; height: 300px; } + .tj1 { width: 230px; display: flex; -- Gitblit v1.8.0