inspectionProudects.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744
  1. <!-- 检验委托-成品 -->
  2. <template>
  3. <div class="examination">
  4. <div class="common-head-search">
  5. <el-form :inline="true">
  6. <el-form-item label="委托单位">
  7. <el-select v-model="search.planCompanyNo" clearable filterable collapse-tags size="small"
  8. style="width: 200px; margin-right: 10px" placeholder="请选择查询内容">
  9. <el-option v-for="item in entrOrgNameType" :key="item.baseName" :label="item.orgName" :value="item.orgCode">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="物料名称">
  14. <el-input v-model="search.matName" size="small" @keyup.enter.native="searchData()" placeholder="请输入查询内容"
  15. style="width: 200px; margin-right: 10px"></el-input>
  16. </el-form-item>
  17. <el-form-item label="批次号">
  18. <el-input v-model="search.batchNo" size="small" @keyup.enter.native="searchData()" placeholder="请输入查询内容"
  19. style="width: 200px; margin-right: 10px"></el-input>
  20. </el-form-item>
  21. <el-form-item label="委托编号">
  22. <el-input v-model="search.carNo" size="small" @keyup.enter.native="searchData()" placeholder="请输入查询内容"
  23. style="width: 200px; margin-right: 10px" clearable></el-input>
  24. </el-form-item>
  25. <el-form-item label="中心编号">
  26. <el-input v-model="search.sampleNo" size="small" @keyup.enter.native="searchData()" placeholder="请输入查询内容"
  27. style="width: 200px; margin-right: 10px" clearable></el-input>
  28. </el-form-item>
  29. <el-form-item label="委托日期">
  30. <el-date-picker v-model="search.times[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  31. placeholder="开始日期" size="mini" style="width: 140px">
  32. </el-date-picker>
  33. <span>至</span>
  34. <el-date-picker v-model="search.times[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  35. placeholder="结束日期" size="mini" style="width: 140px">
  36. </el-date-picker>
  37. <!-- <el-date-picker
  38. v-model="search.times"
  39. type="daterange"
  40. range-separator="至"
  41. start-placeholder="开始日期"
  42. end-placeholder="结束日期"
  43. size="small"
  44. style="width: 300px"
  45. format="yyyy-MM-dd"
  46. value-format="yyyy-MM-dd"
  47. >
  48. </el-date-picker> -->
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
  52. <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
  53. </el-form-item>
  54. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  55. <el-input v-model="values" ref="autoInput" size="mini" style="display: inline-block; width: 150px"
  56. @input="autoSubmit()" placeholder="扫码接收" clearable :disabled="inputLoading"></el-input>
  57. </el-form>
  58. </div>
  59. <el-row>
  60. <el-col :span="14">
  61. <el-tabs v-model="activeName" type="border-card">
  62. <el-tab-pane label="有效委托" name="first">
  63. <div class="common-title-div" style="height: auto; margin-top: -10px">
  64. <div class="common-title-name" style="width: 280px">
  65. <img style="width: 25px; height: 25px" src="../../../../assets/img/imgScreen/logo.png" />
  66. 检验委托信息
  67. </div>
  68. <el-button icon="el-icon-search" style="height: 100%; margin-left: -220px; margin-top: 28px" type="goon"
  69. size="mini" @click="countList">物料统计</el-button>
  70. <div>
  71. <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" v-privilege="activeMenu + 'add'"
  72. @click="addData" style="border: 3px">新增</el-button>
  73. <!-- <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData">修改</el-button> -->
  74. <el-button icon="el-icon-check" type="goon" size="mini" :loading="subLoading"
  75. v-privilege="activeMenu + 'submit'" @click="submitData" style="border: 3px">提交</el-button>
  76. <el-button icon="el-icon-edit" type="goon" size="mini" v-privilege="activeMenu + 'PUT'"
  77. @click="modifyData" style="border: 3px">修改</el-button>
  78. <el-button icon="el-icon-check" type="goon" size="mini" :loading="subLoading8" @click="updateSampleNo"
  79. style="border: 3px">修改委托编号</el-button>
  80. <el-button icon="el-icon-back" type="danger" size="mini" :loading="subLoading"
  81. v-privilege="activeMenu + 'submit'" @click="cancelData" style="margin-top: 2px">取消提交</el-button>
  82. <el-button icon="el-icon-back" type="danger" size="mini" :loading="subLoading"
  83. v-privilege="activeMenu + 'submit'" @click="disable" style="border: 3px">停用</el-button>
  84. <el-button icon="el-icon-download" type="goon" size="mini" :loading="exportFileLoading"
  85. @click="exportFile">导出检测委托书</el-button>
  86. <el-button icon="el-icon-edit-outline" type="goon" size="mini" :loading="false"
  87. @click="showQRCodeInfo">编辑二维码</el-button>
  88. <el-button icon="el-icon-printer" type="goon" size="mini" :loading="printLoading" @click="printQRCode"
  89. style="border: 3px">打印标签</el-button>
  90. </div>
  91. </div>
  92. <div class="common-table-div" style="margin-bottom: 0; margin-top: 0">
  93. <el-table id="excelTable" v-loading="dataLoading" ref="dataTable" border :height="height_top"
  94. highlight-current-row @row-click="saveDataMain" :data="table.list" :icore-filter-flag="icoreFilterFlag"
  95. :header-cell-style="tableHeaderCellStyle" @cell-click="searchFollow" @selection-change="selectRow"
  96. :cell-class-name="tableRowClassName" :summary-method="getSummaries" show-summary>
  97. <el-table-column type="index" label="NO" fixed="left" width="35" align="center"></el-table-column>
  98. <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
  99. <el-table-column sortable :show-overflow-tooltip="true" min-width="60px" prop="stateFlag1" label="状态"
  100. align="center"></el-table-column>
  101. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="carNo" label="委托编号"
  102. align="center">
  103. <template slot-scope="{ row }">
  104. <el-input v-model="row.carNo" size="small" style="width: 100%">
  105. </el-input>
  106. </template>
  107. </el-table-column>
  108. <!-- <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="entrId" label="委托编号" align="center"></el-table-column> -->
  109. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="sampleNo" label="中心编号"
  110. align="center"></el-table-column>
  111. <!-- <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="id" label="编号" align="center"></el-table-column> -->
  112. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="planCompanyName" label="委托单位" align="center"></el-table-column> -->
  113. <el-table-column sortable :show-overflow-tooltip="true" min-width="125px" prop="matName" label="物料名称"
  114. align="center"></el-table-column>
  115. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTime1" label="委托日期"
  116. align="center"></el-table-column>
  117. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
  118. align="center"></el-table-column>
  119. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="planCompanyName"
  120. label="生产单位" align="center"></el-table-column>
  121. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="planDeptName"
  122. label="生产车间" align="center"></el-table-column>
  123. <!-- <el-table-column
  124. sortable
  125. :show-overflow-tooltip="true"
  126. min-width="150px"
  127. prop="batchNo"
  128. label="批次号"
  129. align="center"
  130. >
  131. <template slot-scope="{ row }">
  132. <el-input
  133. v-if="row.stateFlag == '0'"
  134. v-model="row.batchNo"
  135. size="small"
  136. style="width: 100%"
  137. >
  138. </el-input>
  139. <span v-else>{{ row.batchNo }}</span>
  140. </template>
  141. </el-table-column> -->
  142. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="entrTypeName" label="委托类型" align="center"></el-table-column>
  143. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleTypeName" label="样品类型" align="center"></el-table-column>
  144. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="gradeName" label="牌号" align="center"></el-table-column>
  145. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="matClassName" label="物料分类" align="center"></el-table-column> -->
  146. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testTypeName"
  147. label="检验类型" align="center"></el-table-column>
  148. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpDeliName"
  149. label="取样频次" align="center"></el-table-column>
  150. <!-- <el-table-column
  151. sortable
  152. :show-overflow-tooltip="true"
  153. min-width="80px"
  154. prop="gradeName"
  155. label="牌号"
  156. align="center"
  157. ></el-table-column> -->
  158. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="matShapeName"
  159. label="试样形状" align="center"></el-table-column>
  160. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemName" label="分析项目" align="center"></el-table-column> -->
  161. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="companyName"
  162. label="检验单位" align="center"></el-table-column>
  163. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="deptName" label="检验车间"
  164. align="center"></el-table-column>
  165. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="sectionName"
  166. label="检验班组" align="center"></el-table-column>
  167. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpCompanyName"
  168. label="取样单位" align="center"></el-table-column>
  169. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpDeptName"
  170. label="取样车间" align="center"></el-table-column>
  171. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="smpSectionName"
  172. label="取样班组" align="center"></el-table-column>
  173. <!-- <el-table-column
  174. sortable
  175. :show-overflow-tooltip="true"
  176. min-width="100px"
  177. prop="spec"
  178. label="规格"
  179. align="center"
  180. ></el-table-column> -->
  181. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="rollNo" label="轧批号" align="center"></el-table-column> -->
  182. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人"
  183. align="center"></el-table-column>
  184. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  185. align="center"></el-table-column>
  186. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人"
  187. align="center"></el-table-column>
  188. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间"
  189. align="center"></el-table-column>
  190. </el-table>
  191. </div>
  192. <div class="common-foot-style">
  193. <el-pagination @size-change="pageSizeChange" @current-change="pageCurrentChange"
  194. :current-page="page.pageNum" :page-sizes="[100, 200, 500, 800, 1000]" :page-size="page.pageSize"
  195. layout="total, sizes, prev, pager, next, jumper" :total="page.totalPage" background>
  196. </el-pagination>
  197. </div>
  198. </el-tab-pane>
  199. <el-tab-pane label="停用委托" name="first1">
  200. <div class="common-title-div" style="height: auto; margin-top: -10px">
  201. <div class="common-title-name" style="width: 280px">
  202. <img style="width: 25px; height: 25px" src="../../../../assets/img/imgScreen/logo.png" />
  203. 检验委托信息
  204. </div>
  205. <div>
  206. <el-button icon="el-icon-check" type="goon" size="mini" :loading="subLoadingq"
  207. v-privilege="activeMenu + 'submit'" @click="enable" style="border: 3px">启用</el-button>
  208. <el-button icon="el-icon-check" type="goon" size="mini" :loading="subLoadingq"
  209. v-privilege="activeMenu + 'submit'" @click="removeNumber"
  210. style="border: 3px; margin-top: 3px">清除编号</el-button>
  211. </div>
  212. </div>
  213. <div class="common-table-div" style="margin-bottom: 0; margin-top: 0">
  214. <el-table id="invalidTable" v-loading="invalidLoading" ref="dataTable" border :height="height_top"
  215. highlight-current-row @row-click="saveDataMain" :data="table.list1" :icore-filter-flag="icoreFilterFlag"
  216. :header-cell-style="tableHeaderCellStyle" @cell-click="searchFollow" @selection-change="selectRow1"
  217. :cell-class-name="tableRowClassName" :summary-method="getSummaries" show-summary>
  218. <el-table-column type="index" label="NO" fixed="left" width="35" align="center"></el-table-column>
  219. <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
  220. <el-table-column sortable :show-overflow-tooltip="true" min-width="60px" prop="stateFlag1" label="状态"
  221. align="center"></el-table-column>
  222. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="carNo" label="委托编号"
  223. align="center">
  224. <template slot-scope="{ row }">
  225. <el-input v-model="row.carNo" size="small" style="width: 100%">
  226. </el-input>
  227. </template>
  228. </el-table-column>
  229. <!-- <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="entrId" label="委托编号" align="center"></el-table-column> -->
  230. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="sampleNo" label="中心编号"
  231. align="center"></el-table-column>
  232. <!-- <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="id" label="编号" align="center"></el-table-column> -->
  233. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="planCompanyName" label="委托单位" align="center"></el-table-column> -->
  234. <el-table-column sortable :show-overflow-tooltip="true" min-width="125px" prop="matName" label="物料名称"
  235. align="center"></el-table-column>
  236. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTime1" label="委托日期"
  237. align="center"></el-table-column>
  238. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
  239. align="center"></el-table-column>
  240. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="planCompanyName"
  241. label="生产单位" align="center"></el-table-column>
  242. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="planDeptName"
  243. label="生产车间" align="center"></el-table-column>
  244. <!-- <el-table-column
  245. sortable
  246. :show-overflow-tooltip="true"
  247. min-width="150px"
  248. prop="batchNo"
  249. label="批次号"
  250. align="center"
  251. >
  252. <template slot-scope="{ row }">
  253. <el-input
  254. v-if="row.stateFlag == '0'"
  255. v-model="row.batchNo"
  256. size="small"
  257. style="width: 100%"
  258. >
  259. </el-input>
  260. <span v-else>{{ row.batchNo }}</span>
  261. </template>
  262. </el-table-column> -->
  263. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="entrTypeName" label="委托类型" align="center"></el-table-column>
  264. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleTypeName" label="样品类型" align="center"></el-table-column>
  265. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="gradeName" label="牌号" align="center"></el-table-column>
  266. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="matClassName" label="物料分类" align="center"></el-table-column> -->
  267. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testTypeName"
  268. label="检验类型" align="center"></el-table-column>
  269. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpDeliName"
  270. label="取样频次" align="center"></el-table-column>
  271. <!-- <el-table-column
  272. sortable
  273. :show-overflow-tooltip="true"
  274. min-width="80px"
  275. prop="gradeName"
  276. label="牌号"
  277. align="center"
  278. ></el-table-column> -->
  279. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="matShapeName"
  280. label="试样形状" align="center"></el-table-column>
  281. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="anlyItemName" label="分析项目" align="center"></el-table-column> -->
  282. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="companyName"
  283. label="检验单位" align="center"></el-table-column>
  284. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="deptName" label="检验车间"
  285. align="center"></el-table-column>
  286. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="sectionName"
  287. label="检验班组" align="center"></el-table-column>
  288. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpCompanyName"
  289. label="取样单位" align="center"></el-table-column>
  290. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpDeptName"
  291. label="取样车间" align="center"></el-table-column>
  292. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="smpSectionName"
  293. label="取样班组" align="center"></el-table-column>
  294. <!-- <el-table-column
  295. sortable
  296. :show-overflow-tooltip="true"
  297. min-width="100px"
  298. prop="spec"
  299. label="规格"
  300. align="center"
  301. ></el-table-column> -->
  302. <!-- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="rollNo" label="轧批号" align="center"></el-table-column> -->
  303. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人"
  304. align="center"></el-table-column>
  305. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  306. align="center"></el-table-column>
  307. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人"
  308. align="center"></el-table-column>
  309. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间"
  310. align="center"></el-table-column>
  311. </el-table>
  312. </div>
  313. </el-tab-pane>
  314. </el-tabs>
  315. </el-col>
  316. <el-col :span="10">
  317. <el-tabs v-model="activeName2" type="border-card" class="testManagement_left">
  318. <el-tab-pane label="检验项目" name="first">
  319. <div class="common-title-div" style="height: 75px; margin-top: 25px">
  320. <div class="common-title-name">
  321. <img style="width: 25px; height: 25px" src="../../../../assets/img/imgScreen/logo.png" />
  322. 计划检验项目表
  323. </div>
  324. <div>
  325. <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini"
  326. v-privilege="activeMenu + 'addDep'" @click="addData2">新增</el-button>
  327. <el-button icon="el-icon-remove-outline" type="danger" size="mini"
  328. v-privilege="activeMenu + 'deleteDep'" @click="deleteData2">删除</el-button>
  329. </div>
  330. </div>
  331. <div class="common-table-div" style="margin-bottom: 0; margin-top: 0">
  332. <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" @row-click="saveData"
  333. highlight-current-row @selection-change="selectData" :data="table.list2"
  334. :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
  335. :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
  336. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  337. <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
  338. <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="anlyItemNo"
  339. label="分析项目编号" align="center"></el-table-column>
  340. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="anlyItemName"
  341. label="分析项目" align="center"></el-table-column>
  342. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="minSign" label="下限符"
  343. align="center"></el-table-column>
  344. <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="minValue" label="最小值"
  345. align="center"></el-table-column>
  346. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="maxSign" label="上限符"
  347. align="center"></el-table-column>
  348. <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="maxValue" label="最大值"
  349. align="center"></el-table-column>
  350. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo" label="备注"
  351. align="center"></el-table-column>
  352. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="createMan" label="创建人"
  353. align="center"></el-table-column>
  354. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  355. align="center"></el-table-column>
  356. </el-table>
  357. </div>
  358. </el-tab-pane>
  359. <el-tab-pane label="接收电文" name="second">
  360. <div class="common-title-div" style="height: 75px; margin-top: 25px">
  361. <div class="common-title-name">
  362. <img style="width: 25px; height: 25px" src="../../../../assets/img/imgScreen/logo.png" />
  363. 接收电文
  364. </div>
  365. <div></div>
  366. </div>
  367. <div class="common-table-div" style="margin-bottom: 0; margin-top: 0">
  368. <el-table v-loading="dataLoading3" ref="dataTable3" border :height="height_bot" highlight-current-row
  369. :data="table.list3" :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
  370. :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
  371. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  372. <el-table-column sortable :show-overflow-tooltip="true" min-width="400px" prop="msgSource" label="电文内容"
  373. align="center"></el-table-column>
  374. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="createDate" label="创建时间"
  375. align="center"></el-table-column>
  376. </el-table>
  377. </div>
  378. </el-tab-pane>
  379. <el-tab-pane label="发送电文" name="three">
  380. <div class="common-title-div" style="height: 75px; margin-top: 25px">
  381. <div class="common-title-name">
  382. <img style="width: 25px; height: 25px" src="../../../../assets/img/imgScreen/logo.png" />
  383. 发送电文
  384. </div>
  385. <div></div>
  386. </div>
  387. <div class="common-table-div" style="margin-bottom: 0; margin-top: 0">
  388. <el-table v-loading="dataLoading4" ref="dataTable2" border :height="height_bot" highlight-current-row
  389. :data="table.list4" :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
  390. :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
  391. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  392. <el-table-column sortable :show-overflow-tooltip="true" min-width="600px" prop="msgSource" label="电文内容"
  393. align="center"></el-table-column>
  394. </el-table>
  395. </div>
  396. </el-tab-pane>
  397. </el-tabs>
  398. </el-col>
  399. </el-row>
  400. <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh="refresh"></div>
  401. <div is="alertComponets2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" @refresh="refresh2"></div>
  402. <div is="alertComponets3" :showFlag="showFlag3" :Params="Params3" @refresh="refresh3"></div>
  403. <el-dialog @close="closeDialog" :visible.sync="dialogTableCount" width="80%">
  404. <el-table id="excelTable3" ref="dataTable3" border :data="tableCount">
  405. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="MAT_NAME" label="物料编号"
  406. align="center"></el-table-column>
  407. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="COUNT" label="个数"
  408. align="center"></el-table-column>
  409. </el-table>
  410. </el-dialog>
  411. <div id="printContainer2" style="margin-left: 20px; margin-top: 3px" v-show="false">
  412. <div id="printContent">
  413. <div v-for="item in printData" :key="item.id" style="width: 439px; border: 1px solid #fff; position: relative">
  414. <div>
  415. <div v-for="subItem in item.list" :key="subItem.id" style="font-size: 15px">
  416. {{ subItem.fieldKeyName }}:{{ subItem.fieldValue }}
  417. </div>
  418. <div :id="`Qrcode${item.id}`" style="margin-top: 20px"></div>
  419. <div v-if="printData.length > 1" style="page-break-after: always"></div>
  420. </div>
  421. </div>
  422. </div>
  423. </div>
  424. <!-- 二维码编辑 -->
  425. <el-dialog title="二维码信息详情" :visible.sync="isShowQrCodeInfo" width="70%">
  426. <el-button type="goon" size="mini" @click="addQrCodeInfo" style="margin-bottom: 10px">新增</el-button>
  427. <el-button type="goon" size="mini" @click="resetQrCodeInfo" style="margin-bottom: 10px">重置</el-button>
  428. <el-table ref="qrCodeInfoTable" :data="qrCodeInfoData" stripe border tooltip-effect="dark" height="500"
  429. @selection-change="handleQrCodeInfoSelectionChange">
  430. <el-table-column type="selection" width="55" align="center">
  431. </el-table-column>
  432. <el-table-column label="字段名" align="center" prop="fieldKeyName">
  433. </el-table-column>
  434. <el-table-column prop="fieldValue" label="字段值" align="center">
  435. </el-table-column>
  436. <el-table-column label="操作" width="120" align="center">
  437. <template slot-scope="scope">
  438. <el-button @click="editQrCodeInfoRow(scope.$index, scope.row)" type="text" size="small">
  439. 编辑
  440. </el-button>
  441. <el-button v-if="scope.row.fieldKey != 'sampleNo'" @click="delQrCodeInfoRow(scope.$index, scope.row)"
  442. type="text" size="small">
  443. 删除
  444. </el-button>
  445. </template>
  446. </el-table-column>
  447. </el-table>
  448. <div slot="footer" class="dialog-footer">
  449. <div style="
  450. display: flex;
  451. align-items: center;
  452. justify-content: space-between;
  453. ">
  454. <div>
  455. <el-pagination @size-change="pageSizeChange3" @current-change="pageCurrentChange3"
  456. :current-page="page3.pageNum" :page-sizes="[10, 20, 30, 50, 100]" :page-size="page3.pageSize"
  457. layout="total, sizes, prev, pager, next, jumper" :total="page3.totalPage" background>
  458. </el-pagination>
  459. </div>
  460. <div>
  461. <el-button size="mini" @click="isShowQrCodeInfo = false">取消</el-button>
  462. <el-button size="mini" icon="el-icon-printer" type="primary" @click="saveQRCode">保存</el-button>
  463. <el-button size="mini" icon="el-icon-printer" type="primary" @click="saveAndPrintQRCode">保存打印二维码</el-button>
  464. </div>
  465. </div>
  466. </div>
  467. </el-dialog>
  468. <!-- 新增二维码字段 -->
  469. <el-dialog title="新增二维码字段信息" :visible.sync="isShowAddQrCodeInfo" width="30%">
  470. <el-form :model="addQrCodeInfoForm">
  471. <el-form-item label="字段名">
  472. <el-input v-model="addQrCodeInfoForm.fieldKeyName" auto-complete="off"></el-input>
  473. </el-form-item>
  474. <el-form-item label="字段值">
  475. <el-input v-model="addQrCodeInfoForm.fieldValue" auto-complete="off"></el-input>
  476. </el-form-item>
  477. </el-form>
  478. <div slot="footer" class="dialog-footer">
  479. <el-button size="mini" @click="isShowAddQrCodeInfo = false">取消</el-button>
  480. <el-button size="mini" type="primary" @click="confirmAddQrCodeInfo">确定</el-button>
  481. </div>
  482. </el-dialog>
  483. <!-- 编辑二维码字段 -->
  484. <el-dialog title="编辑二维码字段信息" :visible.sync="isShowEditQrCodeInfo" width="30%">
  485. <el-form :model="editQrCodeInfoForm">
  486. <el-form-item label="字段名">
  487. <el-input v-model="editQrCodeInfoForm.fieldKeyName" auto-complete="off"></el-input>
  488. </el-form-item>
  489. <el-form-item label="字段值">
  490. <el-input v-model="editQrCodeInfoForm.fieldValue" auto-complete="off"></el-input>
  491. </el-form-item>
  492. </el-form>
  493. <div slot="footer" class="dialog-footer">
  494. <el-button size="mini" @click="isShowEditQrCodeInfo = false">取消</el-button>
  495. <el-button size="mini" type="primary" @click="confirmEditQrCodeInfo">确定</el-button>
  496. </div>
  497. </el-dialog>
  498. </div>
  499. </template>
  500. <script>
  501. import { getCookie, formatDate } from "@/utils/util.js";
  502. import { cookieUserId, cookieUserName } from "@/config/config.js";
  503. import alertComponets from "./alertComponents";
  504. import alertComponets2 from "./alertComponents2";
  505. import alertComponets3 from "./alertComponents3";
  506. import JsBarcode from "jsbarcode";
  507. let userName = getCookie(cookieUserName);
  508. let userId = getCookie(cookieUserId);
  509. export default {
  510. components: { alertComponets, alertComponets2, alertComponets3 },
  511. data() {
  512. return {
  513. table: {
  514. list: [],
  515. list1: [],
  516. list2: [],
  517. list3: [],
  518. list4: [],
  519. },
  520. activeName: "first",
  521. activeName2: "first",
  522. dataLoading: false,
  523. invalidLoading: false,
  524. dataLoading2: false,
  525. dataLoading3: false,
  526. dataLoading4: false,
  527. subLoading: false,
  528. subLoading1: false,
  529. subLoading2: false,
  530. subLoading3: false,
  531. subLoadingq: false,
  532. icoreFilterFlag: true,
  533. values: "",
  534. inputLoading: false,
  535. timeId: null,
  536. page: {
  537. pageSize: 200,
  538. pageNum: 1,
  539. totalPage: 0,
  540. },
  541. page3: {
  542. pageSize: 10,
  543. pageNum: 1,
  544. totalPage: 0,
  545. },
  546. saveRow: {},
  547. savaDep: {},
  548. list: [],
  549. entrId: "",
  550. showFlag: false,
  551. showFlag3: false,
  552. Params3: {},
  553. Params: {},
  554. showFlag2: false,
  555. Params2: {},
  556. entrOrgNameType: [],
  557. entrOrgNameType1: [],
  558. selectDataList: [],
  559. sampleTypeNameType: [],
  560. multipleSelection3: [],
  561. multipleSelection4: [],
  562. tableCount: [],
  563. dialogTableCount: false,
  564. search: {
  565. batchNo: "",
  566. entrTime: "",
  567. times: [],
  568. planCompanyName: "",
  569. matName: "",
  570. carNo:"",
  571. sampleNo:""
  572. },
  573. height_top: 0,
  574. height_bot: 0,
  575. activeMenu: "",
  576. piciIndex: "",
  577. printData: [],
  578. printLoading: false,
  579. exportFileLoading: false,
  580. // editRow: {},
  581. selectRows: [],
  582. selectRow1s: [],
  583. subLoading8: false,
  584. isShowQrCodeInfo: false,
  585. qrCodeInfoData: [],
  586. isShowAddQrCodeInfo: false,
  587. addQrCodeInfoForm: {},
  588. isShowEditQrCodeInfo: false,
  589. editQrCodeInfoForm: {},
  590. editQrCodeInfoIndex: 0,
  591. deleteIds: [],
  592. isSetDefault: false,
  593. };
  594. },
  595. created() {
  596. this.height_top = window.innerHeight - 200;
  597. this.height_bot = window.innerHeight - 200;
  598. this.search.times = [this.getYNM(new Date()), this.getYNM(new Date())];
  599. this.activeMenu = window.top.localStorage.getItem("activeMenu");
  600. },
  601. mounted() {
  602. this.axios
  603. .post(
  604. "pass/baseManagement/v1/sysorgs/querySysOrgCompanyAll",
  605. {},
  606. { individualType: "json" }
  607. )
  608. .then((response) => {
  609. this.entrOrgNameType = response.data;
  610. });
  611. this.searchData();
  612. this.addScreen();
  613. this.addScreen2();
  614. },
  615. methods: {
  616. getYNM(date) {
  617. let year = date.getFullYear().toString();
  618. let month = date.getMonth() + 1;
  619. let day = date.getDate();
  620. month = month < 10 ? "0" + month : month;
  621. day = day < 10 ? "0" + day : day;
  622. return `${year}-${month}-${day}`;
  623. },
  624. getSummaries(param) {
  625. const { columns, data } = param;
  626. const sums = [];
  627. columns.forEach((column, index) => {
  628. if (index === 0) {
  629. sums[index] = "合计";
  630. }
  631. if (index === 1) {
  632. sums[index] = data.length;
  633. }
  634. });
  635. return sums;
  636. },
  637. refresh() {
  638. this.mainData();
  639. },
  640. refresh2() {
  641. this.depData(this.entrId);
  642. },
  643. refresh3() {
  644. this.mainData();
  645. },
  646. saveDataMain(row) {
  647. this.piciIndex = row.id;
  648. this.saveRow = Object.assign({}, row);
  649. },
  650. addData() {
  651. let _this = this;
  652. _this.showFlag = !_this.showFlag;
  653. _this.Params = null;
  654. },
  655. modifyData() {
  656. if (JSON.stringify(this.saveRow) === "{}") {
  657. this.$message.warning("请点击选中一条您要修改的数据");
  658. return;
  659. }
  660. if (this.saveRow.stateFlag == 1) {
  661. this.$message.warning("数据已提交,不可进行修改");
  662. return;
  663. }
  664. this.Params3 = this.saveRow;
  665. this.showFlag3 = !this.showFlag3;
  666. },
  667. update() {
  668. if (JSON.stringify(this.saveRow) === "{}") {
  669. this.$message.warning("请点击选中一条您要提交的数据");
  670. return;
  671. }
  672. if (this.saveRow.stateFlag == 1) {
  673. this.$message.warning("请选择编辑状态!");
  674. return;
  675. }
  676. let index = this.table.list.findIndex((arr) => arr.id == this.piciIndex);
  677. let arr = this.table.list[index];
  678. this.subLoading2 = true;
  679. this.axios
  680. .post(
  681. "pass/testManagement/v1/limstestentrusts/updateEntrustBatchNo",
  682. arr,
  683. { individualType: "json" }
  684. )
  685. .then((res) => {
  686. if (res.code == 0 || res.code == 200) {
  687. this.$message.success(res.message);
  688. this.mainData();
  689. } else {
  690. this.$message.error(res.message);
  691. }
  692. this.subLoading2 = false;
  693. })
  694. .catch((e) => {
  695. this.subLoading2 = false;
  696. this.$message.error(e.message);
  697. });
  698. },
  699. //清除中心编号的生成规则的记录
  700. removeNumber() {
  701. this.subLoadingq = true;
  702. this.axios
  703. .post("pass/testManagement/v1/api/reflection/removeMapPkALL")
  704. .then((res) => {
  705. if (res.code == 0 || res.code == 200) {
  706. this.subLoadingq = false;
  707. this.$message.success(res.message);
  708. } else {
  709. this.subLoadingq = false;
  710. this.$message.error(res.message);
  711. }
  712. });
  713. },
  714. updateSampleNo() {
  715. if (this.selectRows.length == 0) {
  716. return this.$message.warning("请至少勾选一条您要修改的数据!");
  717. }
  718. this.subLoading8 = true;
  719. this.axios
  720. .post(
  721. "pass/testManagement/v1/limstestentrusts/saveLimsTestEntrustList",
  722. this.selectRows,
  723. { individualType: "json" }
  724. )
  725. .then((res) => {
  726. if (res.succeed) {
  727. this.subLoading8 = false;
  728. this.$message.success("修改成功");
  729. this.searchData();
  730. } else {
  731. this.subLoading8 = false;
  732. this.$message.error(res.message);
  733. }
  734. })
  735. .catch((e) => {
  736. this.subLoading8 = false;
  737. this.$message.error(e.message);
  738. });
  739. }, //扫码提交
  740. autoSubmit() {
  741. if (!this.values) {
  742. this.$message.warning("请先用扫码枪扫描标签");
  743. return;
  744. }
  745. if (!this.timeId) {
  746. this.timeId = setTimeout(() => {
  747. this.inputLoading = true;
  748. this.axios
  749. .post(
  750. "pass/testManagement/v1/limstestentrusts/scanningSubmit",
  751. { carNo: this.values },
  752. { individualType: "json" }
  753. )
  754. .then((res) => {
  755. if (res.code == 0 || res.code == 200) {
  756. this.$nextTick(() => {
  757. this.$refs.autoInput.focus();
  758. });
  759. this.values = "";
  760. this.inputLoading = false;
  761. this.$message.success("操作成功!");
  762. this.mainData();
  763. } else {
  764. this.$nextTick(() => {
  765. this.$refs.autoInput.focus();
  766. });
  767. this.values = "";
  768. this.inputLoading = false;
  769. this.$message.error(res.message);
  770. }
  771. })
  772. .catch((e) => {
  773. this.$nextTick(() => {
  774. this.$refs.autoInput.focus();
  775. });
  776. this.values = "";
  777. this.inputLoading = false;
  778. this.$message.error(e.message);
  779. });
  780. this.timeId = null;
  781. }, 1000);
  782. }
  783. },
  784. exportFile() {
  785. if (this.selectRows.length == 0) {
  786. this.$message.warning("请勾选您要导出的一条数据!");
  787. return;
  788. }
  789. this.exportFileLoading = true;
  790. let str = [];
  791. this.selectRows.forEach((s) => {
  792. str.push(s.entrId);
  793. });
  794. this.axios
  795. .get(
  796. "pass/testManagement/v1/limstestentrusts/newJywts/" + str,
  797. { responseType: "blob" },
  798. { headers: { "content-type": "application/x-www-form-urlencoded" } }
  799. )
  800. .then((res) => {
  801. let blob = new Blob([res]);
  802. let elink = document.createElement("a");
  803. elink.download = "BBWXCLJC-4-08-03.docx";
  804. elink.style.display = "none";
  805. elink.target = "_blank";
  806. elink.href = URL.createObjectURL(blob);
  807. document.body.appendChild(elink);
  808. elink.click();
  809. URL.revokeObjectURL(elink.href); // 释放URL对象
  810. document.body.removeChild(elink);
  811. this.exportFileLoading = false;
  812. })
  813. .catch((e) => {
  814. this.exportFileLoading = false;
  815. return this.$message.error(e.message);
  816. });
  817. },
  818. // 打印二维码
  819. // printQRCode() {
  820. // if (this.selectRows.length == 0) {
  821. // this.$message.warning("请勾选您要打印的数据");
  822. // return;
  823. // }
  824. // let flag = this.selectRows.some((u) => u.stateFlag != 1);
  825. // if (flag) {
  826. // return this.$message.warning(
  827. // "未提交数据不允许进行打印,请重新进行勾选"
  828. // );
  829. // }
  830. // let entrIds = [];
  831. // this.selectRows.forEach((p) => {
  832. // entrIds.push(p.entrId);
  833. // });
  834. // this.axios
  835. // .post(
  836. // "pass/testManagement/v1/limssampleinfos/queryLimsSampleInfosPage",
  837. // { object: { entrIds }, pageIndex: 1, pageSize: 200 },
  838. // { individualType: "json" }
  839. // )
  840. // .then((res) => {
  841. // if (res.code == 0 || res.code == 200) {
  842. // this.$message.success(res.message);
  843. // this.printData = res.data.list;
  844. // this.printData.forEach((item) => {
  845. // item.carNo = this.saveRow.carNo;
  846. // });
  847. // this.runPrint(this.printData);
  848. // this.searchData();
  849. // } else {
  850. // this.$message.error(res.message);
  851. // }
  852. // });
  853. // },
  854. // runPrint(arr) {
  855. // console.log("arr", arr);
  856. // setTimeout(() => {
  857. // arr.forEach((item) => {
  858. // const qrcode = document.getElementById(`Qrcode${item.id}`);
  859. // qrcode.innerHTML = "";
  860. // new QRCode(qrcode, {
  861. // text: item.sampleNo,
  862. // width: 100,
  863. // height: 100,
  864. // colorDark: "#000000",
  865. // colorLight: "#ffffff",
  866. // });
  867. // });
  868. // setTimeout(() => {
  869. // this.printPage("printContent");
  870. // }, 1500);
  871. // }, 100);
  872. // },
  873. // 打印条形码
  874. async printQRCode() {
  875. if (this.selectRows.length == 0) {
  876. this.$message.warning("请勾选您要打印的数据");
  877. return;
  878. }
  879. let flag = this.selectRows.some((u) => u.stateFlag != 1);
  880. if (flag) {
  881. return this.$message.warning(
  882. "未提交数据不允许进行打印,请重新进行勾选"
  883. );
  884. }
  885. let entrIds = [];
  886. this.selectRows.forEach((p) => {
  887. entrIds.push(p.entrId);
  888. });
  889. const list0 = [];
  890. entrIds.forEach((item) => {
  891. list0.push(this.initQrCode(item));
  892. });
  893. await Promise.all(list0);
  894. const list = [];
  895. entrIds.forEach((item) => {
  896. list.push(this.getQrCodeInfoListById(item));
  897. });
  898. Promise.all(list).then((res) => {
  899. this.printData = res.map((item, index) => {
  900. if (item.code == 0 || item.code == 200) {
  901. return {
  902. id: entrIds[index],
  903. list: item.data.list.filter((subItem) => subItem.isCheck === 1),
  904. };
  905. } else {
  906. return {
  907. id: entrIds[index],
  908. list: [],
  909. };
  910. }
  911. });
  912. console.log("this.printData");
  913. console.log(this.printData);
  914. this.runPrint(this.printData);
  915. });
  916. },
  917. runPrint(arr) {
  918. setTimeout(() => {
  919. arr.forEach((item) => {
  920. const qrcode = document.getElementById(`Qrcode${item.id}`);
  921. qrcode.innerHTML = "";
  922. let sampleNo = "";
  923. for (let i = 0; i < item.list.length; i++) {
  924. if (item.list[i].fieldKey === "sampleNo") {
  925. sampleNo = item.list[i].fieldValue;
  926. break;
  927. }
  928. }
  929. new QRCode(qrcode, {
  930. text: sampleNo,
  931. width: 100,
  932. height: 100,
  933. colorDark: "#000000",
  934. colorLight: "#ffffff",
  935. });
  936. });
  937. setTimeout(() => {
  938. this.printPage("printContent");
  939. }, 1500);
  940. }, 100);
  941. },
  942. getpici() {
  943. if (JSON.stringify(this.saveRow) === "{}") {
  944. this.$message.warning("请点击选中一条您要提交的数据");
  945. return;
  946. }
  947. if (this.saveRow.stateFlag == 1) {
  948. this.$message.warning("请选择编辑状态!");
  949. return;
  950. }
  951. this.subLoading1 = true;
  952. this.axios
  953. .post(
  954. "pass/testManagement/v1/limstestentrusts/getNextBacthNoToRule",
  955. this.saveRow,
  956. { individualType: "json" }
  957. )
  958. .then((res) => {
  959. if (res.code == 0 || res.code == 200) {
  960. let index = this.table.list.findIndex(
  961. (arr) => arr.id == this.piciIndex
  962. );
  963. if (res.data != null) {
  964. this.table.list[index].batchNo = res.data;
  965. }
  966. this.saveRow.batchNo = res.data;
  967. } else {
  968. this.$message.error(res.message);
  969. }
  970. this.subLoading1 = false;
  971. })
  972. .catch((e) => {
  973. this.subLoading1 = false;
  974. this.$message.error(e.message);
  975. });
  976. },
  977. async submitData() {
  978. if (this.selectRows.length == 0) {
  979. return this.$message.warning("请至少勾选一条数据进行提交!");
  980. }
  981. let ids = [];
  982. for (let i = 0; i < this.selectRows.length; i++) {
  983. let item = this.selectRows[i];
  984. if (item.stateFlag === "1") {
  985. return this.$message.warning(
  986. "委托编号为[" + item.id + "]的数据已经提交,无法再次进行提交!"
  987. );
  988. }
  989. if (item.validFlag === "1") {
  990. ids.push(item.id);
  991. }
  992. }
  993. this.subLoading = true;
  994. for (let i = 0; i < this.selectRows.length; i++) {
  995. let item = this.selectRows[i];
  996. const str = await this.axios.post(
  997. "pass/testManagement/v1/limstestentrusts/saveLimsTestEntrust",
  998. item,
  999. { individualType: "json" }
  1000. );
  1001. if (str.succeed) {
  1002. const str1 = await this.axios.post(
  1003. "pass/testManagement/v1/limstestentrusts/submit",
  1004. [item.entrId],
  1005. { individualType: "json" }
  1006. );
  1007. if (str1.code == 0 || str1.code == 200) {
  1008. this.$message.success(str1.message);
  1009. } else {
  1010. this.$message.error(str1.message);
  1011. }
  1012. } else {
  1013. this.$message.error(str.message);
  1014. }
  1015. }
  1016. this.subLoading = false;
  1017. this.refresh();
  1018. },
  1019. selectData(val) {
  1020. this.selectDataList = val;
  1021. },
  1022. saveData(row) {
  1023. this.savaDep = Object.assign({}, row);
  1024. },
  1025. addData2() {
  1026. if (JSON.stringify(this.saveRow) === "{}") {
  1027. this.$message.warning("请点击选中一条检验委托信息数据");
  1028. return;
  1029. }
  1030. if (this.saveRow.stateFlag == 1) {
  1031. this.$message.warning("数据已提交,不可进行新增");
  1032. return;
  1033. }
  1034. this.showFlag2 = !this.showFlag2;
  1035. this.Params2 = null;
  1036. this.Params = this.saveRow;
  1037. },
  1038. enable() {
  1039. //启用
  1040. if (this.selectRow1s.length < 1) {
  1041. this.$message.warning("请至少勾选一条您要启用的数据");
  1042. return;
  1043. }
  1044. // if (this.saveRow.validFlag != 0) {
  1045. // this.$message.warning('数据未停用,不可启用!')
  1046. // return
  1047. // }
  1048. let ids = [];
  1049. for (let i = 0; i < this.selectRow1s.length; i++) {
  1050. let item = this.selectRow1s[i];
  1051. if (item.validFlag === "1") {
  1052. return this.$message.warning(
  1053. "委托编号为[" + item.id + "]的数据为启用状态,无法进行启用!"
  1054. );
  1055. }
  1056. if (item.validFlag === "0") {
  1057. ids.push(item.id);
  1058. }
  1059. }
  1060. this.subLoadingq = true;
  1061. this.axios
  1062. .post("pass/testManagement/v1/limstestentrusts/enable", ids, {
  1063. individualType: "json",
  1064. })
  1065. .then((res) => {
  1066. if (res.code == 0 || res.code == 200) {
  1067. this.mainData();
  1068. this.mainData1();
  1069. this.subLoadingq = false;
  1070. this.$message.success(res.message);
  1071. } else {
  1072. this.subLoadingq = false;
  1073. this.$message.error(res.message);
  1074. }
  1075. })
  1076. .catch((e) => {
  1077. this.subLoadingq = false;
  1078. this.$message.error(e.message);
  1079. });
  1080. },
  1081. disable() {
  1082. //停用
  1083. if (this.selectRows.length < 1) {
  1084. this.$message.warning("请至少勾选一条您要停用的数据");
  1085. return;
  1086. }
  1087. let ids = [];
  1088. for (let i = 0; i < this.selectRows.length; i++) {
  1089. let item = this.selectRows[i];
  1090. if (item.validFlag === "0") {
  1091. return this.$message.warning(
  1092. "委托编号为[" + item.id + "]的数据为停用状态,无法进行停用!"
  1093. );
  1094. }
  1095. if (item.validFlag === "1") {
  1096. ids.push(item.id);
  1097. }
  1098. }
  1099. this.subLoading = true;
  1100. this.axios
  1101. .post("pass/testManagement/v1/limstestentrusts/disable", ids, {
  1102. individualType: "json",
  1103. })
  1104. .then((res) => {
  1105. if (res.code == 0 || res.code == 200) {
  1106. this.$message.success(res.message);
  1107. this.mainData();
  1108. this.mainData1();
  1109. this.subLoading = false;
  1110. } else {
  1111. this.subLoading = false;
  1112. this.$message.error(res.message);
  1113. }
  1114. })
  1115. .catch((e) => {
  1116. this.subLoading = false;
  1117. this.$message.error(e.message);
  1118. });
  1119. },
  1120. cancelData() {
  1121. //取消提交
  1122. if (this.selectRows.length < 1) {
  1123. this.$message.warning("请至少勾选一条您要取消提交的数据");
  1124. return;
  1125. }
  1126. // if (this.saveRow.stateFlag != 1) {
  1127. // this.$message.warning('数据不是提交状态,不可取消提交!')
  1128. // return
  1129. // }
  1130. let ids = [];
  1131. for (let i = 0; i < this.selectRows.length; i++) {
  1132. let item = this.selectRows[i];
  1133. if (item.stateFlag === "0") {
  1134. return this.$message.warning(
  1135. "委托编号为[" + item.id + "]的数据为编辑状态,无法进行取消提交!"
  1136. );
  1137. }
  1138. if (item.validFlag === "1") {
  1139. ids.push(item.id);
  1140. }
  1141. }
  1142. this.subLoading = true;
  1143. this.axios
  1144. .post("pass/testManagement/v1/limstestentrusts/cancel", ids, {
  1145. individualType: "json",
  1146. })
  1147. .then((res) => {
  1148. if (res.code == 0 || res.code == 200) {
  1149. this.$message.success(res.message);
  1150. this.removeNumber();
  1151. this.mainData();
  1152. this.mainData1();
  1153. this.subLoading = false;
  1154. } else {
  1155. this.$message.error(res.message);
  1156. }
  1157. this.subLoading = false;
  1158. })
  1159. .catch((e) => {
  1160. this.subLoading = false;
  1161. this.$message.error(e.message);
  1162. });
  1163. },
  1164. deleteData2() {
  1165. if (this.selectDataList.length == 0) {
  1166. this.$message.warning("请选中计划检验项目信息数据!");
  1167. return;
  1168. }
  1169. if (this.saveRow.stateFlag == 1) {
  1170. this.$message.warning("数据已提交,不可进行删除");
  1171. return;
  1172. }
  1173. this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
  1174. confirmButtonText: "确定",
  1175. cancelButtonText: "取消",
  1176. type: "warning",
  1177. })
  1178. .then(() => {
  1179. for (let i = 0; i < this.selectDataList.length; i++) {
  1180. this.axios
  1181. .post(
  1182. "pass/testManagement/v1/limstestentrustds/deleteLimsTestEntrustD?id=" +
  1183. this.selectDataList[i].id,
  1184. { individualType: "json" }
  1185. )
  1186. .then((res) => {
  1187. if (res.succeed) {
  1188. this.dialogTableVisible = false;
  1189. this.$message.success("删除成功");
  1190. this.depData(this.entrId);
  1191. } else {
  1192. this.$message.error(res.message);
  1193. }
  1194. })
  1195. .catch((e) => {
  1196. this.$message.error(e.message);
  1197. });
  1198. }
  1199. })
  1200. .catch(() => { });
  1201. },
  1202. searchData() {
  1203. this.page.pageNum = 1;
  1204. this.page.pageSize = 200;
  1205. this.mainData();
  1206. this.mainData1();
  1207. },
  1208. closeDialog() {
  1209. this.dialogTableCount = false;
  1210. this.tableCount = [];
  1211. },
  1212. countList() {
  1213. let startTime = "";
  1214. let endTime = "";
  1215. if (!this.search.times) {
  1216. startTime = "";
  1217. endTime = "";
  1218. } else {
  1219. startTime =
  1220. formatDate(this.search.times[0], "yyyy-MM-dd") + " 00:00:00";
  1221. endTime = formatDate(this.search.times[1], "yyyy-MM-dd") + " 23:59:59";
  1222. }
  1223. let obj = {
  1224. object: {
  1225. entrOrgNo: this.search.planCompanyNo, // 委托单位
  1226. sampleTypeCode: 480103,
  1227. matName: this.search.matName,
  1228. batchNo: this.search.batchNo,
  1229. validFlag: "1",
  1230. stateFlag: "1",
  1231. },
  1232. startTime: startTime,
  1233. endTime: endTime,
  1234. };
  1235. this.axios
  1236. .post(
  1237. "pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustCount",
  1238. obj,
  1239. { individualType: "json" }
  1240. )
  1241. .then((res) => {
  1242. this.tableCount = res.data;
  1243. this.dialogTableCount = true;
  1244. })
  1245. .catch((e) => {
  1246. this.$message.error("查询错误!");
  1247. });
  1248. },
  1249. mainData() {
  1250. (this.saveRow = {}), (this.dataLoading = true);
  1251. let startTime = "";
  1252. let endTime = "";
  1253. if (!this.search.times) {
  1254. startTime = "";
  1255. endTime = "";
  1256. } else {
  1257. startTime =
  1258. formatDate(this.search.times[0], "yyyy-MM-dd") + " 00:00:00";
  1259. endTime = formatDate(this.search.times[1], "yyyy-MM-dd") + " 23:59:59";
  1260. }
  1261. let tempobj = {
  1262. object: {
  1263. sampleTypeCode: "480103",
  1264. isBatch: "",
  1265. entrOrgNo: this.search.planCompanyNo, // 委托单位
  1266. matName: this.search.matName,
  1267. batchNo: this.search.batchNo,
  1268. carNo: this.search.carNo,
  1269. validFlag: "1",
  1270. },
  1271. sampleNo: this.search.sampleNo,
  1272. pageIndex: this.page.pageNum,
  1273. pageSize: this.page.pageSize,
  1274. startTime: startTime,
  1275. endTime: endTime,
  1276. };
  1277. this.axios
  1278. .post(
  1279. "pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustPage/",
  1280. tempobj,
  1281. { individualType: "json" }
  1282. )
  1283. .then((res) => {
  1284. this.dataLoading = false;
  1285. this.table.list = res.data.list;
  1286. if (this.table.list.length > 0) {
  1287. this.$refs.dataTable.setCurrentRow(this.table.list[0]);
  1288. this.searchFollow(this.table.list[0]);
  1289. }
  1290. this.table.list.forEach((item) => {
  1291. item.stateFlag1 =
  1292. item.validFlag == "0"
  1293. ? "已停用"
  1294. : item.stateFlag === "0"
  1295. ? "编辑"
  1296. : item.stateFlag === "1"
  1297. ? "提交"
  1298. : "";
  1299. item.entrTime1 = formatDate(item.entrTime, "yyyy-MM-dd");
  1300. });
  1301. this.page.totalPage = res.data.total;
  1302. })
  1303. .catch((e) => {
  1304. this.dataLoading = false;
  1305. });
  1306. },
  1307. mainData1() {
  1308. (this.saveRow = {}), (this.invalidLoading = true);
  1309. let startTime = "";
  1310. let endTime = "";
  1311. if (!this.search.times) {
  1312. startTime = "";
  1313. endTime = "";
  1314. } else {
  1315. startTime =
  1316. formatDate(this.search.times[0], "yyyy-MM-dd") + " 00:00:00";
  1317. endTime = formatDate(this.search.times[1], "yyyy-MM-dd") + " 23:59:59";
  1318. }
  1319. let tempobj = {
  1320. object: {
  1321. sampleTypeCode: "480103",
  1322. isBatch: "",
  1323. entrOrgNo: this.search.planCompanyNo, // 委托单位
  1324. matName: this.search.matName,
  1325. batchNo: this.search.batchNo,
  1326. carNo: this.search.carNo,
  1327. validFlag: "0",
  1328. },
  1329. sampleNo: this.search.sampleNo,
  1330. pageIndex: this.page.pageNum,
  1331. pageSize: this.page.pageSize,
  1332. startTime: startTime,
  1333. endTime: endTime,
  1334. };
  1335. this.axios
  1336. .post(
  1337. "pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustPage/",
  1338. tempobj,
  1339. { individualType: "json" }
  1340. )
  1341. .then((res) => {
  1342. this.invalidLoading = false;
  1343. this.table.list1 = res.data.list;
  1344. this.table.list1.forEach((item) => {
  1345. item.stateFlag1 =
  1346. item.validFlag == "0"
  1347. ? "已停用"
  1348. : item.stateFlag === "0"
  1349. ? "编辑"
  1350. : item.stateFlag === "1"
  1351. ? "提交"
  1352. : "";
  1353. item.entrTime1 = formatDate(item.entrTime, "yyyy-MM-dd");
  1354. });
  1355. })
  1356. .catch((e) => {
  1357. this.invalidLoading = false;
  1358. });
  1359. },
  1360. searchFollow(row) {
  1361. this.saveRow = Object.assign({}, row);
  1362. // this.editRow = row
  1363. this.entrId = row.entrId ? row.entrId : "";
  1364. this.depData(this.entrId);
  1365. this.getRevMsg(this.entrId);
  1366. this.getSendMsg(this.entrId);
  1367. },
  1368. selectRow(val) {
  1369. this.selectRows = val;
  1370. },
  1371. selectRow1(val) {
  1372. this.selectRow1s = val;
  1373. },
  1374. getRevMsg(entrId) {
  1375. if (!entrId) {
  1376. return this.$message.warning("获取接收电文参数错误! entrId为空!");
  1377. }
  1378. this.dataLoading3 = true;
  1379. this.axios
  1380. .post(
  1381. "pass/testManagement/v1/limstestentrusts/queryMsgByEntrId",
  1382. { object: { entrId: entrId }, pageIndex: 1, pageSize: 999 },
  1383. { individualType: "json" }
  1384. )
  1385. .then((res) => {
  1386. if (res.code == 0 || res.code == 200) {
  1387. this.dataLoading3 = false;
  1388. this.table.list3 = res.data.list;
  1389. } else {
  1390. this.dataLoading3 = false;
  1391. return this.$message.warning(res.message);
  1392. }
  1393. })
  1394. .catch((e) => {
  1395. this.dataLoading3 = false;
  1396. return this.$message.error(e.message);
  1397. });
  1398. },
  1399. getSendMsg(entrId) {
  1400. if (!entrId) {
  1401. return this.$message.warning("获取发送电文参数错误! entrId为空!");
  1402. }
  1403. this.dataLoading4 = true;
  1404. this.axios
  1405. .post(
  1406. "pass/testManagement/v1/limstestentrusts/queryMsgByEntrIdAndSampleNo",
  1407. { object: { entrId: entrId }, pageIndex: 1, pageSize: 999 },
  1408. { individualType: "json" }
  1409. )
  1410. .then((res) => {
  1411. if (res.code == 0 || res.code == 200) {
  1412. this.dataLoading4 = false;
  1413. this.table.list4 = res.data.list;
  1414. } else {
  1415. this.dataLoading4 = false;
  1416. return this.$message.warning(res.message);
  1417. }
  1418. })
  1419. .catch((e) => {
  1420. this.dataLoading4 = false;
  1421. return this.$message.error(e.message);
  1422. });
  1423. },
  1424. depData(entrId) {
  1425. (this.savaDep = {}), (this.dataLoading2 = true);
  1426. this.axios
  1427. .post(
  1428. "pass/testManagement/v1/limstestentrustds/queryLimsTestEntrustDPage",
  1429. { object: { entrId: entrId }, pageIndex: 1, pageSize: 999 },
  1430. { individualType: "json" }
  1431. )
  1432. .then((res) => {
  1433. this.dataLoading2 = false;
  1434. this.table.list2 = res.data.list;
  1435. this.table.list2.forEach((item) => {
  1436. item.stateFlag1 =
  1437. item.stateFlag === "0"
  1438. ? "编辑"
  1439. : item.stateFlag === "1"
  1440. ? "提交"
  1441. : "";
  1442. item.entrTime1 = formatDate(item.entrTime, "yyyy-MM-dd");
  1443. });
  1444. })
  1445. .catch((e) => {
  1446. this.dataLoading2 = false;
  1447. });
  1448. },
  1449. reset() {
  1450. this.search.times = [this.getYNM(new Date()), this.getYNM(new Date())];
  1451. this.search.planCompanyNo = "";
  1452. this.search.matName = "";
  1453. this.searchData();
  1454. },
  1455. handleSelectionChange(val) {
  1456. this.multipleSelection3 = val;
  1457. },
  1458. pageSizeChange(size) {
  1459. this.page.pageSize = size;
  1460. this.mainData();
  1461. },
  1462. pageCurrentChange(index) {
  1463. this.page.pageNum = index;
  1464. this.mainData();
  1465. },
  1466. async pageSizeChange3(size) {
  1467. this.page3.pageSize = size;
  1468. await this.getQrCodeInfoListAndSetDefault();
  1469. },
  1470. async pageCurrentChange3(index) {
  1471. this.page3.pageNum = index;
  1472. await this.getQrCodeInfoListAndSetDefault();
  1473. },
  1474. handleSelectionChange2(val) {
  1475. this.multipleSelection4 = val;
  1476. },
  1477. addScreen() {
  1478. this.$nextTick(() => {
  1479. let ss = document.createElement("div");
  1480. ss.innerHTML = "筛选";
  1481. ss.style = "text-align: center;";
  1482. this.$refs.dataTable.$el
  1483. .getElementsByClassName("el-table__fixed")[0]
  1484. .getElementsByTagName("td")[0]
  1485. .appendChild(ss);
  1486. });
  1487. },
  1488. addScreen2() {
  1489. this.$nextTick(() => {
  1490. let ss = document.createElement("div");
  1491. ss.innerHTML = "筛选";
  1492. ss.style = "text-align: center;";
  1493. this.$refs.dataTable2.$el
  1494. .getElementsByClassName("el-table__fixed")[0]
  1495. .getElementsByTagName("td")[0]
  1496. .appendChild(ss);
  1497. });
  1498. },
  1499. tableRowClassName({ row, column, rowIndex, columnIndex }) {
  1500. if (columnIndex === 13) {
  1501. if (row.validFlag !== "1") {
  1502. return "error-row";
  1503. }
  1504. }
  1505. if (columnIndex === 2) {
  1506. if (row.validFlag !== "1") {
  1507. return "error-row";
  1508. }
  1509. if (row.stateFlag === "1") {
  1510. return "error-green";
  1511. }
  1512. return "";
  1513. }
  1514. },
  1515. tableRowClassName2({ row, column, rowIndex, columnIndex }) {
  1516. if (columnIndex === 5) {
  1517. if (row.validFlag !== "1") {
  1518. return "error-row";
  1519. }
  1520. return "";
  1521. }
  1522. },
  1523. tableHeaderCellStyle() {
  1524. return "color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;";
  1525. },
  1526. // 1 显示编辑二维码弹窗
  1527. async showQRCodeInfo() {
  1528. if (this.selectRows.length === 0) {
  1529. this.$message.warning("请勾选您要编辑二维码的数据");
  1530. return;
  1531. }
  1532. if (this.selectRows.length > 1) {
  1533. this.$message.warning("一次只能编辑一个二维码");
  1534. return;
  1535. }
  1536. let flag = this.selectRows.some((u) => u.stateFlag != 1);
  1537. if (flag) {
  1538. return this.$message.warning(
  1539. "未提交数据不允许进行打印,请重新进行勾选"
  1540. );
  1541. }
  1542. this.isShowQrCodeInfo = true;
  1543. let entrIds = [];
  1544. this.selectRows.forEach((p) => {
  1545. entrIds.push(p.entrId);
  1546. });
  1547. // 2 初始化二维码信息
  1548. await this.initQrCode(this.selectRows[0].id);
  1549. // 3 获取二维码信息
  1550. await this.getQrCodeInfoListAndSetDefault();
  1551. },
  1552. // 初始化二维码信息
  1553. async initQrCode(id) {
  1554. await this.axios.get(
  1555. "pass/testManagement/v1/limssampleprints/initData/" + id,
  1556. {
  1557. params: {
  1558. dataType: 1,
  1559. isReset: 0,
  1560. },
  1561. },
  1562. { individualType: "json" }
  1563. );
  1564. },
  1565. // 获取二维码信息
  1566. async getQrCodeInfoList() {
  1567. const res = await this.axios.get(
  1568. "pass/testManagement/v1/limssampleprints/",
  1569. {
  1570. params: {
  1571. pageNum: this.page3.pageNum,
  1572. pageSize: this.page3.pageSize,
  1573. dataSourceId: this.selectRows[0].id,
  1574. isDelete: 0,
  1575. },
  1576. },
  1577. { individualType: "json" }
  1578. );
  1579. if (res.code == 0 || res.code == 200) {
  1580. this.qrCodeInfoData = res.data.list || [];
  1581. this.page3.totalPage = res.data.total;
  1582. } else {
  1583. this.$message.error(res.message);
  1584. }
  1585. return res;
  1586. },
  1587. // 获取二维码信息
  1588. async getQrCodeInfoListById(dataSourceId) {
  1589. const res = await this.axios.get(
  1590. "pass/testManagement/v1/limssampleprints/",
  1591. {
  1592. params: {
  1593. pageNum: 1,
  1594. pageSize: 999,
  1595. dataSourceId,
  1596. },
  1597. },
  1598. { individualType: "json" }
  1599. );
  1600. return res;
  1601. },
  1602. handleQrCodeInfoSelectionChange(val) {
  1603. console.log("handleQrCodeInfoSelectionChange");
  1604. console.log(this.qrCodeInfoData);
  1605. // 初始化勾选期间不进行操作
  1606. if (!this.isSetDefault) {
  1607. this.qrCodeInfoData.forEach((item) => {
  1608. item.isCheck = 0;
  1609. });
  1610. val.forEach((item) => {
  1611. item.isCheck = 1;
  1612. });
  1613. }
  1614. },
  1615. // 打开新增弹窗
  1616. addQrCodeInfo() {
  1617. this.isShowAddQrCodeInfo = true;
  1618. },
  1619. // 设置默认选中
  1620. setDefaultSelected() {
  1621. console.log("setDefaultSelected");
  1622. this.isSetDefault = true;
  1623. this.qrCodeInfoData.forEach((item) => {
  1624. if (item.isCheck === 1) {
  1625. console.log(item);
  1626. this.$refs.qrCodeInfoTable.toggleRowSelection(item, true);
  1627. }
  1628. });
  1629. this.isSetDefault = false;
  1630. },
  1631. // 确认添加
  1632. confirmAddQrCodeInfo() {
  1633. this.qrCodeInfoData.push({
  1634. ...this.addQrCodeInfoForm,
  1635. fieldKey: Date.now(),
  1636. dataSourceId: this.selectRows[0].id,
  1637. isCheck: 0,
  1638. isDelete: 0,
  1639. dataSourceType: 1, // 0 原料 1 成品 2 临时
  1640. });
  1641. this.isShowAddQrCodeInfo = false;
  1642. },
  1643. // 打开编辑窗口
  1644. editQrCodeInfoRow(index, row) {
  1645. this.editQrCodeInfoForm = row;
  1646. console.log("editQrCodeInfoRow");
  1647. console.log(this.editQrCodeInfoForm);
  1648. this.editQrCodeInfoIndex = index;
  1649. this.isShowEditQrCodeInfo = true;
  1650. },
  1651. // 删除二维码字段
  1652. delQrCodeInfoRow(index, row) {
  1653. this.qrCodeInfoData.splice(index, 1);
  1654. if (row.id) {
  1655. this.deleteIds.push(row.id);
  1656. }
  1657. },
  1658. // 确认编辑
  1659. confirmEditQrCodeInfo() {
  1660. this.$set(
  1661. this.qrCodeInfoData,
  1662. this.editQrCodeInfoIndex,
  1663. this.editQrCodeInfoForm
  1664. );
  1665. this.isShowEditQrCodeInfo = false;
  1666. },
  1667. // 重置二维码信息
  1668. resetQrCodeInfo() {
  1669. this.$confirm("确定重置二维码信息吗?", "提示", {
  1670. confirmButtonText: "确定",
  1671. cancelButtonText: "取消",
  1672. type: "warning",
  1673. }).then(async () => {
  1674. await this.axios.get(
  1675. "pass/testManagement/v1/limssampleprints/initData/" +
  1676. this.selectRows[0].id,
  1677. {
  1678. params: {
  1679. dataType: 1,
  1680. isReset: 1,
  1681. },
  1682. },
  1683. { individualType: "json" }
  1684. );
  1685. // 获取二维码信息
  1686. const res = await this.getQrCodeInfoListAndSetDefault();
  1687. this.$message.success(res.message);
  1688. });
  1689. },
  1690. // 保存二维码
  1691. async saveQRCode() {
  1692. console.log(this.qrCodeInfoData);
  1693. // 批量删除
  1694. const res = await this.axios.post(
  1695. "pass/testManagement/v1/limssampleprints/batchDelete/",
  1696. this.deleteIds,
  1697. { individualType: "json" }
  1698. );
  1699. if (res.code == 0 || res.code == 200) {
  1700. this.deleteIds = [];
  1701. }
  1702. // 批量更新
  1703. const res2 = await this.axios.post(
  1704. "pass/testManagement/v1/limssampleprints/batchUpdate/",
  1705. this.qrCodeInfoData,
  1706. { individualType: "json" }
  1707. );
  1708. if (res2.code == 0 || res2.code == 200) {
  1709. this.$message.success(res2.message);
  1710. await this.getQrCodeInfoListAndSetDefault();
  1711. // this.isShowQrCodeInfo = false;
  1712. }
  1713. },
  1714. async getQrCodeInfoListAndSetDefault() {
  1715. this.isSetDefault = true;
  1716. await this.getQrCodeInfoList();
  1717. this.$nextTick(async () => {
  1718. // 设置默认选中
  1719. this.setDefaultSelected();
  1720. });
  1721. },
  1722. // 保存并打印二维码
  1723. async saveAndPrintQRCode() {
  1724. await this.saveQRCode();
  1725. this.printQRCode();
  1726. },
  1727. },
  1728. };
  1729. </script>
  1730. <style scoped></style>