inspectionTaskFinished.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <!-- 检验任务(原料)页面 -->
  2. <template>
  3. <div class="examination">
  4. <div class="common-head-search">
  5. <el-form :inline='true'>
  6. <el-form-item label="物料名称">
  7. <el-input v-model="search.matName" @keyup.enter.native="searchData()" size="small" placeholder="请输入物料名称"
  8. style="width: 200px"></el-input>
  9. </el-form-item>
  10. <el-form-item label="批次号">
  11. <el-input v-model="search.batchNo" @keyup.enter.native="searchData()" size="small" placeholder="请输入批次号"
  12. style="width: 200px"></el-input>
  13. </el-form-item>
  14. <el-form-item label="任务日期">
  15. <el-date-picker v-model="search.entrTime[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  16. placeholder="开始日期" size="mini" style="width: 140px">
  17. </el-date-picker>
  18. <span>至</span>
  19. <el-date-picker v-model="search.entrTime[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  20. placeholder="结束日期" size="mini" style="width: 140px">
  21. </el-date-picker>
  22. <!-- <el-date-picker
  23. v-model="search.entrTime"
  24. type="daterange"
  25. range-separator="至"
  26. start-placeholder="开始日期"
  27. end-placeholder="结束日期"
  28. size="small"
  29. style="width:300px"
  30. format="yyyy-MM-dd"
  31. value-format="yyyy-MM-dd">
  32. </el-date-picker> -->
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
  36. <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
  37. </el-form-item>
  38. </el-form>
  39. </div>
  40. <el-row>
  41. <el-col>
  42. <div class="common-title-div">
  43. <div class="common-title-name">
  44. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  45. 检验任务信息
  46. </div>
  47. <div>
  48. <el-button icon="el-icon-check" type="goon" size="mini" :loading='copyLoading'
  49. v-privilege="activeMenu + 'copy'" @click="copyData">复制</el-button>
  50. <el-button icon="el-icon-circle-close" :loading="buttonLoading1" type="danger" size="mini"
  51. v-privilege="activeMenu + 'disable'" @click="deleteData">停用</el-button>
  52. <el-button icon="el-icon-check" :loading="buttonLoading2" type="goon" size="mini"
  53. v-privilege="activeMenu + 'effectivity'" @click="recoverData">启用</el-button>
  54. </div>
  55. </div>
  56. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  57. <el-table v-loading="tableLoading1" ref="dataTable" border :height="tableTop" highlight-current-row
  58. @selection-change="handleSelectionChange" @cell-click='searchFollow' :data="tableData1"
  59. :row-class-name="tableRowClassName" :icore-filter-flag="icoreFilterFlag"
  60. :header-cell-style="tableHeaderCellStyle" :summary-method="getSummaries2" show-summary>
  61. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  62. <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
  63. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stateFlagName" label="状态"
  64. align="center"></el-table-column>
  65. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlagName" label="数据状态"
  66. align="center"></el-table-column>
  67. <!-- <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="id" label="编号" align="center"></el-table-column> -->
  68. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="taskDate" label="任务日期"
  69. align="center"></el-table-column>
  70. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="matName" label="物料"
  71. align="center"></el-table-column>
  72. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="batchNo" label="批次号" align="center"></el-table-column> -->
  73. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="gradeName" label="牌号"
  74. align="center"></el-table-column>
  75. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="matShapeName" label="试样形状"
  76. align="center"></el-table-column>
  77. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="tmpName" label="样品模板" align="center"></el-table-column>
  78. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="testPlanName" label="测试计划" align="center"></el-table-column>
  79. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="taskName" label="方案号" align="center" style="color:blue;"></el-table-column>
  80. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="companyName" label="检验单位" align="center"></el-table-column>
  81. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="deptName" label="检验车间" align="center"></el-table-column> -->
  82. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="indexName" label="指标集" align="center" style="color:blue;"></el-table-column> -->
  83. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleTypeName" label="样品类型" align="center"></el-table-column> -->
  84. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="entrTypeName" label="委托类型"
  85. align="center"></el-table-column>
  86. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isCiqName" label="是否商检"
  87. align="center"></el-table-column>
  88. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isBatchName" label="是否匹配"
  89. align="center"></el-table-column>
  90. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
  91. align="center"></el-table-column>
  92. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人"
  93. align="center"></el-table-column>
  94. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  95. align="center"></el-table-column>
  96. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人"
  97. align="center"></el-table-column>
  98. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间"
  99. align="center"></el-table-column>
  100. </el-table>
  101. </div>
  102. <!-- 分页一 -->
  103. <div class="common-foot-style">
  104. <el-pagination @size-change="pageSizeChange" @current-change="pageCurrentChange" :current-page="pageIndex"
  105. :page-sizes="[10, 20, 50, 100, 200]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
  106. :total="total" background>
  107. </el-pagination>
  108. </div>
  109. </el-col>
  110. </el-row>
  111. <el-row>
  112. <el-col :span='12'>
  113. <div class="common-title-div">
  114. <div class="common-title-name">
  115. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  116. 测试项目信息
  117. </div>
  118. <div>
  119. <el-button icon="el-icon-circle-close" type="danger" :loading='buttonLoading3' size="mini"
  120. v-privilege="activeMenu + 'disableDep'" @click="deleteData2">停用</el-button>
  121. <el-button size="mini" type="goon" icon="el-icon-remove-outline" :loading='buttonLoading4'
  122. v-privilege="activeMenu + 'effectivityDep'" @click="recoverData2">启用</el-button>
  123. </div>
  124. </div>
  125. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  126. <el-table v-loading="tableLoading2" ref="dataTable2" border :height="tableBot" highlight-current-row
  127. @selection-change="handleSelectionChange2" :data="tableData2" @cell-click="clickTwoTable"
  128. :row-class-name="tableRowClassName2" :icore-filter-flag="icoreFilterFlag"
  129. :header-cell-style="tableHeaderCellStyle" :summary-method="getSummaries2" show-summary>
  130. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  131. <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
  132. <el-table-column :show-overflow-tooltip="true" sortable min-width="80px" prop="stateFlagName" label="状态"
  133. align="center"></el-table-column>
  134. <el-table-column :show-overflow-tooltip="true" sortable min-width="80px" prop="validFlagName" label="数据状态"
  135. align="center"></el-table-column>
  136. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="testItemName" label="任务名称"
  137. align="center"></el-table-column>
  138. <el-table-column :show-overflow-tooltip="true" sortable min-width="80px" prop="itemTypeName" label="任务类型"
  139. align="center"></el-table-column>
  140. <el-table-column :show-overflow-tooltip="true" sortable min-width="80px" prop="optName" label="领用人"
  141. align="center"></el-table-column>
  142. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="doOrder" label="执行顺序"
  143. align="center"></el-table-column>
  144. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="isAutoName" label="是否分配"
  145. align="center"></el-table-column>
  146. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="stdName" label="标准号"
  147. align="center"></el-table-column>
  148. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="pointName" label="地点名称"
  149. align="center"></el-table-column>
  150. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="testLimit" label="任务时限"
  151. align="center"></el-table-column>
  152. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="deptName" label="部门名称"
  153. align="center"></el-table-column>
  154. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="sectionName" label="班组名称"
  155. align="center"></el-table-column>
  156. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="testPostName" label="岗位"
  157. align="center"></el-table-column>
  158. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="eqpTypeName" label="设备"
  159. align="center"></el-table-column>
  160. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="memo" label="备注"
  161. align="center"></el-table-column>
  162. <el-table-column :show-overflow-tooltip="true" sortable min-width="95px" prop="createMan" label="创建人"
  163. align="center"></el-table-column>
  164. <el-table-column :show-overflow-tooltip="true" sortable min-width="160px" prop="createTime" label="创建时间"
  165. align="center"></el-table-column>
  166. <el-table-column :show-overflow-tooltip="true" sortable min-width="95px" prop="updateMan" label="修改人"
  167. align="center"></el-table-column>
  168. <el-table-column :show-overflow-tooltip="true" sortable min-width="160px" prop="updateTime" label="修改时间"
  169. align="center"></el-table-column>
  170. </el-table>
  171. </div>
  172. <!-- <div class="common-foot-style">
  173. <el-pagination
  174. @size-change="pageSizeChange2"
  175. @current-change="pageCurrentChange"
  176. :current-page="page2.pageNum"
  177. :page-sizes="[10, 20, 50, 100, 200]"
  178. :page-size="page2.pageSize"
  179. layout="total, sizes, prev, pager, next, jumper"
  180. :total="page2.totalPage" background>
  181. </el-pagination>
  182. </div> -->
  183. </el-col>
  184. <el-col :span='12'>
  185. <div class="common-title-div">
  186. <div class="common-title-name">
  187. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  188. 分析项目信息
  189. </div>
  190. </div>
  191. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  192. <el-table v-loading="tableLoading3" ref="dataTable3" border :height="tableBot" highlight-current-row
  193. :data="tableData3" :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
  194. :summary-method="getSummaries2" show-summary>
  195. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  196. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="testItemName" label="任务名称"
  197. align="center"></el-table-column>
  198. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="anlyItemName" label="分析项目"
  199. align="center"></el-table-column>
  200. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isRepost1" label="是否报出"
  201. align="center"></el-table-column>
  202. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isAlarm1" label="是否报警"
  203. align="center"></el-table-column>
  204. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
  205. align="center"></el-table-column>
  206. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人"
  207. align="center"></el-table-column>
  208. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  209. align="center"></el-table-column>
  210. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人"
  211. align="center"></el-table-column>
  212. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间"
  213. align="center"></el-table-column>
  214. </el-table>
  215. </div>
  216. <!-- <div class="common-foot-style">
  217. <el-pagination
  218. @size-change="pageSizeChange"
  219. @current-change="pageCurrentChange3"
  220. :current-page="page3.pageNum"
  221. :page-sizes="[10, 20, 50, 100, 200]"
  222. :page-size="page3.pageSize"
  223. layout="total, sizes, prev, pager, next, jumper"
  224. :total="page3.totalPage" background>
  225. </el-pagination>
  226. </div> -->
  227. </el-col>
  228. </el-row>
  229. <el-row>
  230. <el-col class="common-table-div" style="margin-bottom:0;margin-top:0">
  231. <el-steps :space="500" :active="1" style="margin-top: 20px">
  232. <el-step title="取样"></el-step>
  233. <el-step title="制样"></el-step>
  234. <el-step title="检验"></el-step>
  235. <el-step title="审核"></el-step>
  236. <el-step title="发布"></el-step>
  237. <el-step title="报告单"></el-step>
  238. </el-steps>
  239. </el-col>
  240. </el-row>
  241. </div>
  242. </template>
  243. <script>
  244. import { getCookie, formatDate, isStartEndDate, } from '@/utils/util.js';
  245. import {
  246. cookieUserId,
  247. cookieUserName
  248. } from '@/config/config.js';
  249. let userName = getCookie(cookieUserName);
  250. let userId = getCookie(cookieUserId);
  251. export default {
  252. data() {
  253. return {
  254. icoreFilterFlag: true,
  255. taskId: '',
  256. testItemNo: '',
  257. search: {
  258. batchNo: '',
  259. mode: '',
  260. entrTime: []
  261. },
  262. tableData1: [],
  263. tableData2: [],
  264. tableData3: [],
  265. tableLoading1: false,
  266. tableLoading2: false,
  267. tableLoading3: false,
  268. copyLoading: false,
  269. buttonLoading1: false,
  270. buttonLoading2: false,
  271. buttonLoading3: false,
  272. buttonLoading4: false,
  273. clickFlag: {},
  274. selectMain: [],
  275. selectDep: [],
  276. tableTop: 0,
  277. tableBot: 0,
  278. pageIndex: 1,
  279. pageSize: 100,
  280. total: 0,
  281. multipleSelection4: [],
  282. activeMenu: ''
  283. }
  284. },
  285. created() {
  286. this.tableTop = window.innerHeight / 2 - 140 < 249 ? 249 : window.innerHeight / 2 - 150;
  287. this.tableBot = window.innerHeight / 2 - 150 < 249 ? 249 : window.innerHeight / 2 - 150;
  288. this.search.entrTime = [this.getYNM(new Date(Date.now() - 6 * 24 * 60 * 60 * 1000)), this.getYNM(new Date())]
  289. this.activeMenu = window.top.localStorage.getItem('activeMenu')
  290. },
  291. mounted() {
  292. this.searchData()
  293. this.addScreen();
  294. this.addScreen2();
  295. this.addScreen3();
  296. },
  297. methods: {
  298. getYNM(date) {
  299. let year = date.getFullYear().toString();
  300. let month = date.getMonth() + 1;
  301. let day = date.getDate();
  302. month = month < 10 ? "0" + month : month;
  303. day = day < 10 ? "0" + day : day;
  304. return `${year}-${month}-${day}`;
  305. },
  306. getSummaries2(param) {
  307. const { columns, data } = param;
  308. const sums = [];
  309. columns.forEach((column, index) => {
  310. if (index === 0) {
  311. sums[index] = "总计";
  312. }
  313. if (index === 1) {
  314. sums[index] = data.length;
  315. } else if (column.property === "quantity") {
  316. let val = 0;
  317. for (let i in data) {
  318. val = this.floatComputed(
  319. data[i].quantity ? data[i].quantity : 0,
  320. val,
  321. "+"
  322. );
  323. }
  324. sums[index] = val;
  325. } else if (column.property === "factweight") {
  326. let val = 0;
  327. for (let i in data) {
  328. val = this.floatComputed(
  329. data[i].factweight ? data[i].factweight : 0,
  330. val,
  331. "+"
  332. );
  333. }
  334. sums[index] = val;
  335. }
  336. });
  337. return sums;
  338. },
  339. //复制
  340. copyData() {
  341. if (this.selectMain.length < 1) {
  342. this.$message.warning('请勾选您要复制的数据')
  343. return
  344. }
  345. this.copyLoading = true
  346. this.axios.post('pass/testManagement/v1/limstesttasks/copy', this.selectMain, { individualType: 'json' }).then(res => {
  347. if (res.code == 0 || res.code == 200) {
  348. this.$message.success(res.message);
  349. this.searchData()
  350. } else {
  351. this.$message.error(res.message)
  352. }
  353. this.copyLoading = false
  354. }).catch(err => {
  355. this.copyLoading = false
  356. this.$message.error(err.message)
  357. })
  358. },
  359. // 终止
  360. deleteData() {
  361. if (this.selectMain.length < 1) {
  362. this.$message.warning('请勾选您要停用的数据')
  363. return
  364. }
  365. let tempArr = []
  366. this.selectMain.map(item => {
  367. tempArr.push(item.id)
  368. })
  369. this.buttonLoading1 = true
  370. this.axios.post('pass/testManagement/v1/limstesttasks/invalid', tempArr, { individualType: 'json' }).then(res => {
  371. if (res.code == 0 || res.code == 200) {
  372. this.$message.success(res.message);
  373. this.searchData()
  374. } else {
  375. this.$message.error(res.message)
  376. }
  377. this.buttonLoading1 = false
  378. }).catch(err => {
  379. this.buttonLoading1 = false
  380. this.$message.error(err.message)
  381. })
  382. },
  383. // 恢复
  384. recoverData() {
  385. if (this.selectMain.length < 1) {
  386. this.$message.warning('请勾选您要启用的数据')
  387. return
  388. }
  389. let tempArr = []
  390. this.selectMain.map(item => {
  391. tempArr.push(item.id)
  392. })
  393. this.buttonLoading2 = true
  394. this.axios.post('pass/testManagement/v1/limstesttasks/valid', tempArr, { individualType: 'json' }).then(res => {
  395. if (res.code == 0 || res.code == 200) {
  396. this.$message.success(res.message);
  397. this.searchData()
  398. } else {
  399. this.$message.error(res.message)
  400. }
  401. this.buttonLoading2 = false
  402. }).catch(err => {
  403. this.buttonLoading2 = false
  404. this.$message.error(err.message)
  405. })
  406. },
  407. // 查询
  408. searchData() {
  409. this.selectMain = []
  410. this.pageIndex = 1
  411. this.pageSize = 100
  412. this.dataMain()
  413. },
  414. //查询检验任务信息
  415. dataMain() {
  416. this.tableData2 = []
  417. this.tableData3 = []
  418. let startTime = ''
  419. let endTime = ''
  420. if (!this.search.entrTime) {
  421. startTime = ''
  422. endTime = ''
  423. } else {
  424. startTime = this.search.entrTime[0] + ' 00:00:00'
  425. endTime = this.search.entrTime[1] + ' 23:59:59'
  426. }
  427. let tempobj = {
  428. 'object': {
  429. "batchNo": this.search.batchNo,
  430. "sampleTypeCode": "480103",
  431. "matName": this.search.matName
  432. },
  433. 'pageIndex': this.pageIndex,
  434. 'pageSize': this.pageSize,
  435. 'startTime': startTime,
  436. 'endTime': endTime
  437. }
  438. this.tableLoading1 = true
  439. this.axios.post('pass/testManagement/v1/limstesttasks/queryLimsTestTasks', tempobj, { individualType: 'json' }).then(res => {
  440. if (res.code == 0 || res.code == 200) {
  441. this.tableData1 = res.data.list;
  442. this.total = res.data.total;
  443. this.tableData1.forEach(item => {
  444. item.validFlagName = item.validFlag == 0 ? '无效' : item.validFlag == 1 ? '有效' : ''
  445. item.stateFlagName = item.stateFlag == 0 ? '编辑' : item.stateFlag == 1 ? '取样' : item.stateFlag == 2 ? '制样' : item.stateFlag == 3 ? '检验' : item.stateFlag == 4 ? '审核' : item.stateFlag == 5 ? '发布' : item.stateFlag == 6 ? '质保书' : ''
  446. item.isCiqName = item.isCiq == 0 ? '否' : item.isCiq == 1 ? '是' : ''
  447. item.isBatchName = item.isBatch == 0 ? '否' : item.isBatch == 1 ? '是' : ''
  448. })
  449. if (this.tableData1.length > 0) {
  450. this.$refs.dataTable.setCurrentRow(this.tableData1[0])
  451. this.searchFollow(this.tableData1[0])
  452. }
  453. } else {
  454. this.$message.error(res.message)
  455. }
  456. this.tableLoading1 = false
  457. }).catch(e => {
  458. this.tableLoading1 = false;
  459. this.$message.error(e.message)
  460. });
  461. },
  462. //点击检验任务信息表格数据,查询测试项目信息数据
  463. searchFollow(row) {
  464. this.clickFlag = row
  465. this.tableLoading2 = true
  466. this.axios.post('pass/testManagement/v1/limstesttaskds/queryLimsTestTaskDs?taskId=' + row.id, { individualType: 'json' }).then(res => {
  467. if (res.code == 0 || res.code == 200) {
  468. this.tableData2 = res.data
  469. this.tableData2.forEach(item => {
  470. item.validFlagName = item.validFlag == 0 ? '无效' : item.validFlag == 1 ? '有效' : ''
  471. item.isAutoName = item.isAuto == 0 ? '否' : item.isAuto == 1 ? '是' : ''
  472. item.stateFlagName = item.stateFlag == 0 ? '未执行' : item.stateFlag == 1 ? '已执行' : item.stateFlag == 2 ? '已领用' : item.stateFlag == 3 ? '已提交' : item.stateFlag == 4 ? '二审已审' : item.stateFlagName == 5 ? '三审已审' : ''
  473. })
  474. if (this.tableData2.length > 0) {
  475. this.$refs.dataTable2.setCurrentRow(this.tableData2[0])
  476. this.clickTwoTable(this.tableData2[0])
  477. }
  478. } else {
  479. this.$message.error(res.message)
  480. }
  481. this.tableLoading2 = false
  482. }).catch(err => {
  483. this.tableLoading2 = false
  484. this.$message.error(err.message)
  485. })
  486. },
  487. //点击测试项目信息表格,查询分析项目信息
  488. clickTwoTable(row) {
  489. this.tableLoading3 = false
  490. this.tableData3 = row.lsidList
  491. this.tableData3.forEach(item => {
  492. item.isReport1 = item.isReport == 0 ? '否' : item.isReport == 1 ? '是' : ''
  493. item.isAlarm1 = item.isAlarm == 0 ? '否' : item.isAlarm == 1 ? '是' : ''
  494. })
  495. },
  496. // 重置
  497. reset() {
  498. this.search.matName = '';
  499. this.search.entrTime = [this.getYNM(new Date(Date.now() - 6 * 24 * 60 * 60 * 1000)), this.getYNM(new Date())]
  500. this.searchData();
  501. },
  502. // 删除
  503. deleteData2() {
  504. if (this.selectDep.length < 1) {
  505. this.$message.warning('请勾选测试任务信息表中您要停用的数据')
  506. return
  507. }
  508. let tempArr = []
  509. this.selectDep.map(item => {
  510. tempArr.push(item.id)
  511. })
  512. this.buttonLoading3 = true
  513. this.axios.post('pass/testManagement/v1/limstesttaskds/invalid', tempArr, { individualType: 'json' }).then(res => {
  514. if (res.code == 0 || res.code == 200) {
  515. this.$message.success(res.message)
  516. this.searchFollow(this.clickFlag)
  517. } else {
  518. this.$message.error(res.message)
  519. }
  520. this.buttonLoading3 = false
  521. }).catch(err => {
  522. this.buttonLoading3 = false
  523. this.$message.error(err.message)
  524. })
  525. },
  526. // 取消
  527. recoverData2() {
  528. if (this.selectDep.length < 1) {
  529. this.$message.warning('请勾选测试任务信息表中您要启用的数据')
  530. return
  531. }
  532. let tempArr = []
  533. this.selectDep.map(item => {
  534. tempArr.push(item.id)
  535. })
  536. this.buttonLoading4 = true
  537. this.axios.post('pass/testManagement/v1/limstesttaskds/valid', tempArr, { individualType: 'json' }).then(res => {
  538. this.buttonLoading4 = false
  539. if (res.code == 0 || res.code == 200) {
  540. this.$message.success(res.message)
  541. this.searchFollow(this.clickFlag)
  542. } else {
  543. this.$message.error(res.message)
  544. }
  545. }).catch(err => {
  546. this.buttonLoading4 = false
  547. this.$message.error(err.message)
  548. })
  549. },
  550. pageSizeChange(size) {
  551. this.pageIndex = 1
  552. this.pageSize = size;
  553. this.dataMain();
  554. },
  555. pageCurrentChange(index) {
  556. this.pageIndex = index;
  557. this.dataMain();
  558. },
  559. //勾选主表数据
  560. handleSelectionChange(val) {
  561. this.selectMain = val;
  562. },
  563. handleSelectionChange2(val) {
  564. this.selectDep = val
  565. },
  566. addScreen() {
  567. this.$nextTick(() => {
  568. let ss = document.createElement('div');
  569. ss.innerHTML = '筛选';
  570. ss.style = 'text-align: center;'
  571. this.$refs.dataTable.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  572. });
  573. },
  574. addScreen2() {
  575. this.$nextTick(() => {
  576. let ss = document.createElement('div');
  577. ss.innerHTML = '筛选';
  578. ss.style = 'text-align: center;'
  579. this.$refs.dataTable2.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  580. });
  581. },
  582. addScreen3() {
  583. this.$nextTick(() => {
  584. let ss = document.createElement('div');
  585. ss.innerHTML = '筛选';
  586. ss.style = 'text-align: center;'
  587. this.$refs.dataTable3.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  588. });
  589. },
  590. tableRowClassName({ row, column, rowIndex, columnIndex }) {
  591. if (row.validFlag !== '1') {
  592. return 'error-row';
  593. }
  594. },
  595. tableRowClassName2({ row, column, rowIndex, columnIndex }) {
  596. if (row.validFlag !== '1') {
  597. return 'error-row';
  598. }
  599. return '';
  600. },
  601. // 表格上横线
  602. tableHeaderCellStyle() {
  603. return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
  604. }
  605. }
  606. }
  607. </script>
  608. <style scoped></style>