From 53606eac81e6d3a76937c4cb6f45ad61581cb4da Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 05 六月 2025 14:41:55 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb --- src/views/picture/picture/index.vue | 465 ++++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 352 insertions(+), 113 deletions(-) diff --git a/src/views/picture/picture/index.vue b/src/views/picture/picture/index.vue index 7283183..19515c2 100644 --- a/src/views/picture/picture/index.vue +++ b/src/views/picture/picture/index.vue @@ -1,54 +1,156 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + label-width="68px" + > <el-form-item label="浣撴鍙�" prop="tjNumber"> - <el-input ref="inputName" v-model="queryParams.tjNumber" placeholder="璇疯緭鍏ヤ綋妫�鍙�" clearable - @keyup.enter.native="handleQuery" @blur="hb" style="width: 170px" /> + <el-input + ref="inputName" + v-model="queryParams.tjNumber" + placeholder="璇疯緭鍏ヤ綋妫�鍙�" + clearable + @keyup.enter.native="handleQuery" + @blur="hb" + style="width: 170px" + /> </el-form-item> <el-form-item label="濮撳悕" prop="name"> - <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ュ鍚�" clearable @keyup.enter.native="handleQuery" - style="width: 110px" /> + <el-input + v-model="queryParams.name" + placeholder="璇疯緭鍏ュ鍚�" + clearable + @keyup.enter.native="handleQuery" + style="width: 110px" + /> </el-form-item> - <el-form-item label="鍗曚綅鍚嶇О" prop="tjCompName" style="margin-left: 20px"> - <el-select :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId" - style="width: 180px" remote filterable placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" clearable @change="searchSelect"> - <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict" /> + <el-form-item + label="鍗曚綅鍚嶇О" + prop="tjCompName" + style="margin-left: 20px" + > + <el-select + :remote-method="getRemoteData" + v-model="queryParams.tjCompName" + value-key="drugManufacturerId" + style="width: 180px" + remote + filterable + placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" + clearable + @change="searchSelect" + > + <el-option + v-for="dict in CompanyList" + :key="dict.drugManufacturerId" + :label="dict.cnName" + :value="dict" + /> </el-select> </el-form-item> <el-form-item label="椤圭洰" prop="tcm"> - <el-input v-model="queryParams.tcm" placeholder="璇疯緭鍏ラ」鐩�" clearable @keyup.enter.native="handleQuery" - style="width: 170px" /> + <el-input + v-model="queryParams.tcm" + placeholder="璇疯緭鍏ラ」鐩�" + clearable + @keyup.enter.native="handleQuery" + style="width: 170px" + /> </el-form-item> - <el-form-item label="鐧昏鏃堕棿" prop="createTimeList" v-show="isCollapsed == 1"> - <el-date-picker v-model="createTimeList" type="datetimerange" align="right" :picker-options="pickerOptions" - style="width: 310px" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" :default-time="['00:00:00', '23:59:59']" - format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" @change="dateChangebirthday1"> + <el-form-item + label="鐧昏鏃堕棿" + prop="createTimeList" + v-show="isCollapsed == 1" + > + <el-date-picker + v-model="createTimeList" + type="datetimerange" + align="right" + :picker-options="pickerOptions" + style="width: 310px" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + :default-time="['00:00:00', '23:59:59']" + format="yyyy-MM-dd HH:mm" + value-format="yyyy-MM-dd HH:mm" + @change="dateChangebirthday1" + > </el-date-picker> </el-form-item> <el-form-item> - <el-button type="primary" size="mini" @click="toggleCollapse" style="margin-right: 15px" - v-show="isCollapsed == 0">灞曞紑鏇村</el-button> - <el-button type="primary" size="mini" @click="toggleCollapse3" style="margin-right: 15px" - v-show="isCollapsed == 1">鏀惰捣鏇村</el-button> - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" - style="margin-right: 15px">鎼滅储</el-button> - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + <el-button + type="primary" + size="mini" + @click="toggleCollapse" + style="margin-right: 15px" + v-show="isCollapsed == 0" + >灞曞紑鏇村</el-button + > + <el-button + type="primary" + size="mini" + @click="toggleCollapse3" + style="margin-right: 15px" + v-show="isCollapsed == 1" + >鏀惰捣鏇村</el-button + > + <el-button + type="primary" + icon="el-icon-search" + size="mini" + @click="handleQuery" + style="margin-right: 15px" + >鎼滅储</el-button + > + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" + >閲嶇疆</el-button + > </el-form-item> </el-form> - <el-radio-group v-model="checkStatus" @input="radioChange" style="margin: 10px 15px"> + <el-radio-group + v-model="checkStatus" + @input="radioChange" + style="margin: 10px 15px" + > <el-radio-button label="0">鏈</el-radio-button> <el-radio-button label="1">宸叉</el-radio-button> </el-radio-group> <el-row :gutter="20"> <el-col :span="11"> - <el-table v-loading="loading" ref="tb" :data="pictureList" highlight-current-row - :row-class-name="tableRowClassName" @current-change="handleCurrentChange" border height="520px"> - <el-table-column label="浣撴鍙�" align="center" prop="tjNumber" min-width="130" /> - <el-table-column label="濮撳悕" align="center" prop="cusName" min-width="80" /> - <el-table-column label="鎬у埆" align="center" prop="cusSex" min-width="50"> + <el-table + v-loading="loading" + ref="tb" + :data="pictureList" + highlight-current-row + :row-class-name="tableRowClassName" + @current-change="handleCurrentChange" + border + height="520px" + > + <el-table-column + label="浣撴鍙�" + align="center" + prop="tjNumber" + min-width="130" + /> + <el-table-column + label="濮撳悕" + align="center" + prop="cusName" + min-width="80" + /> + <el-table-column + label="鎬у埆" + align="center" + prop="cusSex" + min-width="50" + > <template slot-scope="scope"> <span v-if="scope.row.cusSex == '0'">鐢�</span> <span v-if="scope.row.cusSex == '1'">濂�</span> @@ -56,36 +158,102 @@ <span v-if="scope.row.cusSex == '9'">鏈鏄庢�у埆</span> </template> </el-table-column> - <el-table-column label="韬唤璇佸彿" align="center" prop="cusIdcard" min-width="190" /> - <el-table-column label="濂楅鍚�" align="center" prop="tcm" min-width="100" /> - <el-table-column label="鐧昏鏃堕棿" align="center" prop="tjTime" min-width="120" /> - <el-table-column label="瀹℃牳鐘舵��" align="center" prop="confirmStatus" min-width="80"> + <el-table-column + label="韬唤璇佸彿" + align="center" + prop="cusIdcard" + min-width="190" + /> + <el-table-column + label="濂楅鍚�" + align="center" + prop="tcm" + min-width="100" + /> + <el-table-column + label="鐧昏鏃堕棿" + align="center" + prop="tjTime" + min-width="120" + /> + <el-table-column + label="瀹℃牳鐘舵��" + align="center" + prop="confirmStatus" + min-width="80" + > <template slot-scope="scope"> - <span :style="{ color: scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29' }" - v-if="scope.row.confirmStatus == '301'">宸查�氳繃</span> - <span :style="{ color: scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29' }" - v-if="scope.row.confirmStatus == '299'">宸查┏鍥�</span> + <span + :style="{ + color: + scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29', + }" + v-if="scope.row.confirmStatus == '301'" + >宸查�氳繃</span + > + <span + :style="{ + color: + scope.row.confirmStatus == '301' ? '#0CB618' : '#EA1B29', + }" + v-if="scope.row.confirmStatus == '299'" + >宸查┏鍥�</span + > </template> </el-table-column> </el-table> <div class="pag"> <div class="pag1"> - <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" - :limit.sync="queryParams.pageSize" @pagination="submitForm" /> + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.page" + :limit.sync="queryParams.pageSize" + @pagination="submitForm" + /> </div> </div> </el-col> <el-col :span="11"> - <el-table v-loading="loading" ref="mu" :data="tableList" :row-class-name="tableRowClassName" - @header-click="handleHeaderClick" highlight-current-row @selection-change="handleChange" border - style="height: 400px"> + <el-table + v-loading="loading" + ref="mu" + :data="tableList" + :row-class-name="tableRowClassName" + @header-click="handleHeaderClick" + highlight-current-row + @selection-change="handleChange" + border + style="height: 400px" + > <el-table-column type="selection" width="50" align="center" /> - <el-table-column label="绉戝" align="center" prop="deptName" min-width="100" :show-overflow-tooltip="true" /> - <el-table-column label="椤圭洰" align="center" prop="proName" min-width="150" :show-overflow-tooltip="true" /> - <el-table-column label="鐘舵��" align="center" prop="type" :show-overflow-tooltip="true" min-width="100"> + <el-table-column + label="绉戝" + align="center" + prop="deptName" + min-width="100" + :show-overflow-tooltip="true" + /> + <el-table-column + label="椤圭洰" + align="center" + prop="proName" + min-width="150" + :show-overflow-tooltip="true" + /> + <el-table-column + label="鐘舵��" + align="center" + prop="type" + :show-overflow-tooltip="true" + min-width="100" + > <template slot-scope="scope"> - <span v-if="scope.row.type == '0'" :style="type == 0 ? { color: 'red' } : { color: '#409EFF' }"> + <span + v-if="scope.row.type == '0'" + :style="type == 0 ? { color: 'red' } : { color: '#409EFF' }" + > {{ type == 0 ? "鏈� 妫�" : "鍦� 妫�" }} </span> <span v-if="scope.row.type == '1'">宸插畬鎴�</span> @@ -95,50 +263,110 @@ </el-table-column> <el-table-column label="鍥剧墖" align="center" min-width="100"> <template slot-scope="scope"> - <img v-if="scope.row.imageUrl" :src="scope.row.imageUrl" alt="鍥剧墖" - style="width: 50px; height: 50px; object-fit: cover;" /> + <img + v-if="scope.row.imageUrl" + :src="scope.row.imageUrl" + alt="鍥剧墖" + style="width: 50px; height: 50px; object-fit: cover" + /> <span v-else>鏃犲浘鐗�</span> </template> </el-table-column> - <el-table-column label="妫�鏌ユ椂闂�" align="center" prop="bcupdateTime" min-width="160" /> + <el-table-column + label="妫�鏌ユ椂闂�" + align="center" + prop="bcupdateTime" + min-width="160" + /> <el-table-column label="鎿嶄綔" align="center" width="100"> <template slot-scope="scope"> - <el-button type="text" size="small" @click="showImagePreview(scope.row.imageUrl)" - :disabled="!scope.row.imageUrl">鏌ョ湅鍥剧墖</el-button> + <el-button + type="text" + size="small" + @click="showImagePreview(scope.row.imageUrl)" + :disabled="!scope.row.imageUrl" + >鏌ョ湅鍥剧墖</el-button + > </template> </el-table-column> </el-table> <div style="margin-top: 10px"> - <el-form :model="form" ref="queryForm" size="small" :inline="false" label-width="68px"> + <el-form + :model="form" + ref="queryForm" + size="small" + :inline="false" + label-width="68px" + > <el-form-item label="妫�鏌ユ墍瑙�" prop="proResult"> - <el-input v-model="form.proResult" clearable type="textarea" @focus="submiepilog" /> + <el-input + v-model="form.proResult" + clearable + type="textarea" + @focus="submiepilog" + /> </el-form-item> <el-form-item label="妫�鏌ョ粨璁�" prop="conclusion"> - <el-input v-model="form.conclusion" clearable type="textarea" @focus="submiepilog" /> + <el-input + v-model="form.conclusion" + clearable + type="textarea" + @focus="submiepilog" + /> </el-form-item> <el-form-item> - <el-upload action="" :http-request="uploadFile" :show-file-list="false" accept="image/*" - :before-upload="beforeUpload" style="display: inline-block; margin-right: 10px;"> - <el-button type="primary" icon="el-icon-picture" size="mini" - :disabled="!isUploadEnabled">涓婁紶鍥剧墖</el-button> + <el-upload + action="" + :http-request="uploadFile" + :show-file-list="false" + accept="image/*" + :before-upload="beforeUpload" + style="display: inline-block; margin-right: 10px" + > + <el-button + type="primary" + icon="el-icon-picture" + size="mini" + :disabled="!isUploadEnabled" + >涓婁紶鍥剧墖</el-button + > </el-upload> - <el-button type="primary" icon="el-icon-search" size="mini" @click="submito">鎻愪氦</el-button> + <el-button + type="primary" + icon="el-icon-search" + size="mini" + @click="submito" + >鎻愪氦</el-button + > </el-form-item> </el-form> </div> </el-col> </el-row> - <el-dialog title="鍥剧墖棰勮" :visible.sync="imagePreviewVisible" width="60%" class="image-preview-dialog"> + <el-dialog + title="鍥剧墖棰勮" + :visible.sync="imagePreviewVisible" + width="60%" + class="image-preview-dialog" + > <div class="image-container"> <img :src="currentImageUrl" alt="鍥剧墖" class="preview-image" /> </div> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="imagePreviewVisible = false">纭畾</el-button> + <el-button type="primary" @click="imagePreviewVisible = false" + >纭畾</el-button + > </span> </el-dialog> - <Public ref="aaa" :check-status="checkStatus" :pro-result="form.proResult" :conclusion="form.conclusion" - @add="handleChanges" :project-list="projectList" /> + <Public + ref="aaa" + :check-status="checkStatus" + :pro-result="form.proResult" + :conclusion="form.conclusion" + @add="handleChanges" + :project-list="projectList" + /> </div> </template> <script> @@ -279,18 +507,22 @@ } }, beforeUpload(file) { - const isImage = file.type.startsWith('image/'); + const isImage = file.type.startsWith("image/"); if (!isImage) { - this.$message.error('鍙兘涓婁紶鍥剧墖鏂囦欢锛�'); + this.$message.error("鍙兘涓婁紶鍥剧墖鏂囦欢锛�"); return false; } const isLt5M = file.size / 1024 / 1024 < 5; if (!isLt5M) { - this.$message.error('鍥剧墖澶у皬涓嶈兘瓒呰繃 5MB锛�'); + this.$message.error("鍥剧墖澶у皬涓嶈兘瓒呰繃 5MB锛�"); return false; } - if (!this.selectedRow || !this.selectedRow.proId || !this.selectedTjNumber) { - this.$message.error('璇峰厛閫夋嫨涓�涓」鐩紒'); + if ( + !this.selectedRow || + !this.selectedRow.proId || + !this.selectedTjNumber + ) { + this.$message.error("璇峰厛閫夋嫨涓�涓」鐩紒"); return false; } return true; @@ -300,38 +532,40 @@ const tjNumber = this.selectedTjNumber; const proId = this.selectedRow.proId; - const fileExtension = file.name.split('.').pop(); + const fileExtension = file.name.split(".").pop(); const newFileName = `${tjNumber}_${proId}.${fileExtension}`; const formData = new FormData(); - formData.append('file', file, newFileName); - formData.append('tjh', tjNumber); - formData.append('proId', proId); + formData.append("file", file, newFileName); + formData.append("tjh", tjNumber); + formData.append("proId", proId); tupian(formData) - .then(response => { + .then((response) => { // console.log('鎴愬姛浜�', response); if (response.code === 200) { - this.$message.success('鍥剧墖涓婁紶鎴愬姛锛�'); - const index = this.tableList.findIndex(item => item.proId === proId); + this.$message.success("鍥剧墖涓婁紶鎴愬姛锛�"); + const index = this.tableList.findIndex( + (item) => item.proId === proId + ); if (index !== -1) { // 淇濆瓨 base64 鍥惧儚鐢ㄤ簬鏄剧ず if (response.base64) { const base64Image = `data:image/${fileExtension};base64,${response.base64}`; - this.$set(this.tableList[index], 'imageUrl', base64Image); + this.$set(this.tableList[index], "imageUrl", base64Image); } // 淇濆瓨杩斿洖鐨� url if (response.url) { - this.$set(this.tableList[index], 'url', response.url); + this.$set(this.tableList[index], "url", response.url); } } } else { - this.$message.error('鍥剧墖涓婁紶澶辫触锛�'); + this.$message.error("鍥剧墖涓婁紶澶辫触锛�"); } }) - .catch(error => { + .catch((error) => { // console.log('涓婁紶澶辫触', error); - this.$message.error('鍥剧墖涓婁紶澶辫触锛�'); + this.$message.error("鍥剧墖涓婁紶澶辫触锛�"); }); }, enterHandler() { @@ -544,9 +778,9 @@ let tjNumber = val; this.loading = true; getYxJcXx(tjNumber).then((res) => { - this.tableList = res.data.map(item => { + this.tableList = res.data.map((item) => { // 濡傛灉 imageUrl 瀛樺湪涓旀槸绾� Base64 瀛楃涓诧紝娣诲姞 data:image 鍓嶇紑 - if (item.imageUrl && !item.imageUrl.startsWith('data:image')) { + if (item.imageUrl && !item.imageUrl.startsWith("data:image")) { // 鍋囪鍥剧墖绫诲瀷涓� png锛屽鏋滄帴鍙f彁渚涚被鍨嬶紝鍙互鏇挎崲涓哄姩鎬佸�� item.imageUrl = `data:image/png;base64,${item.imageUrl}`; } @@ -686,43 +920,48 @@ }, submito() { if (!this.selectedRow || !this.selectedRow.proId) { - console.error("鏈�変腑琛屾垨缂哄皯 proId"); + this.$message.error("璇烽�夋嫨鎻愪氦椤圭洰"); return; } - const proId = this.selectedRow.proId; - const jcsj = this.form.proResult || " "; - const jcjl = this.form.conclusion || " "; - const url = this.selectedRow.url || ""; // 鑾峰彇 url锛屽鏋滀笉瀛樺湪鍒欎负绌哄瓧绗︿覆 - addYxJcXx({ - proId: proId, - tjNumber: this.selectedTjNumber, - jcsj: jcsj, - jcjl: jcjl, - url: url // 娣诲姞 url 鍙傛暟 - }) - .then((response) => { - this.form.proResult = ""; - this.form.conclusion = ""; - - if (this.tableList.length == 1) { - this.submitForm(); - } else { - this.tableList.forEach((item, index) => { - if (item.type == 0) { - this.changtjNumber(this.selectedTjNumber); - } else { - this.submitForm(); - } - }); - } + if (!this.form.proResult && !this.form.conclusion) { + this.$message.warning("璇烽�夋嫨妫�鏌ユ墍瑙佹垨妫�鏌ョ粨璁�!"); + } else { + const proId = this.selectedRow.proId; + const jcsj = this.form.proResult || " "; + const jcjl = this.form.conclusion || " "; + const url = this.selectedRow.url || ""; // 鑾峰彇 url锛屽鏋滀笉瀛樺湪鍒欎负绌哄瓧绗︿覆 + + addYxJcXx({ + proId: proId, + tjNumber: this.selectedTjNumber, + jcsj: jcsj, + jcjl: jcjl, + url: url, // 娣诲姞 url 鍙傛暟 }) - .catch((error) => { - console.error("鎻愪氦澶辫触", error); - }); + .then((response) => { + this.form.proResult = ""; + this.form.conclusion = ""; + + if (this.tableList.length == 1) { + this.submitForm(); + } else { + this.tableList.forEach((item, index) => { + if (item.type == 0) { + this.changtjNumber(this.selectedTjNumber); + } else { + this.submitForm(); + } + }); + } + }) + .catch((error) => { + console.error("鎻愪氦澶辫触", error); + }); + } }, - handleDelete() { }, - handleExport() { }, + handleDelete() {}, + handleExport() {}, }, }; </script> -- Gitblit v1.8.0