inspectionProudects.vue 70 KB

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