chemicalAnalysisReport.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <template>
  2. <div class="examination secondApprove">
  3. <div class="common-head-search">
  4. <el-form :inline="true">
  5. <el-form-item label="样品类型">
  6. <el-select v-model="search.sampleTypeCode" clearable filterable collapse-tags size="small"
  7. style="width: 150px" placeholder="请选择">
  8. <el-option v-for="item in sampleTypeNameType" :key="item.baseCode" :label="item.baseName"
  9. :value="item.baseCode">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="样品名称">
  14. <el-input v-model="search.matName" size="small" placeholder="请输入样品名称" style="width: 150px"
  15. clearable></el-input>
  16. </el-form-item>
  17. <el-form-item label="中心编号">
  18. <el-input v-model="search.sampleNo" size="small" placeholder="请输入中心编号" style="width: 150px"
  19. clearable></el-input>
  20. </el-form-item>
  21. <el-form-item label="委托编号">
  22. <el-input v-model="search.carNo" size="small" placeholder="请输入委托编号" style="width: 150px" clearable></el-input>
  23. </el-form-item>
  24. <el-form-item label="委托日期">
  25. <el-date-picker v-model="search.stateTime[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  26. placeholder="开始日期" size="mini" style="width: 150px">
  27. </el-date-picker>
  28. <span>至</span>
  29. <el-date-picker v-model="search.stateTime[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  30. placeholder="结束日期" size="mini" style="width: 150px">
  31. </el-date-picker>
  32. <!-- <el-date-picker v-model="search.stateTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="daterange"
  33. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="mini" style="width: 200px">
  34. </el-date-picker> -->
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button icon="el-icon-search" type="goon" size="mini" :loading="dataLoading"
  38. @click="searchData">查询</el-button>
  39. <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
  40. </el-form-item>
  41. </el-form>
  42. </div>
  43. <el-row>
  44. <el-col :span="4">
  45. <div class="common-title-div">
  46. <div class="common-title-name">
  47. <img style="width: 25px; height: 25px" src="../../../assets/img/imgScreen/logo.png" />
  48. <span style="font-size: 15px">物料名称</span>
  49. </div>
  50. </div>
  51. <div class="common-table-div">
  52. <el-table ref="tableMain11" :height="singleTableHeight" v-loading="tableLoading" :data="table.list"
  53. highlight-current-row @row-click="handleCurrentChange" :summary-method="getSummaries"
  54. :header-cell-style="tableHeaderCellStyle" show-summary border style="width: 100%" :icorePanelShown="100"
  55. :icore-filter-flag="icoreFilterFlag">
  56. <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="MAT_NAME"
  57. label="物料名称"></el-table-column>
  58. </el-table>
  59. </div>
  60. </el-col>
  61. <el-col :span="20">
  62. <div class="common-title-div">
  63. <div class="common-title-name">
  64. <img style="width: 25px; height: 25px" src="../../../assets/img/imgScreen/logo.png" />
  65. 台账信息
  66. </div>
  67. <div class="common-button-div">
  68. <el-button icon="el-icon-download" type="goon" size="mini" :loading="tableExportLoading"
  69. @click="maintenance">维护上下限</el-button>
  70. <el-button icon="el-icon-download" type="goon" size="mini" :loading="tableExportLoading"
  71. @click="doExport">导出</el-button>
  72. </div>
  73. </div>
  74. <div class="common-table-div" id="topTable">
  75. <el-table ref="el_table_1" border :height="singleTableHeight" width="100%" highlight-current-row
  76. @selection-change="searchFollow" :data="table.list1">
  77. <el-table-column type="selection" width="55" align="center"></el-table-column>
  78. <el-table-column sortable show-overflow-tooltip align="center" width="160" prop="CAR_NO"
  79. label="委托编号"></el-table-column>
  80. <el-table-column sortable show-overflow-tooltip align="center" width="120" prop="SAMPLE_NO"
  81. label="中心编号"></el-table-column>
  82. <el-table-column sortable show-overflow-tooltip align="center" width="120" prop="MAT_NAME"
  83. label="物料名称"></el-table-column>
  84. <el-table-column sortable show-overflow-tooltip align="center" width="120" prop="MEMO"
  85. label="委托备注"></el-table-column>
  86. <el-table-column v-for="col in cols" :prop="col.ANLY_ITEM_NO" show-overflow-tooltip align="center"
  87. :key="col.ANLY_ITEM_NO" :label="col.ANLY_ITEM_NAME">
  88. <template slot-scope="scope">
  89. <span :style="redStyle(scope.row.SA_ID, col.ANLY_ITEM_NO)">{{
  90. scope.row[col.ANLY_ITEM_NO]
  91. }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column sortable show-overflow-tooltip align="center" width="120" prop="UPDATE_TIME"
  95. label="开始时间"></el-table-column>
  96. <el-table-column sortable show-overflow-tooltip align="center" width="120" prop="CREATE_TIME"
  97. label="结束时间"></el-table-column>
  98. </el-table>
  99. </div>
  100. <div class="common-foot-style">
  101. <el-pagination @size-change="pageSizeChange" @current-change="pageCurrentChange" :current-page="page.pageNum"
  102. :page-sizes="[50, 100, 200, 500, 1000]" :page-size="page.pageSize"
  103. layout="total, sizes, prev, pager, next, jumper" :total="page.totalPage" background>
  104. </el-pagination>
  105. </div>
  106. </el-col>
  107. </el-row>
  108. <el-dialog :close-on-click-modal="false" @close="closebatch" width="100%" :visible.sync="recallShow" top="0">
  109. <div slot="title" class="titleBox">
  110. <i class="el-icon-document" style="font-size: 20px"></i>
  111. <span style="margin-left: 10px; font-size: 18px">维护信息</span>
  112. </div>
  113. <div class="common-table-div">
  114. <el-table border ref="dataTable123" :data="recallList" :height="theight2" @selection-change="recallSelection"
  115. highlight-current-row>
  116. <el-table-column type="selection" width="45" align="center"></el-table-column>
  117. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="ANLY_ITEM_NAME"
  118. label="检测项目"></el-table-column>
  119. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="MIN_SIGN" label="下限符号">
  120. <template slot-scope="scope">
  121. <input v-model="scope.row.MIN_SIGN" size="small" @keydown="keyDown($event, scope.row, scope.$index)"
  122. :id="scope.column.id + '--' + scope.$index" @change="inputDataPl($event, scope.$index)" style="
  123. width: 100%;
  124. height: 28px;
  125. line-height: 28px;
  126. border: 0px;
  127. padding-left: 3px;
  128. text-align: center;
  129. font-size: 15px;
  130. " />
  131. </template>
  132. </el-table-column>
  133. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="MIN_VALUE" label="下限值">
  134. <template slot-scope="scope">
  135. <input v-model="scope.row.MIN_VALUE" size="small" @keydown="keyDown($event, scope.row, scope.$index)"
  136. :id="scope.column.id + '--' + scope.$index" @change="inputDataPl($event, scope.$index)"
  137. oninput="value=value.replace(/[^0-9\[.\]{1}-]/g,'')" style="
  138. width: 100%;
  139. height: 28px;
  140. line-height: 28px;
  141. border: 0px;
  142. padding-left: 3px;
  143. text-align: center;
  144. font-size: 15px;
  145. " />
  146. </template>
  147. </el-table-column>
  148. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="MAX_SIGN" label="上限符号">
  149. <template slot-scope="scope">
  150. <input v-model="scope.row.MAX_SIGN" size="small" @keydown="keyDown($event, scope.row, scope.$index)"
  151. :id="scope.column.id + '--' + scope.$index" @change="inputDataPl($event, scope.$index)" style="
  152. width: 100%;
  153. height: 28px;
  154. line-height: 28px;
  155. border: 0px;
  156. padding-left: 3px;
  157. text-align: center;
  158. font-size: 15px;
  159. " />
  160. </template>
  161. </el-table-column>
  162. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="MAX_VALUE" label="上限值">
  163. <template slot-scope="scope">
  164. <input v-model="scope.row.MAX_VALUE" size="small" @keydown="keyDown($event, scope.row, scope.$index)"
  165. :id="scope.column.id + '--' + scope.$index" @change="inputDataPl($event, scope.$index)"
  166. oninput="value=value.replace(/[^0-9\[.\]{1}-]/g,'')" style="
  167. width: 100%;
  168. height: 28px;
  169. line-height: 28px;
  170. border: 0px;
  171. padding-left: 3px;
  172. text-align: center;
  173. font-size: 15px;
  174. " />
  175. </template>
  176. </el-table-column>
  177. </el-table>
  178. </div>
  179. <span slot="footer" class="dialog-footer">
  180. <el-button type="goon" size="mini" icon="el-icon-check" :loading="batchLoading"
  181. @click="determineList()">确认</el-button>
  182. <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="closebatch">取消</el-button>
  183. </span>
  184. </el-dialog>
  185. </div>
  186. </template>
  187. <script>
  188. import { getCookie, formatDate } from "@/utils/util.js";
  189. import { cookieUserId, cookieUserName } from "@/config/config.js";
  190. import { exportToExcel } from "../../../utils/utils.js";
  191. let userName = getCookie(cookieUserName);
  192. let userId = getCookie(cookieUserId);
  193. export default {
  194. data() {
  195. return {
  196. search: {
  197. sampleTypeCode: "",
  198. sampleNo: "",
  199. carNo: "",
  200. matName: "",
  201. stateTime: [],
  202. },
  203. dataLoading: false,
  204. dataLoading1: false,
  205. sampleTypeNameType: [], //样品类型
  206. saveMainData: [], //勾选数据
  207. tableList: {},
  208. table: {
  209. list: [],
  210. list1: [],
  211. },
  212. page: {
  213. pageNum: 1,
  214. pageSize: 100,
  215. totalPage: 0,
  216. },
  217. cols: ["无"],
  218. redDataCk: [], //显红的数据
  219. singleTableHeight: 600,
  220. icoreFilterFlag: true,
  221. tableLoading: false,
  222. tableExportLoading: false,
  223. batchLoading: false,
  224. recallShow: false,
  225. recallList: [],
  226. theight2: 0,
  227. recallSelectionList: [],
  228. clickMap: {}
  229. };
  230. },
  231. created() {
  232. this.singleTableHeight = window.innerHeight - 190;
  233. this.theight2 = window.innerHeight - 180;
  234. let aaa = new Date();
  235. let bbb = new Date().getTime() - 60000 * 60 * 24 * 7;
  236. aaa.setTime(bbb);
  237. this.search.stateTime = [this.getYNM(aaa), this.getYNM(new Date())];
  238. },
  239. mounted() {
  240. this.axios
  241. .post(
  242. "pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",
  243. { validFlag: 1, baseCode: 4801 },
  244. { individualType: "json" }
  245. )
  246. .then((res) => {
  247. this.sampleTypeNameType = res.data;
  248. });
  249. },
  250. methods: {
  251. getYNM(date) {
  252. let year = date.getFullYear().toString();
  253. let month = date.getMonth() + 1;
  254. let day = date.getDate();
  255. month = month < 10 ? "0" + month : month;
  256. day = day < 10 ? "0" + day : day;
  257. return `${year}-${month}-${day}`;
  258. },
  259. mainData() {
  260. this.page.pageNum = 1;
  261. this.page.pageSize = 100;
  262. this.searchData();
  263. },
  264. searchFollow(val) {
  265. this.saveMainData = val;
  266. },
  267. searchData1() {
  268. let startTime = "";
  269. let endTime = "";
  270. if (!this.search.stateTime) {
  271. } else {
  272. startTime = this.search.stateTime[0];
  273. endTime = this.search.stateTime[1];
  274. }
  275. let obj = {
  276. matName: this.search.matName,
  277. sampleTypeCode: this.search.sampleTypeCode,
  278. sampleNo: this.search.sampleNo,
  279. carNo: this.search.carNo,
  280. stateFlag: 1,
  281. validFlag: 1,
  282. startTime: startTime,
  283. endTime: endTime,
  284. };
  285. if (this.tableList.MAT_NO != null) {
  286. this.searchData()
  287. } else {
  288. this.dataLoading = true;
  289. this.axios
  290. .post(
  291. "pass/baseManagement/v1/limssamplereleases/queryParameterMatName",
  292. obj,
  293. { individualType: "json" }
  294. )
  295. .then((res) => {
  296. if (res.code == 0 || res.code == 200) {
  297. this.table.list = res.data;
  298. } else {
  299. this.$message.error(res.message);
  300. }
  301. this.dataLoading = false;
  302. })
  303. .catch((err) => {
  304. this.dataLoading = false;
  305. this.$message.error(err.message);
  306. });
  307. }
  308. },
  309. searchData() {
  310. let startTime = "";
  311. let endTime = "";
  312. if (!this.search.stateTime) {
  313. } else {
  314. startTime = this.search.stateTime[0];
  315. endTime = this.search.stateTime[1];
  316. }
  317. let obj = {
  318. sampleTypeCode: this.search.sampleTypeCode,
  319. sampleNo: this.search.sampleNo,
  320. carNo: this.search.carNo,
  321. pageIndex: this.page.pageNum,
  322. pageSize: this.page.pageSize,
  323. stateFlag: 1,
  324. validFlag: 1,
  325. startTime: startTime,
  326. endTime: endTime,
  327. matName: this.clickMap.MAT_NAME || this.search.matName,
  328. matNo: this.clickMap.MAT_NO,
  329. };
  330. this.dataLoading = true;
  331. this.axios
  332. .post("pass/baseManagement/v1/limssamplereleases/queryParameter", obj, {
  333. individualType: "json",
  334. })
  335. .then((res) => {
  336. if (res.code == 0 || res.code == 200) {
  337. if (res.data.head[0] != null) {
  338. this.cols = res.data.head;
  339. } else {
  340. this.cols = [];
  341. }
  342. this.table.list1 = res.data.badyData.list;
  343. if (this.table.list1 != null && this.table.list1.length > 0) {
  344. if (Object.keys(this.clickMap).length === 0) {
  345. this.table.list = res.data.badyData.list[0].sampleResults
  346. }
  347. } else {
  348. if (Object.keys(this.clickMap).length === 0) {
  349. this.table.list = []
  350. }
  351. }
  352. this.page.totalPage = res.data.badyData.total;
  353. this.redDataCk = res.data.redMap || {};
  354. this.clickMap = {}
  355. } else {
  356. this.$message.error(res.message);
  357. }
  358. this.dataLoading = false;
  359. })
  360. .catch((err) => {
  361. this.dataLoading = false;
  362. this.$message.error(err.message);
  363. });
  364. },
  365. closebatch() {
  366. this.recallShow = false;
  367. this.recallList = [];
  368. },
  369. recallSelection(val) {
  370. this.recallSelectionList = val;
  371. },
  372. determineList() {
  373. if (this.recallSelectionList.length < 1) {
  374. this.$message.warning("请勾选要确定的数据!");
  375. return;
  376. }
  377. let arr = [];
  378. this.saveMainData.forEach((s) => {
  379. arr.push(s.SA_ID);
  380. });
  381. let obj = {
  382. list: arr,
  383. map: this.recallSelectionList,
  384. };
  385. this.batchLoading = true;
  386. this.axios
  387. .post(
  388. "pass/baseManagement/v1/limssamplereleaseds/updateLimsSampleReleaseD",
  389. obj,
  390. { individualType: "json" }
  391. )
  392. .then((res) => {
  393. if (res.code == 0 || res.code == 200) {
  394. this.closebatch();
  395. this.$message.success("维护成功!");
  396. this.searchData();
  397. } else {
  398. this.$message.error(res.message);
  399. }
  400. this.batchLoading = false;
  401. })
  402. .catch((err) => {
  403. this.batchLoading = false;
  404. this.$message.error(err.message);
  405. });
  406. },
  407. maintenance() {
  408. if (this.saveMainData.length < 1) {
  409. this.$message.warning("请先选择一个需要维护的数据!");
  410. return;
  411. }
  412. let arr = [];
  413. this.saveMainData.forEach((s) => {
  414. arr.push(s.SA_ID);
  415. });
  416. this.tableExportLoading = true;
  417. this.axios
  418. .post(
  419. "pass/baseManagement/v1/limssamplereleaseds/maintenanceList",
  420. arr,
  421. { individualType: "json" }
  422. )
  423. .then((res) => {
  424. if (res.code == 0 || res.code == 200) {
  425. this.recallList = res.data;
  426. this.recallShow = true;
  427. } else {
  428. this.$message.error(res.message);
  429. }
  430. this.tableExportLoading = false;
  431. })
  432. .catch((err) => {
  433. this.tableExportLoading = false;
  434. this.$message.error(err.message);
  435. });
  436. },
  437. // 导出
  438. doExport() {
  439. // if (this.table.list1.length === 0) {
  440. // this.$message.warning("表格无数据不能导出");
  441. // return true;
  442. // }
  443. if (this.saveMainData.length < 1) {
  444. this.$message.warning("表格无数据不能导出");
  445. return;
  446. }
  447. this.tableExportLoading = true;
  448. let tHeader = [];
  449. let filterVal = [];
  450. tHeader = [
  451. "委托编号",
  452. "中心编号",
  453. "物料名称",
  454. "委托备注",
  455. "开始时间",
  456. "结束时间",
  457. ];
  458. filterVal = [
  459. "CAR_NO",
  460. "SAMPLE_NO",
  461. "MAT_NAME",
  462. "MEMO",
  463. "UPDATE_TIME",
  464. "CREATE_TIME",
  465. ];
  466. this.cols.forEach((s) => {
  467. tHeader.push(s.ANLY_ITEM_NAME);
  468. filterVal.push(s.ANLY_ITEM_NO);
  469. });
  470. exportToExcel(
  471. this.saveMainData,
  472. tHeader,
  473. filterVal,
  474. "台账信息",
  475. [],
  476. [],
  477. []
  478. );
  479. // setTimeout(() => {
  480. // setTimeout(() => {
  481. // setTimeout(() => {
  482. this.tableExportLoading = false;
  483. // this.doExport2();
  484. // }, 0);
  485. // }, 0);
  486. // }, 0);
  487. },
  488. doExport2() {
  489. this.$nextTick(() => {
  490. let table = document.querySelector("#topTable .el-table");
  491. let header = document.querySelector(
  492. "#topTable .el-table .el-table__header"
  493. );
  494. let body = document.querySelector(
  495. "#topTable .el-table .el-table__body"
  496. );
  497. let oTd = document.querySelectorAll("#topTable .el-table td");
  498. let oTh = document.querySelectorAll("#topTable .el-table th");
  499. header.border = "1";
  500. body.border = "1";
  501. for (let item of Array.from(oTd)) {
  502. item.style.height = "27px";
  503. }
  504. for (let item of Array.from(oTh)) {
  505. item.style.height = "27px";
  506. }
  507. let ex =
  508. '<th class="gutter" align= "left" style="width: 10px; height: 27px;"></th>';
  509. let ex2 =
  510. '<th class="gutter" align= "left" style="width: 0px; height: 27px;"></th>';
  511. ex = new RegExp(ex, "g").test(table.outerHTML) ? ex : ex2;
  512. let bd = table.outerHTML.replace(new RegExp(ex, "g"), "");
  513. bd = bd.replace("正在整理数据", "");
  514. let html =
  515. '<html><head><meta charset="utf-8" /></head><body>' +
  516. bd +
  517. "</body></html>";
  518. let blob = new Blob([html], { type: "application/vnd.ms-excel" });
  519. let link = document.createElement("a");
  520. link.download = "台账信息.xls";
  521. link.href = URL.createObjectURL(blob);
  522. link.click();
  523. header.border = "0";
  524. body.border = "0";
  525. for (let item of Array.from(oTd)) {
  526. item.style.height = "";
  527. }
  528. for (let item of Array.from(oTh)) {
  529. item.style.height = "";
  530. }
  531. });
  532. },
  533. handleCurrentChange(row) {
  534. this.clickMap = JSON.parse(JSON.stringify(row))
  535. this.searchData();
  536. },
  537. tableHeaderCellStyle() {
  538. return "color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;";
  539. },
  540. pageSizeChange(size) {
  541. this.page.pageSize = size;
  542. this.searchData();
  543. },
  544. pageCurrentChange(index) {
  545. this.page.pageNum = index;
  546. this.searchData();
  547. },
  548. reset() {
  549. this.search = {};
  550. let aaa = new Date();
  551. let bbb = new Date().getTime() - 60000 * 60 * 24 * 7;
  552. aaa.setTime(bbb);
  553. this.search.stateTime = [this.getYNM(aaa), this.getYNM(new Date())];
  554. this.tableList = {}
  555. this.table.list = []
  556. this.table.list1 = []
  557. this.searchData();
  558. },
  559. getSummaries(param) {
  560. const { columns, data } = param;
  561. const sums = [];
  562. columns.forEach((column, index) => {
  563. if (index === 0) {
  564. sums[index] = "合计:" + data.length;
  565. }
  566. });
  567. return sums;
  568. },
  569. handleInput(val, index, prop) {
  570. let regex = /^>=?$/;
  571. let newValue = val;
  572. if (regex.test(newValue)) {
  573. this.recallList[index][prop] = newValue;
  574. } else {
  575. this.recallList[index][prop] = "";
  576. }
  577. },
  578. inputDataPl(val, index) {
  579. this.$refs.dataTable123.toggleRowSelection(this.recallList[index], true);
  580. },
  581. keyDown(event, row, rindex) {
  582. let tdTarget = event.target;
  583. let pid = tdTarget.id;
  584. if (!pid) {
  585. return true;
  586. }
  587. let ids = pid.split("--");
  588. if (ids.length != 2) {
  589. return true;
  590. }
  591. let columnId = ids[0];
  592. let index = ids[1];
  593. let that = this;
  594. while (tdTarget.tagName !== "TD") {
  595. tdTarget = tdTarget.parentElement;
  596. }
  597. // if (event.keyCode === 13) {
  598. // this.jisuanRow(row, rindex)
  599. // }
  600. // 如果按下键盘下键或者回车键
  601. if (event.keyCode === 40 || event.keyCode === 13) {
  602. let ind = Number(index) + 1;
  603. let id = "#" + columnId + "--" + ind;
  604. let input = $(id);
  605. if (input) {
  606. // this.$refs.tablePllr.setCurrentRow(this.tableData[ind])
  607. input.focus();
  608. input.select(); // 选中内容
  609. event.stopPropagation();
  610. event.stopImmediatePropagation();
  611. event.preventDefault();
  612. return false;
  613. }
  614. } else if (event.keyCode === 38) {
  615. // 键盘上键
  616. let ind = Number(index) - 1;
  617. let id = "#" + columnId + "--" + ind;
  618. let input = $(id);
  619. if (input) {
  620. // this.$refs.tablePllr.setCurrentRow(this.tableData[ind])
  621. input.focus();
  622. input.select(); // 选中内容
  623. event.stopPropagation();
  624. event.stopImmediatePropagation();
  625. event.preventDefault();
  626. return false;
  627. }
  628. } else if (event.keyCode === 37) {
  629. // 键盘左键
  630. let input =
  631. $(tdTarget).prev().find("input") &&
  632. $(tdTarget).prev().find("input")[0];
  633. if (input) {
  634. input.focus();
  635. input.select(); // 选中内容
  636. event.stopPropagation();
  637. event.stopImmediatePropagation();
  638. event.preventDefault();
  639. return false;
  640. }
  641. } else if (event.keyCode === 39) {
  642. // 键盘右键
  643. let input = $(tdTarget).next().find("input")[0];
  644. if (input) {
  645. input.focus();
  646. input.select(); // 选中内容
  647. event.stopPropagation();
  648. event.stopImmediatePropagation();
  649. event.preventDefault();
  650. return false;
  651. }
  652. }
  653. },
  654. redStyle(stId, anlyNo) {
  655. let arr = this.redDataCk[stId];
  656. if (!arr || arr.length < 1) {
  657. return {};
  658. }
  659. let obj = arr.find((ii) => ii == anlyNo);
  660. if (obj) {
  661. return { color: "red" };
  662. } else {
  663. return {};
  664. }
  665. },
  666. },
  667. };
  668. </script>
  669. <style scoped></style>