secondApprove.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704
  1. <!-- 二级审核:批量审核操作不理解!!!三审撤回操作好难!!! -->
  2. <template>
  3. <div class="examination testManagement">
  4. <div class="common-head-search">
  5. <el-form :inline="true" @submit.native.prevent ref="searchForm" :model="searchForm"
  6. class="demo-form-inline sui-search-form">
  7. <el-form-item label="样品名称">
  8. <el-input v-model="searchForm.matName" @keyup.enter.native="searchData()" size="small" placeholder="请输入查询内容"
  9. style="width: 150px"></el-input>
  10. </el-form-item>
  11. <el-form-item label="样品类型">
  12. <el-select v-model="searchForm.sampleTypeCode" clearable filterable collapse-tags size="small"
  13. style="width: 150px" placeholder="请选择查询内容">
  14. <el-option v-for="item in sampleTypeNameType" :key="item.baseName" :label="item.baseName"
  15. :value="item.baseCode">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="创建时间">
  20. <el-date-picker v-model="searchForm.times[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  21. placeholder="开始日期" size="mini" style="width: 140px" :default-time="'00:00:00'">
  22. </el-date-picker>
  23. <!-- <el-date-picker v-model="searchForm.times[0]" value-format="yyyy-MM-dd HH:mm:ss" format="" type="date"
  24. placeholder="开始日期" size="mini" style="width: 140px" :default-time="'00:00:00'">
  25. </el-date-picker> -->
  26. <span>至</span>
  27. <el-date-picker v-model="searchForm.times[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  28. placeholder="结束日期" size="mini" style="width: 140px" :default-time="'23:59:59'">
  29. </el-date-picker>
  30. <!-- <el-date-picker v-model="searchForm.times[1]" value-format="yyyy-MM-dd HH:mm:ss" format="" type="date"
  31. placeholder="结束日期" size="mini" style="width: 140px" :default-time="'23:59:59'">
  32. </el-date-picker> -->
  33. <!-- <el-date-picker
  34. v-model="searchForm.times"
  35. type="daterange"
  36. range-separator="至"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. size="small"
  40. style="width: 350px"
  41. value-format="yyyy-MM-dd HH:mm:ss"
  42. :default-time="['00:00:00', '23:59:59']"
  43. >
  44. </el-date-picker> -->
  45. </el-form-item>
  46. <el-form-item>
  47. <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
  48. <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="resetData">重置</el-button>
  49. </el-form-item>
  50. </el-form>
  51. </div>
  52. <el-row>
  53. <el-col :span="10">
  54. <el-tabs type="border-card" v-model="activeName" class="testManagement_left">
  55. <el-tab-pane label="未审核数据" name="first">
  56. <span slot="label">待审核数据<el-badge :max="10" :hidden="total_main == 0" style="margin-top: -18px"
  57. :value="total_main"></el-badge></span>
  58. <div class="common-title-div" style="height: auto">
  59. <div class="common-title-name" style="margin-right: 10px">
  60. <img style="width: 25px; height: 25px" src="../../../assets/img/imgScreen/logo.png" />
  61. 待审核
  62. </div>
  63. <div>
  64. <el-form :inline="true" @submit.native.prevent>
  65. <el-form-item style="margin-bottom: 0">
  66. <el-button icon="el-icon-check" type="goon" :loading="sampleLoading" @click="audit"
  67. v-privilege="activeMenu + 'audit'" size="mini">审批通过</el-button>
  68. <el-button icon="el-icon-check" type="goon" :loading="batchDataLoading" @click="showBatch"
  69. v-privilege="activeMenu + 'batch'" size="mini">批量审核</el-button>
  70. <el-button icon="el-icon-check" type="danger" :loading="backAuditLoading" @click="showBackData"
  71. v-privilege="activeMenu + 'back'" size="mini">审批不通过</el-button>
  72. </el-form-item>
  73. </el-form>
  74. </div>
  75. </div>
  76. <div class="common-table-div">
  77. <el-table ref="table1" :height="theight1" v-loading="tableLoading4" :data="tableData4"
  78. :cell-class-name="tableRowClassName" :summary-method="getSummaries2" show-summary
  79. @row-click="searchAnalyze" border @selection-change="searchFollow"
  80. :header-cell-style="tableHeaderCellStyle" highlight-current-row :icorePanelShown="100"
  81. :icore-filter-flag="icoreFilterFlag" :exchangeFilterMap="{
  82. lock_flag: { '0': '未锁定', '1': '已锁定' },
  83. }" style="width: 100%">
  84. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  85. <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
  86. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="state"
  87. label="状态"></el-table-column>
  88. <el-table-column show-overflow-tooltip sortable min-width="115" align="center" prop="carNo"
  89. label="委托编号"></el-table-column>
  90. <el-table-column show-overflow-tooltip sortable min-width="115" align="center" prop="sampleNo"
  91. label="中心编号">
  92. <template slot-scope="scope">
  93. <span @click.stop="showHistory(scope.row)" style="cursor: pointer"
  94. :class="{ 'color-blue': scope.row.sampleNo }">
  95. {{ scope.row.sampleNo }}
  96. </span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column show-overflow-tooltip sortable min-width="150" align="center" prop="matName"
  100. label="物料名称"></el-table-column>
  101. <el-table-column show-overflow-tooltip sortable min-width="180" align="center" prop="testItemName"
  102. label="测试项目"></el-table-column>
  103. <el-table-column show-overflow-tooltip sortable min-width="180" align="center" prop="receivedDate"
  104. label="收样日期"></el-table-column>
  105. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="entrTypeName"
  106. label="委托类型"></el-table-column>
  107. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="sampleTypeName"
  108. label="样品类型"></el-table-column>
  109. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="entrMemo"
  110. label="委托备注"></el-table-column>
  111. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="testMemo"
  112. label="检测标准"></el-table-column>
  113. <el-table-column show-overflow-tooltip sortable min-width="150" align="center" prop="nantNo"
  114. label="测试设备"></el-table-column>
  115. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="checkMan"
  116. label="提交人"></el-table-column>
  117. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="checkTime"
  118. label="提交时间"></el-table-column>
  119. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="createMan"
  120. label="创建人"></el-table-column>
  121. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="createTime"
  122. label="创建时间"></el-table-column>
  123. </el-table>
  124. </div>
  125. <div class="common-foot-style">
  126. <el-pagination @size-change="handleSizeChangeMain" @current-change="Data4()"
  127. :current-page.sync="pageIndex4" :page-sizes="[50, 100, 200, 500, 800, 1000]" :page-size="pageSize4"
  128. layout="total, sizes, prev, pager, next, jumper" :total="total4" background></el-pagination>
  129. </div>
  130. </el-tab-pane>
  131. <el-tab-pane label="已审核数据" name="second">
  132. <div class="common-title-div" style="height: auto">
  133. <div class="common-title-name" style="margin-right: 10px">
  134. <img style="width: 25px; height: 25px" src="../../../assets/img/imgScreen/logo.png" />
  135. 已审核
  136. </div>
  137. <div class="buttons">
  138. <el-button icon="el-icon-back" type="danger" size="mini" :loading="backLoading"
  139. v-privilege="activeMenu + 'withdraw'" @click="showBackAuditData">撤回已审核</el-button>
  140. </div>
  141. </div>
  142. <div class="common-table-div">
  143. <el-table v-loading="tableLoading42" ref="table2" :row-class-name="tableRowClassName0"
  144. :cell-class-name="cellClassName" @selection-change="SelectionValues"
  145. @current-change="handleCurrentChange" border @row-click="searchAnalyze" :height="theight2"
  146. highlight-current-row :data="tableData42" :icore-filter-flag="icoreFilterFlag"
  147. :header-cell-style="tableHeaderCellStyle" :summary-method="getSummaries2" show-summary>
  148. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  149. <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
  150. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="state"
  151. label="状态"></el-table-column>
  152. <el-table-column show-overflow-tooltip sortable min-width="115" align="center" prop="carNo"
  153. label="委托编号"></el-table-column>
  154. <el-table-column show-overflow-tooltip sortable min-width="115" align="center" prop="sampleNo"
  155. label="中心编号">
  156. <template slot-scope="scope">
  157. <span @click.stop="showHistory(scope.row)" style="cursor: pointer"
  158. :class="{ 'color-blue': scope.row.sampleNo }">
  159. {{ scope.row.sampleNo }}
  160. </span>
  161. </template>
  162. </el-table-column>
  163. <el-table-column show-overflow-tooltip sortable min-width="150" align="center" prop="matName"
  164. label="物料名称"></el-table-column>
  165. <el-table-column show-overflow-tooltip sortable min-width="170" align="center" prop="testItemName"
  166. label="测试项目"></el-table-column>
  167. <el-table-column show-overflow-tooltip sortable min-width="180" align="center" prop="receivedDate"
  168. label="收样日期"></el-table-column>
  169. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="entrTypeName"
  170. label="委托类型"></el-table-column>
  171. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="sampleTypeCode"
  172. label="样品类型"></el-table-column>
  173. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="testDirection"
  174. label="测试部门"></el-table-column>
  175. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="memo"
  176. label="检测标准"></el-table-column>
  177. <el-table-column show-overflow-tooltip sortable min-width="150" align="center" prop="nantNo"
  178. label="测试设备"></el-table-column>
  179. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="entrMemo"
  180. label="委托备注"></el-table-column>
  181. <el-table-column sortable show-overflow-tooltip min-width="80px" prop="checkMan" label="提交人"
  182. align="center"></el-table-column>
  183. <el-table-column sortable show-overflow-tooltip min-width="140px" prop="checkTime" label="提交时间"
  184. align="center"></el-table-column>
  185. <el-table-column sortable show-overflow-tooltip min-width="100px" prop="auditMan" label="二审审核人"
  186. align="center"></el-table-column>
  187. <el-table-column sortable show-overflow-tooltip min-width="140px" prop="auditTime" label="二审审核时间"
  188. align="center"></el-table-column>
  189. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="createMan"
  190. label="创建人"></el-table-column>
  191. <el-table-column show-overflow-tooltip sortable min-width="75" align="center" prop="createTime"
  192. label="创建时间"></el-table-column>
  193. </el-table>
  194. <div class="common-foot-style">
  195. <el-pagination @size-change="handleSizeChangeDep" @current-change="Data5()"
  196. :current-page.sync="pageIndex42" :page-sizes="[50, 100, 200, 500, 800, 1000]" :page-size="pageSize42"
  197. layout="total, sizes, prev, pager, next, jumper" :total="total42" background></el-pagination>
  198. </div>
  199. </div>
  200. </el-tab-pane>
  201. </el-tabs>
  202. </el-col>
  203. <el-col :span="14">
  204. <el-tabs type="border-card" v-model="activeName2">
  205. <el-tab-pane :label="analyzeVal.matName
  206. ? '【 ' +
  207. analyzeVal.matName +
  208. ' 】 - 【 ' +
  209. analyzeVal.testItemName +
  210. ' 】'
  211. : '未选择数据'
  212. " name="first2">
  213. <div style="height: auto; padding-top: 1px" class="common-title-div">
  214. <div class="common-title-name">
  215. <img style="width: 25px; height: 25px" src="../../../assets/img/imgScreen/logo.png" />
  216. 分析项目
  217. </div>
  218. <div class="buttons"></div>
  219. <div></div>
  220. </div>
  221. <div class="common-table-div">
  222. <el-table v-loading="tableLoading3" border :height="theight3" @selection-change="selectMultiples"
  223. highlight-current-row @row-click="clickRow" :data="tableData3" :icore-filter-flag="icoreFilterFlag"
  224. :header-cell-style="tableHeaderCellStyle" @row-dblclick="showCell"
  225. :cell-class-name="fxTableRowClassName" :summary-method="getSummaries2" show-summary>
  226. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  227. <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
  228. <el-table-column show-overflow-tooltip sortable min-width="180" fixed="left" align="center"
  229. prop="anlyItemName" label="分析项目"></el-table-column>
  230. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="anlyValue"
  231. label="报出值">
  232. </el-table-column>
  233. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="reviseValue"
  234. label="录入值">
  235. </el-table-column>
  236. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="dasValue"
  237. label="采集值"></el-table-column>
  238. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="cptValue"
  239. label="计算值"></el-table-column>
  240. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="memo" label="备注">
  241. </el-table-column>
  242. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="memo" label="文件预览">
  243. </el-table-column>
  244. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="unitName"
  245. label="单位"></el-table-column>
  246. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="formulaName"
  247. label="计算公式"></el-table-column>
  248. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="reviseRuleName"
  249. label="修约规则"></el-table-column>
  250. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="isReportName"
  251. label="是否报出"></el-table-column>
  252. <el-table-column show-overflow-tooltip sortable min-width="100" align="center" prop="outputTypeName"
  253. label="输出类型"></el-table-column>
  254. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="minSign"
  255. label="最小符号"></el-table-column>
  256. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="minValue"
  257. label="最小值"></el-table-column>
  258. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="maxSign"
  259. label="最大符号"></el-table-column>
  260. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="maxValue"
  261. label="最大值"></el-table-column>
  262. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="maxLimit"
  263. label="方法上限值"></el-table-column>
  264. <el-table-column show-overflow-tooltip sortable min-width="80" align="center" prop="minLimit"
  265. label="方法下限值"></el-table-column>
  266. </el-table>
  267. </div>
  268. </el-tab-pane>
  269. </el-tabs>
  270. </el-col>
  271. </el-row>
  272. <!-- 批量审核 -->
  273. <el-dialog class="testManagement-pllr" :close-on-click-modal="false" @close="closebatch" width="100%"
  274. :visible.sync="batchShow" top="0">
  275. <div slot="title" class="titleBox">
  276. <div>
  277. <i class="el-icon-document" style="font-size: 20px"></i>
  278. <span style="margin-left: 10px; font-size: 18px">批量审核</span>
  279. </div>
  280. </div>
  281. <el-table ref="tablePllr" border :height="theight4" highlight-current-row :data="tableData"
  282. :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowBatch" :summary-method="getSummaries2"
  283. show-summary>
  284. <el-table-column type="index" label="NO" fixed="left" align="center">
  285. <template slot-scope="scope">
  286. <span>{{ scope.$index }}</span>
  287. </template>
  288. </el-table-column>
  289. <el-table-column width="50px" fixed="left" label="操作" align="center">
  290. <template slot-scope="scope">
  291. <el-button v-if="scope.$index > 0" type="text" style="padding: 0"
  292. @click="delData(scope.row, scope.$index)">删除</el-button>
  293. </template>
  294. </el-table-column>
  295. <template v-for="col in cols">
  296. <el-table-column :prop="col.prop" :fixed="col.prop == 'sampleNo' ||
  297. col.prop == 'matName' ||
  298. col.prop == 'carNo'
  299. " show-overflow-tooltip min-width="90" align="center" :key="col.prop" :label="col.label">
  300. <template slot-scope="scope">
  301. <span v-if="col.prop == 'matName'">{{
  302. tableData[scope.$index].matName
  303. }}</span>
  304. <span v-else-if="col.prop == 'sampleNo'">{{
  305. tableData[scope.$index].sampleNo
  306. }}</span>
  307. <span v-else-if="col.prop == 'carNo'">{{
  308. tableData[scope.$index].carNo
  309. }}</span>
  310. <span v-else-if="scope.$index > 0">{{
  311. scope.row[col.prop]
  312. }}</span>
  313. </template>
  314. </el-table-column>
  315. </template>
  316. </el-table>
  317. <span slot="footer" class="dialog-footer">
  318. <el-button type="goon" size="mini" icon="el-icon-check" :loading="batchLoading"
  319. @click="batchAudit()">审批通过</el-button>
  320. <el-button size="mini" type="danger" icon="el-icon-remove-outline" @click="closebatch">取消</el-button>
  321. </span>
  322. </el-dialog>
  323. <!-- 撤回审核 -->
  324. <el-dialog :close-on-click-modal="false" width="80%" :visible.sync="dialog.show" @close="closeBack">
  325. <div slot="title" class="titleBox">
  326. <i class="el-icon-document" style="font-size: 20px"></i>
  327. <span style="margin-left: 10px; font-size: 18px">审批不通过</span>
  328. </div>
  329. <div style="padding: 10px 0">
  330. <el-form ref="dialog_form" :model="dialog.form.data" size="mini" label-width="100px">
  331. <el-row>
  332. <el-col :span="24">
  333. <el-table v-loading="glDialogLoading" ref="dataTable" border :height="heightTop" highlight-current-row
  334. :data="dialog.form.tableData" :header-cell-style="tableHeaderCellStyle"
  335. :icore-filter-flag="icoreFilterFlag">
  336. <el-table-column type="index" label="NO" align="center"></el-table-column>
  337. <el-table-column width="100px" show-overflow-tooltip label="操作" align="center">
  338. <template slot-scope="scope">
  339. <el-button type="text" style="padding: 0"
  340. @click="dialogDeleteData(scope.row, scope.$index)">删除</el-button>
  341. </template>
  342. </el-table-column>
  343. <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="sampleNo" label="中心编号"
  344. align="center"></el-table-column>
  345. <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="matName" label="物料名称"
  346. align="center"></el-table-column>
  347. <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="testItemName"
  348. label="测试项目" align="center"></el-table-column>
  349. <el-table-column show-overflow-tooltip sortable min-width="180" align="center" prop="receivedDate"
  350. label="收样日期"></el-table-column>
  351. <el-table-column min-width="120px" :show-overflow-tooltip="true" sortable prop="testItemName"
  352. label="退回原因" align="center">
  353. <template slot-scope="{ row }">
  354. <el-input v-model="row.logMemo" @blur="saveCell" @keyup.enter.native="saveCell" size="small"
  355. style="width: 100%"></el-input>
  356. </template>
  357. </el-table-column>
  358. </el-table>
  359. <div style="margin-top: 20px; margin-left: 10px">
  360. <el-pagination style="float: right" @size-change="glDialogSizeTest"
  361. @current-change="glDialogPageChangeTest" :current-page="glDialog.pageNum"
  362. :page-sizes="[10, 20, 50, 100, 200]" :page-size="glDialog.pageSize"
  363. layout="total, sizes, prev, pager, next" :total="glDialog.totalPage" background>
  364. </el-pagination>
  365. </div>
  366. </el-col>
  367. </el-row>
  368. </el-form>
  369. </div>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="danger" size="mini" :loading="backAuditLoading"
  372. @click="tableType === 1 ? back() : backAudit()">审批不通过</el-button>
  373. <el-button type="goon" size="mini" @click="closeBack">取 消</el-button>
  374. </span>
  375. </el-dialog>
  376. <div is="historyAlert" :showFlag="historyShowFlag" :Params="Params" @refresh="refresh"></div>
  377. </div>
  378. </template>
  379. <script>
  380. import { getCookie, formatDate } from "@/utils/util.js";
  381. import { cookieUserId, cookieUserName } from "@/config/config.js";
  382. import historyAlert from "../../testAnalysis/components/testManagement/historyAlert";
  383. let userName = getCookie(cookieUserName);
  384. let userId = getCookie(cookieUserId);
  385. export default {
  386. components: { historyAlert },
  387. data() {
  388. return {
  389. fromDaiban: null,
  390. searchForm: {
  391. times: "",
  392. matName: "",
  393. sampleTypeCode: "",
  394. eqpNo: "",
  395. type:''
  396. },
  397. autoCollData: {
  398. eqpTypeCode: "",
  399. eqpNo: "",
  400. },
  401. historyShowFlag: false,
  402. gangwei: "",
  403. showFlag: false,
  404. resetShowFlag: false,
  405. deleteFlag: false,
  406. dataCollectionFlag: false,
  407. Params: {},
  408. Params2: [],
  409. matNameType: [],
  410. autoColl: {
  411. eqpTypeCode: [
  412. { required: true, message: "不能为空", trigger: "change" },
  413. ],
  414. eqpNo: [{ required: true, message: "不能为空", trigger: "change" }],
  415. },
  416. table: {
  417. listTests: [],
  418. collectionData: [],
  419. selectCollectionData: [],
  420. sampleData: [],
  421. },
  422. activeName: "first",
  423. activeName2: "first2",
  424. backLoading: false,
  425. tableType: 0,
  426. withdrawLoading: false,
  427. batchDataLoading: false,
  428. buttonLoading1: false,
  429. buttonLoading2: false,
  430. batchLoading: false,
  431. addByLoading: false,
  432. addKbLoading: false,
  433. addGlyLoading: false,
  434. testTable: [],
  435. cols: [],
  436. tableData: [],
  437. resultData: [],
  438. collectionLoading: false,
  439. autoColletLoading: false,
  440. clickColl: false,
  441. batchShow: false,
  442. eqpType: [],
  443. autoEqpType: [],
  444. facilityType: [],
  445. selectVal: [], // 已审 多选
  446. selectVal4: [],
  447. selectVal42: [], //
  448. selectMul: [],
  449. companyNameType: [],
  450. userdeptNo: "",
  451. usersectionNo: "",
  452. userjobs: "",
  453. selectRecall: [],
  454. testShow: false,
  455. checked: true,
  456. interval: null,
  457. saveValue: "",
  458. saveMainData: [],
  459. cllotData: [],
  460. addRetestLoading: false,
  461. dataLoading: false,
  462. glDialogLoading: false,
  463. sampleLoading: false,
  464. backAuditLoading: false,
  465. saveLoading: false,
  466. errorLoading: false,
  467. submitLoading: false,
  468. isAutoColl: false,
  469. sampleTypeNameType: [],
  470. analyzeVal: {},
  471. analyzeValues: {},
  472. formulacomLoading: false,
  473. isOneHint: false,
  474. theight1: 0,
  475. theight2: 0,
  476. theight3: 0,
  477. theight4: 0,
  478. testItemName2: "",
  479. pageTests: {
  480. pageSize: 50,
  481. pageNum: 1,
  482. totalPage: 0,
  483. },
  484. glDialog: {
  485. pageSize: 50,
  486. pageNum: 1,
  487. totalPage: 0,
  488. },
  489. equipment: {
  490. nantNo: [],
  491. itemTemp: "",
  492. },
  493. addByShow: false,
  494. deleteLoading: false,
  495. collectionShow: false,
  496. recallShow: false,
  497. addCollectionLoading: false,
  498. tableLoading1: false,
  499. tableLoading2: false,
  500. tableLoading3: false,
  501. tableLoading4: false,
  502. tableLoading42: false,
  503. tableLoading5: false,
  504. selectLine: {},
  505. tabClickIndex: null,
  506. func: "",
  507. originalData: [],
  508. tableData1: [],
  509. tableData2: [],
  510. tableData3: [],
  511. tableData4: [],
  512. tableData42: [],
  513. tableData5: [],
  514. pageIndex: 1,
  515. pageSize: 100,
  516. total_main: 0,
  517. pageIndex_dep: 1,
  518. pageSize_dep: 100,
  519. total_dep: 0,
  520. pageIndex4: 1,
  521. pageSize4: 100,
  522. pageIndex42: 1,
  523. pageSize42: 100,
  524. total4: 0,
  525. total42: 0,
  526. scale: "",
  527. allFacility: [],
  528. scaleId: null,
  529. inputLoading: false,
  530. values: "",
  531. saveAnaly: {},
  532. timeId: null,
  533. icoreFilterFlag: true,
  534. heightTop: 0,
  535. activeMenu: "",
  536. dialog: {
  537. show: false,
  538. form: {
  539. data: {
  540. sampleNo: "",
  541. matName: "",
  542. },
  543. tableData: [],
  544. rules: {
  545. sampleNo: [
  546. { required: true, message: "该项不能为空", trigger: "blur" },
  547. ],
  548. matName: [
  549. { require: true, message: "物料名称不能为空!", trigger: "blur" },
  550. ],
  551. },
  552. },
  553. },
  554. dialog2: {
  555. show: false,
  556. form: {
  557. data: {
  558. sampleNum: "6", // 标准点数量
  559. yuansu: "",
  560. },
  561. rules: {
  562. sampleNum: [
  563. { required: true, message: "该项不能为空", trigger: "blur" },
  564. ],
  565. },
  566. },
  567. },
  568. };
  569. },
  570. created() {
  571. this.theight1 =
  572. window.innerHeight - 185 < 249 ? 249 : window.innerHeight - 230;
  573. this.theight2 =
  574. window.innerHeight - 185 < 249 ? 249 : window.innerHeight - 230;
  575. this.theight3 =
  576. window.innerHeight - 230 < 249 ? 249 : window.innerHeight - 230;
  577. this.theight4 =
  578. window.innerHeight - 140 < 249 ? 249 : window.innerHeight - 140;
  579. this.heightTop =
  580. window.innerHeight / 2 - 130 < 249 ? 249 : window.innerHeight / 2 - 130;
  581. let timestamp = new Date().getTime() - 7 * 24 * 60 * 60 * 1000; // 默认前一周
  582. this.fromDaiban = JSON.parse(sessionStorage.getItem("fromDaiban"));
  583. sessionStorage.removeItem("fromDaiban");
  584. if (this.fromDaiban) {
  585. this.searchForm.times = [
  586. this.fromDaiban.startTime,
  587. this.fromDaiban.endTime,
  588. ];
  589. this.activeName = this.fromDaiban.status == 1 ? "second" : "first";
  590. } else {
  591. this.searchForm.times = [
  592. this.getYNM(new Date(timestamp)),
  593. this.getYNM(new Date()),
  594. ];
  595. // this.searchForm.times = [
  596. // this.getYNM(new Date(timestamp)) + " 00:00:00",
  597. // this.getYNM(new Date()) + " 23:59:59",
  598. // ];
  599. }
  600. this.activeMenu = window.top.localStorage.getItem("activeMenu");
  601. this.axios
  602. .post(
  603. "pass/baseManagement/v1/sysorgs/querySysOrgCompanyAll",
  604. {},
  605. { individualType: "json" }
  606. )
  607. .then((response) => {
  608. this.companyNameType = response.data;
  609. this.getCompany();
  610. });
  611. },
  612. watch: {
  613. "$route.query.type"(newType) {
  614. this.searchForm.type = newType || '';
  615. }
  616. },
  617. mounted() {
  618. console.log('2mounted.....',this.$route.query.type)
  619. this.searchForm.type=this.$route.query.type||'';
  620. console.log('1mounted.....',this.searchForm.type)
  621. this.axios
  622. .post(
  623. "pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",
  624. //
  625. { validFlag: 1, baseCode: 4801},
  626. { individualType: "json" }
  627. )
  628. .then((res) => {
  629. this.sampleTypeNameType = res.data;
  630. });
  631. this.axios
  632. .post(
  633. "pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",
  634. { validFlag: 1, baseCode: 4808},
  635. { individualType: "json"}
  636. )
  637. .then((res) => {
  638. this.facilityType = res.data;
  639. });
  640. this.axios
  641. .get(
  642. "pass/baseManagement/v1/limslrceqpinfos/like/" +
  643. "?pageNum=1" +
  644. "&pageSize=9999" +
  645. "&eqpTypeName=" +
  646. "" +
  647. "&stateFlag=" +
  648. ""
  649. // "&sectionName="+this.searchForm.type
  650. )
  651. .then((res) => {
  652. this.allFacility = res.data.list;
  653. });
  654. // 设备信息
  655. this.axios
  656. .post("pass/baseManagement/v1/limslrceqpinfos/queryAll", {
  657. individualType: "json",
  658. })
  659. .then((res) => {
  660. this.matNameType = res.data;
  661. });
  662. this.searchData();
  663. },
  664. methods: {
  665. getYNM(date) {
  666. let year = date.getFullYear().toString();
  667. let month = date.getMonth() + 1;
  668. let day = date.getDate();
  669. month = month < 10 ? "0" + month : month;
  670. day = day < 10 ? "0" + day : day;
  671. return `${year}-${month}-${day}`;
  672. },
  673. refresh() {
  674. this.searchAnalyze(this.analyzeVal, true);
  675. },
  676. refresh2() {
  677. this.searchData();
  678. },
  679. refresh3() {
  680. // console.log('批量采集执行完毕');
  681. },
  682. getSummaries2(param) {
  683. const { columns, data } = param;
  684. const sums = [];
  685. columns.forEach((column, index) => {
  686. if (index === 0) {
  687. sums[index] = "总计";
  688. }
  689. if (index === 1) {
  690. sums[index] = data.length;
  691. } else if (column.property === "quantity") {
  692. let val = 0;
  693. for (let i in data) {
  694. val = this.floatComputed(
  695. data[i].quantity ? data[i].quantity : 0,
  696. val,
  697. "+"
  698. );
  699. }
  700. sums[index] = val;
  701. }
  702. });
  703. return sums;
  704. },
  705. recall() {
  706. if (this.selectRecall.length < 1) {
  707. this.$message.warning("请勾选需要撤回的数据!");
  708. return;
  709. }
  710. let tempIds = this.selectRecall.map((item) => item.stIdD);
  711. this.deleteLoading = true;
  712. let obj = {
  713. id: tempIds,
  714. validFlag: "1",
  715. };
  716. this.axios
  717. .post("pass/testManagement/v1/limssampletestds/delete", obj, {
  718. individualType: "json",
  719. })
  720. .then((res) => {
  721. if (res.code == 0 || res.code == 200) {
  722. this.$message.success(res.message);
  723. this.searchAnalyze(this.analyzeVal, true);
  724. } else {
  725. this.$message.error(res.message);
  726. }
  727. this.deleteLoading = false;
  728. this.recallShow = !this.recallShow;
  729. })
  730. .catch((e) => {
  731. this.deleteLoading = false;
  732. this.$message.error(e.message);
  733. });
  734. },
  735. addAnaly() {
  736. if (JSON.stringify(this.analyzeVal) == "{}") {
  737. this.$message.warning("请选择一条需要新增的主数据!");
  738. return;
  739. }
  740. if (this.analyzeVal.stateFlag == 3) {
  741. this.$message.warning(
  742. "选中的已接收数据为已提交的数据,不能进行新增!,请选择状态为未处理的数据进行操作"
  743. );
  744. return;
  745. }
  746. this.showFlag = !this.showFlag;
  747. this.Params = this.analyzeVal;
  748. },
  749. clickRow(val) {
  750. this.saveAnaly = val;
  751. },
  752. //删除分析项目
  753. deleteData() {
  754. if (this.selectMul.length < 1) {
  755. this.$message.warning("请勾选需要删除的数据!");
  756. return;
  757. }
  758. if (this.analyzeVal.stateFlag == 3) {
  759. this.$message.warning(
  760. "选中的已接收数据为已提交的数据,不能进行删除!,请选择状态为未处理的数据进行操作"
  761. );
  762. return;
  763. }
  764. let tempIds = this.selectMul.map((item) => item.stIdD);
  765. this.deleteLoading = true;
  766. let obj = {
  767. id: tempIds,
  768. validFlag: "0",
  769. };
  770. this.axios
  771. .post("pass/testManagement/v1/limssampletestds/delete", obj, {
  772. individualType: "json",
  773. })
  774. .then((res) => {
  775. if (res.code == 0 || res.code == 200) {
  776. this.$message.success(res.message);
  777. this.searchAnalyze(this.analyzeVal, true);
  778. } else {
  779. this.$message.error(res.message);
  780. }
  781. this.deleteLoading = false;
  782. })
  783. .catch((e) => {
  784. this.deleteLoading = false;
  785. this.$message.error(e.message);
  786. });
  787. },
  788. selectAuto(val) {
  789. this.autoEqpType = [];
  790. this.scale = "";
  791. this.autoCollData.eqpNo = "";
  792. if (!val) {
  793. return;
  794. }
  795. this.axios
  796. .post(
  797. "pass/baseManagement/v1/limslrceqpinfos/queryeqpName",
  798. { eqpTypeCode: val },
  799. { individualType: "json" }
  800. )
  801. .then((res) => {
  802. this.autoEqpType = res.data;
  803. });
  804. },
  805. resetData() {
  806. this.searchForm.matName = "";
  807. this.searchForm.sampleTypeCode = "";
  808. this.searchForm.eqpNo = "";
  809. let timestamp = new Date().getTime() - 7 * 24 * 60 * 60 * 1000; // 默认前一周
  810. this.searchForm.times = [
  811. this.getYNM(new Date(timestamp)),
  812. this.getYNM(new Date()),
  813. ];
  814. // this.searchForm.times = [
  815. // this.getYNM(new Date(timestamp)) + " 00:00:00",
  816. // this.getYNM(new Date()) + " 23:59:59",
  817. // ];
  818. this.searchData();
  819. },
  820. SelectionValues(val) {
  821. this.selectVal = val;
  822. },
  823. // 已提交、无效数据,多选
  824. SelectionValues4(val) {
  825. this.selectVal4 = val;
  826. },
  827. SelectionValues42(val) {
  828. this.selectVal42 = val;
  829. },
  830. selectMultiples(val) {
  831. this.selectMul = val;
  832. this.selectRecall = val;
  833. },
  834. //点击选中样品信息数据
  835. searchFollow(val) {
  836. this.saveMainData = val;
  837. },
  838. //获取选中已接任务数据
  839. handleCurrentChange(val) {
  840. this.selectLine = val;
  841. },
  842. //撤回已提交数据
  843. backWithdraw() {
  844. if (this.selectVal4.length < 1) {
  845. this.$message.warning("请先勾选您要撤回的数据");
  846. return;
  847. }
  848. for (let item of this.selectVal4) {
  849. if (item.validFlag == "0") {
  850. this.$message.warning("请选择有效数据");
  851. return;
  852. }
  853. }
  854. this.withdrawLoading = true;
  855. this.axios
  856. .post(
  857. "pass/testManagement/v1/limssampletests/withdraw",
  858. this.selectVal4,
  859. { individualType: "json" }
  860. )
  861. .then((res) => {
  862. if (res.code == 0 || res.code == 200) {
  863. this.$message.success(res.message);
  864. this.searchData();
  865. } else {
  866. this.$message.error(res.message);
  867. }
  868. this.withdrawLoading = false;
  869. })
  870. .catch((err) => {
  871. this.withdrawLoading = false;
  872. this.$message.error(err.message);
  873. });
  874. },
  875. //打开批量审核窗口
  876. showBatch() {
  877. if (this.saveMainData.length < 1) {
  878. this.$message.warning("请勾选测试项目的数据");
  879. return;
  880. }
  881. let temp = [];
  882. this.saveMainData.map((item) => {
  883. temp.push(item.stId);
  884. });
  885. this.batchDataLoading = true;
  886. this.axios
  887. .post("pass/testManagement/v1/limssampletestds/transData", temp, {
  888. individualType: "json",
  889. })
  890. .then((res) => {
  891. if (res.code == 0 || res.code == 200) {
  892. if (res.data.badyData.length > 0) {
  893. // 增加第一行用于批量修改
  894. let obj = Object.assign({}, res.data.badyData[0]);
  895. for (let key in obj) {
  896. obj[key] = "";
  897. }
  898. let arr = res.data.badyData;
  899. arr.splice(0, 0, obj);
  900. this.cols = res.data.head;
  901. this.tableData = arr;
  902. this.testTable = res.data.headBabyData;
  903. }
  904. this.batchShow = true;
  905. this.$nextTick(() => {
  906. this.$refs["tablePllr"].bodyWrapper.scrollTop = 0;
  907. });
  908. } else {
  909. this.$message.error(res.message);
  910. }
  911. this.batchDataLoading = false;
  912. })
  913. .catch((e) => {
  914. this.batchDataLoading = false;
  915. this.$message.error(e.message);
  916. });
  917. },
  918. // 批量审核删除数据(前端删除)
  919. delData(row, index) {
  920. let that = this;
  921. // console.log(row, index)
  922. that.tableData.splice(index, 1);
  923. that.testTable.splice(index - 1, 1);
  924. let srow = that.saveMainData[index - 1];
  925. that.saveMainData.splice(index - 1, 1);
  926. that.$refs.table2.toggleRowSelection(srow, false);
  927. },
  928. // 批量审核
  929. batchAudit() {
  930. let tempData = [];
  931. this.saveMainData.map((item) => {
  932. tempData.push(item.stId);
  933. });
  934. this.batchLoading = true;
  935. this.axios
  936. .post("pass/testManagement/v1/limssampletests/firstAudit", tempData, {
  937. individualType: "json",
  938. })
  939. .then((res) => {
  940. if (res.code == 0 || res.code == 200) {
  941. this.$message.success("批量审核成功!");
  942. this.batchShow = false;
  943. this.searchData();
  944. } else {
  945. this.$message.error(res.message);
  946. }
  947. this.batchLoading = false;
  948. })
  949. .catch((err) => {
  950. this.batchLoading = false;
  951. this.$message.error(err.message);
  952. });
  953. },
  954. //审核
  955. audit() {
  956. if (this.saveMainData.length < 1) {
  957. this.$message.warning("请先勾选您要审核的数据!");
  958. return;
  959. }
  960. this.sampleLoading = true;
  961. let ids = [];
  962. this.saveMainData.forEach((item) => {
  963. ids.push(item.id);
  964. });
  965. this.axios
  966. .post("pass/testManagement/v1/limssampletests/firstAudit", ids, {
  967. individualType: "json",
  968. })
  969. .then((res) => {
  970. if (res.code == 0 || res.code == 200) {
  971. this.$message.success(res.message);
  972. this.searchData();
  973. } else {
  974. this.$message.error(res.message);
  975. }
  976. this.sampleLoading = false;
  977. })
  978. .catch((err) => {
  979. this.sampleLoading = false;
  980. this.$message.error(err.message);
  981. });
  982. },
  983. // 显示撤回已审核操作的数据
  984. showBackAuditData() {
  985. if (this.selectVal.length < 1) {
  986. this.$message.warning("请先勾选您要退回的数据!");
  987. return;
  988. }
  989. this.backLoading = true;
  990. this.selectVal.forEach((item) => {
  991. item.logMemo = "";
  992. this.dialog.form.tableData.push(item);
  993. });
  994. this.dialog.show = true;
  995. this.backLoading = false;
  996. this.tableType = 1;
  997. },
  998. // 显示审批不通过的数据
  999. showBackData() {
  1000. if (this.saveMainData.length < 1) {
  1001. this.$message.warning("请先勾选您要退回的数据!");
  1002. return;
  1003. }
  1004. this.backAuditLoading = true;
  1005. this.saveMainData.forEach((item) => {
  1006. item.logMemo = "";
  1007. this.dialog.form.tableData.push(item);
  1008. });
  1009. this.dialog.show = true;
  1010. this.backAuditLoading = false;
  1011. this.tableType = 0;
  1012. },
  1013. backAudit() {
  1014. let bool = false;
  1015. this.dialog.form.tableData.forEach((ss) => {
  1016. if (ss.logMemo == "" || ss.logMemo == null) {
  1017. bool = true;
  1018. }
  1019. });
  1020. if (bool) {
  1021. this.$message.warning("请输入退回原因!");
  1022. return;
  1023. }
  1024. this.backAuditLoading = true;
  1025. this.axios
  1026. .post(
  1027. "pass/testManagement/v1/limssampletests/backAuditData",
  1028. this.dialog.form.tableData,
  1029. { individualType: "json" }
  1030. )
  1031. .then((res) => {
  1032. if (res.code == 0 || res.code == 200) {
  1033. this.$message.success(res.message);
  1034. this.closeBack();
  1035. this.searchData();
  1036. } else {
  1037. this.$message.error(res.message);
  1038. }
  1039. this.backAuditLoading = false;
  1040. })
  1041. .catch((err) => {
  1042. this.backAuditLoading = false;
  1043. this.$message.error(err.message);
  1044. });
  1045. },
  1046. // 撤回已审核
  1047. back() {
  1048. if (this.dialog.form.tableData.length < 1) {
  1049. this.$message.warning("请先勾选您要退回的数据!");
  1050. return;
  1051. }
  1052. let bool = false;
  1053. this.dialog.form.tableData.forEach((ss) => {
  1054. if (ss.logMemo == "" || ss.logMemo == null) {
  1055. bool = true;
  1056. }
  1057. });
  1058. if (bool) {
  1059. this.$message.warning("请输入退回原因!");
  1060. return;
  1061. }
  1062. this.backLoading = true;
  1063. this.backAuditLoading = true;
  1064. this.axios
  1065. .post(
  1066. "pass/testManagement/v1/limssampletests/firstBack",
  1067. this.dialog.form.tableData,
  1068. { individualType: "json" }
  1069. )
  1070. .then((res) => {
  1071. if (res.code == 0 || res.code == 200) {
  1072. this.$message.success(res.message);
  1073. this.closeBack();
  1074. this.searchData();
  1075. } else {
  1076. this.$message.error(res.message);
  1077. }
  1078. this.backLoading = false;
  1079. this.backAuditLoading = false;
  1080. })
  1081. .catch((err) => {
  1082. this.backLoading = false;
  1083. this.backAuditLoading = false;
  1084. this.$message.error(err.message);
  1085. });
  1086. },
  1087. autoSubmit(val) {
  1088. if (!this.values) {
  1089. this.$message.warning("请先用扫码枪扫描标签");
  1090. return;
  1091. }
  1092. if (!this.timeId) {
  1093. this.timeId = setTimeout(() => {
  1094. this.inputLoading = true;
  1095. this.axios
  1096. .post(
  1097. "pass/testManagement/v1/limssampletests/pickUpSampleScan?tkId=" +
  1098. this.values,
  1099. { individualType: "json" }
  1100. )
  1101. .then((res) => {
  1102. if (res.code == 0 || res.code == 200) {
  1103. this.$message.success(res.message);
  1104. this.searchData();
  1105. } else {
  1106. this.$message.error(res.message);
  1107. }
  1108. this.$nextTick(() => {
  1109. this.$refs.autoInput.focus();
  1110. });
  1111. this.values = "";
  1112. this.inputLoading = false;
  1113. })
  1114. .catch((e) => {
  1115. this.$nextTick(() => {
  1116. this.$refs.autoInput.focus();
  1117. });
  1118. this.values = "";
  1119. this.inputLoading = false;
  1120. })
  1121. .catch((e) => {
  1122. this.$nextTick(() => {
  1123. this.$refs.autoInput.focus();
  1124. });
  1125. this.values = "";
  1126. this.inputLoading = false;
  1127. this.$message.error(e.message);
  1128. });
  1129. this.timeId = null;
  1130. }, 1000);
  1131. }
  1132. },
  1133. autoScale(val) {
  1134. if (!this.scale) {
  1135. this.$message.warning("请先用扫码枪扫描二维码");
  1136. return;
  1137. }
  1138. if (!this.scaleId) {
  1139. this.scaleId = setTimeout(() => {
  1140. this.autoCollData.eqpTypeCode = "";
  1141. this.autoEqpType = this.allFacility;
  1142. this.autoCollData.eqpNo = this.scale;
  1143. this.scaleId = null;
  1144. }, 1000);
  1145. }
  1146. },
  1147. //扫码接样
  1148. changeval() {
  1149. if (!this.values) {
  1150. this.$message.warning("请先用扫码枪扫描标签");
  1151. return;
  1152. }
  1153. this.inputLoading = true;
  1154. this.axios
  1155. .post(
  1156. "pass/testManagement/v1/limssampletests/pickUpSampleScan?tkId=" +
  1157. this.values,
  1158. { individualType: "json" }
  1159. )
  1160. .then((res) => {
  1161. if (res.code == 0 || res.code == 200) {
  1162. this.values = "";
  1163. this.$message.success(res.message);
  1164. this.searchData();
  1165. } else {
  1166. this.$message.error(res.message);
  1167. }
  1168. this.inputLoading = false;
  1169. })
  1170. .catch((e) => {
  1171. this.inputLoading = false;
  1172. this.$message.error(e.message);
  1173. });
  1174. },
  1175. stopall() {
  1176. if (this.interval != null) {
  1177. clearInterval(this.interval);
  1178. }
  1179. this.autoColletLoading = false;
  1180. },
  1181. changeIsOneHint(val) {
  1182. this.isOneHint = val;
  1183. },
  1184. realTimeCollect(val) {
  1185. if (val && this.tableData3.length <= 0) {
  1186. this.$message.warning("测试分析项目不能为空");
  1187. this.stopall();
  1188. return;
  1189. }
  1190. if (val && this.autoCollData.eqpNo && this.autoCollData.eqpTypeCode) {
  1191. } else {
  1192. this.$message.warning("请选择【设备类型】【设备名称】,不能为空");
  1193. this.stopall();
  1194. // this.checked = false
  1195. return;
  1196. }
  1197. },
  1198. startTime(tableLength, openOff, times) {
  1199. let that = this;
  1200. var timesRun = 0;
  1201. that.interval = setInterval(function () {
  1202. timesRun += 1;
  1203. if (!openOff) {
  1204. clearInterval(that.interval);
  1205. }
  1206. if (!tableLength) {
  1207. clearInterval(that.interval);
  1208. }
  1209. if (timesRun > tableLength) {
  1210. clearInterval(that.interval);
  1211. }
  1212. that.autoCollet();
  1213. }, times);
  1214. },
  1215. getCompany() {
  1216. this.axios
  1217. .get("pass/baseManagement/v1/limslrcemps/" + userId)
  1218. .then((res) => {
  1219. if (res.code == 0 || res.code == 200) {
  1220. this.userdeptNo = res.data ? res.data.deptNo : "";
  1221. this.usersectionNo = res.data ? res.data.sectionNo : "";
  1222. this.userjobs = res.data ? res.data.postNo : "";
  1223. } else {
  1224. this.$message.error(e.message);
  1225. }
  1226. })
  1227. .catch((e) => {
  1228. this.$message.error(e.message);
  1229. });
  1230. },
  1231. closebatch() {
  1232. this.batchShow = false;
  1233. this.batchLoading = false;
  1234. this.recallShow = false;
  1235. this.cols = [];
  1236. this.tableData = [];
  1237. this.testTable = [];
  1238. },
  1239. closeBack() {
  1240. this.dialog.show = false;
  1241. this.addByShow = false;
  1242. this.dialog.form.data.sampleNo = "";
  1243. this.dialog.form.tableData = [];
  1244. },
  1245. inputData(val, index, prop) {
  1246. let that = this;
  1247. // 修改第一行数据,联动修改同列其他行数据
  1248. if (index == 0 && that.tableData.length > 1) {
  1249. for (let i = 1; i < that.tableData.length; i++) {
  1250. that.tableData[i][prop] = val;
  1251. }
  1252. }
  1253. },
  1254. //保存
  1255. saveData() {
  1256. if (this.tableData3.length < 1) {
  1257. this.$message.warning("表格中无数据,无法进行保存");
  1258. return;
  1259. }
  1260. if (this.analyzeVal.stateFlag == 3) {
  1261. this.$message.warning(
  1262. "已提交的数据不能进行保存,请选择状态为未处理的数据进行操作"
  1263. );
  1264. return;
  1265. }
  1266. if (this.analyzeVal.validFlag == "0") {
  1267. this.$message.warning("停用的数据不能进行保存");
  1268. return;
  1269. }
  1270. this.saveLoading = true;
  1271. this.axios
  1272. .post(
  1273. "pass/testManagement/v1/limssampletestds/testAnalysisUpdateLimsSampleTestDList",
  1274. this.tableData3,
  1275. { individualType: "json" }
  1276. )
  1277. .then((res) => {
  1278. if (res.code == 0 || res.code == 200) {
  1279. this.$message.success(res.message);
  1280. this.searchAnalyze(this.analyzeVal, true);
  1281. // this.searchData()
  1282. } else {
  1283. this.$message.error(res.message);
  1284. }
  1285. this.saveLoading = false;
  1286. })
  1287. .catch((err) => {
  1288. this.saveLoading = false;
  1289. this.$message.error(err.message);
  1290. });
  1291. },
  1292. //查询操作
  1293. searchData() {
  1294. this.pageIndex4 = 1;
  1295. this.pageSize4 = 500;
  1296. this.pageIndex42 = 1;
  1297. this.pageSize42 = 500;
  1298. this.tableData3 = [];
  1299. this.Data4(); // 未审核数据
  1300. this.Data5(); // 已审核数据
  1301. },
  1302. // 未审核
  1303. Data4() {
  1304. let startTime = null;
  1305. let endTime = null;
  1306. startTime = this.searchForm.times[0] === null ? null : (this.searchForm.times[0] + ' 00:00:00')
  1307. endTime = this.searchForm.times[1] === null ? null : (this.searchForm.times[1] + ' 23:59:59')
  1308. // let startTime = "";
  1309. // let endTime = "";
  1310. // if (!this.searchForm.times) {
  1311. // startTime = "";
  1312. // endTime = "";
  1313. // } else {
  1314. // startTime = this.searchForm.times[0];
  1315. // endTime = this.searchForm.times[1];
  1316. // }
  1317. let obj = {
  1318. object: {
  1319. matName: this.searchForm.matName,
  1320. sampleTypeCode: this.searchForm.sampleTypeCode,
  1321. },
  1322. list: [3],
  1323. list2: [484003], // 测试分析模块
  1324. pageSize: this.pageSize4,
  1325. pageIndex: this.pageIndex4,
  1326. startTime: startTime,
  1327. endTime: endTime,
  1328. deptName:this.searchForm.type
  1329. };
  1330. this.tableLoading4 = true;
  1331. this.axios
  1332. .post(
  1333. "pass/testManagement/v1/limssampletests/queryLimsSampleTestPage",
  1334. obj,
  1335. { individualType: "json" }
  1336. )
  1337. .then((res) => {
  1338. if (res.code == 0 || res.code == 200) {
  1339. this.tableData4 = res.data.list;
  1340. this.total4 = res.data.total;
  1341. this.tableData4.forEach((item) => {
  1342. item.state =
  1343. item.validFlag == 0
  1344. ? "无效"
  1345. : item.validFlag == 1
  1346. ? item.stateFlag === "3"
  1347. ? "待审核"
  1348. : "未知"
  1349. : "无效";
  1350. });
  1351. } else {
  1352. this.$message.error(res.message);
  1353. }
  1354. this.tableLoading4 = false;
  1355. })
  1356. .catch((err) => {
  1357. this.tableLoading4 = false;
  1358. this.$message.error(err.message);
  1359. });
  1360. },
  1361. dialogDeleteData(row, index) {
  1362. row.glMatName = "";
  1363. row.glSampleNo = "";
  1364. row.glCount = 1;
  1365. this.dialog.form.tableData.splice(index, 1);
  1366. this.glDialog.totalPage = this.glDialog.totalPage - 1;
  1367. },
  1368. Data5() {
  1369. let startTime = null;
  1370. let endTime = null;
  1371. startTime = this.searchForm.times[0] === null ? null : (this.searchForm.times[0] + ' 00:00:00')
  1372. endTime = this.searchForm.times[1] === null ? null : (this.searchForm.times[1] + ' 23:59:59')
  1373. // let startTime = "";
  1374. // let endTime = "";
  1375. // if (!this.searchForm.times) {
  1376. // startTime = "";
  1377. // endTime = "";
  1378. // } else {
  1379. // startTime = this.searchForm.times[0];
  1380. // endTime = this.searchForm.times[1];
  1381. // }
  1382. let obj = {
  1383. object: {
  1384. matName: this.searchForm.matName,
  1385. sampleTypeCode: this.searchForm.sampleTypeCode,
  1386. },
  1387. list: [4], // 查询已审
  1388. list2: [484003], // 测试分析模块
  1389. pageSize: this.pageSize42,
  1390. pageIndex: this.pageIndex42,
  1391. startTime: startTime,
  1392. endTime: endTime,
  1393. // sectionName:this.searchForm.sectionName
  1394. deptName:this.searchForm.type
  1395. };
  1396. this.tableLoading42 = true;
  1397. this.axios
  1398. .post(
  1399. "pass/testManagement/v1/limssampletests/queryLimsSampleTestPage",
  1400. obj,
  1401. { individualType: "json" }
  1402. )
  1403. .then((res) => {
  1404. if (res.code == 0 || res.code == 200) {
  1405. this.tableData42 = res.data.list;
  1406. this.total42 = res.data.total;
  1407. this.tableData42.forEach((item) => {
  1408. item.state =
  1409. item.validFlag == 0
  1410. ? "无效"
  1411. : item.validFlag == 1
  1412. ? item.stateFlag === "4"
  1413. ? "已审核"
  1414. : "未知"
  1415. : "无效";
  1416. });
  1417. this.tableLoading42 = false;
  1418. } else {
  1419. this.$message.error(res.message);
  1420. this.tableLoading42 = false;
  1421. }
  1422. })
  1423. .catch((err) => {
  1424. this.tableLoading42 = false;
  1425. this.$message.error(err.message);
  1426. });
  1427. },
  1428. searchResultD(row) {
  1429. //保存点击的样品信息数据,保存、提交操作时刷新
  1430. this.tableLoading3 = true;
  1431. this.axios
  1432. .post(
  1433. "pass/testManagement/v1/limssampleresultds/queryLimsSampleResultDList?srId=" +
  1434. row.SR_ID
  1435. )
  1436. .then((res) => {
  1437. if (res.code == 0 || res.code == 200) {
  1438. this.tableData3 = res.data;
  1439. this.tableData3.forEach((item) => {
  1440. item.isReportName =
  1441. item.isReport == 0 ? "否" : item.isReport == 1 ? "是" : "";
  1442. item.isAlarmName =
  1443. item.isAlarm == 0 ? "否" : item.isAlarm == 1 ? "是" : "";
  1444. });
  1445. } else {
  1446. this.$message.error(res.message);
  1447. }
  1448. this.tableLoading3 = false;
  1449. })
  1450. .catch((err) => {
  1451. this.tableLoading3 = false;
  1452. this.$message.error(err.message);
  1453. });
  1454. },
  1455. //点击测试项目,查询分析项目
  1456. searchAnalyze(row, notColl) {
  1457. //保存点击的样品信息数据,保存、提交操作时刷新
  1458. this.saveAnaly = {};
  1459. this.analyzeVal = row;
  1460. this.tableLoading3 = true;
  1461. this.axios
  1462. .post(
  1463. "pass/testManagement/v1/limssampletestds/queryLimsSampleTestDList?stId=" +
  1464. this.analyzeVal.id
  1465. )
  1466. .then((res) => {
  1467. if (res.code == 0 || res.code == 200) {
  1468. this.tableData3 = res.data;
  1469. this.tableData3.forEach((item) => {
  1470. item.isReportName =
  1471. item.isReport == 0 ? "否" : item.isReport == 1 ? "是" : "";
  1472. item.isAlarmName =
  1473. item.isAlarm == 0 ? "否" : item.isAlarm == 1 ? "是" : "";
  1474. });
  1475. } else {
  1476. this.$message.error(res.message);
  1477. }
  1478. this.tableLoading3 = false;
  1479. })
  1480. .catch((err) => {
  1481. this.tableLoading3 = false;
  1482. this.$message.error(err.message);
  1483. });
  1484. },
  1485. showHistory(row) {
  1486. if (!row) {
  1487. return this.$message.warning("查询历史记录失败,参数错误!");
  1488. }
  1489. this.axios
  1490. .post(
  1491. "pass/testManagement/v1/limssamplehistorys/queryHistoryTest",
  1492. row,
  1493. { individualType: "json" }
  1494. )
  1495. .then((res) => {
  1496. if (res.code == 0 || res.code == 200) {
  1497. //打开窗口
  1498. this.historyShowFlag = !this.historyShowFlag;
  1499. this.Params = Object.assign([{}], res.data);
  1500. } else {
  1501. this.$message.warning("查询历史记录失败!");
  1502. }
  1503. })
  1504. .catch((e) => {
  1505. this.$message.error(e.message);
  1506. });
  1507. },
  1508. //表格数据右移
  1509. rightData2(row) {
  1510. //新增的数据清空id
  1511. row.cretNoD = "";
  1512. this.table.addTest.push(row);
  1513. },
  1514. showCell(row) {
  1515. this.tabClickIndex = row.index;
  1516. },
  1517. saveCell(row) {
  1518. this.tabClickIndex = null;
  1519. },
  1520. tableRowName({ row, rowIndex }) {
  1521. row.index = rowIndex;
  1522. if (row.state === "无效") {
  1523. return "error-row";
  1524. } else {
  1525. return "error-green";
  1526. }
  1527. },
  1528. handleSizeChangeMain(pageSize) {
  1529. this.pageIndex4 = 1;
  1530. this.pageSize4 = pageSize;
  1531. this.Data4();
  1532. },
  1533. handleSizeChangeDep(pageSize) {
  1534. this.pageIndex42 = 1;
  1535. this.pageSize42 = pageSize;
  1536. this.Data5();
  1537. },
  1538. handleSizeChange4(pageSize) {
  1539. this.pageIndex4 = 1;
  1540. this.pageSize4 = pageSize;
  1541. this.Data4();
  1542. },
  1543. handleSizeChange5(pageSize) {
  1544. this.pageIndex42 = 1;
  1545. this.pageSize42 = pageSize;
  1546. this.Data5();
  1547. },
  1548. glDialogSizeTest(size) {
  1549. this.glDialog.pageSize = size;
  1550. },
  1551. glDialogPageChangeTest(index) {
  1552. this.glDialog.pageNum = index;
  1553. },
  1554. SizeTest(size) {
  1555. this.pageTests.pageSize = size;
  1556. this.getDataListTest2();
  1557. },
  1558. pageChangeTest(index) {
  1559. this.pageTests.pageNum = index;
  1560. this.getDataListTest2();
  1561. },
  1562. tableRowClassName0({ row, rowIndex }) {
  1563. if (row.state === "无效") {
  1564. return "error-row";
  1565. } else if (row.state === "未知") {
  1566. return "error-green";
  1567. }
  1568. return "";
  1569. },
  1570. cellClassName({ row, column, rowIndex, columnIndex }) {
  1571. if (columnIndex === 2) {
  1572. if (row.state === "已审核") {
  1573. return "error-green";
  1574. }
  1575. return "";
  1576. }
  1577. },
  1578. tableRowClassName({ row, column, rowIndex, columnIndex }) {
  1579. if (columnIndex === 2) {
  1580. if (row.yearMonth === "1") {
  1581. return "error-row";
  1582. }
  1583. }
  1584. if (row.STATE === "无效") {
  1585. return "error-row";
  1586. } else if (row.STATE === "未知") {
  1587. return "error-green";
  1588. }
  1589. return "";
  1590. },
  1591. tableRowBatch({ row, column, rowIndex, columnIndex }) { },
  1592. fxTableRowClassName({ row, column, rowIndex, columnIndex }) {
  1593. if (columnIndex === 3) {
  1594. //最大符号与最小符号必须同时存在,最大值与最小值必须有一项要有值,否则直接return不进入判断
  1595. if (row.maxSign && row.minSign && (row.maxValue || row.minValue)) {
  1596. if (row.maxSign == "<=" && row.minSign == ">=") {
  1597. if (
  1598. Number(row.anlyValue) <=
  1599. Number(row.maxValue ? row.maxValue : Infinity) &&
  1600. Number(row.anlyValue) >= Number(row.minValue ? row.minValue : 0)
  1601. ) {
  1602. return "error-green";
  1603. } else {
  1604. return "error-row";
  1605. }
  1606. }
  1607. if (row.maxSign == "<=" && row.minSign == ">") {
  1608. if (
  1609. Number(row.anlyValue) <=
  1610. Number(row.maxValue ? row.maxValue : Infinity) &&
  1611. Number(row.anlyValue) > Number(row.minValue ? row.minValue : 0)
  1612. ) {
  1613. return "error-green";
  1614. } else {
  1615. return "error-row";
  1616. }
  1617. }
  1618. if (row.maxSign == "<" && row.minSign == ">=") {
  1619. if (
  1620. Number(row.anlyValue) <
  1621. Number(row.maxValue ? row.maxValue : Infinity) &&
  1622. Number(row.anlyValue) >= Number(row.minValue ? row.minValue : 0)
  1623. ) {
  1624. return "error-green";
  1625. } else {
  1626. return "error-row";
  1627. }
  1628. }
  1629. if (row.maxSign == "<" && row.minSign == ">") {
  1630. if (
  1631. Number(row.anlyValue) <
  1632. Number(row.maxValue ? row.maxValue : Infinity) &&
  1633. Number(row.anlyValue) > Number(row.minValue ? row.minValue : 0)
  1634. ) {
  1635. return "error-green";
  1636. } else {
  1637. return "error-row";
  1638. }
  1639. }
  1640. }
  1641. return "";
  1642. } else if (column.property === "reviseValue") {
  1643. return "error-blue";
  1644. }
  1645. },
  1646. tableHeaderCellStyle() {
  1647. return "background-color: rgb(249,249,249) !important;color: rgb(73, 72, 72);border-bottom: 1px solid #DCDFE7;border-top:3px solid #3ac1ea;";
  1648. },
  1649. selectStyle({ row, column, rowIndex, columnIndex }) {
  1650. if (row.warning) {
  1651. return "row-green";
  1652. }
  1653. },
  1654. },
  1655. };
  1656. </script>
  1657. <style scoped></style>
  1658. <style lang="less">
  1659. .testManagement {
  1660. .buttons {
  1661. .el-button {
  1662. margin: 2px 3px 0 0;
  1663. }
  1664. }
  1665. .textOverflow {
  1666. white-space: nowrap;
  1667. text-overflow: ellipsis;
  1668. overflow: hidden;
  1669. }
  1670. .testManagement_left {
  1671. .el-table .el-table__body tr.error-row {
  1672. background-color: rgb(253, 89, 89) !important;
  1673. }
  1674. .el-table .el-table__body tr.error-row>td {
  1675. background-color: rgb(253, 89, 89) !important;
  1676. }
  1677. .el-table .el-table__body tr.error-green {
  1678. background-color: rgb(202, 249, 130) !important;
  1679. }
  1680. .el-table .el-table__body tr.error-green>td {
  1681. background-color: rgb(202, 249, 130) !important;
  1682. }
  1683. }
  1684. .testManagement-pllr {
  1685. .el-table .el-table__body tr.current-row>td {
  1686. //background-color: rgba(26, 75, 236, 0.2) !important;
  1687. background-color: rgba(64, 158, 255, 0.3) !important;
  1688. }
  1689. }
  1690. }
  1691. </style>