From 9290a0a7023a612cddc5971553a6efb727a51165 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期二, 19 八月 2025 17:34:58 +0800
Subject: [PATCH] qx
---
src/views/sampling/sampling/index.vue | 177 +++++++++++++++++++++++++++++++++++------------------------
1 files changed, 105 insertions(+), 72 deletions(-)
diff --git a/src/views/sampling/sampling/index.vue b/src/views/sampling/sampling/index.vue
index 88fd823..57d952b 100644
--- a/src/views/sampling/sampling/index.vue
+++ b/src/views/sampling/sampling/index.vue
@@ -69,18 +69,20 @@
<el-button type="primary" :disabled="!disabled" @click="Cancellation">鎾ら攢鍚堝苟</el-button>
<el-button type="primary" @click="Confirmreceipt" :disabled="!selectList.length">閲囨牱鎵撶爜</el-button>
<el-button type="primary" @click="piliangPrint" :disabled="!isAllSelected">鎵归噺鎵撳嵃</el-button>
+
</el-col>
<el-col :span="12" style="margin: 10px 15px" v-show="samplingList.length > 0 && tjStatus == 0">
<el-button type="primary" :disabled="!selectList.length" @click="buda">琛ユ墦鏉$爜</el-button>
<!-- @click="Collection" -->
<el-button type="primary" :disabled="!disabled" @click="Cancellation">鎾ら攢鍚堝苟</el-button>
+ <el-button type="primary" @click="jydPrint">鎵撳嵃妫�楠屽崟</el-button>
</el-col>
</el-row>
<div style="width: 100%; margin-left: 10px; display: flex">
<div style="width: 40%; margin-right: 20px">
<el-table id="ta" v-loading="loading1" ref="tb" :data="samplingList" @selection-change="handleSelectionChange"
- border height="520px" :row-class-name="tableRowClassName">
+ @current-change="handleCurrentChangess" border height="520px" :row-class-name="tableRowClassName">
<el-table-column type="selection" width="40" align="center" :selectable="selectable" />
<el-table-column label="浣撴鍙�" align="center" prop="tjNumber" width="160px" />
<el-table-column label="濮撳悕" align="center" prop="cusName" width="80px" />
@@ -105,8 +107,9 @@
</div>
<div style="width: 50%">
<!-- v-if="this.rightTabShow" -->
- <el-table :row-key="getRowKey" v-if="tableList.length > 0" v-loading="loading" :data="tableList" @selection-change="handleChange"
- :span-method="objectSpanMethod" ref="tab1" :row-class-name="tableRowClassName" border height="520px">
+ <el-table :key="tableKey" :row-key="getRowKey" v-if="tableList.length > 0" v-loading="loading" :data="tableList"
+ @selection-change="handleChange" :span-method="objectSpanMethod" ref="tab1"
+ :row-class-name="tableRowClassName" border height="520px">
<el-table-column type="selection" width="40" align="center" />
<!-- :selectable="selectEnable" -->
<!-- <el-table-column label="鏄惁绛炬敹" align="center" prop="isSignFor" /> -->
@@ -249,7 +252,7 @@
piliangList: [],
msg: "",
getNumbr: null,
- valueUrl: "ws://127.0.0.1/websocket",
+ valueUrl: "ws://127.0.0.1:6789/websocket",
webSocket: null,
list: [],
selectList: [],
@@ -297,7 +300,9 @@
proId: null,
proName: null,
},
+ tjNumber: null,
startTime: "",
+ tableKey: "",
pickerOptions: {
shortcuts: [
{
@@ -342,7 +347,6 @@
// this.getNowTime();
getTxmmccd().then((res) => {
this.msg = Number(res.msg);
- console.log(res, 444);
});
getCompany(this.queryParams).then((response) => {
this.CompanyList = response.data;
@@ -379,7 +383,6 @@
searchSelect(val) {
this.CheckBox = val;
this.queryParams.dw = this.CheckBox.drugManufacturerId;
- console.log(this.CheckBox, 9999);
},
getRemoteData(query) {
if (query) {
@@ -448,6 +451,23 @@
this.selectList = []; // 娓呯┖ selectList
loadingInstance.close();
}
+ },
+
+
+ jydPrint() {
+ if (this.piliangList.length != 0) {
+ const tjnumber = this.piliangList[0].tjNumber;
+ const viewNum = "1086792376946569216";
+ const params = { viewNum, tjnumber };
+ this.$tab.openPage("妫�楠岀瀵兼鍗�", "/report/clinical", params);
+ this.$refs.tb.toggleRowSelection(this.piliangList[0], false);
+ this.piliangList = []
+ } else {
+ this.$message.info('璇烽噸鏂伴�夋嫨瑕佹墦鍗扮殑鏁版嵁');
+ this.$refs.tb.toggleRowSelection(this.piliangList[0], false);
+ this.piliangList = []
+ }
+
},
getTruncatedName(proName) {
// 鍘绘帀鎵�鏈夌┖鏍�
@@ -533,41 +553,41 @@
},
/** 鏌ヨ浣撴閲囨牱绠$悊鍒楄〃 */
/** 鏌ヨ浣撴閲囨牱绠$悊鍒楄〃 */
-getList() {
- this.queryParams.compId = this.CheckBox.drugManufacturerId;
- this.loading1 = true;
- this.queryParams.isSignFor = this.tjStatus;
+ getList() {
+ this.queryParams.compId = this.CheckBox.drugManufacturerId;
+ this.loading1 = true;
+ this.queryParams.isSignFor = this.tjStatus;
- if (this.createTimeList) {
- this.queryParams.beginTime = this.createTimeList[0];
- this.queryParams.endTime = this.createTimeList[1];
- } else {
- this.queryParams.beginTime = null;
- this.queryParams.endTime = null;
- }
-
- getList(this.queryParams).then((response) => {
- this.loading1 = false;
- if (response.data && response.data.list && response.data.list.length > 0) {
- this.samplingList = response.data.list;
- this.total = response.data.total;
- // 绉婚櫎榛樿閫変腑绗竴琛岀殑閫昏緫
- // this.$nextTick(() => {
- // this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 榛樿閫変腑绗竴琛�
- // this.fetchData(this.samplingList[0].tjNumber); // 鍒锋柊鍙充晶琛ㄦ牸
- // });
- } else {
- this.samplingList = [];
- this.tableList = [];
- this.selectList = []; // 娓呯┖ selectList
- this.ids = []; // 娓呯┖ ids
- if (this.$refs.tab1) {
- this.$refs.tab1.clearSelection(); // 娓呯┖鍙充晶琛ㄦ牸閫変腑鐘舵��
+ if (this.createTimeList) {
+ this.queryParams.beginTime = this.createTimeList[0];
+ this.queryParams.endTime = this.createTimeList[1];
+ } else {
+ this.queryParams.beginTime = null;
+ this.queryParams.endTime = null;
}
- }
- this.loading1 = false;
- });
-},
+
+ getList(this.queryParams).then((response) => {
+ this.loading1 = false;
+ if (response.data && response.data.list && response.data.list.length > 0) {
+ this.samplingList = response.data.list;
+ this.total = response.data.total;
+ // 绉婚櫎榛樿閫変腑绗竴琛岀殑閫昏緫
+ // this.$nextTick(() => {
+ // this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 榛樿閫変腑绗竴琛�
+ // this.fetchData(this.samplingList[0].tjNumber); // 鍒锋柊鍙充晶琛ㄦ牸
+ // });
+ } else {
+ this.samplingList = [];
+ this.tableList = [];
+ this.selectList = []; // 娓呯┖ selectList
+ this.ids = []; // 娓呯┖ ids
+ if (this.$refs.tab1) {
+ this.$refs.tab1.clearSelection(); // 娓呯┖鍙充晶琛ㄦ牸閫変腑鐘舵��
+ }
+ }
+ this.loading1 = false;
+ });
+ },
// 鍙栨秷鎸夐挳
cancel() {
this.open = false;
@@ -618,9 +638,15 @@
}
this.handleQuery(); // 閲嶆柊鏌ヨ
},
+ handleCurrentChangess(val) {
+ if (val != null) {
+ this.$refs.tb.toggleRowSelection(val, true);
+ this.handleSelectionChange(val);
+ }
+ },
handleSelectionChange(selection) {
- this.piliangList = selection;
+
const selectedCount = selection.length;
const totalCount = this.samplingList.length;
@@ -628,6 +654,7 @@
if (selectedCount === 1) {
this.disableSelections = false;
const selectedPerson = selection[0];
+ this.piliangList = selection;
const tjNumber = selectedPerson.tjNumber;
console.log(`閫変腑鐨勪綋妫�鍙�: ${tjNumber}`);
this.fetchData(tjNumber);
@@ -660,6 +687,7 @@
// 璋冭瘯鏃ュ織
console.log(`褰撳墠閫変腑鏁伴噺: ${selectedCount}`);
console.log(`鏄惁绂佺敤閫夋嫨: ${this.disableSelections}`);
+
},
getRowKey(row) {
@@ -673,13 +701,18 @@
.then((response) => {
if (response.data) {
this.tableList = response.data;
+ this.tableKey = Date.now()
this.$nextTick(() => {
if (this.$refs.tab1) {
this.$refs.tab1.doLayout(); // 淇敼涓烘纭殑 ref 鍚嶇О
this.$refs.tab1.clearSelection(); // 娓呯┖閫変腑鐘舵��
+ const headerCheckbox = this.$refs.tab1.$el.querySelector('.el-table__header .el-checkbox');
+ if (headerCheckbox) headerCheckbox.style.display = 'inline';
+
}
});
resolve(this.tableList);
+ this.loading = false;
} else {
this.tableList = [];
this.selectList = [];
@@ -1001,37 +1034,37 @@
});
},
// 鍗曢�夋寜閽�
- // 鍗曢�夋寜閽�
-radioChange(value) {
- this.loading = true;
- this.queryParams.isSignFor = value;
- getList(this.queryParams).then((response) => {
- if (response.data) {
- if (response.data.list == null) {
- this.samplingList = [];
- this.tableList = [];
- this.loading = false;
- } else {
- this.samplingList = response.data.list;
- this.loading = false;
- // 绉婚櫎榛樿閫変腑绗竴琛岀殑閫昏緫
- // if (this.samplingList.length != 0) {
- // this.$nextTick(() => {
- // this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
- // });
- // } else {
- // this.$refs.tb.clearSelection();
- // }
- }
- this.total = response.data.total;
- this.loading = false;
- } else {
- this.samplingList = [];
- this.tableList = [];
- this.loading = false;
- }
- });
-},
+ // 鍗曢�夋寜閽�
+ radioChange(value) {
+ this.loading = true;
+ this.queryParams.isSignFor = value;
+ getList(this.queryParams).then((response) => {
+ if (response.data) {
+ if (response.data.list == null) {
+ this.samplingList = [];
+ this.tableList = [];
+ this.loading = false;
+ } else {
+ this.samplingList = response.data.list;
+ this.loading = false;
+ // 绉婚櫎榛樿閫変腑绗竴琛岀殑閫昏緫
+ // if (this.samplingList.length != 0) {
+ // this.$nextTick(() => {
+ // this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
+ // });
+ // } else {
+ // this.$refs.tb.clearSelection();
+ // }
+ }
+ this.total = response.data.total;
+ this.loading = false;
+ } else {
+ this.samplingList = [];
+ this.tableList = [];
+ this.loading = false;
+ }
+ });
+ },
// 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 }
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@@ -1083,7 +1116,7 @@
<style>
#ta .el-table__header-wrapper .el-checkbox {
- /* display: none; */
+ display: none;
}
.el-table .warning-row {
--
Gitblit v1.8.0