| | |
| | | v-show="showSearch" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="体检号" prop="tjNum"> |
| | | <el-form-item label="体检号" prop="tjNumber"> |
| | | <el-input |
| | | ref="inputName" |
| | | v-model="queryParams.tjNum" |
| | | v-model="queryParams.tjNumber" |
| | | placeholder="请输入体检号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | |
| | | @click="handleQuery" |
| | | >查询</el-button |
| | | > |
| | | <el-button |
| | | <!-- <el-button |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | size="mini" |
| | | size="mini" style="margin:0 15px;" |
| | | @click="Confirmreceipt" |
| | | >确认采样</el-button |
| | | > |
| | | > --> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| | | >重置</el-button |
| | | > |
| | |
| | | @input="radioChange" |
| | | style="margin: 10px 15px" |
| | | > |
| | | <el-radio-button label="1">未采样</el-radio-button> |
| | | <el-radio-button label="0">已采样</el-radio-button> |
| | | <el-radio-button label="1" :disabled="qiehuan && disabledId === 0">未采样</el-radio-button> |
| | | <el-radio-button label="0" :disabled="qiehuan && disabledId === 1">已采样</el-radio-button> |
| | | </el-radio-group> |
| | | </el-col> |
| | | <el-col :span="12" v-if="tableList.length > 1 && tjStatus == 0"> |
| | | <el-button type="primary" plain v-hasPermi="['hosp:detail:add']" |
| | | >合并样本</el-button |
| | | <el-col |
| | | :span="12" |
| | | style="margin: 10px 15px" |
| | | v-if="samplingList.length > 0 && tjStatus == 1" |
| | | > |
| | | <el-button type="primary" @click="Merging">合并项目</el-button> |
| | | <!-- <el-button |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | style="margin: 0 15px" |
| | | v-hasPermi="['hosp:detail:add']" |
| | | @click="Confirmreceipt" |
| | | >确认采样</el-button |
| | | > --> |
| | | <el-button type="primary" :disabled="!disabled" @click="Cancellation" |
| | | >撤销合并</el-button |
| | | > |
| | | <el-button type="primary" @click="Confirmreceipt">采样打码</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="Collection" |
| | | >补打条码</el-button |
| | | > |
| | | <el-button type="primary" :disabled="!disabled" @click="Cancellation" |
| | | >撤销合并</el-button |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <div style="width: 40%; margin-right: 20px"> |
| | | <el-table |
| | | id="ta" |
| | | v-loading="loading" |
| | | v-loading="loading1" |
| | | ref="tb" |
| | | :data="samplingList" |
| | | @selection-change="handleSelectionChange" |
| | |
| | | <el-table-column |
| | | label="体检号" |
| | | align="center" |
| | | prop="customer.tjNumber" |
| | | prop="tjNumber" |
| | | width="160px" |
| | | /> |
| | | <el-table-column |
| | | label="姓名" |
| | | align="center" |
| | | prop="customer.cusName" |
| | | prop="cusName" |
| | | width="80px" |
| | | /> |
| | | <el-table-column |
| | | label="性别" |
| | | align="center" |
| | | prop="customer.cusSex" |
| | | prop="cusSex" |
| | | width="60px" |
| | | > |
| | | <!-- <template slot-scope="scope"> |
| | |
| | | <el-table-column |
| | | label="手机号" |
| | | align="center" |
| | | prop="customer.cusPhone" |
| | | prop="cusPhone" |
| | | width="120px" |
| | | /> |
| | | <el-table-column |
| | | label="申请时间" |
| | | align="center" |
| | | prop="customer.applicationTime" |
| | | prop="applicationTime" |
| | | width="210" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.customer.applicationTime) }}</span> |
| | | <span>{{ parseTime(scope.row.applicationTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div style="width: 50%"> |
| | | <!-- :default-sort="{ prop: 'specimenType', order: 'ascending' }" :default-sort="{ prop: 'specimenType', order: 'ascending' }" |
| | | @sort-change="handleSortChange" |
| | | :span-method="objectSpanMethod" |
| | | @selection-change="handleChange" ref="tab1" |
| | | :row-class-name="tableRowClassName"--> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="tableList" |
| | | :span-method="objectSpanMethod" |
| | | @selection-change="handleChange" |
| | | border |
| | | height="520px" |
| | | :span-method="objectSpanMethod" |
| | | ref="tab1" |
| | | :row-class-name="tableRowClassName" |
| | | border |
| | | height="520px" |
| | | > |
| | | <el-table-column type="selection" width="40" align="center" /> |
| | | <!-- :selectable="selectEnable" --> |
| | |
| | | prop="specimenType" |
| | | width="120" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_dict_specimen" |
| | | :value="scope.row.specimenType" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="项目名称" align="center" prop="proName" /> |
| | | <el-table-column |
| | | label="采样编号" |
| | | align="center" |
| | | prop="jyxh" |
| | | :show-overflow-tooltip="true" |
| | | width="120" |
| | | /> |
| | | <el-table-column label="项目名称" align="center" prop="proName" /> |
| | | <!-- <el-table-column |
| | | label="性别" |
| | | align="center" |
| | | prop="proSex" |
| | | width="90" |
| | | /> |
| | | /> --> |
| | | <el-table-column |
| | | label="空腹" |
| | | label="是否合并" |
| | | align="center" |
| | | prop="proCheckMethod" |
| | | prop="isMerge" |
| | | width="90" |
| | | /> |
| | | <el-table-column |
| | | label="采样编号" |
| | | align="center" |
| | | prop="samplingNumber" |
| | | :show-overflow-tooltip="true" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span |
| | | :style="{ color: scope.row.isMerge === 0 ? '' : '#409EFF' }" |
| | | > |
| | | {{ scope.row.isMerge === 0 ? "未合并" : "已合并" }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <!-- <el-table-column |
| | | label="采样状态" |
| | | align="center" |
| | | prop="isSignFor" |
| | |
| | | :value="scope.row.isSignFor" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| | |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div id="printSection" style="display: none"> |
| | | <!-- 动态生成多个条形码的容器 --> |
| | | <div v-for="(item, index) in selectList" :key="index"> |
| | | <svg :id="'barcode' + index"></svg> |
| | | <div class="name">{{ getTruncatedName(item.proName).truncated }}</div> |
| | | <div class="name1"> |
| | | {{ getTruncatedName(item.proName).remaining }} |
| | | </div> |
| | | <!-- <div class="name">{{ item.proName.slice(0, msg) }}</div> |
| | | <div class="name1"> |
| | | {{ item.proName.slice(msg) }} |
| | | </div> --> |
| | | <div class="last"> |
| | | <p>{{ item.cusName }}</p> |
| | | <div> |
| | | <span>{{ item.customer.cusSex == 0 ? "男" : "女" }}</span> |
| | | <span>{{ item.customer.age }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="tj"> |
| | | <span>体检中心</span> |
| | | <!-- <span>{{ item.cardId.slice(0, 14) }}</span> --> |
| | | <!-- <span>{{ item.cardId }}</span> --> |
| | | <span>{{ item.cardId ? item.cardId.substring(0, 14) : "" }}</span> |
| | | </div> |
| | | <div class="tj"> |
| | | <span>{{ item.jyxh }}</span> |
| | | <span>{{ formatDate(item.applicationTime) }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- |
| | |
| | | addSampling, |
| | | updateSampling, |
| | | confirmSampling, |
| | | getCusCyList, |
| | | mergeCaiYang, |
| | | chexiaoCaiYang, |
| | | getTxmmccd, |
| | | getTxmkd, |
| | | } from "@/api/sampling/sampling"; |
| | | import { getNewDateList } from "@/api/hosp/order"; |
| | | import moment from "moment"; |
| | |
| | | name: "Sampling", |
| | | data() { |
| | | return { |
| | | msg: "", |
| | | getNumbr: null, |
| | | list: [], |
| | | selectList: "", |
| | | selectList: [], |
| | | selectedRows: [], |
| | | createTimeList: [], |
| | | // 遮罩层 |
| | | loading: true, |
| | | loading1: true, |
| | | // 选中数组 |
| | | ids: [], |
| | | // 绑定单选按钮 |
| | |
| | | pageNum: 1, |
| | | pageSize: 20, |
| | | name: null, |
| | | tjNum: null, |
| | | tjNumber: null, |
| | | applicationTime: null, |
| | | isSignFor: null, |
| | | tjTime: null, |
| | |
| | | }, |
| | | created() { |
| | | // this.getNowTime(); |
| | | |
| | | getTxmmccd().then((res) => { |
| | | this.msg = Number(res.msg); |
| | | }); |
| | | this.getdate(); |
| | | }, |
| | | mounted() { |
| | |
| | | this.$refs.inputName.focus(); |
| | | }); |
| | | }, |
| | | computed: { |
| | | disabled() { |
| | | return ( |
| | | this.selectList.length > 0 && |
| | | this.selectList[this.selectList.length - 1].isMerge === 1 |
| | | ); |
| | | }, |
| | | qiehuan() { |
| | | return ( |
| | | this.selectList.length > 0 |
| | | ); |
| | | }, |
| | | disabledId() { |
| | | return ( |
| | | this.tjStatus == "1" ? 1 : 0 |
| | | ); |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | getTruncatedName(proName) { |
| | | // 去掉所有空格 |
| | | const trimmedProName = proName.replace(/\s+/g, ""); |
| | | |
| | | const number = this.msg; |
| | | |
| | | const truncated = |
| | | trimmedProName.length > number |
| | | ? trimmedProName.slice(0, number) |
| | | : trimmedProName; |
| | | let remaining = |
| | | trimmedProName.length > number ? trimmedProName.slice(number) : ""; |
| | | |
| | | if (remaining.length > number) { |
| | | remaining = remaining.slice(0, number) + "..."; |
| | | } |
| | | return { truncated, remaining }; // 返回结果 |
| | | }, |
| | | |
| | | /* getTruncatedName(proName) { |
| | | const trimmedProName = proName.replace(/\s+/g, ""); // 去掉所有空格 |
| | | const truncated = |
| | | trimmedProName.length > 35 |
| | | ? trimmedProName.slice(0, 35) |
| | | : trimmedProName; |
| | | const remaining = |
| | | trimmedProName.length > 35 ? trimmedProName.slice(35) : ""; |
| | | return { truncated, remaining }; |
| | | }, */ |
| | | |
| | | // 示例的日期格式化方法 |
| | | formatDate(date) { |
| | | const options = { year: "numeric", month: "2-digit", day: "2-digit" }; |
| | | return new Date(date).toLocaleDateString(undefined, options); |
| | | }, |
| | | getdate() { |
| | | getNewDateList().then((res) => { |
| | | this.createTimeList = [ |
| | |
| | | dateChangebirthday1(val) { |
| | | this.createTimeList = val; |
| | | }, |
| | | formatDate(applicationTime) { |
| | | // 确保 applicationTime 是有效的字符串 |
| | | if (applicationTime) { |
| | | return applicationTime.split(" ")[0]; // 通过空格分隔日期和时间,只返回日期部分 |
| | | } |
| | | return ""; // 如果 applicationTime 无效,返回空字符串 |
| | | }, |
| | | /** 查询体检采样管理列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | this.loading1 = true; |
| | | this.queryParams.isSignFor = this.tjStatus; |
| | | this.queryParams.beginTime = this.createTimeList[0]; |
| | | this.queryParams.endTime = this.createTimeList[1]; |
| | | |
| | | if (this.createTimeList) { |
| | | this.queryParams.beginTime = this.createTimeList[0]; |
| | | this.queryParams.endTime = this.createTimeList[1]; |
| | | } else if (this.createTimeList == null) { |
| | | this.queryParams.beginTime = null; |
| | | this.queryParams.endTime = null; |
| | | } |
| | | getList(this.queryParams).then((response) => { |
| | | this.loading1 = false; |
| | | if (response.data) { |
| | | if (!response.data.list || response.data.list.length === 0) { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading1 = false; |
| | | this.loading = false; |
| | | return; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | // console.log(this.samplingList, 888); |
| | | // 判断是否需要刷新右边表格 |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | // this.fetchData(this.samplingList[0].tjNumber); |
| | | }); |
| | | } |
| | | this.total = response.data.total; |
| | | this.loading1 = false; |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading1 = false; |
| | | } |
| | | }); |
| | | |
| | | /* getList(this.queryParams).then((response) => { |
| | | if (response.data) { |
| | | if (response.data.list == null) { |
| | | this.samplingList = []; |
| | |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | console.log(this.samplingList,888); |
| | | |
| | | this.loading = false; |
| | | if (this.samplingList.length != 0) { |
| | | this.$nextTick(() => { |
| | |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | }); */ |
| | | }, |
| | | |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | |
| | | this.form = { |
| | | id: null, |
| | | samplingNumber: null, |
| | | cusId: null, |
| | | tjNumber: null, |
| | | applicationTime: null, |
| | | isSignFor: null, |
| | | tjTime: null, |
| | |
| | | updateTime: null, |
| | | deleted: null, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | hb() { |
| | | console.log(this.queryParams.tjNum); |
| | | if (this.queryParams.tjNum != null) { |
| | | if (this.queryParams.tjNumber != null) { |
| | | this.handleQuery(); |
| | | } |
| | | }, |
| | |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.createTimeList=[] |
| | | this.resetForm("queryForm"); |
| | | this.createTimeList = []; |
| | | this.handleQuery(); |
| | | }, |
| | | // 单选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | /* handleSelectionChange(selection) { |
| | | this.selectList = selection; |
| | | selection.forEach((element) => { |
| | | this.tableList = element.list; |
| | | console.log(this.tableList, 111); |
| | | |
| | | if (this.tableList.length != 0) { |
| | | this.$nextTick(() => { |
| | | this.$refs.tab1.toggleAllSelection(this.tableList, true); |
| | |
| | | } |
| | | this.single = selection.length !== 1; |
| | | this.multiple = !selection.length; |
| | | }, */ |
| | | |
| | | handleSelectionChange(selection) { |
| | | // 清空右侧表格的数据 |
| | | this.tableList = []; |
| | | |
| | | // 只有一个人被选中时进行操作 |
| | | if (selection.length === 1) { |
| | | const selectedPerson = selection[0]; // 获取选中的那个人 |
| | | const tjNumber = selectedPerson.tjNumber; |
| | | console.log(selectedPerson.tjNumber, 6363); |
| | | |
| | | this.fetchData(tjNumber); |
| | | } else { |
| | | // 如果选中多人,则取消选中 |
| | | if (selection.length > 1) { |
| | | let del_row = selection.shift(); |
| | | this.$refs.tb.toggleRowSelection(del_row, false); // 设置这一行取消选中 |
| | | } |
| | | } |
| | | |
| | | // 更新选择状态 |
| | | this.single = selection.length === 1; |
| | | this.multiple = selection.length === 0; |
| | | |
| | | this.selectedRows = selection; |
| | | }, |
| | | |
| | | fetchData(tjNumber) { |
| | | this.loading = true; // 显示加载状态 |
| | | |
| | | getCusCyList(tjNumber, this.tjStatus) // 调用API获取数据 |
| | | .then((response) => { |
| | | if (response.data) { |
| | | console.log(response, 2525); |
| | | |
| | | this.tableList = response.data; // 确认 list 存在后再进行赋值 |
| | | } else { |
| | | // 如果没有数据或 list 为空,清空表格并提示 |
| | | this.tableList = []; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.error("Error fetching data:", error); |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; // 隐藏加载状态 |
| | | }); |
| | | }, |
| | | |
| | | /* 点击合并按钮 */ |
| | | Merging() { |
| | | // 检查是否选中了数据 |
| | | if (this.selectedRows.length === 0) { |
| | | this.$message.error("至少选中一个人"); |
| | | return; |
| | | } |
| | | if (this.selectList.length === 0) { |
| | | this.$message.error("请选择要合并项目"); |
| | | return; |
| | | } |
| | | if (this.selectList.every((item) => item.isMerge === 0)) { |
| | | const baseSpecimenTypeCode = this.selectList[0].specimenTypeCode; |
| | | |
| | | // 检查 specimenTypeCode 是否一致 |
| | | const canMergeBySpecimenTypeCode = this.selectList.every( |
| | | (row) => row.specimenTypeCode === baseSpecimenTypeCode |
| | | ); |
| | | |
| | | // 根据 canMergeBySpecimenTypeCode 判断是否合并 |
| | | if (canMergeBySpecimenTypeCode) { |
| | | let data = this.ids; |
| | | |
| | | mergeCaiYang(data).then((response) => { |
| | | this.$message.success("合并成功。"); |
| | | // console.log("合并的行:", this.selectedRows); |
| | | // this.getList(); |
| | | this.fetchData(this.selectedRows[0].cusId); |
| | | }); |
| | | } else { |
| | | this.$message.error("标本类型不一致,无法合并!"); |
| | | } |
| | | } else { |
| | | this.$message.error("该项目已合并"); |
| | | } |
| | | }, |
| | | |
| | | /** 点击撤销按钮 **/ |
| | | Cancellation() { |
| | | let data = this.ids; |
| | | console.log("撤销"); |
| | | if (data.length === 0) { |
| | | // 如果没有已合并的项目,给出提示信息 |
| | | this.$message.error("没有已合并的项目可以撤销!"); |
| | | return; |
| | | } |
| | | |
| | | // console.log("撤销的已合并项目ID:", data); |
| | | |
| | | // 调用撤销采样的接口 |
| | | chexiaoCaiYang(data) |
| | | .then((res) => { |
| | | if (res && res.code === 200) { |
| | | this.$message.success("撤销成功!"); |
| | | // 刷新数据列表或进行其他操作 |
| | | // this.getList(); |
| | | this.fetchData(this.selectedRows[0].cusId); |
| | | } else { |
| | | this.$message.error(res.msg || "撤销失败,请重试!"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.$message.error("请求失败,请重试!"); |
| | | }); |
| | | }, |
| | | |
| | | /** 点击补打条码按钮 **/ |
| | | async Collection() { |
| | | // console.log("selectList:", this.selectList); |
| | | const jyxh = this.selectList.map((item) => item.jyxh); |
| | | console.log("jyxh:", jyxh); |
| | | try { |
| | | // 请求接口并获取宽度值 |
| | | const widthResponse = await getTxmkd(); |
| | | const barcodeWidth = `${Number(widthResponse.msg)}%` || "70%"; // 获取宽度值,默认使用 70% |
| | | |
| | | // const jyxh = this.selectList.map((item) => item.jyxh); |
| | | |
| | | // await this.$nextTick(); // 确保 DOM 更新 |
| | | |
| | | jyxh.forEach((number, index) => { |
| | | const barcodeContent = number; // 确保 jyxh 是有效的 |
| | | if (barcodeContent && barcodeContent !== "未提供体检号") { |
| | | JsBarcode(`#barcode${index}`, barcodeContent, { |
| | | format: "CODE128", |
| | | width: 2, |
| | | height: 50, |
| | | displayValue: false, |
| | | }); |
| | | } else { |
| | | console.log(`条形码内容无效: ${barcodeContent}`); // 调试输出 |
| | | } |
| | | }); |
| | | |
| | | // await this.$nextTick(); |
| | | |
| | | const barcodeElements = jyxh.map((_, index) => |
| | | document.querySelector(`#barcode${index}`) |
| | | ); |
| | | |
| | | if (barcodeElements) { |
| | | barcodeElements.forEach((element) => { |
| | | if (element) { |
| | | console.log(element.innerHTML); // 打印条形码的内容,看看是否生成成功 |
| | | } |
| | | }); |
| | | } else { |
| | | console.log("条形码元素未找到"); |
| | | } |
| | | |
| | | const newWindow = window.open("", "_blank", "width=800,height=600"); |
| | | const printContents = document.getElementById("printSection").innerHTML; |
| | | |
| | | // console.log(printContents); |
| | | newWindow.document.write(` |
| | | <html> |
| | | <head> |
| | | <title>Print Barcode</title> |
| | | <style> |
| | | @media print { |
| | | * { |
| | | margin: 0; |
| | | padding: 0; /* 重置所有元素的 margin 和 padding */ |
| | | box-sizing: border-box; /* 使内边距和边框包含在元素的总宽度和高度内 */ |
| | | } |
| | | .name, .name1, .last, .tj, .last div span, .last p, .tj span { |
| | | font-family: Arial, sans-serif !important; /* 重新指定字体 */ |
| | | font-weight: bold !important; /* 强制加粗 */ |
| | | } |
| | | body { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | .barcode-container { |
| | | // width: 100%; /* 根据需要调整 */ |
| | | // text-align: center; /* 确保条形码居中 */ |
| | | } |
| | | .name, .name1 { |
| | | padding: 0; |
| | | font-size: 18px; |
| | | width: 70%; |
| | | font-family: "Arial Black", sans-serif; /* 设置黑体 */ |
| | | } |
| | | p { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | svg { |
| | | display: block; |
| | | width: ${barcodeWidth}; /* 使用从接口获取的宽度 */ |
| | | margin-left: 10mm; |
| | | height: auto; |
| | | margin-bottom: 0; |
| | | } |
| | | .last { |
| | | width: 66%; |
| | | display: flex; |
| | | font-size: 19px; |
| | | justify-content: space-between; |
| | | // font-weight: bold; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .last div span { |
| | | // font-weight: bold; |
| | | margin-left: 10px; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .last p { |
| | | // font-weight: bold; |
| | | margin-left: 10px; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | p { |
| | | margin-left: 10px; |
| | | // font-weight: bold; |
| | | // font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .tj { |
| | | width: 70%; |
| | | display: flex; |
| | | font-size: 19px; |
| | | justify-content: space-between; |
| | | // font-weight: bold; |
| | | font-family: "Arial Black", sans-serif !important; |
| | | } |
| | | .tj span { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | </style> |
| | | </head> |
| | | <body>${printContents}</body> |
| | | </html> |
| | | `); |
| | | newWindow.document.close(); |
| | | newWindow.focus(); |
| | | newWindow.print(); |
| | | newWindow.close(); |
| | | } catch (error) { |
| | | console.error("获取宽度时出错:", error); // 捕获错误 |
| | | } |
| | | }, |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | | for (let i = 0; i < this.selectList.length; i++) { |
| | | if (row === this.selectList[i]) { |
| | |
| | | }, |
| | | |
| | | handleChange(selection) { |
| | | // console.log(selection); |
| | | |
| | | this.selectList = selection; |
| | | console.log(this.selectList, 5555); |
| | | |
| | | this.ids = selection.map((item) => item.id); |
| | | }, |
| | | |
| | |
| | | // 确认采样 |
| | | Confirmreceipt() { |
| | | let data = this.ids; |
| | | confirmSampling(data).then((res) => { |
| | | this.$modal.msgSuccess("采样成功"); |
| | | this.getList(); |
| | | console.log(this.ids, 999); |
| | | |
| | | const loadingInstance = this.$loading({ |
| | | lock: true, // 锁定屏幕 |
| | | text: "加载中...", // 加载文本 |
| | | spinner: "el-icon-loading", // 自定义加载图标 |
| | | background: "rgba(255, 255, 255, 0.7)", // 背景颜色 |
| | | }); |
| | | confirmSampling(this.ids) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | // this.$modal.msgSuccess("采样成功"); |
| | | |
| | | this.Collection(); |
| | | this.getList(); |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | // this.getList(); |
| | | }) |
| | | .catch((error) => { |
| | | this.$message.error("采样失败"); |
| | | }) |
| | | .finally(() => { |
| | | loadingInstance.close(); |
| | | }); |
| | | }, |
| | | |
| | | // 单选按钮 |
| | | radioChange(value) { |
| | | this.loading = true; |
| | | this.queryParams.isSignFor = value; |
| | | getList(this.queryParams).then((response) => { |
| | | if (response.data) { |
| | | if (response.data.list == null) { |
| | | |
| | | if (this.selectList.length > 0) { |
| | | alert("已选中后禁止切换"); |
| | | |
| | | } else { |
| | | console.log("切换"); |
| | | |
| | | 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; |
| | | } 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; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 } |
| | |
| | | } |
| | | |
| | | .el-table .warning-row { |
| | | background: #e5f3ff !important; |
| | | background-color: #e5f3ff !important; |
| | | /* font-weight: bold; */ |
| | | } |
| | | </style> |