interimPlanManagement.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. <template>
  2. <div class="examination">
  3. <div class="common-head-search">
  4. <el-form :inline="true">
  5. <el-form-item label='计划单位'>
  6. <el-select v-model="search.companyNo" filterable clearable style="width:100%" collapse-tags size="small">
  7. <el-option v-for="item in companyNameType" :key="item.orgCode" :label="item.orgName" :value="item.orgCode">
  8. </el-option>
  9. </el-select>
  10. </el-form-item>
  11. <el-form-item label='计划日期'>
  12. <el-date-picker v-model="search.planDate[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  13. placeholder="开始日期" size="mini" style="width: 150px">
  14. </el-date-picker>
  15. <span>至</span>
  16. <el-date-picker v-model="search.planDate[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  17. placeholder="结束日期" size="mini" style="width: 150px">
  18. </el-date-picker>
  19. <!-- <el-date-picker
  20. v-model="search.planDate"
  21. type="daterange"
  22. range-separator="至"
  23. start-placeholder="开始日期"
  24. end-placeholder="结束日期"
  25. size="small"
  26. format="yyyy-MM-dd"
  27. value-format="yyyy-MM-dd">
  28. </el-date-picker> -->
  29. </el-form-item>
  30. <el-form-item>
  31. <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
  32. <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
  33. </el-form-item>
  34. </el-form>
  35. </div>
  36. <div class="common-title-div">
  37. <div class="common-title-name">
  38. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  39. 临时计划
  40. </div>
  41. <div>
  42. <el-button icon="el-icon-circle-plus-outline" type="goon" v-privilege="activeMenu + 'ADD'" size="mini"
  43. @click="addData">新增</el-button>
  44. <el-button icon="el-icon-edit" type="goon" size="mini" v-privilege="activeMenu + 'PUT'"
  45. @click="modifyData">修改</el-button>
  46. <el-button icon="el-icon-remove-outline" type="danger" v-privilege="activeMenu + 'disable'" size="mini"
  47. @click="deleteData">停用</el-button>
  48. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'effectivity'"
  49. @click="recoverData">启用</el-button>
  50. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'submit'"
  51. @click="submitData">提交</el-button>
  52. <el-button icon="el-icon-back" type="danger" size="mini" :loading='returnSubLoading'
  53. v-privilege="activeMenu + 'submit'" @click="returnSubmit">取消提交</el-button>
  54. <el-button icon="el-icon-audit" type="goon" size="mini" :loading='subLoading1'
  55. v-privilege="activeMenu + 'shenhe'" @click="checkData">审核</el-button>
  56. <el-button icon="el-icon-noaudit" type="danger" size="mini" :loading='returnSubLoading1'
  57. v-privilege="activeMenu + 'shenhe'" @click="uncheckData">取消审核</el-button>
  58. </div>
  59. </div>
  60. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  61. <el-table id="excelTable" v-loading="dataLoading" ref="dataTable" border :height="height_top"
  62. highlight-current-row @selection-change="handleSelectionChange" :data="table.list"
  63. :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle" @cell-click='searchFollow'
  64. :cell-class-name="tableCellClassName" :row-class-name="tableRowClassName" :summary-method="getSummaries"
  65. show-summary>
  66. <el-table-column type="index" label="NO" align="center"></el-table-column>
  67. <el-table-column type="selection" width="55" align="center"></el-table-column>
  68. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="validFlag1" label="数据状态"
  69. align="center"></el-table-column>
  70. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="stateFlag1" label="状态"
  71. align="center"></el-table-column>
  72. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="id" label="编号"
  73. align="center"></el-table-column>
  74. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="planDate1" label="计划日期"
  75. align="center"></el-table-column>
  76. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="entrTypeName" label="委托类型"
  77. align="center"></el-table-column>
  78. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="planCompanyName" label="计划单位"
  79. align="center"></el-table-column>
  80. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="planDeptName" label="计划车间"
  81. align="center"></el-table-column>
  82. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="planName" label="计划名称"
  83. align="center"></el-table-column>
  84. <!-- <el-table-column sortable width="140px" prop="deptName" label="计划车间" align="center"></el-table-column> -->
  85. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="sampleTypeName" label="样品类型"
  86. align="center"></el-table-column>
  87. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="matName" label="物料名称"
  88. align="center"></el-table-column>
  89. <!-- <el-table-column sortable width="140px" prop="planDate1" label="计划日期" align="center"></el-table-column> -->
  90. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="companyName" label="检验单位"
  91. align="center"></el-table-column>
  92. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="deptName" label="检验车间"
  93. align="center"></el-table-column>
  94. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="sectionName" label="检验班组"
  95. align="center"></el-table-column>
  96. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="smpCompanyName" label="取样单位"
  97. align="center"></el-table-column>
  98. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="smpDeptName" label="取样车间"
  99. align="center"></el-table-column>
  100. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="smpSectionName" label="取样班组"
  101. align="center"></el-table-column>
  102. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="smpDeliName" label="送样频次"
  103. align="center"></el-table-column>
  104. <el-table-column :show-overflow-tooltip="true" sortable min-width="200px" prop="pointName" label="取样地点"
  105. align="center"></el-table-column>
  106. <el-table-column :show-overflow-tooltip="true" sortable min-width="200px" prop="planName" label="计划名称"
  107. align="center"></el-table-column>
  108. <el-table-column :show-overflow-tooltip="true" sortable min-width="200px" prop="planDesc" label="计划说明"
  109. align="center"></el-table-column>
  110. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="testLimit" label="测试时限(小时)"
  111. align="center"></el-table-column>
  112. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="isSmp1" label="是否取样"
  113. align="center"></el-table-column>
  114. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="isBatch1" label="是否组批"
  115. align="center"></el-table-column>
  116. <!-- <el-table-column sortable width="100px" prop="testTime1" label="测试起始时间" align="center"></el-table-column>
  117. <el-table-column sortable width="130px" prop="durTime" label="间隔时间(小时)" align="center"></el-table-column> -->
  118. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="planCompanyName" label="委托单位"
  119. align="center"></el-table-column>
  120. <el-table-column :show-overflow-tooltip="true" sortable min-width="120px" prop="testTypeName" label="检验类型"
  121. align="center"></el-table-column>
  122. <!-- <el-table-column sortable width="90px" prop="validFlag1" label="状态" align="center"></el-table-column> -->
  123. <!-- <template slot-scope="scope">
  124. <span v-if="scope.row.validFlag == 1">已启用</span>
  125. <span v-else-if="scope.row.validFlag == 0">已停用</span>
  126. </template> -->
  127. <el-table-column :show-overflow-tooltip="true" sortable min-width="200px" prop="memo" label="备注"
  128. align="center"></el-table-column>
  129. <el-table-column :show-overflow-tooltip="true" sortable min-width="95px" prop="createMan" label="创建人"
  130. align="center"></el-table-column>
  131. <el-table-column :show-overflow-tooltip="true" sortable min-width="160px" prop="createTime" label="创建时间"
  132. align="center"></el-table-column>
  133. </el-table>
  134. </div>
  135. <div class="common-foot-style">
  136. <el-pagination @size-change="pageSizeChange" @current-change="pageCurrentChange" :current-page="page.pageNum"
  137. :page-sizes="[100, 200, 500, 800, 1000]" :page-size="page.pageSize"
  138. layout="total, sizes, prev, pager, next, jumper" :total="page.totalPage" background>
  139. </el-pagination>
  140. </div>
  141. <div class="common-title-div">
  142. <div class="common-title-name">
  143. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  144. 分析项目
  145. </div>
  146. <div>
  147. <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" v-privilege="activeMenu + 'addDep'"
  148. @click="addData2">新增</el-button>
  149. <el-button icon="el-icon-edit" type="goon" size="mini" v-privilege="activeMenu + 'modifyDep'"
  150. @click="modifyData2">修改</el-button>
  151. <!-- <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="copyData2">复制</el-button> -->
  152. <el-button icon="el-icon-remove-outline" type="danger" size="mini" v-privilege="activeMenu + 'delete'"
  153. @click="deleteData2">删除</el-button>
  154. <!-- <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData2">启用</el-button> -->
  155. </div>
  156. </div>
  157. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  158. <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" highlight-current-row
  159. @row-click='saveData'
  160. :data="table.list2.slice((this.page2.pageNum - 1) * this.page2.pageSize, this.page2.pageNum * this.page2.pageSize)"
  161. :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
  162. :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
  163. <el-table-column type="index" label="NO" fixed="left" align="center">
  164. </el-table-column>
  165. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="validFlag" label="状态"
  166. align="center"></el-table-column>
  167. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="planIdD" label="计划单子号"
  168. align="center"></el-table-column>
  169. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="planId" label="计划单号"
  170. align="center"></el-table-column>
  171. <el-table-column :show-overflow-tooltip="true" sortable min-width="160px" prop="anlyItemName" label="分析项目"
  172. align="center"></el-table-column>
  173. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="maxSign" label="上限符"
  174. align="center"></el-table-column>
  175. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="maxValue" label="上限值"
  176. align="center"></el-table-column>
  177. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="minSign" label="下限符"
  178. align="center"></el-table-column>
  179. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="minValue" label="下限值"
  180. align="center"></el-table-column>
  181. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="createMan" label="创建人"
  182. align="center"></el-table-column>
  183. <el-table-column :show-overflow-tooltip="true" sortable min-width="90px" prop="createTime" label="创建时间"
  184. align="center"></el-table-column>
  185. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="memo" label="备注"
  186. align="center"></el-table-column>
  187. </el-table>
  188. </div>
  189. <!-- <div class="common-foot-style">
  190. <el-pagination @size-change="pageSizeChange2" @current-change="pageCurrentChange2"
  191. :current-page="page2.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page2.pageSize" layout="total, sizes, prev, pager, next, jumper"
  192. :total="page2.totalPage" background>
  193. </el-pagination>
  194. </div> -->
  195. <el-dialog @close="fxcloseDialog" :close-on-click-modal='false' :visible.sync="fxdialogTableVisible">
  196. <div slot="title" class="titleBox">
  197. <i class="el-icon-document" style="font-size: 20px"></i>
  198. <span style="margin-left:10px;font-size:18px;margin-right:20px">修改计划检验项目信息</span>
  199. </div>
  200. <el-form label-width="80px">
  201. <el-row>
  202. <el-col :span='12'>
  203. <el-form-item prop="maxSignTypeIndex" label="上限符">
  204. <el-select v-model="baseData.maxSign" filterable collapse-tags size="small" style="width:100%">
  205. <el-option v-for="(item, index) in maxSignType" :key="index" :label="item.maxSign"
  206. :value="item.maxSign">
  207. </el-option>
  208. </el-select>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span='12'>
  212. <el-form-item label="最大值">
  213. <el-input v-model="baseData.maxValue" style="width:100%" size="small"></el-input>
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. <el-row>
  218. <el-col :span='12'>
  219. <el-form-item prop="minSignTypeIndex" label="下限符">
  220. <el-select v-model="baseData.minSign" filterable collapse-tags size="small" style="width:100%">
  221. <el-option v-for="(item, index) in minSignType" :key="index" :label="item.minSign"
  222. :value="item.minSign">
  223. </el-option>
  224. </el-select>
  225. </el-form-item>
  226. </el-col>
  227. <el-col :span='12'>
  228. <el-form-item label="最小值">
  229. <el-input v-model="baseData.minValue" style="width:100%" size="small"></el-input>
  230. </el-form-item>
  231. </el-col>
  232. </el-row>
  233. </el-form>
  234. <span slot="footer" class="dialog-footer">
  235. <el-button type="goon" icon="el-icon-check" size="mini" @click="fxaddData()">确定</el-button>
  236. <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="fxcloseDialog">取消</el-button>
  237. </span>
  238. </el-dialog>
  239. <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh='refresh'></div>
  240. <div is="alertComponets2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" @refresh='refresh2'></div>
  241. </div>
  242. </template>
  243. <script>
  244. import {
  245. getCookie,
  246. formatDate
  247. } from '@/utils/util.js';
  248. import {
  249. cookieUserId,
  250. cookieUserName
  251. } from '@/config/config.js'
  252. import alertComponets from './alertComponents';
  253. import alertComponets2 from './alertComponents2';
  254. let userName = getCookie(cookieUserName);
  255. let userId = getCookie(cookieUserId);
  256. export default {
  257. components: { alertComponets, alertComponets2 },
  258. data() {
  259. return {
  260. table: {
  261. list: [],
  262. list2: []
  263. },
  264. dataLoading: false,
  265. dataLoading2: false,
  266. icoreFilterFlag: true,
  267. fxdialogTableVisible: false,
  268. minSignType: [{ minSign: ">=" }, { minSign: ">" }],
  269. maxSignType: [{ maxSign: "<=" }, { maxSign: "<" }],
  270. baseData: {},
  271. page: {
  272. pageSize: 200,
  273. pageNum: 1,
  274. totalPage: 0
  275. },
  276. page2: {
  277. pageSize: 200,
  278. pageNum: 1,
  279. totalPage: 0
  280. },
  281. list: [],
  282. planSave: {},
  283. saveRow: {},
  284. planId: '',
  285. showFlag: false,
  286. Params: {},
  287. showFlag2: false,
  288. Params2: {},
  289. height_top: 0,
  290. height_bot: 0,
  291. companyNameType: [],
  292. companyNameType1: [],
  293. sampleTypeNameType: [],
  294. multipleSelection3: [],
  295. multipleSelection4: [],
  296. returnSubLoading: false,
  297. subLoading1: false,
  298. returnSubLoading1: false,
  299. search: {
  300. planDate: [],
  301. companyName: ''
  302. },
  303. activeMenu: ''
  304. }
  305. },
  306. created() {
  307. this.height_top = window.innerHeight / 2 - 130 < 249 ? 249 : window.innerHeight / 2 - 110;
  308. this.height_bot = window.innerHeight / 2 - 140 < 249 ? 249 : window.innerHeight / 2 - 110;
  309. this.search.planDate = [this.getYNM(new Date()), this.getYNM(new Date())]
  310. this.activeMenu = window.top.localStorage.getItem('activeMenu')
  311. },
  312. mounted() {
  313. this.axios.post("pass/baseManagement/v1/sysorgs/querySysOrgCompanyAll", {}, { individualType: 'json' }).then(response => {
  314. this.companyNameType = response.data
  315. });
  316. this.searchData();
  317. // this.getDataList2();
  318. this.addScreen();
  319. this.addScreen2()
  320. },
  321. methods: {
  322. getYNM(date) {
  323. let year = date.getFullYear().toString();
  324. let month = date.getMonth() + 1;
  325. let day = date.getDate();
  326. month = month < 10 ? "0" + month : month;
  327. day = day < 10 ? "0" + day : day;
  328. return `${year}-${month}-${day}`;
  329. },
  330. getSummaries(param) {
  331. const { columns, data } = param;
  332. const sums = [];
  333. columns.forEach((column, index) => {
  334. if (index === 0) {
  335. sums[index] = "合计";
  336. }
  337. if (index === 1) {
  338. sums[index] = data.length;
  339. }
  340. });
  341. return sums;
  342. },
  343. refresh() {
  344. this.mainData();
  345. },
  346. refresh2() {
  347. this.depData(this.saveRow.planId)
  348. },
  349. saveData(row) {
  350. this.planSave = Object.assign({}, row)
  351. },
  352. addData() {
  353. let _this = this;
  354. _this.showFlag = !_this.showFlag;
  355. _this.Params = null;
  356. },
  357. modifyData() {
  358. let _this = this;
  359. if (_this.multipleSelection3.length !== 1) {
  360. this.$message.warning('请勾选您要修改的一条数据!')
  361. return
  362. }
  363. if (this.multipleSelection3[0].stateFlag === '1') {
  364. this.$message.warning('已提交的数据不可以进行修改!')
  365. return
  366. }
  367. this.showFlag = !this.showFlag;
  368. this.Params = this.multipleSelection3[0]
  369. },
  370. deleteData() {
  371. let _this = this;
  372. if (_this.multipleSelection3.length < 1) {
  373. this.$message.warning('请勾选您要停用的数据!')
  374. return
  375. }
  376. let tempArr = []
  377. this.multipleSelection3.map(item => {
  378. tempArr.push(item.id)
  379. })
  380. _this.axios.post('pass/testManagement/v1/limstestplans/disable', tempArr, { individualType: 'json' }).then(res => {
  381. if (res.succeed) {
  382. _this.dialogTableVisible = false;
  383. this.$message.success('停用操作成功');
  384. _this.refresh()
  385. } else {
  386. this.$message.error(res.message)
  387. }
  388. }).catch(e => {
  389. this.$message.error(e.message)
  390. })
  391. },
  392. recoverData() {
  393. let _this = this;
  394. if (_this.multipleSelection3.length < 1) {
  395. this.$message.warning('请勾选您要启用的数据!')
  396. return
  397. }
  398. let tempArr = []
  399. this.multipleSelection3.map(item => {
  400. tempArr.push(item.id)
  401. })
  402. _this.axios.post('pass/testManagement/v1/limstestplans/enabled', tempArr, { individualType: 'json' }).then(res => {
  403. if (res.succeed) {
  404. this.dialogTableVisible = false;
  405. this.$message.success('启用成功');
  406. _this.refresh()
  407. } else {
  408. this.$message.error(res.message)
  409. }
  410. }).catch(e => {
  411. this.$message.error(e.message)
  412. })
  413. },
  414. submitData() {
  415. if (this.multipleSelection3.length < 1) {
  416. this.$message.warning('请勾选您要提交的数据!')
  417. return
  418. }
  419. for (let item of this.multipleSelection3) {
  420. if (item.stateFlag != 0) {
  421. this.$message.warning('数据不是编辑状态,不可提交!')
  422. return
  423. }
  424. if (item.validFlag == 0) {
  425. this.$message.warning('无效状态的数据,不可以提交!')
  426. return
  427. }
  428. }
  429. this.axios.post('pass/testManagement/v1/limstestplans/check', this.multipleSelection3, { individualType: 'json' }).then(res => {
  430. if (res.succeed) {
  431. this.$message.success('提交成功');
  432. this.refresh()
  433. } else {
  434. this.$message.error(res.message)
  435. }
  436. }).catch(e => {
  437. this.$message.error(e.message)
  438. })
  439. },
  440. returnSubmit() {//取消提交
  441. if (this.multipleSelection3.length < 1) {
  442. this.$message.warning('请勾选您要取消提交的数据!')
  443. return
  444. }
  445. for (let item of this.multipleSelection3) {
  446. if (item.stateFlag != 4) {
  447. this.$message.warning('数据不是待审核状态,不可取消提交!')
  448. return
  449. }
  450. if (item.validFlag == 0) {
  451. this.$message.warning('无效状态的数据,不可以提交!')
  452. return
  453. }
  454. }
  455. this.axios.post('pass/testManagement/v1/limstestplans/returnSubmit', this.multipleSelection3, { individualType: 'json' }).then(res => {
  456. if (res.succeed) {
  457. this.$message.success('提交成功');
  458. this.refresh()
  459. } else {
  460. this.$message.error(res.message)
  461. }
  462. }).catch(e => {
  463. this.$message.error(e.message)
  464. })
  465. },
  466. checkData() {//审核
  467. if (this.multipleSelection3.length < 1) {
  468. this.$message.warning('请勾选您要审核的数据!')
  469. return
  470. }
  471. let flag = false;
  472. this.multipleSelection3.forEach(item => {
  473. if (item.stateFlag != 4) {
  474. this.$message.warning('请勾选状态为待审核的数据')
  475. flag = true
  476. }
  477. })
  478. if (flag) {
  479. return
  480. }
  481. this.axios.post('pass/testManagement/v1/limstestplans/checkInterPlan', this.multipleSelection3, { individualType: 'json' }).then(res => {
  482. if (res.succeed) {
  483. this.$message.success('审核成功');
  484. this.searchData()
  485. } else {
  486. this.$message.error(res.message)
  487. }
  488. }).catch(e => {
  489. this.$message.error(e.message)
  490. })
  491. },
  492. uncheckData() {//取消审核
  493. let _this = this;
  494. if (_this.multipleSelection3.length < 1) {
  495. this.$message.warning('请勾选您要取消审核的数据!')
  496. return
  497. } else {
  498. for (var j = 0; j < _this.multipleSelection3.length; j++) {
  499. if (_this.multipleSelection3[j].stateFlag != '1') {
  500. this.$message.warning('请勾选状态为审核的数据')
  501. return
  502. }
  503. }
  504. _this.axios.post('pass/testManagement/v1/limstestplans/uncheck', _this.multipleSelection3, { individualType: 'json' }).then(res => {
  505. if (res.succeed) {
  506. this.$message.success('取消成功');
  507. _this.searchData()
  508. } else {
  509. this.$message.error(res.message)
  510. }
  511. }).catch(e => {
  512. this.$message.error(e.message)
  513. })
  514. }
  515. },
  516. addData2() {
  517. if (JSON.stringify(this.saveRow) === "{}") {
  518. this.$message.warning('请点击选中一条固定计划信息数据!')
  519. return
  520. }
  521. if (this.saveRow.stateFlag == 2) {
  522. this.$message.warning('数据已提交,不可再新增')
  523. return
  524. }
  525. this.showFlag2 = !this.showFlag2;
  526. this.Params2 = null;
  527. this.Params = this.saveRow
  528. },
  529. modifyData2() {
  530. let _this = this;
  531. if (JSON.stringify(this.planSave) === "{}") {
  532. this.$message.warning('请点击选中一条需要修改的数据')
  533. return
  534. }
  535. if (this.saveRow.stateFlag == 2) {
  536. this.$message.warning('数据已提交,不可再修改')
  537. return
  538. }
  539. this.baseData = Object.assign({}, this.planSave)
  540. this.fxdialogTableVisible = true
  541. },
  542. fxcloseDialog() {
  543. this.fxdialogTableVisible = false
  544. this.baseData = {}
  545. },
  546. fxaddData() {
  547. this.axios.post('pass/testManagement/v1/limstestplands/saveLimsTestPlanD', this.baseData, { individualType: 'json' }).then(res => {
  548. if (res.succeed) {
  549. this.fxdialogTableVisible = false;
  550. this.$message.success(res.message)
  551. this.depData(this.saveRow.planId)
  552. } else {
  553. this.$message.error(res.message)
  554. }
  555. }).catch(e => {
  556. this.$message.error(e.message)
  557. })
  558. },
  559. copyData2() {
  560. let _this = this;
  561. if (_this.multipleSelection4.length < 1) {
  562. this.$message.warning('请勾选您要复制的数据!')
  563. } else {
  564. _this.axios.post('pass/testManagement/v1/limstestplands/', _this.multipleSelection4, { individualType: 'json' }).then(res => {
  565. if (res.succeed) {
  566. this.$message.success('复制成功')
  567. _this.refresh2()
  568. } else {
  569. this.$message.error(res.message)
  570. }
  571. }).catch(e => {
  572. this.$message.error(e.message)
  573. })
  574. }
  575. },
  576. deleteData2() {
  577. if (JSON.stringify(this.planSave) === "{}") {
  578. this.$message.warning('请点击选中一条需要删除的数据')
  579. return
  580. }
  581. if (this.saveRow.stateFlag == 2) {
  582. this.$message.warning('数据已提交,不可再删除')
  583. return
  584. }
  585. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  586. confirmButtonText: '确定',
  587. cancelButtonText: '取消',
  588. type: 'warning'
  589. }).then(() => {
  590. this.axios.post('pass/testManagement/v1/limstestplands/deleteLimsTestPlanD?id=' + this.planSave.id, { individualType: 'json' }).then(res => {
  591. if (res.succeed) {
  592. this.$message.success('删除操作成功');
  593. this.depData(this.saveRow.planId)
  594. } else {
  595. this.$message.error(res.message)
  596. }
  597. }).catch(e => {
  598. this.$message.error(e.message)
  599. })
  600. }).catch(() => { });
  601. },
  602. searchData() {
  603. this.page.pageNum = 1;
  604. this.page.pageSize = 200
  605. this.mainData()
  606. },
  607. mainData() {
  608. this.saveRow = {}
  609. this.table.list2 = []
  610. if (!this.search.planDate) {
  611. this.startTime = ''
  612. this.endTime = ''
  613. } else {
  614. this.startTime = this.search.planDate[0] + ' 00:00:00'
  615. this.endTime = this.search.planDate[1] + ' 23:59:59'
  616. }
  617. this.dataLoading = true;
  618. let obj = {
  619. object: {
  620. companyNo: this.search.companyNo,
  621. planTypeCode: 481702
  622. },
  623. list: [0, 4, 1],
  624. startTime: this.startTime,
  625. endTime: this.endTime,
  626. pageIndex: this.page.pageNum,
  627. pageSize: this.page.pageSize
  628. }
  629. this.axios.post('pass/testManagement/v1/limstestplans/queryLimsTestPlanPage', obj, { individualType: 'json' }).then(res => {
  630. this.dataLoading = false;
  631. this.table.list = res.data.list;
  632. this.table.list.forEach(item => {
  633. item.validFlag1 = item.validFlag == '0' ? '无效' : item.validFlag == '1' ? '有效' : ''
  634. item.stateFlag1 = item.stateFlag == '0' ? '编辑' : item.stateFlag == '1' ? '已审核' : item.stateFlag == '4' ? '待审核' : ''
  635. item.isSmp1 = item.isSmp == '0' ? '否' : item.isSmp == '1' ? '是' : ''
  636. item.isBatch1 = item.isBatch == '0' ? '否' : item.isBatch == '1' ? '是' : ''
  637. item.planDate1 = formatDate(item.planDate, 'yyyy-MM-dd')
  638. })
  639. this.page.totalPage = res.data.total;
  640. if (this.table.list.length > 0) {
  641. this.$refs.dataTable.setCurrentRow(this.table.list[0])
  642. this.searchFollow(this.table.list[0])
  643. }
  644. }).catch(e => {
  645. this.dataLoading = false;
  646. });
  647. },
  648. searchFollow(row) {
  649. this.saveRow = row
  650. this.page2.pageNum = 1
  651. this.page2.pageSize = 50
  652. this.depData(this.saveRow.planId)
  653. },
  654. depData(planId) {
  655. this.planSave = {}
  656. this.dataLoading2 = true
  657. let planIds = planId ? planId : ''
  658. this.axios.post('pass/testManagement/v1/limstestplands/queryLimsTestPlanDByPlanId?planId=' + planIds, { individualType: 'json' }).then(res => {
  659. this.dataLoading2 = false;
  660. this.table.list2 = res.data;
  661. this.table.list2.forEach(item => {
  662. item.validFlag = item.validFlag == '0' ? '无效' : item.validFlag == '1' ? '有效' : ''
  663. })
  664. this.page2.totalPage = res.data.total;
  665. }).catch(e => {
  666. this.dataLoading2 = false;
  667. });
  668. },
  669. reset() {
  670. this.search.planDate = [this.getYNM(new Date()), this.getYNM(new Date())]
  671. this.search.companyNo = '';
  672. this.searchData();
  673. },
  674. handleSelectionChange(val) {
  675. this.multipleSelection3 = val;
  676. },
  677. pageSizeChange(size) {
  678. this.page.pageSize = size;
  679. this.mainData();
  680. },
  681. pageCurrentChange(index) {
  682. this.page.pageNum = index;
  683. this.mainData();
  684. },
  685. handleSelectionChange2(val) {
  686. this.multipleSelection4 = val;
  687. },
  688. pageSizeChange2(size) {
  689. this.page2.pageSize = size;
  690. },
  691. pageCurrentChange2(index) {
  692. this.page2.pageNum = index;
  693. },
  694. addScreen() {
  695. this.$nextTick(() => {
  696. let ss = document.createElement('div');
  697. ss.innerHTML = '筛选';
  698. ss.style = 'text-align: center;'
  699. this.$refs.dataTable.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  700. });
  701. },
  702. addScreen2() {
  703. this.$nextTick(() => {
  704. let ss = document.createElement('div');
  705. ss.innerHTML = '筛选';
  706. ss.style = 'text-align: center;'
  707. this.$refs.dataTable2.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  708. });
  709. },
  710. tableRowClassName({ row, rowIndex }) {
  711. if (row.validFlag !== '1') {
  712. return 'error-row';
  713. }
  714. return '';
  715. },
  716. tableCellClassName({
  717. row, column, rowIndex, columnIndex
  718. }) {
  719. // if (columnIndex === 24) {
  720. // if (row.validFlag !== '1') {
  721. // return 'error-row';
  722. // }
  723. // }
  724. if (columnIndex === 2) {
  725. if (row.stateFlag === '2') {
  726. return 'error-green';
  727. }
  728. return '';
  729. }
  730. },
  731. tableRowClassName2({
  732. row, column, rowIndex, columnIndex
  733. }) {
  734. // if (columnIndex === 6) {
  735. // if (row.validFlag !== '1') {
  736. // return 'error-row';
  737. // }
  738. // return '';
  739. // }
  740. // if (columnIndex === 10 || columnIndex === 9) {
  741. // return 'erroe-bule2'
  742. // }
  743. // if (columnIndex === 12) {
  744. // if (Date.parse(row.startTime) > new Date ()) {
  745. // return 'error-green2';
  746. // }
  747. // return '';
  748. // }
  749. // if (columnIndex === 13) {
  750. // if (Date.parse(row.endTime) < new Date ()) {
  751. // return 'error-yellow2';
  752. // }
  753. // return '';
  754. // }
  755. },
  756. tableHeaderCellStyle() {
  757. return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
  758. }
  759. }
  760. }
  761. </script>
  762. <style scoped></style>