You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4216 lines
149 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
5 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
5 months ago
5 months ago
9 months ago
9 months ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-card :class="['search-card', { 'collapsed': !searchExpanded }]" shadow="hover">
  5. <div slot="header" class="search-header">
  6. <div class="header-left">
  7. <i class="el-icon-search"></i>
  8. <span class="header-title">Search</span>
  9. </div>
  10. <div class="header-right">
  11. <el-button
  12. type="text"
  13. size="small"
  14. @click="toggleSearchExpand"
  15. class="collapse-btn">
  16. <span>{{ searchExpanded ? '收起' : '展开' }}</span>
  17. <i :class="searchExpanded ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
  18. </el-button>
  19. </div>
  20. </div>
  21. <el-form
  22. :inline="true"
  23. label-position="top"
  24. :model="searchData"
  25. class="search-form"
  26. @keyup.enter.native="getDataList">
  27. <!-- 所有查询条件 - 可展开/收起 -->
  28. <template v-if="searchExpanded">
  29. <!-- 第一行 -->
  30. <el-row :gutter="16">
  31. <el-col :span="6">
  32. <el-form-item label="BU">
  33. <el-select v-model="searchData.buNo" placeholder="请选择" clearable>
  34. <el-option
  35. v-for="i in buList"
  36. :key="i.buNo"
  37. :label="i.buDesc"
  38. :value="i.buNo">
  39. </el-option>
  40. </el-select>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="6">
  44. <el-form-item label="检验单号">
  45. <el-input v-model="searchData.inspectionNo" placeholder="请输入检验单号" clearable>
  46. <i slot="prefix" class="el-input__icon el-icon-document"></i>
  47. </el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="6">
  51. <el-form-item label="单据号">
  52. <el-input v-model="searchData.poOrderNo" placeholder="请输入单据号" clearable>
  53. <i slot="prefix" class="el-input__icon el-icon-document"></i>
  54. </el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="6">
  58. <el-form-item label="单据行号">
  59. <el-input v-model="searchData.poItemNo" placeholder="请输入单据行号" clearable></el-input>
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. <!-- 第二行 -->
  64. <el-row :gutter="16">
  65. <el-col :span="6">
  66. <el-form-item label="物料编码">
  67. <el-input v-model="searchData.partNo" placeholder="请输入物料编码" clearable>
  68. <i slot="prefix" class="el-input__icon el-icon-goods"></i>
  69. </el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="6">
  73. <el-form-item label="物料名称">
  74. <el-input v-model="searchData.partDesc" placeholder="请输入物料名称" clearable>
  75. <i slot="prefix" class="el-input__icon el-icon-goods"></i>
  76. </el-input>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="6">
  80. <el-form-item label="SKU">
  81. <el-input v-model="searchData.sku" placeholder="请输入SKU" clearable></el-input>
  82. </el-form-item>
  83. </el-col>
  84. <el-col :span="6">
  85. <el-form-item label="PN">
  86. <el-input v-model="searchData.cinvSourceCode" placeholder="请输入PN" clearable></el-input>
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. <!-- 第三行 -->
  91. <el-row :gutter="16">
  92. <el-col :span="6">
  93. <el-form-item label="物料类别">
  94. <el-input v-model="searchData.invdefinetype" placeholder="请输入物料类别" clearable></el-input>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="6">
  98. <el-form-item label="供应商">
  99. <el-input v-model="searchData.supplierDesc" placeholder="请输入供应商" clearable></el-input>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="6">
  103. <el-form-item label="质检员">
  104. <el-input v-model="searchData.inspectorName" placeholder="请输入质检员姓名" clearable>
  105. <i slot="prefix" class="el-input__icon el-icon-user"></i>
  106. </el-input>
  107. </el-form-item>
  108. </el-col>
  109. <el-col :span="6">
  110. <el-form-item label="状态">
  111. <el-select v-model="searchData.states" multiple collapse-tags placeholder="请选择状态" class="status-select">
  112. <el-option label="未开始" value="未开始"></el-option>
  113. <el-option label="待检验" value="待检验"></el-option>
  114. <el-option label="待审核" value="待审核"></el-option>
  115. <el-option label="已完成" value="已完成"></el-option>
  116. </el-select>
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. <!-- 第四行 -->
  121. <el-row :gutter="16">
  122. <el-col :span="6">
  123. <el-form-item label="检验结论">
  124. <el-select v-model="searchData.inspectionResult" clearable placeholder="请选择检验结论">
  125. <el-option label="合格" value="合格">
  126. <i class="el-icon-success" style="color: #67C23A;"></i> 合格
  127. </el-option>
  128. <el-option label="不合格" value="不合格">
  129. <i class="el-icon-error" style="color: #F56C6C;"></i> 不合格
  130. </el-option>
  131. <el-option label="免检" value="免检">
  132. <i class="el-icon-circle-check" style="color: #409EFF;"></i> 免检
  133. </el-option>
  134. </el-select>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="6">
  138. <el-form-item label="处置措施">
  139. <el-select v-model="searchData.disposalMeasures" clearable placeholder="请选择处置措施">
  140. <el-option
  141. v-for="i in disposalMeasuresOptions"
  142. :key="i.id"
  143. :label="i.disposalMeasures"
  144. :value="i.disposalMeasures">
  145. </el-option>
  146. </el-select>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="6">
  150. <el-form-item label="采购类型">
  151. <el-select v-model="searchData.orderType" clearable placeholder="请选择采购类型">
  152. <el-option label="采购订单" value="采购订单"></el-option>
  153. <el-option label="委外订单" value="委外订单"></el-option>
  154. </el-select>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="6">
  158. <el-form-item label="送检类型">
  159. <el-select v-model="searchData.submissionType" clearable placeholder="请选择送检类型">
  160. <el-option label="厂内使用" value="厂内使用"></el-option>
  161. <el-option label="外协使用" value="外协使用"></el-option>
  162. <el-option label="其他" value="其他"></el-option>
  163. </el-select>
  164. </el-form-item>
  165. </el-col>
  166. </el-row>
  167. <!-- 第五行 -->
  168. <el-row :gutter="20">
  169. <el-col :span="12">
  170. <el-form-item label="送检日期">
  171. <el-date-picker
  172. v-model="searchData.startDate2"
  173. type="datetime"
  174. value-format='yyyy-MM-dd HH:mm'
  175. format='yyyy-MM-dd HH:mm'
  176. placeholder="开始日期"
  177. style="width: 44%">
  178. </el-date-picker>
  179. <span style="margin: 0 4px; color: #DCDFE6;">~</span>
  180. <el-date-picker
  181. v-model="searchData.endDate2"
  182. type="datetime"
  183. value-format='yyyy-MM-dd HH:mm'
  184. format='yyyy-MM-dd HH:mm'
  185. placeholder="结束日期"
  186. style="width: 44%">
  187. </el-date-picker>
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="12">
  191. <el-form-item label="检验时间">
  192. <el-date-picker
  193. v-model="searchData.startDate"
  194. type="datetime"
  195. value-format='yyyy-MM-dd HH:mm'
  196. format='yyyy-MM-dd HH:mm'
  197. placeholder="开始日期"
  198. style="width: 44%">
  199. </el-date-picker>
  200. <span style="margin: 0 4px; color: #DCDFE6;">~</span>
  201. <el-date-picker
  202. v-model="searchData.endDate"
  203. type="datetime"
  204. value-format='yyyy-MM-dd HH:mm'
  205. format='yyyy-MM-dd HH:mm'
  206. placeholder="结束日期"
  207. style="width: 44%">
  208. </el-date-picker>
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. </template>
  213. <!-- 操作按钮区域 -->
  214. <el-row :gutter="16">
  215. <el-col :span="24">
  216. <div class="search-actions">
  217. <div class="action-left">
  218. <el-button
  219. v-if="!authSearch"
  220. type="primary"
  221. icon="el-icon-search"
  222. :loading="searchLoading"
  223. @click="getDataList">
  224. 查询
  225. </el-button>
  226. <el-button
  227. icon="el-icon-refresh-left"
  228. @click="resetSearch">
  229. 重置
  230. </el-button>
  231. </div>
  232. <div class="action-right">
  233. <el-button
  234. v-if="!authCheck"
  235. type="success"
  236. icon="el-icon-check"
  237. @click="submitResult">
  238. 审核
  239. </el-button>
  240. <el-button
  241. v-if="!authCancelCheck"
  242. type="warning"
  243. icon="el-icon-close"
  244. @click="cancelApproval">
  245. 取消审核
  246. </el-button>
  247. <el-button
  248. v-if="!authDelete"
  249. type="danger"
  250. icon="el-icon-delete"
  251. @click="deleteModal">
  252. 删除
  253. </el-button>
  254. <el-button
  255. v-if="!authOverLoad"
  256. icon="el-icon-refresh"
  257. @click="overLoadModal">
  258. 任务重载
  259. </el-button>
  260. <el-button
  261. icon="el-icon-printer"
  262. @click="printList">
  263. 打印
  264. </el-button>
  265. <el-button
  266. icon="el-icon-download"
  267. @click="exportExcel()">
  268. 导出
  269. </el-button>
  270. </div>
  271. </div>
  272. </el-col>
  273. </el-row>
  274. </el-form>
  275. </el-card>
  276. <!-- 检验记录展示列表 -->
  277. <el-table
  278. :height="height"
  279. :data="dataList"
  280. border
  281. ref="IQCTable"
  282. @row-click="IQCClickRow"
  283. @selection-change="selectionIQC"
  284. style="width: 100%;">
  285. <el-table-column
  286. type="selection"
  287. header-align="center"
  288. align="center"
  289. width="50">
  290. </el-table-column>
  291. <el-table-column
  292. prop="state"
  293. header-align="center"
  294. align="center"
  295. label="状态">
  296. <template slot-scope="scope">
  297. <div :style="{fontWeight:'bold', color: scope.row.state === '待检验' ? 'red' : scope.row.state === '待审核' ? '#ffa500e0' : scope.row.state === '已完成' ? '#3ac252' : ''}">
  298. {{ scope.row.state }}
  299. </div>
  300. </template>
  301. </el-table-column>
  302. <el-table-column
  303. v-for="(item,index) in columnList1" :key="index"
  304. :sortable="item.columnSortable"
  305. :prop="item.columnProp"
  306. :header-align="item.headerAlign"
  307. :show-overflow-tooltip="item.showOverflowTooltip"
  308. :align="item.align"
  309. :fixed="item.fixed===''?false:item.fixed"
  310. :min-width="item.columnWidth"
  311. :label="item.columnLabel">
  312. <template slot-scope="scope">
  313. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  314. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  315. </template>
  316. </el-table-column>
  317. <el-table-column
  318. fixed="right"
  319. header-align="center"
  320. align="center"
  321. width="130"
  322. label="操作">
  323. <template slot-scope="scope">
  324. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state === '未开始'" @click="actionModal(scope.row)">开始检验</el-link>
  325. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">检验单</el-link>
  326. <el-link style="cursor: pointer" v-if="!authFile" @click="getFileContentData(scope.row)">工作文件</el-link>
  327. </template>
  328. </el-table-column>
  329. </el-table>
  330. <!-- 分页-->
  331. <el-pagination
  332. style="margin-top: 0px"
  333. @size-change="sizeChangeHandle"
  334. @current-change="currentChangeHandle"
  335. :current-page="pageIndex"
  336. :page-sizes="[20, 50, 100, 200, 500]"
  337. :page-size="pageSize"
  338. :total="totalPage"
  339. layout="total, sizes, prev, pager, next, jumper">
  340. </el-pagination>
  341. <!-- 检验单详情页 -->
  342. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1200px">
  343. <el-form :inline="true" label-position="top">
  344. <el-form-item :label="'物料编码'">
  345. <el-input v-model="detailData.partNo" disabled style="width: 100px"></el-input>
  346. </el-form-item>
  347. <el-form-item :label="'物料类别'">
  348. <el-input v-model="detailData.invdefinetype" readonly style="width: 100px"></el-input>
  349. </el-form-item>
  350. <el-form-item :label="'PN'">
  351. <el-input v-model="detailData.cinvSourceCode" readonly style="width: 100px"></el-input>
  352. </el-form-item>
  353. <el-form-item :label="'SKU'">
  354. <el-input v-model="detailData.sku" readonly style="width: 100px"></el-input>
  355. </el-form-item>
  356. <el-form-item :label="'物料名称'">
  357. <el-input v-model="detailData.partDesc" disabled style="width: 300px"></el-input>
  358. </el-form-item>
  359. <el-form-item :label="'单位'">
  360. <el-input v-model="detailData.umId" disabled style="width: 60px"></el-input>
  361. </el-form-item>
  362. <el-form-item>
  363. <span v-if="detailData.submitFlag === 'Y'" slot="label">协同人员</span>
  364. <span v-else style="cursor: pointer" slot="label" @click="getOperatorList"><a>协同人员</a></span>
  365. <el-input v-model="detailData.operatorName" readonly style="width: 150px"></el-input>
  366. </el-form-item>
  367. <el-form-item>
  368. <span v-if="detailData.submitFlag === 'Y'" slot="label">责任人</span>
  369. <span v-else style="cursor: pointer" slot="label" @click="getResponsiblePersonList"><a>责任人</a></span>
  370. <el-input v-model="detailData.responsiblePersonName" readonly style="width: 150px"></el-input>
  371. </el-form-item>
  372. </el-form>
  373. <el-form :inline="true" label-position="top">
  374. <el-form-item :label="'到货数量'">
  375. <el-input-number :controls="false" :step="0" v-model="detailData.rollQty" disabled style="width: 81px"></el-input-number>
  376. </el-form-item>
  377. <el-form-item :label="'送检数量'">
  378. <el-input-number :controls="false" :step="0" v-model="detailData.rollCount" style="width: 81px"></el-input-number>
  379. </el-form-item>
  380. <el-form-item :label="'抽样数量'">
  381. <el-input-number :controls="false" :step="0" v-model="detailData.samplingQty" style="width: 81px"></el-input-number>
  382. </el-form-item>
  383. <el-form-item :label="'合格数量'">
  384. <el-input-number :controls="false" :step="0" min="0" v-if="detailData.submitFlag === 'Y'" v-model="detailData.passQty" disabled style="width: 81px"></el-input-number>
  385. <el-input-number :controls="false" :step="0" min="0" v-else v-model="detailData.passQty" style="width: 81px"></el-input-number>
  386. </el-form-item>
  387. <el-form-item :label="'不合格数量'">
  388. <el-input-number :controls="false" :step="0" min="0" v-model="detailData.notPassQty" disabled style="width: 81px"></el-input-number>
  389. </el-form-item>
  390. <el-form-item :label="'不合格项目数量'">
  391. <el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled style="width: 81px"></el-input-number>
  392. <el-input-number :controls="false" :step="0" v-else v-model="detailData.unqualifiedQty" style="width: 81px"></el-input-number>
  393. </el-form-item>
  394. <el-form-item :label="'批次不合格数'">
  395. <el-input-number :controls="false" min="0" v-model="detailData.noBatchQualifiedQty" @change="noBatchQualifiedQtyChange()" style="width: 81px"></el-input-number>
  396. </el-form-item>
  397. <el-form-item :label="'批次合格数'">
  398. <el-input-number :controls="false" :step="0" min="0" disabled v-model="detailData.batchQualifiedQty" style="width: 81px"></el-input-number>
  399. </el-form-item>
  400. <el-form-item style="margin-top: 13px;margin-left: 235px">
  401. <el-button v-if="detailData.submitFlag !== 'Y'" :loading="loadFlag" @click="dataAcquisition">
  402. <svg t="1739002700745" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="38076" width="22" height="22"><path d="M922.000696 762.746435V465.363478l55.652174-0.111304v299.542261c0 131.695304-106.562783 239.571478-236.922435 239.571478H285.42887C155.158261 1004.365913 48.484174 896.623304 48.484174 764.794435V465.252174h59.258435v299.542261c0 101.843478 77.022609 179.712 177.775304 179.712H740.841739c100.61913 0 181.158957-79.916522 181.158957-181.76z" fill="#1D293F" p-id="38077"></path><path d="M290.148174 192.556522c20.301913-20.925217 30.47513-48.617739 30.47513-83.099826 0-72.548174-36.285217-108.833391-108.722087-108.833392H141.401043v223.365566h70.255305c32.055652-0.111304 58.167652-10.529391 78.491826-31.432348z m-105.227131-7.635479V39.446261h23.596522c19.70087 0 35.661913 6.166261 47.994435 18.632348 12.354783 12.466087 18.387478 29.740522 18.387478 52.001391 0 22.973217-5.921391 41.22713-17.652869 54.650435s-27.937391 20.190609-48.617739 20.190608H184.921043zM634.434783 595.366957h-84.057044V498.866087a102.511304 102.511304 0 0 0 74.262261-98.54887c0-56.230957-45.478957-102.310957-101.10887-102.310956-55.629913 0-101.086609 46.08-101.086608 102.310956 0 46.08 30.586435 85.25913 72.192 97.947826v96.990609h-81.252174c-16.829217-43.78713-50.688-99.283478-81.65287-143.070609a101.331478 101.331478 0 0 0 14.269218-52.001391c0-56.230957-45.946435-102.310957-102.177392-102.310956s-102.177391 46.08-102.177391 102.310956c0 56.230957 45.946435 102.310957 102.177391 102.310957 15.716174 0 30.72-3.628522 44.009739-10.017392 21.170087 34.326261 42.829913 74.351304 57.811479 102.778435h-73.906087l128.333913 130.493218 94.675478-108.966957v145.853217h-111.616l148.034783 148.858435 130.715826-148.858435h-111.504696v-129.402434l91.180522 92.516174 113.307826-130.248348h-53.203478c14.758957-28.42713 36.173913-68.452174 57.210434-102.800696 13.178435 6.41113 27.937391 10.039652 43.542261 10.039652 55.629913 0 101.086609-46.08 101.086609-102.310956 0-56.230957-45.456696-102.310957-101.086609-102.310957-55.652174 0-101.220174 46.08-101.220174 102.310957a102.4 102.4 0 0 0 14.135653 52.001391c-30.72 43.653565-64.200348 99.283478-80.896 142.937044z m-390.611479-148.48a46.614261 46.614261 0 0 1-46.436174-46.458435c0-25.510957 20.925217-46.436174 46.436174-46.436174s46.436174 20.925217 46.436174 46.436174-20.925217 46.436174-46.436174 46.436174z m279.819131 0c-25.266087 0-45.946435-20.925217-45.946435-46.458435 0-25.510957 20.702609-46.436174 45.968696-46.436174 25.266087 0 45.946435 20.925217 45.946434 46.436174s-20.680348 46.436174-45.946434 46.436174z m278.639304-93.005914c25.288348 0 45.968696 20.925217 45.968696 46.436174s-20.702609 46.436174-45.968696 46.436174c-25.266087 0-45.946435-20.925217-45.946435-46.436174s20.680348-46.436174 45.946435-46.436174zM395.130435 172.722087h74.128695l15.248696 51.155478h47.415652L458.707478 0.623304h-51.155478L332.8 223.98887h47.170783l15.11513-51.266783z m32.768-114.777044c1.825391-6.032696 3.027478-12.332522 3.517217-18.854956h1.202087c0.601043 8.102957 1.691826 14.514087 3.138783 19.456l23.218087 77.401043h-54.405566l23.329392-78.002087z m168.96 165.932522h43.631304V39.446261h58.189913V0.623304h-159.877565v38.956522h58.056348v184.297739z m169.894956-51.155478h74.128696l15.248696 51.155478h47.415652L830.330435 0.623304h-51.155478l-74.752 223.365566h47.193043l15.09287-51.266783z m32.768-114.777044c1.825391-6.032696 3.027478-12.332522 3.517218-18.854956h1.202087c0.601043 8.102957 1.691826 14.514087 3.161043 19.456l23.218087 77.401043h-54.427826l23.329391-78.002087z" fill="#FD9F01" p-id="38078"></path></svg>
  403. </el-button>
  404. <el-button @click="getFileContentData(detailData)">
  405. <svg t="1739002974630" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="59598" width="22" height="22"><path d="M807.3216 889.5488H221.184c-78.7456 0-142.848-64.1024-142.848-142.848V286.976c0-78.7456 64.1024-142.848 142.848-142.848h178.8416c20.7872 0 40.7552 8.8064 54.784 24.1664l77.568 85.0944c2.4064 2.6112 5.8368 4.1472 9.3696 4.1472h265.5232c78.7456 0 142.848 64.1024 142.848 142.848v346.2656c0.0512 78.7968-64.0512 142.8992-142.7968 142.8992zM221.184 205.568c-44.9024 0-81.408 36.5056-81.408 81.408v459.6736c0 44.9024 36.5056 81.408 81.408 81.408h586.1376c44.9024 0 81.408-36.5056 81.408-81.408V400.4352c0-44.9024-36.5056-81.408-81.408-81.408h-265.5232c-20.7872 0-40.7552-8.8064-54.784-24.1664L409.3952 209.7152c-2.4064-2.6112-5.8368-4.1472-9.3696-4.1472H221.184z" fill="#6FB1F9" p-id="59599"></path><path d="M466.0224 453.8368H249.0368c-16.9472 0-30.72-13.7728-30.72-30.72s13.7728-30.72 30.72-30.72h216.9856c16.9472 0 30.72 13.7728 30.72 30.72s-13.7728 30.72-30.72 30.72z" fill="#6FB1F9" p-id="59600"></path></svg>
  406. </el-button>
  407. <el-button @click="subDetailUpload">
  408. <svg t="1739002903501" class="icon" viewBox="0 0 1550 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="50418" width="22" height="22"><path d="M985.000229 727.917714c20.48 0 34.113829-13.663086 34.113828-34.143085 0-10.24-3.393829-17.056914-10.24-23.873829l-204.8-204.8c-6.816914-6.846171-13.633829-10.24-23.873828-10.24-10.24 0-17.086171 3.393829-23.903086 10.24l-204.8 204.8c-6.816914 6.816914-10.24 13.633829-10.24 23.873829 0 20.48 13.663086 34.143086 34.143086 34.143085 10.24 0 17.056914-3.423086 23.873828-10.24l146.783086-146.783085v395.966171c0 20.48 13.663086 34.113829 34.143086 34.113829s34.113829-13.633829 34.113828-34.113829V570.894629l146.783086 146.783085c6.816914 6.816914 13.663086 10.24 23.903086 10.24z m282.799542-353.045943c0-10.24 1.287314-17.086171 0-27.296914C1240.502857 128.117029 1043.0464 29.257143 858.199771 29.257143 701.205943 29.257143 564.662857 117.994057 496.405943 247.720229 469.079771 240.874057 441.782857 234.057143 414.485943 234.057143 281.365943 234.057143 175.542857 307.112229 175.542857 440.232229c0 17.056914 3.423086 34.113829 6.816914 51.2C97.514057 535.786057 29.257143 585.5232 29.257143 723.031771c0 170.656914 136.543086 277.942857 307.2 277.942858H585.142857c20.48 0 34.143086-13.633829 34.143086-34.113829S605.622857 932.717714 585.142857 932.717714h-248.685714c-133.12 0-238.943086-76.565943-238.943086-209.685943 0-82.797714 37.566171-131.657143 105.325714-166.765714l58.046172-20.48-13.663086-61.44c-3.423086-10.24-3.423086-23.873829-3.423086-34.113828 0-95.583086 75.103086-137.918171 170.686172-137.918172 20.48 0 37.536914 3.423086 58.016914 10.24l54.623086 20.48 27.296914-51.2c61.44-112.64 179.317029-198.100114 303.776914-184.32 184.846629 20.48 309.511314 71.68 341.343086 250.0608 1.199543 6.787657 0 10.24 0 17.056914v6.846172l-3.423086 47.776914 44.383086 20.48c110.094629 34.6112 222.354286 143.36 222.354286 249.183086 0 150.176914-122.88 243.799771-273.056914 243.799771h-214.571886c-20.48 0-34.113829 13.663086-34.113829 34.143086s13.633829 34.113829 34.113829 34.113829h214.571886c187.713829 0 341.313829-124.342857 341.313828-312.056686 0-144.530286-121.270857-269.663086-263.314286-314.046172z" fill="#6C5FFC" p-id="50419"></path></svg>
  409. </el-button>
  410. </el-form-item>
  411. </el-form>
  412. <el-form :inline="true" label-position="top" style="display: flex; align-items: flex-start;margin-right: 11px">
  413. <el-form-item :label="'检验结论'">
  414. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  415. <el-option label="合格" value="合格"></el-option>
  416. <el-option label="不合格" value="不合格"></el-option>
  417. </el-select>
  418. <el-select v-else v-model="detailData.inspectionResult" @change="resultChange" style="width: 100px" placeholder="请选择">
  419. <el-option label="合格" value="合格"></el-option>
  420. <el-option label="不合格" value="不合格"></el-option>
  421. </el-select>
  422. </el-form-item>
  423. <el-form-item :label="'质检备注'">
  424. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 293px"></el-input>
  425. <el-input v-else v-model="detailData.inspectionRemark" style="width: 293px"></el-input>
  426. </el-form-item>
  427. <el-form-item v-show="detailData.inspectionResult === '不合格'" :label="'处置措施'">
  428. <el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
  429. <el-option
  430. v-for = "i in disposalMeasuresOptions"
  431. :key = "i.id"
  432. :label = "i.disposalMeasures"
  433. :value = "i.disposalMeasures">
  434. </el-option>
  435. </el-select>
  436. <el-select v-else clearable v-model="detailData.disposalMeasures" style="width: 100px">
  437. <el-option
  438. v-for = "i in disposalMeasuresOptions"
  439. :key = "i.id"
  440. :label = "i.disposalMeasures"
  441. :value = "i.disposalMeasures">
  442. </el-option>
  443. </el-select>
  444. </el-form-item>
  445. <el-form-item v-show="detailData.inspectionResult === '不合格'" :label="'处置说明'">
  446. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled style="width: 293px"></el-input>
  447. <el-input v-else v-model="detailData.disposalRemark" style="width: 293px"></el-input>
  448. </el-form-item>
  449. <el-form-item :label="' '" style="margin-left: auto; margin-top: -10px">
  450. <el-button class="operation-btn item-operation-btn" @click="openItemOperationDialog">
  451. <i class="el-icon-setting"></i>
  452. <span>项目导入</span>
  453. </el-button>
  454. <el-button class="operation-btn template-import-btn" @click="openTemplateImportDialog">
  455. <i class="el-icon-download"></i>
  456. <span>模板导入</span>
  457. </el-button>
  458. </el-form-item>
  459. </el-form>
  460. <!-- 展示列表 -->
  461. <div class="rq ">
  462. <el-table
  463. :height="500"
  464. :data="detailList"
  465. border
  466. style="width: 100%;">
  467. <el-table-column
  468. prop=""
  469. header-align="center"
  470. align="center"
  471. min-width="90"
  472. label="操作">
  473. <template slot-scope="scope">
  474. <el-button icon="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  475. <el-button style="margin-left: 2px" icon="el-icon-s-platform" type="primary" :loading="loadFlag" @click="dataAcquisitionByItem(scope.row)"></el-button>
  476. </template>
  477. </el-table-column>
  478. <el-table-column
  479. v-for="(item,index) in detailColumnList" :key="index"
  480. :sortable="item.columnSortable"
  481. :prop="item.columnProp"
  482. :header-align="item.headerAlign"
  483. :show-overflow-tooltip="item.showOverflowTooltip"
  484. :align="item.align"
  485. :fixed="item.fixed===''?false:item.fixed"
  486. :min-width="item.columnWidth"
  487. :label="item.columnLabel">
  488. <template slot-scope="scope">
  489. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  490. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  491. </template>
  492. </el-table-column>
  493. <el-table-column
  494. prop=""
  495. header-align="center"
  496. align="right"
  497. min-width="80"
  498. label="实测值">
  499. <template slot-scope="scope">
  500. <el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numberValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" type="number" @change="updateItemResult(scope.row)" style="height: 11px; width: 98%"></el-input>
  501. <el-input :ref="`textValue${scope.$index}`" v-else v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px; width: 98%"></el-input>
  502. </template>
  503. </el-table-column>
  504. <el-table-column
  505. prop=""
  506. header-align="center"
  507. align="center"
  508. min-width="80"
  509. label="检验明细">
  510. <template slot-scope="scope">
  511. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
  512. <el-button v-else type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  513. </template>
  514. </el-table-column>
  515. <el-table-column
  516. prop=""
  517. header-align="center"
  518. align="right"
  519. min-width="80"
  520. label="抽样数量">
  521. <template slot-scope="scope">
  522. <el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.samplingQty" disabled style="height: 11px; width: 98%"></el-input-number>
  523. <el-input-number :controls="false" :step="0" v-else :ref="`samplingQty${scope.$index}`" v-model="scope.row.samplingQty" @keyup.enter.native="focusNextInput(scope.$index, 'samplingQty')" style="height: 11px; width: 98%"></el-input-number>
  524. </template>
  525. </el-table-column>
  526. <el-table-column
  527. prop=""
  528. header-align="center"
  529. align="right"
  530. min-width="80"
  531. label="不合格数量">
  532. <template slot-scope="scope">
  533. <el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled style="height: 11px; width: 98%"></el-input-number>
  534. <el-input-number :controls="false" :step="0" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
  535. </template>
  536. </el-table-column>
  537. <el-table-column
  538. prop=""
  539. header-align="center"
  540. align="right"
  541. min-width="90"
  542. label="项目检验结论">
  543. <template slot-scope="scope">
  544. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
  545. <el-option label="合格" value="Y" style="color: green"></el-option>
  546. <el-option label="不合格" value="N" style="color: red"></el-option>
  547. </el-select>
  548. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  549. <el-option label="合格" value="Y" style="color: green"></el-option>
  550. <el-option label="不合格" value="N" style="color: red"></el-option>
  551. </el-select>
  552. </template>
  553. </el-table-column>
  554. </el-table>
  555. </div>
  556. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  557. <el-button v-if="detailData.state === '待检验'" type="primary" :loading="transferLoadFlag" @click="Transfer('1')">应用</el-button>
  558. <el-button v-if="detailData.state === '待检验' || detailData.state === '待审核'" type="primary" :loading="transferLoadFlag" @click="Transfer('2')">保存</el-button>
  559. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  560. </el-footer>
  561. </el-dialog>
  562. <!-- 文件清单 -->
  563. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  564. <el-form :inline="true" label-position="top">
  565. <el-form-item v-if="detailInformationFlag">
  566. <el-button type="primary" @click="addUploadFileModal">上传文件</el-button>
  567. </el-form-item>
  568. </el-form>
  569. <iqc-file-table :columns="fileColumnList" :data-list="fileContentList" :query-loading="fileLoading"></iqc-file-table>
  570. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  571. <el-button type="primary" @click="fileFlag = false">关闭</el-button>
  572. </el-footer>
  573. </el-dialog>
  574. <!-- 子明细信息 -->
  575. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="1102px">
  576. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  577. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  578. <el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
  579. <div class="rq ">
  580. <el-table
  581. :height="400"
  582. :data="templateTableData"
  583. border
  584. v-loading="subDetailLoading"
  585. element-loading-text="拼命加载中"
  586. :row-class-name="rowClassName"
  587. @selection-change="handleDetailSelectionChange"
  588. style="width: 100%;">
  589. <el-table-column type="selection" align="center" width="40"></el-table-column>
  590. <el-table-column label="序号" align="center" prop="num" width="50"></el-table-column>
  591. <el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="120">
  592. <template slot-scope="{row}">
  593. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
  594. <el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
  595. </template>
  596. </el-table-column>
  597. <el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="120">
  598. <template slot-scope="{row}">
  599. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
  600. <el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
  601. </template>
  602. </el-table-column>
  603. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值A" width="150">
  604. <template slot-scope="{row}">
  605. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值A"></el-input>
  606. <el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值A"></el-input>
  607. </template>
  608. </el-table-column>
  609. <el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true" label="实测值B" width="150">
  610. <template slot-scope="{row}">
  611. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueB" readonly placeholder="请输入实测值B"></el-input>
  612. <el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" placeholder="请输入实测值B"></el-input>
  613. </template>
  614. </el-table-column>
  615. <el-table-column prop="subDetailValueC" header-align="center" align="center" :required="true" label="实测值C" width="150">
  616. <template slot-scope="{row}">
  617. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueC" readonly placeholder="请输入实测值C"></el-input>
  618. <el-input v-else :ref="`${row.xh-1}` + `e`" v-model="templateTableData[row.xh-1].subDetailValueC" @keyup.enter.native="nextFocus5(row.xh-1)" placeholder="请输入实测值C"></el-input>
  619. </template>
  620. </el-table-column>
  621. <el-table-column prop="subDetailValueD" header-align="center" align="center" :required="true" label="实测值D" width="150">
  622. <template slot-scope="{row}">
  623. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueD" readonly placeholder="请输入实测值D"></el-input>
  624. <el-input v-else :ref="`${row.xh-1}` + `f`" v-model="templateTableData[row.xh-1].subDetailValueD" @keyup.enter.native="nextFocus6(row.xh-1)" placeholder="请输入实测值D"></el-input>
  625. </template>
  626. </el-table-column>
  627. <el-table-column prop="subDetailValueE" header-align="center" align="center" :required="true" label="实测值E" width="150">
  628. <template slot-scope="{row}">
  629. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueE" readonly placeholder="请输入实测值E"></el-input>
  630. <el-input v-else :ref="`${row.xh-1}` + `g`" v-model="templateTableData[row.xh-1].subDetailValueE" @keyup.enter.native="nextFocus7(row.xh-1)" placeholder="请输入实测值E"></el-input>
  631. </template>
  632. </el-table-column>
  633. </el-table>
  634. <!-- 分页-->
  635. <el-pagination
  636. @size-change="sizeChangeHandle2"
  637. @current-change="currentChangeHandle2"
  638. :current-page="pageIndex2"
  639. :page-sizes="[20, 50, 100, 200, 500]"
  640. :page-size="pageSize2"
  641. :total="tableData.length"
  642. layout="total, sizes, prev, pager, next, jumper">
  643. </el-pagination>
  644. </div>
  645. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  646. <el-button v-if="detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">保存</el-button>
  647. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  648. </el-footer>
  649. </el-dialog>
  650. <!-- 批量新增子明细操作-->
  651. <el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
  652. <el-form :inline="true" label-position="top">
  653. <el-form-item :label="'默认抽样位置A'">
  654. <el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
  655. </el-form-item>
  656. <el-form-item :label="'默认抽样位置B'">
  657. <el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
  658. </el-form-item>
  659. <el-form-item :label="'抽样数量'">
  660. <el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
  661. </el-form-item>
  662. </el-form>
  663. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  664. <el-button type="primary" @click="batchHandleAddModal">保存</el-button>
  665. <el-button type="primary" @click="batchHandleAddModalFlag = false">关闭</el-button>
  666. </el-footer>
  667. </el-dialog>
  668. <!-- 机修人员清单 -->
  669. <el-dialog title="人员清单" :close-on-click-modal="false" v-drag :visible.sync="operatorModelFlag" width="820px">
  670. <div class="rq">
  671. <el-form :inline="true" label-position="top" :model="operatorData">
  672. <el-form-item v-if="operatorData.flag !== '2'" :label="'所属角色'">
  673. <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px">
  674. <el-option
  675. v-for = "i in roleList"
  676. :key = "i.roleId"
  677. :label = "i.roleName"
  678. :value = "i.roleId">
  679. </el-option>
  680. </el-select>
  681. </el-form-item>
  682. <el-form-item :label="'用户编码'">
  683. <el-input v-model="operatorData.adminID" clearable style="width: 120px"></el-input>
  684. </el-form-item>
  685. <el-form-item :label="'用户姓名'">
  686. <el-input v-model="operatorData.adminName" clearable style="width: 120px"></el-input>
  687. </el-form-item>
  688. <el-form-item :label="' '">
  689. <el-button type="primary" @click="getOperatorList2">查询</el-button>
  690. </el-form-item>
  691. </el-form>
  692. <el-table
  693. :height="300"
  694. :data="operatorList"
  695. ref="operatorTable"
  696. @row-click="operatorClickRow"
  697. @selection-change="selectionChangeHandle2"
  698. border
  699. style="width: 100%;">
  700. <el-table-column
  701. type="selection"
  702. header-align="center"
  703. align="center"
  704. width="50">
  705. </el-table-column>
  706. <el-table-column
  707. v-for="(item,index) in operatorDetailList" :key="index"
  708. :sortable="item.columnSortable"
  709. :prop="item.columnProp"
  710. :header-align="item.headerAlign"
  711. :show-overflow-tooltip="item.showOverflowTooltip"
  712. :align="item.align"
  713. :fixed="item.fixed==''?false:item.fixed"
  714. :min-width="item.columnWidth"
  715. :label="item.columnLabel">
  716. <template slot-scope="scope">
  717. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  718. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  719. </template>
  720. </el-table-column>
  721. </el-table>
  722. </div>
  723. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  724. <el-button type="primary" @click="confirmOperator">确认</el-button>
  725. <el-button type="primary" @click="operatorModelFlag = false">关闭</el-button>
  726. </el-footer>
  727. </el-dialog>
  728. <!-- 配置项目设备 -->
  729. <el-dialog title="检验项目" :close-on-click-modal="false" v-drag :visible.sync="ItemObjectModelFlag" width="666px">
  730. <el-table
  731. :height="350"
  732. :data="itemObjectList"
  733. border
  734. style="width: 100%; ">
  735. <el-table-column
  736. v-for="(item,index) in itemObjectColumnList" :key="index"
  737. :sortable="item.columnSortable"
  738. :prop="item.columnProp"
  739. :header-align="item.headerAlign"
  740. :show-overflow-tooltip="item.showOverflowTooltip"
  741. :align="item.align"
  742. :fixed="item.fixed===''?false:item.fixed"
  743. :min-width="item.columnWidth"
  744. :label="item.columnLabel">
  745. <template slot-scope="scope">
  746. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  747. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  748. </template>
  749. </el-table-column>
  750. <el-table-column
  751. header-align="center"
  752. align="center"
  753. min-width="100"
  754. label="设备">
  755. <template slot-scope="scope">
  756. <el-select v-model="scope.row.equipmentNo" style="height: 11px" placeholder="请选择设备">
  757. <el-option
  758. v-for = "i in scope.row.objectList"
  759. :key = "i.objectID"
  760. :label = "i.objectDesc"
  761. :value = "i.objectID">
  762. </el-option>
  763. </el-select>
  764. </template>
  765. </el-table-column>
  766. </el-table>
  767. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  768. <el-button type="primary" @click="actionModal2">保存</el-button>
  769. <el-button type="primary" @click="ItemObjectModelFlag=false">关闭</el-button>
  770. </el-footer>
  771. </el-dialog>
  772. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  773. <!-- 上传文件的modal -->
  774. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="()=>{this.getFileContentData(this.detailData)}" v-drag></qcFAIUploadFile>
  775. <!-- 上传文件的modal -->
  776. <comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData" v-drag></comQcItemImageUploadFile>
  777. <!-- 子明细导入 -->
  778. <subDetailUpload @changeEvent="changeMyString" ref="subDetailUpload" @refreshPageTables="getInspectionFormData" v-drag></subDetailUpload>
  779. <!-- 打印标签 -->
  780. <qr-code ref="qrCode"></qr-code>
  781. <!-- 项目操作对话框 -->
  782. <el-dialog
  783. title="检验项目操作"
  784. @close="refreshInspectionDetailList"
  785. :close-on-click-modal="false"
  786. v-drag
  787. :visible.sync="itemOperationDialogFlag"
  788. width="1200px"
  789. custom-class="item-operation-dialog">
  790. <!-- 查询区域 -->
  791. <div class="search-container">
  792. <el-form :inline="true" size="small">
  793. <el-form-item label="项目编码">
  794. <el-input
  795. v-model="itemOperationQuery.itemNo"
  796. placeholder="请输入项目编码"
  797. clearable
  798. prefix-icon="el-icon-search"
  799. style="width: 160px">
  800. </el-input>
  801. </el-form-item>
  802. <el-form-item label="项目名称">
  803. <el-input
  804. v-model="itemOperationQuery.itemDesc"
  805. placeholder="请输入项目名称"
  806. clearable
  807. prefix-icon="el-icon-search"
  808. style="width: 200px">
  809. </el-input>
  810. </el-form-item>
  811. <el-button type="primary" icon="el-icon-search" size="small" @click="searchIQCItems">查询</el-button>
  812. <el-button icon="el-icon-refresh" size="small" @click="resetItemQuery">重置</el-button>
  813. </el-form>
  814. </div>
  815. <!-- 主内容区域 -->
  816. <div class="item-operation-content">
  817. <!-- 可选项目列表 -->
  818. <div class="item-panel available-panel">
  819. <div class="panel-header">
  820. <i class="el-icon-menu"></i>
  821. <span class="panel-title">可选项目列表</span>
  822. <span class="item-count">{{ availableItemList.length }}</span>
  823. </div>
  824. <el-table
  825. ref="availableItemTable"
  826. :data="availableItemList"
  827. @row-click="availableItemClickRow"
  828. @selection-change="availableItemSelectionChange"
  829. highlight-current-row
  830. class="operation-table"
  831. height="400"
  832. border>
  833. <el-table-column type="selection" width="45" align="center"></el-table-column>
  834. <el-table-column prop="itemNo" label="项目编码" min-width="120"></el-table-column>
  835. <el-table-column prop="itemDesc" label="项目名称" min-width="180" show-overflow-tooltip></el-table-column>
  836. </el-table>
  837. </div>
  838. <!-- 操作按钮 -->
  839. <div class="operation-buttons">
  840. <el-tooltip content="添加选中项目" placement="left">
  841. <el-button
  842. type="primary"
  843. icon="el-icon-d-arrow-right"
  844. circle
  845. @click="addInspectionItems"
  846. :disabled="!availableItemSelections || availableItemSelections.length === 0">
  847. </el-button>
  848. </el-tooltip>
  849. <el-tooltip content="移除选中项目" placement="right">
  850. <el-button
  851. type="danger"
  852. icon="el-icon-d-arrow-left"
  853. circle
  854. @click="deleteInspectionItems"
  855. :disabled="!selectedItemSelections || selectedItemSelections.length === 0">
  856. </el-button>
  857. </el-tooltip>
  858. </div>
  859. <!-- 已有项目列表 -->
  860. <div class="item-panel selected-panel">
  861. <div class="panel-header">
  862. <i class="el-icon-tickets"></i>
  863. <span class="panel-title">已有项目列表</span>
  864. <span class="item-count">{{ selectedItemList.length }}</span>
  865. </div>
  866. <el-table
  867. ref="selectedItemTable"
  868. :data="selectedItemList"
  869. @row-click="selectedItemClickRow"
  870. @selection-change="selectedItemSelectionChange"
  871. highlight-current-row
  872. class="operation-table"
  873. height="400"
  874. border>
  875. <el-table-column type="selection" width="45" align="center"></el-table-column>
  876. <el-table-column prop="itemNo" label="项目编码" min-width="120"></el-table-column>
  877. <el-table-column prop="itemDesc" label="项目名称" min-width="180" show-overflow-tooltip></el-table-column>
  878. </el-table>
  879. </div>
  880. </div>
  881. <!-- 底部按钮 -->
  882. <div slot="footer" class="dialog-footer">
  883. <el-button @click="itemOperationDialogFlag = false" size="small" style="width: 80px;">关闭</el-button>
  884. </div>
  885. </el-dialog>
  886. <!-- 模板导入对话框 -->
  887. <el-dialog
  888. title="模板导入"
  889. :close-on-click-modal="false"
  890. v-drag
  891. :visible.sync="templateImportDialogFlag"
  892. width="900px"
  893. custom-class="template-import-dialog">
  894. <!-- 查询区域 -->
  895. <div class="search-container">
  896. <el-form :inline="true" size="small">
  897. <el-form-item label="模板编码">
  898. <el-input
  899. v-model="templateQuery.templateId"
  900. placeholder="请输入模板编码"
  901. clearable
  902. prefix-icon="el-icon-search"
  903. style="width: 160px">
  904. </el-input>
  905. </el-form-item>
  906. <el-form-item label="模板名称">
  907. <el-input
  908. v-model="templateQuery.templateDesc"
  909. placeholder="请输入模板名称"
  910. clearable
  911. prefix-icon="el-icon-search"
  912. style="width: 200px">
  913. </el-input>
  914. </el-form-item>
  915. <el-button type="primary" icon="el-icon-search" size="small" @click="searchIQCTemplates">查询</el-button>
  916. <el-button icon="el-icon-refresh-left" size="small" @click="resetTemplateQuery">重置</el-button>
  917. </el-form>
  918. </div>
  919. <!-- 模板列表 -->
  920. <div class="template-list-container">
  921. <div class="panel-header">
  922. <i class="el-icon-s-grid"></i>
  923. <span class="panel-title">IQC检验模板</span>
  924. <span class="item-count">({{ templateList.length }})</span>
  925. </div>
  926. <el-table
  927. ref="templateTable"
  928. :data="templateList"
  929. @row-click="templateClickRow"
  930. @selection-change="templateSelectionChange"
  931. highlight-current-row
  932. class="template-table"
  933. height="450"
  934. :header-cell-style="{background: '#f5f7fa', color: '#606266', fontWeight: '500'}">
  935. <el-table-column type="selection" width="50" align="center"></el-table-column>
  936. <el-table-column prop="templateId" label="模板编码" align="center" width="120"></el-table-column>
  937. <el-table-column prop="templateName" label="模板名称" align="left" min-width="200" show-overflow-tooltip></el-table-column>
  938. <el-table-column prop="itemCount" label="项目数量" align="center" width="100"></el-table-column>
  939. </el-table>
  940. </div>
  941. <!-- 底部按钮 -->
  942. <div slot="footer" class="dialog-footer">
  943. <el-button
  944. type="primary"
  945. icon="el-icon-download"
  946. @click="confirmImportTemplate"
  947. :disabled="!templateSelections || templateSelections.length === 0"
  948. :loading="importLoading"
  949. size="small">
  950. 导入选中模板
  951. </el-button>
  952. <el-button @click="templateImportDialogFlag = false" size="small" style="width: 80px;">关闭</el-button>
  953. </div>
  954. </el-dialog>
  955. </div>
  956. </template>
  957. <script>
  958. import {
  959. qcIQCInspectionSearch, // IQC检验记录查询
  960. iqcDetailSearch, // iqc检验记录查询
  961. selectIQCSubDetailedRecord, // 查询子明细记录
  962. saveIQCDetailedRecord, // 新增明细信息
  963. checkIQCIsSubmit, // 检查是否已提交
  964. saveIQCSubDetailed, // 新增子明细信息
  965. saveIQCSubmitResult, // 审核
  966. iqcRecordDelete, // 删除检验记录
  967. disposalMeasuresSearch, // 获取处置措施列表
  968. iqcRecordOverLoad, // 重载检验单
  969. getSiteAndBuByUserName,
  970. getSiteAndBuByUserName2,
  971. orderTypeSearch, // 获取采购类型
  972. actionIQCInspection, // 开始检验
  973. dataAcquisition, // 数据采集
  974. getResponsibleOperatorList, // 获取责任人列表
  975. getIQCItemObjectList, // 查询项目设备
  976. dataAcquisitionByItem, // 根据项目数据采集
  977. cancelApproval, // 取消审核
  978. getUserRoleList, // 获取用户角色列表
  979. getOperatorList,
  980. // IQC检验项目操作和模板导入
  981. getIQCItemList,
  982. addIQCItemDetails,
  983. deleteIQCItemDetails,
  984. getIQCTemplateList,
  985. importIQCTemplateItems
  986. } from "@/api/qc/qc.js"
  987. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  988. import Chooselist from '@/views/modules/common/Chooselist_eam'
  989. import {getInspectionFile} from '@/api/eam/eam_object_list.js'
  990. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  991. import {qcPrint} from '@/api/qc/qcPrint.js'
  992. import excel from "@/utils/excel-util.js"
  993. import qcFAIUploadFile from "./qc_FAI_upload_file"
  994. import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
  995. import subDetailUpload from "./sub_detail_upload"
  996. import QrCode from "../common/QrCode.vue";
  997. import IqcFileTable from "./IQCFileTable.vue";
  998. export default {
  999. components: {
  1000. IqcFileTable,
  1001. QrCode,
  1002. Chooselist,
  1003. qcFAIUploadFile,
  1004. comQcItemImageUploadFile,
  1005. subDetailUpload
  1006. },
  1007. computed: {
  1008. templateTableData () {
  1009. let start = (this.pageIndex2 - 1) * this.pageSize2
  1010. let end = start + this.pageSize2
  1011. if (end > this.tableData.length){
  1012. end = this.tableData.length
  1013. }
  1014. return this.tableData.slice(start,end)
  1015. }
  1016. },
  1017. watch: {
  1018. detailData: {
  1019. deep: true,
  1020. handler: function (newV, oldV) {
  1021. this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
  1022. if (this.detailData.inspectionResult === '不合格') {
  1023. if (this.detailData.disposalMeasures === '让步接收') {
  1024. this.detailData.batchQualifiedQty = this.detailData.rollQty
  1025. } else if (this.detailData.disposalMeasures === '返工返修' || this.detailData.disposalMeasures === '拒收退回') {
  1026. this.detailData.batchQualifiedQty = 0
  1027. } else if (this.detailData.disposalMeasures === '挑选使用') {
  1028. this.detailData.batchQualifiedQty = this.detailData.rollQty - this.detailData.notPassQty
  1029. }
  1030. } else if (this.detailData.inspectionResult === '合格'){
  1031. this.detailData.batchQualifiedQty = this.detailData.rollQty
  1032. }
  1033. }
  1034. },
  1035. detailList: {
  1036. deep: true,
  1037. handler: function (newV, oldV) {
  1038. let num2 = 0
  1039. for (let i = 0; i < this.detailList.length; i++) {
  1040. if (this.detailList[i].itemResult === 'N') {
  1041. num2++
  1042. }
  1043. }
  1044. this.detailData.unqualifiedQty = num2
  1045. }
  1046. },
  1047. },
  1048. data () {
  1049. return {
  1050. searchExpanded: false,
  1051. loadFlag: false,
  1052. transferLoadFlag: false,
  1053. // 是否收藏
  1054. favorite: false,
  1055. // 导出 start
  1056. exportData: [],
  1057. exportName: "IQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  1058. exportHeader: ["IQC检验录入"],
  1059. exportFooter: [],
  1060. exportList: [],
  1061. // 导出 end
  1062. submitData: {
  1063. site: '',
  1064. inspectionNo: '',
  1065. isQualified: '',
  1066. isQualifiedChinese: '',
  1067. submitList: [],
  1068. updateBy: this.$store.state.user.name,
  1069. },
  1070. tagNo:'',
  1071. searchData: {
  1072. site: '',
  1073. userName: this.$store.state.user.name,
  1074. inspectionNo: '',
  1075. inspectionTypeNo:'105',
  1076. isQualified: '',
  1077. buNo: '',
  1078. startDate: '',
  1079. endDate: '',
  1080. startDate2: '',
  1081. endDate2: '',
  1082. partNo:'',
  1083. partDesc:'',
  1084. cinvSourceCode:'',
  1085. sku:'',
  1086. state: '',
  1087. inspectionResult: '',
  1088. supplierDesc: '',
  1089. disposalMeasures: '',
  1090. inspectorName: '',
  1091. page: 1,
  1092. limit: 10,
  1093. poOrderNo: '',
  1094. poItemNo: '',
  1095. orderType: '',
  1096. states: ['未开始','待检验'],
  1097. submissionType: '',
  1098. invdefinetype: ''
  1099. },
  1100. pageIndex: 1,
  1101. pageSize: 20,
  1102. totalPage: 0,
  1103. pageIndex2: 1,
  1104. pageSize2: 20,
  1105. totalPage2: 0,
  1106. height: 200,
  1107. dataList: [],
  1108. dataListSelections: [],
  1109. submitFlag: false,
  1110. modalData: {
  1111. flag:'',
  1112. functionType:'',
  1113. site: '',
  1114. bu: '',
  1115. inspectionNo:'',
  1116. workOrderNumber: '',
  1117. workOrderQuantity: '',
  1118. reelNumber: '',
  1119. partNo: '',
  1120. cinvSourceCode:'',
  1121. rollingQuantity: '',
  1122. sampleQuantity: '',
  1123. detailCodeNo:'',
  1124. detailCodeDesc:'',
  1125. inspectionTypeNo:'105',
  1126. inspectionTypeName:'IQC',
  1127. inspectorNo:'',
  1128. inspectorName:'',
  1129. isQualified:'',
  1130. isQualifiedChinese:'',
  1131. invdefinetype: '',
  1132. },
  1133. // 展示列集
  1134. // columnList1: [],
  1135. columnList1: [
  1136. {
  1137. userId: this.$store.state.user.name,
  1138. functionId: 301006,
  1139. serialNumber: '301006Table1BuDesc',
  1140. tableId: "301006Table1",
  1141. tableName: "IQC检验记录表",
  1142. columnProp: 'buDesc',
  1143. headerAlign: "center",
  1144. align: "center",
  1145. columnLabel: 'BU',
  1146. columnHidden: false,
  1147. columnImage: false,
  1148. columnSortable: false,
  1149. sortLv: 0,
  1150. status: true,
  1151. fixed: '',
  1152. columnWidth: 100,
  1153. },
  1154. {
  1155. userId: this.$store.state.user.name,
  1156. functionId: 301006,
  1157. serialNumber: '301006Table1InspectionNo',
  1158. tableId: "301006Table1",
  1159. tableName: "IQC检验记录表",
  1160. columnProp: 'inspectionNo',
  1161. headerAlign: "center",
  1162. align: "center",
  1163. columnLabel: '检验单号',
  1164. columnHidden: false,
  1165. columnImage: false,
  1166. columnSortable: false,
  1167. sortLv: 0,
  1168. status: true,
  1169. fixed: '',
  1170. columnWidth: 120,
  1171. },
  1172. {
  1173. userId: this.$store.state.user.name,
  1174. functionId: 301006,
  1175. serialNumber: '301006Table1InspectionResult',
  1176. tableId: "301006Table1",
  1177. tableName: "IQC检验记录表",
  1178. columnProp: 'inspectionResult',
  1179. headerAlign: "center",
  1180. align: "center",
  1181. columnLabel: '检验结论',
  1182. columnHidden: false,
  1183. columnImage: false,
  1184. columnSortable: false,
  1185. sortLv: 0,
  1186. status: true,
  1187. fixed: '',
  1188. columnWidth: 100,
  1189. },
  1190. {
  1191. userId: this.$store.state.user.name,
  1192. functionId: 301006,
  1193. serialNumber: '301006Table1DisposalMeasures',
  1194. tableId: "301006Table1",
  1195. tableName: "IQC检验记录表",
  1196. columnProp: 'disposalMeasures',
  1197. headerAlign: "center",
  1198. align: "center",
  1199. columnLabel: '处置措施',
  1200. columnHidden: false,
  1201. columnImage: false,
  1202. columnSortable: false,
  1203. sortLv: 0,
  1204. status: true,
  1205. fixed: '',
  1206. columnWidth: 120,
  1207. },
  1208. {
  1209. userId: this.$store.state.user.name,
  1210. functionId: 301006,
  1211. serialNumber: '301006Table1TaskDate',
  1212. tableId: "301006Table1",
  1213. tableName: "IQC检验记录表",
  1214. columnProp: 'taskDate',
  1215. headerAlign: "center",
  1216. align: "center",
  1217. columnLabel: '送检日期',
  1218. columnHidden: false,
  1219. columnImage: false,
  1220. columnSortable: false,
  1221. sortLv: 0,
  1222. status: true,
  1223. fixed: '',
  1224. columnWidth: 150,
  1225. },
  1226. {
  1227. userId: this.$store.state.user.name,
  1228. functionId: 301006,
  1229. serialNumber: '301006Table1InspectionCycle',
  1230. tableId: "301006Table1",
  1231. tableName: "IQC检验记录表",
  1232. columnProp: 'inspectionCycle',
  1233. headerAlign: "center",
  1234. align: "right",
  1235. columnLabel: '检验周期(h)',
  1236. columnHidden: false,
  1237. columnImage: false,
  1238. columnSortable: false,
  1239. sortLv: 0,
  1240. status: true,
  1241. fixed: '',
  1242. columnWidth: 100,
  1243. },
  1244. {
  1245. userId: this.$store.state.user.name,
  1246. functionId: 301006,
  1247. serialNumber: '301006Table1RollNo',
  1248. tableId: "301006Table1",
  1249. tableName: "IQC检验记录表",
  1250. columnProp: 'rollNo',
  1251. headerAlign: "center",
  1252. align: "center",
  1253. columnLabel: '标签条码',
  1254. columnHidden: false,
  1255. columnImage: false,
  1256. columnSortable: false,
  1257. sortLv: 0,
  1258. status: true,
  1259. fixed: '',
  1260. columnWidth: 120,
  1261. },
  1262. {
  1263. userId: this.$store.state.user.name,
  1264. functionId: 301006,
  1265. serialNumber: '301006Table1PartNo',
  1266. tableId: "301006Table1",
  1267. tableName: "IQC检验记录表",
  1268. columnProp: 'partNo',
  1269. headerAlign: "center",
  1270. align: "center",
  1271. columnLabel: '物料编码',
  1272. columnHidden: false,
  1273. columnImage: false,
  1274. columnSortable: false,
  1275. sortLv: 0,
  1276. status: true,
  1277. fixed: '',
  1278. columnWidth: 120,
  1279. },
  1280. {
  1281. userId: this.$store.state.user.name,
  1282. functionId: 301006,
  1283. serialNumber: '301006Table1PartDesc',
  1284. tableId: "301006Table1",
  1285. tableName: "IQC检验记录表",
  1286. columnProp: 'partDesc',
  1287. headerAlign: "center",
  1288. align: "left",
  1289. columnLabel: '物料名称',
  1290. columnHidden: false,
  1291. columnImage: false,
  1292. columnSortable: false,
  1293. sortLv: 0,
  1294. status: true,
  1295. fixed: '',
  1296. columnWidth: 300,
  1297. },
  1298. {
  1299. userId: this.$store.state.user.name,
  1300. functionId: 301006,
  1301. serialNumber: '301006Table1SKU',
  1302. tableId: "301006Table1",
  1303. tableName: "IQC检验记录表",
  1304. columnProp: 'sku',
  1305. headerAlign: "center",
  1306. align: "center",
  1307. columnLabel: 'SKU',
  1308. columnHidden: false,
  1309. columnImage: false,
  1310. columnSortable: false,
  1311. sortLv: 0,
  1312. status: true,
  1313. fixed: '',
  1314. columnWidth: 120,
  1315. },
  1316. {
  1317. userId: this.$store.state.user.name,
  1318. functionId: 301006,
  1319. serialNumber: '301006Table1CinvSourceCode',
  1320. tableId: "301006Table1",
  1321. tableName: "IQC检验记录表",
  1322. columnProp: 'cinvSourceCode',
  1323. headerAlign: "center",
  1324. align: "center",
  1325. columnLabel: 'PN',
  1326. columnHidden: false,
  1327. columnImage: false,
  1328. columnSortable: false,
  1329. sortLv: 0,
  1330. status: true,
  1331. fixed: '',
  1332. columnWidth: 120,
  1333. },
  1334. {
  1335. userId: this.$store.state.user.name,
  1336. functionId: 301006,
  1337. serialNumber: '301006Table1Invdefinetype',
  1338. tableId: "301006Table1",
  1339. tableName: "IPQC检验记录表",
  1340. columnProp: 'invdefinetype',
  1341. headerAlign: "center",
  1342. align: "left",
  1343. columnLabel: '物料类别',
  1344. columnHidden: false,
  1345. columnImage: false,
  1346. columnSortable: false,
  1347. sortLv: 0,
  1348. status: true,
  1349. fixed: '',
  1350. columnWidth: 120,
  1351. },
  1352. {
  1353. userId: this.$store.state.user.name,
  1354. functionId: 301006,
  1355. serialNumber: '301006Table1Umid',
  1356. tableId: "301006Table1",
  1357. tableName: "IQC检验记录表",
  1358. columnProp: 'umId',
  1359. headerAlign: "center",
  1360. align: "center",
  1361. columnLabel: '计量单位',
  1362. columnHidden: false,
  1363. columnImage: false,
  1364. columnSortable: false,
  1365. sortLv: 0,
  1366. status: true,
  1367. fixed: '',
  1368. columnWidth: 100,
  1369. },
  1370. {
  1371. userId: this.$store.state.user.name,
  1372. functionId: 301006,
  1373. serialNumber: '301006Table1RollQty',
  1374. tableId: "301006Table1",
  1375. tableName: "IQC检验记录表",
  1376. columnProp: 'rollQty',
  1377. headerAlign: "center",
  1378. align: "right",
  1379. columnLabel: '到货数量',
  1380. columnHidden: false,
  1381. columnImage: false,
  1382. columnSortable: false,
  1383. sortLv: 0,
  1384. status: true,
  1385. fixed: '',
  1386. columnWidth: 100,
  1387. },
  1388. {
  1389. userId: this.$store.state.user.name,
  1390. functionId: 301006,
  1391. serialNumber: '301006Table1RollQty',
  1392. tableId: "301006Table1",
  1393. tableName: "IQC检验记录表",
  1394. columnProp: 'rollCount',
  1395. headerAlign: "center",
  1396. align: "right",
  1397. columnLabel: '到货卷数',
  1398. columnHidden: false,
  1399. columnImage: false,
  1400. columnSortable: false,
  1401. sortLv: 0,
  1402. status: true,
  1403. fixed: '',
  1404. columnWidth: 100,
  1405. },
  1406. {
  1407. userId: this.$store.state.user.name,
  1408. functionId: 301006,
  1409. serialNumber: '301006Table1RollCount',
  1410. tableId: "301006Table1",
  1411. tableName: "IQC检验记录表",
  1412. columnProp: 'rollCount',
  1413. headerAlign: "center",
  1414. align: "right",
  1415. columnLabel: '送检数量',
  1416. columnHidden: false,
  1417. columnImage: false,
  1418. columnSortable: false,
  1419. sortLv: 0,
  1420. status: true,
  1421. fixed: '',
  1422. columnWidth: 100,
  1423. },
  1424. {
  1425. userId: this.$store.state.user.name,
  1426. functionId: 301006,
  1427. serialNumber: '301006Table1SamplingQty',
  1428. tableId: "301006Table1",
  1429. tableName: "IQC检验记录表",
  1430. columnProp: 'samplingQty',
  1431. headerAlign: "center",
  1432. align: "right",
  1433. columnLabel: '抽样数量',
  1434. columnHidden: false,
  1435. columnImage: false,
  1436. columnSortable: false,
  1437. sortLv: 0,
  1438. status: true,
  1439. fixed: '',
  1440. columnWidth: 100,
  1441. },
  1442. {
  1443. userId: this.$store.state.user.name,
  1444. functionId: 301006,
  1445. serialNumber: '301006Table1DocumentNo',
  1446. tableId: "301006Table1",
  1447. tableName: "IQC检验记录表",
  1448. columnProp: 'documentNo',
  1449. headerAlign: "center",
  1450. align: "left",
  1451. columnLabel: '通知单号',
  1452. columnHidden: false,
  1453. columnImage: false,
  1454. columnSortable: false,
  1455. sortLv: 0,
  1456. status: true,
  1457. fixed: '',
  1458. columnWidth: 150,
  1459. },
  1460. {
  1461. userId: this.$store.state.user.name,
  1462. functionId: 301006,
  1463. serialNumber: '301006Table1PoOrderNo',
  1464. tableId: "301006Table1",
  1465. tableName: "IQC检验记录表",
  1466. columnProp: 'poOrderNo',
  1467. headerAlign: "center",
  1468. align: "left",
  1469. columnLabel: '单据号',
  1470. columnHidden: false,
  1471. columnImage: false,
  1472. columnSortable: false,
  1473. sortLv: 0,
  1474. status: true,
  1475. fixed: '',
  1476. columnWidth: 180,
  1477. },
  1478. {
  1479. userId: this.$store.state.user.name,
  1480. functionId: 301006,
  1481. serialNumber: '301006Table1PoItemNo',
  1482. tableId: "301006Table1",
  1483. tableName: "IQC检验记录表",
  1484. columnProp: 'poItemNo',
  1485. headerAlign: "center",
  1486. align: "right",
  1487. columnLabel: '单据行号',
  1488. columnHidden: false,
  1489. columnImage: false,
  1490. columnSortable: false,
  1491. sortLv: 0,
  1492. status: true,
  1493. fixed: '',
  1494. columnWidth: 160,
  1495. },
  1496. {
  1497. userId: this.$store.state.user.name,
  1498. functionId: 301006,
  1499. serialNumber: '301006Table1OrderType',
  1500. tableId: "301006Table1",
  1501. tableName: "IQC检验记录表",
  1502. columnProp: 'orderType',
  1503. headerAlign: "center",
  1504. align: "left",
  1505. columnLabel: '采购类型',
  1506. columnHidden: false,
  1507. columnImage: false,
  1508. columnSortable: false,
  1509. sortLv: 0,
  1510. status: true,
  1511. fixed: '',
  1512. columnWidth: 100,
  1513. },
  1514. {
  1515. userId: this.$store.state.user.name,
  1516. functionId: 301006,
  1517. serialNumber: '301006Table1SubmissionType',
  1518. tableId: "301006Table1",
  1519. tableName: "IQC检验记录表",
  1520. columnProp: 'submissionType',
  1521. headerAlign: "center",
  1522. align: "center",
  1523. columnLabel: '送检类型',
  1524. columnHidden: false,
  1525. columnImage: false,
  1526. columnSortable: false,
  1527. sortLv: 0,
  1528. status: true,
  1529. fixed: '',
  1530. columnWidth: 100,
  1531. },
  1532. {
  1533. userId: this.$store.state.user.name,
  1534. functionId: 301006,
  1535. serialNumber: '301006Table1SupplierDesc',
  1536. tableId: "301006Table1",
  1537. tableName: "IQC检验记录表",
  1538. columnProp: 'supplierDesc',
  1539. headerAlign: "center",
  1540. align: "left",
  1541. columnLabel: '供应商',
  1542. columnHidden: false,
  1543. columnImage: false,
  1544. columnSortable: false,
  1545. sortLv: 0,
  1546. status: true,
  1547. fixed: '',
  1548. columnWidth: 200,
  1549. },
  1550. {
  1551. userId: this.$store.state.user.name,
  1552. functionId: 301006,
  1553. serialNumber: '301006Table1InspectionRemark',
  1554. tableId: "301006Table1",
  1555. tableName: "IQC检验记录表",
  1556. columnProp: 'inspectionRemark',
  1557. headerAlign: "center",
  1558. align: "left",
  1559. columnLabel: '质检备注',
  1560. columnHidden: false,
  1561. columnImage: false,
  1562. columnSortable: false,
  1563. sortLv: 0,
  1564. status: true,
  1565. fixed: '',
  1566. columnWidth: 200,
  1567. },
  1568. {
  1569. userId: this.$store.state.user.name,
  1570. functionId: 301006,
  1571. serialNumber: '301006Table1DisposalRemark',
  1572. tableId: "301006Table1",
  1573. tableName: "IQC检验记录表",
  1574. columnProp: 'disposalRemark',
  1575. headerAlign: "center",
  1576. align: "left",
  1577. columnLabel: '处置说明',
  1578. columnHidden: false,
  1579. columnImage: false,
  1580. columnSortable: false,
  1581. sortLv: 0,
  1582. status: true,
  1583. fixed: '',
  1584. columnWidth: 200,
  1585. },
  1586. {
  1587. userId: this.$store.state.user.name,
  1588. functionId: 301006,
  1589. serialNumber: '301006Table1ActionDate',
  1590. tableId: "301006Table1",
  1591. tableName: "IQC检验记录表",
  1592. columnProp: 'actionDate',
  1593. headerAlign: "center",
  1594. align: "center",
  1595. columnLabel: '开始检验时间',
  1596. columnHidden: false,
  1597. columnImage: false,
  1598. columnSortable: false,
  1599. sortLv: 0,
  1600. status: true,
  1601. fixed: '',
  1602. columnWidth: 170,
  1603. },
  1604. {
  1605. userId: this.$store.state.user.name,
  1606. functionId: 301006,
  1607. serialNumber: '301006Table1InspectorDate',
  1608. tableId: "301006Table1",
  1609. tableName: "IQC检验记录表",
  1610. columnProp: 'inspectorDate',
  1611. headerAlign: "center",
  1612. align: "center",
  1613. columnLabel: '检验时间',
  1614. columnHidden: false,
  1615. columnImage: false,
  1616. columnSortable: false,
  1617. sortLv: 0,
  1618. status: true,
  1619. fixed: '',
  1620. columnWidth: 170,
  1621. },
  1622. {
  1623. userId: this.$store.state.user.name,
  1624. functionId: 301006,
  1625. serialNumber: '301006Table1InspectorName',
  1626. tableId: "301006Table1",
  1627. tableName: "IQC检验记录表",
  1628. columnProp: 'inspectorName',
  1629. headerAlign: "center",
  1630. align: "center",
  1631. columnLabel: '质检员',
  1632. columnHidden: false,
  1633. columnImage: false,
  1634. columnSortable: false,
  1635. sortLv: 0,
  1636. status: true,
  1637. fixed: '',
  1638. columnWidth: 100,
  1639. },
  1640. {
  1641. userId: this.$store.state.user.name,
  1642. functionId: 301006,
  1643. serialNumber: '301006Table1SubmissionRemark',
  1644. tableId: "301006Table1",
  1645. tableName: "IQC检验记录表",
  1646. columnProp: 'submissionRemark',
  1647. headerAlign: "center",
  1648. align: "left",
  1649. columnLabel: '送检备注',
  1650. columnHidden: false,
  1651. columnImage: false,
  1652. columnSortable: false,
  1653. sortLv: 0,
  1654. status: true,
  1655. fixed: '',
  1656. columnWidth: 200,
  1657. },
  1658. ],
  1659. detailColumnList: [
  1660. {
  1661. userId: this.$store.state.user.name,
  1662. functionId: 301006,
  1663. serialNumber: '301006Table2ItemNo',
  1664. tableId: "301006Table2",
  1665. tableName: "检验单明细表",
  1666. columnProp: 'itemNo',
  1667. headerAlign: "center",
  1668. align: "center",
  1669. columnLabel: '检验项目编码',
  1670. columnHidden: false,
  1671. columnImage: false,
  1672. columnSortable: false,
  1673. sortLv: 0,
  1674. status: true,
  1675. fixed: '',
  1676. columnWidth: 120,
  1677. },
  1678. {
  1679. userId: this.$store.state.user.name,
  1680. functionId: 301006,
  1681. serialNumber: '301006Table2ItemDesc',
  1682. tableId: "301006Table2",
  1683. tableName: "检验单明细表",
  1684. columnProp: 'itemDesc',
  1685. headerAlign: "center",
  1686. align: "left",
  1687. columnLabel: '检验项目名称',
  1688. columnHidden: false,
  1689. columnImage: false,
  1690. columnSortable: false,
  1691. sortLv: 0,
  1692. status: true,
  1693. fixed: '',
  1694. columnWidth: 150,
  1695. },
  1696. {
  1697. userId: this.$store.state.user.name,
  1698. functionId: 301006,
  1699. serialNumber: '301006Table2SamplingLevelDesc',
  1700. tableId: "301006Table2",
  1701. tableName: "检验单明细表",
  1702. columnProp: 'samplingLevelDesc',
  1703. headerAlign: "center",
  1704. align: "center",
  1705. columnLabel: '检验水平',
  1706. columnHidden: false,
  1707. columnImage: false,
  1708. columnSortable: false,
  1709. sortLv: 0,
  1710. status: true,
  1711. fixed: '',
  1712. columnWidth: 120,
  1713. },
  1714. {
  1715. userId: this.$store.state.user.name,
  1716. functionId: 301006,
  1717. serialNumber: '301006Table2SamplingProgrammeDesc',
  1718. tableId: "301006Table2",
  1719. tableName: "检验单明细表",
  1720. columnProp: 'samplingProgrammeDesc',
  1721. headerAlign: "center",
  1722. align: "center",
  1723. columnLabel: '检验方案',
  1724. columnHidden: false,
  1725. columnImage: false,
  1726. columnSortable: false,
  1727. sortLv: 0,
  1728. status: true,
  1729. fixed: '',
  1730. columnWidth: 120,
  1731. },
  1732. {
  1733. userId: this.$store.state.user.name,
  1734. functionId: 301006,
  1735. serialNumber: '301006Table2MethodName',
  1736. tableId: "301006Table2",
  1737. tableName: "检验单明细表",
  1738. columnProp: 'methodName',
  1739. headerAlign: "center",
  1740. align: "left",
  1741. columnLabel: '检验方法',
  1742. columnHidden: false,
  1743. columnImage: false,
  1744. columnSortable: false,
  1745. sortLv: 0,
  1746. status: true,
  1747. fixed: '',
  1748. columnWidth: 120,
  1749. },
  1750. {
  1751. userId: this.$store.state.user.name,
  1752. functionId: 301006,
  1753. serialNumber: '301006Table2MethodRemark',
  1754. tableId: "301006Table2",
  1755. tableName: "检验单明细表",
  1756. columnProp: 'methodRemark',
  1757. headerAlign: "center",
  1758. align: "left",
  1759. columnLabel: '检验方法说明',
  1760. columnHidden: false,
  1761. columnImage: false,
  1762. columnSortable: false,
  1763. sortLv: 0,
  1764. status: true,
  1765. fixed: '',
  1766. columnWidth: 200,
  1767. },
  1768. {
  1769. userId: this.$store.state.user.name,
  1770. functionId: 301006,
  1771. serialNumber: '301006Table2ObjectDesc',
  1772. tableId: "301006Table2",
  1773. tableName: "检验单明细表",
  1774. columnProp: 'objectDesc',
  1775. headerAlign: "center",
  1776. align: "center",
  1777. columnLabel: '检测仪器',
  1778. columnHidden: false,
  1779. columnImage: false,
  1780. columnSortable: false,
  1781. sortLv: 0,
  1782. status: true,
  1783. fixed: '',
  1784. columnWidth: 120,
  1785. },
  1786. {
  1787. userId: this.$store.state.user.name,
  1788. functionId: 301006,
  1789. serialNumber: '301006Table2Aql',
  1790. tableId: "301006Table2",
  1791. tableName: "检验单明细表",
  1792. columnProp: 'aql',
  1793. headerAlign: "center",
  1794. align: "right",
  1795. columnLabel: 'AQL',
  1796. columnHidden: false,
  1797. columnImage: false,
  1798. columnSortable: false,
  1799. sortLv: 0,
  1800. status: true,
  1801. fixed: '',
  1802. columnWidth: 100,
  1803. },
  1804. {
  1805. userId: this.$store.state.user.name,
  1806. functionId: 301006,
  1807. serialNumber: '301006Table2Ac',
  1808. tableId: "301006Table2",
  1809. tableName: "检验单明细表",
  1810. columnProp: 'ac',
  1811. headerAlign: "center",
  1812. align: "right",
  1813. columnLabel: 'AC',
  1814. columnHidden: false,
  1815. columnImage: false,
  1816. columnSortable: false,
  1817. sortLv: 0,
  1818. status: true,
  1819. fixed: '',
  1820. columnWidth: 100,
  1821. },
  1822. {
  1823. userId: this.$store.state.user.name,
  1824. functionId: 301006,
  1825. serialNumber: '301006Table2Re',
  1826. tableId: "301006Table2",
  1827. tableName: "检验单明细表",
  1828. columnProp: 're',
  1829. headerAlign: "center",
  1830. align: "right",
  1831. columnLabel: 'RE',
  1832. columnHidden: false,
  1833. columnImage: false,
  1834. columnSortable: false,
  1835. sortLv: 0,
  1836. status: true,
  1837. fixed: '',
  1838. columnWidth: 100,
  1839. },
  1840. {
  1841. userId: this.$store.state.user.name,
  1842. functionId: 301006,
  1843. serialNumber: '301006Table2DefaultValue',
  1844. tableId: "301006Table2",
  1845. tableName: "检验单明细表",
  1846. columnProp: 'defaultValue',
  1847. headerAlign: "center",
  1848. align: "center",
  1849. columnLabel: '标准值',
  1850. columnHidden: false,
  1851. columnImage: false,
  1852. columnSortable: false,
  1853. sortLv: 0,
  1854. status: true,
  1855. fixed: '',
  1856. columnWidth: 100,
  1857. },
  1858. {
  1859. userId: this.$store.state.user.name,
  1860. functionId: 301006,
  1861. serialNumber: '301006Table2MaxValue',
  1862. tableId: "301006Table2",
  1863. tableName: "检验单明细表",
  1864. columnProp: 'maxValue',
  1865. headerAlign: "center",
  1866. align: "right",
  1867. columnLabel: '最大值',
  1868. columnHidden: false,
  1869. columnImage: false,
  1870. columnSortable: false,
  1871. sortLv: 0,
  1872. status: true,
  1873. fixed: '',
  1874. columnWidth: 100,
  1875. },
  1876. {
  1877. userId: this.$store.state.user.name,
  1878. functionId: 301006,
  1879. serialNumber: '301006Table2MinValue',
  1880. tableId: "301006Table2",
  1881. tableName: "检验单明细表",
  1882. columnProp: 'minValue',
  1883. headerAlign: "center",
  1884. align: "right",
  1885. columnLabel: '最小值',
  1886. columnHidden: false,
  1887. columnImage: false,
  1888. columnSortable: false,
  1889. sortLv: 0,
  1890. status: true,
  1891. fixed: '',
  1892. columnWidth: 100,
  1893. },
  1894. {
  1895. userId: this.$store.state.user.name,
  1896. functionId: 301006,
  1897. serialNumber: '301006Table2ValueType',
  1898. tableId: "301006Table2",
  1899. tableName: "检验单明细表",
  1900. columnProp: 'valueType',
  1901. headerAlign: "center",
  1902. align: "center",
  1903. columnLabel: '检测值类型',
  1904. columnHidden: false,
  1905. columnImage: false,
  1906. columnSortable: false,
  1907. sortLv: 0,
  1908. status: true,
  1909. fixed: '',
  1910. columnWidth: 100,
  1911. },
  1912. ],
  1913. fileColumnList: [
  1914. {
  1915. columnProp: 'fileName',
  1916. headerAlign: "center",
  1917. align: "center",
  1918. columnLabel: '文件名称',
  1919. columnHidden: false,
  1920. columnImage: false,
  1921. columnSortable: false,
  1922. sortLv: 0,
  1923. status: true,
  1924. fixed: '',
  1925. },
  1926. {
  1927. columnProp: 'createdBy',
  1928. headerAlign: "center",
  1929. align: 'center',
  1930. columnLabel: '上传人',
  1931. columnHidden: false,
  1932. columnImage: false,
  1933. columnSortable: true,
  1934. sortLv: 0,
  1935. status: true,
  1936. fixed: false
  1937. },
  1938. {
  1939. columnProp: 'createDate',
  1940. headerAlign: "center",
  1941. align: 'center',
  1942. columnLabel: '上传时间',
  1943. columnHidden: false,
  1944. columnImage: false,
  1945. columnSortable: true,
  1946. sortLv: 0,
  1947. status: true,
  1948. fixed: false
  1949. },
  1950. {
  1951. columnProp: 'orderRef3',
  1952. headerAlign: "center",
  1953. align: 'center',
  1954. columnLabel: '备注',
  1955. columnHidden: false,
  1956. columnImage: false,
  1957. columnSortable: true,
  1958. sortLv: 0,
  1959. status: true,
  1960. fixed: false
  1961. },
  1962. ],
  1963. detailData: {
  1964. site: '',
  1965. buNo: '',
  1966. inspectionNo: '',
  1967. partNo: '',
  1968. partDesc: '',
  1969. cinvSourceCode:'',
  1970. sku:'',
  1971. rollQty: '',
  1972. samplingQty: '',
  1973. noBatchQualifiedQty: 0,
  1974. unqualifiedQty: 0,
  1975. unqualifiedQuantity: '',
  1976. disposalMeasures: '',
  1977. disposalRemark: '',
  1978. inspectionResult: '',
  1979. inspectorNo: '',
  1980. inspectionRemark: '',
  1981. submitFlag: '',
  1982. supplierNo: '',
  1983. umId: '',
  1984. rollCount: '',
  1985. poOrderNo: '',
  1986. poItemNo: '',
  1987. operator: '',
  1988. operatorName: '',
  1989. responsiblePerson: '',
  1990. responsiblePersonName: '',
  1991. invdefinetype: '',
  1992. state: '',
  1993. passQty: '',
  1994. notPassQty: '',
  1995. batchQualifiedQty: 0
  1996. },
  1997. detailInformationFlag: false,
  1998. detailList: [],
  1999. saveInformationData: {
  2000. site: '',
  2001. buNo: '',
  2002. cinvSourceCode:'',
  2003. inspectionNo:'',
  2004. disposalMeasures: '',
  2005. disposalRemark: '',
  2006. inspectorNo: '',
  2007. inspectionRemark: '',
  2008. itemList:[],
  2009. unqualifiedQty: '',
  2010. rollCount: '',
  2011. samplingQty: '',
  2012. poOrderNo: '',
  2013. poItemNo: '',
  2014. partNo: '',
  2015. partDesc: '',
  2016. sku: '',
  2017. operator: '',
  2018. operatorName: '',
  2019. responsiblePerson: '',
  2020. responsiblePersonName: '',
  2021. subDetailList: [],
  2022. type: '',
  2023. passQty: '',
  2024. notPassQty: '',
  2025. batchQualifiedQty: ''
  2026. },
  2027. // 子明细数据对象
  2028. tableData: [],
  2029. checkedDetail: [],
  2030. subDetailFlag: false,
  2031. subDetailData: {
  2032. site: '',
  2033. buNo: '',
  2034. inspectionNo: '',
  2035. itemNo: '',
  2036. itemDesc: '',
  2037. defaultValue: '',
  2038. maxValue: '',
  2039. minValue: '',
  2040. valueTypeDb: '',
  2041. subDetailValues:[],
  2042. page: 1,
  2043. limit: 10,
  2044. },
  2045. options: [],
  2046. fileFlag: false,
  2047. fileContentList: [],
  2048. IQCSelections: [],
  2049. batchHandleAddModalFlag: false,
  2050. batchAddData: {
  2051. samplingLocation: '',
  2052. samplingLocationB: '',
  2053. samplingNumber: ''
  2054. },
  2055. disposalMeasuresOptions: [],
  2056. orderTypeList: [],
  2057. userBuList: [],
  2058. buList: [],
  2059. authSearch: false,
  2060. authCheck: false,
  2061. authCancelCheck: false,
  2062. authOverLoad: false,
  2063. authDelete: false,
  2064. authDetail: false,
  2065. authFile: false,
  2066. menuId: this.$route.meta.menuId,
  2067. roleList: [],
  2068. operatorList: [],
  2069. operatorData: {
  2070. flag: '',
  2071. site: '',
  2072. bu: '',
  2073. adminID: '',
  2074. adminName: '',
  2075. roleName: '',
  2076. roleId: '',
  2077. userName: this.$store.state.user.name
  2078. },
  2079. operatorModelFlag: false,
  2080. dataListSelections2: [],
  2081. operatorDetailList: [
  2082. {
  2083. columnProp: 'adminID',
  2084. headerAlign: "center",
  2085. align: "center",
  2086. columnLabel: '用户账号',
  2087. columnHidden: false,
  2088. columnImage: false,
  2089. columnSortable: false,
  2090. sortLv: 0,
  2091. status: true,
  2092. fixed: '',
  2093. },
  2094. {
  2095. columnProp: 'adminName',
  2096. headerAlign: "center",
  2097. align: "center",
  2098. columnLabel: '用户名称',
  2099. columnHidden: false,
  2100. columnImage: false,
  2101. columnSortable: false,
  2102. sortLv: 0,
  2103. status: true,
  2104. fixed: '',
  2105. },
  2106. {
  2107. columnProp: 'email',
  2108. headerAlign: "center",
  2109. align: "center",
  2110. columnLabel: '邮箱',
  2111. columnHidden: false,
  2112. columnImage: false,
  2113. columnSortable: false,
  2114. sortLv: 0,
  2115. status: true,
  2116. fixed: '',
  2117. },
  2118. {
  2119. columnProp: 'phone',
  2120. headerAlign: "center",
  2121. align: "center",
  2122. columnLabel: '手机号',
  2123. columnHidden: false,
  2124. columnImage: false,
  2125. columnSortable: false,
  2126. sortLv: 0,
  2127. status: true,
  2128. fixed: '',
  2129. },
  2130. ],
  2131. acquisitionList: [],
  2132. ItemObjectModelFlag: false,
  2133. itemObjectList: [],
  2134. itemObjectColumnList: [
  2135. {
  2136. columnProp: 'itemNo',
  2137. headerAlign: "center",
  2138. align: "center",
  2139. columnLabel: '项目编码',
  2140. columnHidden: false,
  2141. columnImage: false,
  2142. status: true,
  2143. },
  2144. {
  2145. columnProp: 'itemDesc',
  2146. headerAlign: "center",
  2147. align: "left",
  2148. columnLabel: '项目名称',
  2149. columnHidden: false,
  2150. columnImage: false,
  2151. status: true,
  2152. },
  2153. ],
  2154. actionData: {
  2155. site: '',
  2156. buNo: '',
  2157. inspectionNo: ''
  2158. },
  2159. fileLoading: false,
  2160. subDetailLoading: false,
  2161. searchLoading: false,
  2162. // IQC项目操作相关
  2163. itemOperationDialogFlag: false,
  2164. itemOperationQuery: {
  2165. itemNo: '',
  2166. itemDesc: '',
  2167. },
  2168. availableItemList: [],
  2169. selectedItemList: [],
  2170. availableItemSelections: [],
  2171. selectedItemSelections: [],
  2172. // IQC模板导入相关
  2173. templateImportDialogFlag: false,
  2174. templateQuery: {
  2175. templateId: '',
  2176. templateDesc: '',
  2177. },
  2178. templateList: [],
  2179. templateSelections: [],
  2180. importLoading: false
  2181. }
  2182. },
  2183. mounted () {
  2184. this.$nextTick(() => {
  2185. this.height = window.innerHeight - 250
  2186. })
  2187. },
  2188. created () {
  2189. // 按钮控制
  2190. this.getButtonAuthData()
  2191. // 获取用户的 site 和 bu
  2192. this.getSiteAndBuByUserName()
  2193. // 获取用户的 site 和 bu
  2194. this.getSiteAndBuByUserName2()
  2195. this.favoriteIsOk()
  2196. this.disposalMeasuresSearch()
  2197. // 动态列
  2198. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2199. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  2200. if (!this.authSearch) {
  2201. // 获取数据列表
  2202. this.getDataList()
  2203. }
  2204. // 获取用户角色
  2205. this.getUserRoleList()
  2206. },
  2207. methods: {
  2208. // 切换搜索框展开/收起
  2209. toggleSearchExpand() {
  2210. this.searchExpanded = !this.searchExpanded
  2211. },
  2212. // 重置搜索条件
  2213. resetSearch() {
  2214. this.searchData = {
  2215. site: '',
  2216. userName: this.$store.state.user.name,
  2217. inspectionNo: '',
  2218. inspectionTypeNo:'105',
  2219. isQualified: '',
  2220. buNo: '',
  2221. startDate: '',
  2222. endDate: '',
  2223. startDate2: '',
  2224. endDate2: '',
  2225. partNo:'',
  2226. partDesc:'',
  2227. cinvSourceCode:'',
  2228. sku:'',
  2229. state: '',
  2230. inspectionResult: '',
  2231. supplierDesc: '',
  2232. disposalMeasures: '',
  2233. inspectorName: '',
  2234. page: 1,
  2235. limit: 10,
  2236. poOrderNo: '',
  2237. poItemNo: '',
  2238. orderType: '',
  2239. states: ['未开始','待检验'],
  2240. submissionType: '',
  2241. invdefinetype: ''
  2242. }
  2243. },
  2244. // 获取用户的bu
  2245. getSiteAndBuByUserName2 () {
  2246. let tempData = {
  2247. username: this.$store.state.user.name,
  2248. }
  2249. getSiteAndBuByUserName2(tempData).then(({data}) => {
  2250. if (data.code === 0) {
  2251. this.buList = data.rows
  2252. }
  2253. })
  2254. },
  2255. // 批量打印标签
  2256. printList () {
  2257. if (this.IQCSelections.length === 0) {
  2258. this.$message.warning('请勾选要打印的检验单!')
  2259. return
  2260. }
  2261. const inspectionNos = this.$refs.qrCode.init(this.IQCSelections.map(item => item.inspectionNo))
  2262. for (let i = 0; i < inspectionNos.length; i++) {
  2263. this.IQCSelections[i].qrCode = inspectionNos[i]
  2264. }
  2265. qcPrint(this.IQCSelections)
  2266. },
  2267. noBatchQualifiedQtyChange(){
  2268. if (this.detailData.noBatchQualifiedQty > this.detailData.rollQty) {
  2269. // 恢复原值
  2270. this.detailData.noBatchQualifiedQty = this.detailData.rollQty - this.detailData.batchQualifiedQty
  2271. this.$message.warning('批次不合格数量不能大于到货数量!')
  2272. return false
  2273. }
  2274. // 给合格数量赋值
  2275. let newValue = this.detailData.rollQty - this.detailData.noBatchQualifiedQty
  2276. this.$set(this.detailData, 'batchQualifiedQty', newValue)
  2277. },
  2278. // 数据采集
  2279. dataAcquisition () {
  2280. this.loadFlag = true
  2281. let tempDate = {
  2282. site: this.detailData.site,
  2283. buNo: this.detailData.buNo,
  2284. inspectionNo: this.detailData.inspectionNo,
  2285. flag: 'iqc'
  2286. }
  2287. dataAcquisition(tempDate).then(({data}) => {
  2288. if (data.code === 0) {
  2289. // this.acquisitionList = data.rows
  2290. this.changeMyString(data.rows)
  2291. this.$message({
  2292. message: '数据采集成功',
  2293. type: 'success',
  2294. duration: 1500
  2295. })
  2296. } else {
  2297. this.$message({
  2298. message: data.msg,
  2299. type: 'warning',
  2300. duration: 1500
  2301. })
  2302. }
  2303. this.loadFlag = false
  2304. }).catch(()=>{
  2305. this.loadFlag = false
  2306. })
  2307. },
  2308. // 根据项目数据采集
  2309. dataAcquisitionByItem (row) {
  2310. this.loadFlag = true
  2311. let tempDate = {
  2312. site: row.site,
  2313. buNo: row.buNo,
  2314. inspectionNo: row.inspectionNo,
  2315. templateId: row.templateId,
  2316. itemNo: row.itemNo,
  2317. flag: 'iqc'
  2318. }
  2319. dataAcquisitionByItem(tempDate).then(({data}) => {
  2320. if (data.code === 0) {
  2321. this.changeMyString(data.rows)
  2322. this.$message({
  2323. message: '数据采集成功',
  2324. type: 'success',
  2325. duration: 1500
  2326. })
  2327. } else {
  2328. this.$message({
  2329. message: data.msg,
  2330. type: 'warning',
  2331. duration: 1500
  2332. })
  2333. }
  2334. this.loadFlag = false
  2335. }).catch(()=>{
  2336. this.loadFlag = false
  2337. })
  2338. },
  2339. // 获取用户角色
  2340. getUserRoleList () {
  2341. getUserRoleList().then(({data}) => {
  2342. if (data.code === 0) {
  2343. this.roleList = data.rows
  2344. } else {
  2345. this.roleList = []
  2346. }
  2347. })
  2348. },
  2349. // 获取协同人员列表
  2350. getOperatorList () {
  2351. this.operatorData.flag = '1'
  2352. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2353. if (this.roleList.length > 0) {
  2354. let filterList = this.roleList.filter(item => item.roleName === '机修人员')
  2355. if (filterList.length > 0) {
  2356. this.operatorData.roleId = filterList[0].roleId
  2357. } else {
  2358. this.operatorData.roleId = this.roleList[0].roleId
  2359. }
  2360. } else {
  2361. this.operatorData.roleId = ''
  2362. }
  2363. // 先清空缓存选中
  2364. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2365. // 拿到选中的人员编号
  2366. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2367. getOperatorList(this.operatorData).then(({data}) => {
  2368. if (data && data.code === 0) {
  2369. this.operatorList = data.rows
  2370. this.operatorList.forEach(val => {
  2371. // 回显选中
  2372. if (tempDataList.includes(val.adminID)) {
  2373. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2374. }
  2375. })
  2376. this.operatorModelFlag = true
  2377. } else {
  2378. this.$message.error(data.msg)
  2379. }
  2380. })
  2381. },
  2382. // 获取责任人员列表
  2383. getResponsiblePersonList () {
  2384. this.operatorData.flag = '2'
  2385. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2386. // 先清空缓存选中
  2387. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2388. // 拿到选中的人员编号
  2389. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2390. getResponsibleOperatorList(this.operatorData).then(({data}) => {
  2391. if (data && data.code === 0) {
  2392. this.operatorList = data.rows
  2393. this.operatorList.forEach(val => {
  2394. // 回显选中
  2395. if (tempDataList.includes(val.adminID)) {
  2396. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2397. }
  2398. })
  2399. this.operatorModelFlag = true
  2400. } else {
  2401. this.$message.error(data.msg)
  2402. }
  2403. })
  2404. },
  2405. // 查询机修人员列表
  2406. getOperatorList2 () {
  2407. if (this.operatorData.flag === '1') {
  2408. // 拿到选中的人员编号
  2409. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2410. getOperatorList(this.operatorData).then(({data}) => {
  2411. if (data && data.code === 0) {
  2412. this.operatorList = data.rows
  2413. this.operatorList.forEach(val => {
  2414. // 回显选中的部门
  2415. if (tempDataList.includes(val.adminID)) {
  2416. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2417. }
  2418. })
  2419. } else {
  2420. this.operatorList = []
  2421. }
  2422. })
  2423. } else {
  2424. // 拿到选中的人员编号
  2425. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2426. getResponsibleOperatorList(this.operatorData).then(({data}) => {
  2427. if (data && data.code === 0) {
  2428. this.operatorList = data.rows
  2429. this.operatorList.forEach(val => {
  2430. // 回显选中的部门
  2431. if (tempDataList.includes(val.adminID)) {
  2432. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2433. }
  2434. })
  2435. } else {
  2436. this.operatorList = []
  2437. }
  2438. })
  2439. }
  2440. },
  2441. // 点击行选中复选框
  2442. operatorClickRow (row) {
  2443. this.$refs.operatorTable.toggleRowSelection(row)
  2444. },
  2445. // 多选
  2446. selectionChangeHandle2 (val) {
  2447. this.dataListSelections2 = val
  2448. },
  2449. // 确认多选协同人员
  2450. confirmOperator () {
  2451. if (this.dataListSelections2.length === 0) {
  2452. this.$message.warning('请勾选人员!')
  2453. return
  2454. }
  2455. if (this.operatorData.flag === '1') {
  2456. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2457. if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) {
  2458. this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName
  2459. this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID
  2460. }
  2461. }
  2462. if (this.detailData.operator.charAt(0) === ';') {
  2463. this.detailData.operator = this.detailData.operator.substring(1)
  2464. this.detailData.operatorName = this.detailData.operatorName.substring(1)
  2465. }
  2466. } else {
  2467. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2468. if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) {
  2469. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName
  2470. this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID
  2471. }
  2472. }
  2473. if (this.detailData.responsiblePerson.charAt(0) === ';') {
  2474. this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1)
  2475. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1)
  2476. }
  2477. }
  2478. this.operatorData = {
  2479. flag: '',
  2480. site: '',
  2481. bu: '',
  2482. adminID: '',
  2483. adminName: '',
  2484. roleName: '',
  2485. roleId: '',
  2486. userName: this.$store.state.user.name
  2487. }
  2488. this.operatorModelFlag = false
  2489. },
  2490. // 获取用户的bu
  2491. getSiteAndBuByUserName () {
  2492. let tempData = {
  2493. username: this.$store.state.user.name,
  2494. }
  2495. getSiteAndBuByUserName(tempData).then(({data}) => {
  2496. if (data.code === 0) {
  2497. this.userBuList = data.rows
  2498. }
  2499. })
  2500. },
  2501. // 子明细导入
  2502. subDetailUpload () {
  2503. let currentData = {
  2504. flag: 'IQC',
  2505. site: this.detailData.site,
  2506. buNo: this.detailData.buNo,
  2507. inspectionNo: this.detailData.inspectionNo
  2508. }
  2509. //打开组件 去做新增业务
  2510. this.$nextTick(() => {
  2511. this.$refs.subDetailUpload.init(currentData)
  2512. })
  2513. },
  2514. // 获取处置措施列表
  2515. disposalMeasuresSearch () {
  2516. let tempData = {
  2517. inspectionTypeNo: '105'
  2518. }
  2519. disposalMeasuresSearch(tempData).then(({data}) => {
  2520. if (data.code === 0) {
  2521. this.disposalMeasuresOptions = data.rows
  2522. }
  2523. })
  2524. },
  2525. // 获取采购类型列表
  2526. orderTypeSearch () {
  2527. orderTypeSearch().then(({data}) => {
  2528. if (data.code === 0) {
  2529. this.orderTypeList = data.rows
  2530. }
  2531. })
  2532. },
  2533. // 单机选中
  2534. IQCClickRow (row) {
  2535. this.$refs.IQCTable.toggleRowSelection(row)
  2536. },
  2537. // 复选
  2538. selectionIQC (val) {
  2539. this.IQCSelections = val
  2540. },
  2541. // 刷新派设备文档的列表
  2542. getFileContentData (row) {
  2543. let currentData = {
  2544. orderRef1: row.site,
  2545. orderRef2: row.inspectionNo,
  2546. orderRef4: row.buNo,
  2547. partNo: row.partNo
  2548. }
  2549. this.fileLoading = true
  2550. getInspectionFile(currentData).then(({data}) => {
  2551. //区分请求成功和失败的状况
  2552. if (data && data.code === 0) {
  2553. this.fileContentList = data.rows
  2554. } else {
  2555. this.fileContentList = []
  2556. }
  2557. this.fileLoading = false
  2558. }).catch(()=>{
  2559. this.fileLoading = false
  2560. })
  2561. this.fileFlag = true
  2562. },
  2563. // 新增文件的modal
  2564. addUploadFileModal () {
  2565. let currentData = {
  2566. titleCon: 'IQC文件上传',
  2567. site: this.detailData.site,
  2568. buNo: this.detailData.buNo,
  2569. createBy: this.$store.state.user.name,
  2570. inspectionNo: this.detailData.inspectionNo,
  2571. remark: '',
  2572. folder: 'qcIQC',
  2573. }
  2574. //打开组件 去做新增业务
  2575. this.$nextTick(() => {
  2576. this.$refs.qcFAIUploadFile.init(currentData)
  2577. })
  2578. },
  2579. // 上传项目图片
  2580. uploadImageModal (row) {
  2581. let currentData = {
  2582. site: this.detailData.site,
  2583. buNo: this.detailData.buNo,
  2584. createBy: this.$store.state.user.name,
  2585. inspectionNo: this.detailData.inspectionNo,
  2586. itemNo: row.itemNo,
  2587. folder: 'IQCItemImageFile'
  2588. }
  2589. //打开组件 去做新增业务
  2590. this.$nextTick(() => {
  2591. this.$refs.comQcItemImageUploadFile.init(currentData)
  2592. })
  2593. },
  2594. // 获取基础数据列表S
  2595. getBaseList (val,type) {
  2596. this.tagNo = val
  2597. this.$nextTick(() => {
  2598. let strVal = ''
  2599. if (val === 1037) {
  2600. strVal = this.modalData.detailCodeNo
  2601. this.$refs.baseList.init(val, strVal)
  2602. }
  2603. if (val === 1040) {
  2604. strVal = this.modalData.inspectorNo
  2605. this.$refs.baseList.init(val, strVal)
  2606. }
  2607. })
  2608. },
  2609. // 列表方法的回调
  2610. getBaseData (val) {
  2611. if (this.tagNo === 1037) {
  2612. this.modalData.detailCodeNo = val.code_no
  2613. this.modalData.detailCodeDesc = val.code_desc
  2614. }
  2615. if (this.tagNo === 1040) {
  2616. this.modalData.inspectorNo = val.inspector_no
  2617. this.modalData.inspectorName = val.inspector_name
  2618. }
  2619. },
  2620. // 获取主信息数据列表
  2621. getDataList () {
  2622. this.searchLoading = true
  2623. this.searchData.limit = this.pageSize
  2624. this.searchData.page = this.pageIndex
  2625. qcIQCInspectionSearch(this.searchData).then(({data}) => {
  2626. if (data.code === 0) {
  2627. this.dataList = data.page.list
  2628. this.pageIndex = data.page.currPage
  2629. this.pageSize = data.page.pageSize
  2630. this.totalPage = data.page.totalCount
  2631. this.searchLoading = false
  2632. } else {
  2633. this.searchLoading = false
  2634. }
  2635. }).catch(()=>{
  2636. this.searchLoading = false
  2637. })
  2638. },
  2639. // 每页数
  2640. sizeChangeHandle (val) {
  2641. this.pageSize = val
  2642. this.pageIndex = 1
  2643. this.getDataList()
  2644. },
  2645. // 当前页
  2646. currentChangeHandle (val) {
  2647. this.pageIndex = val
  2648. this.getDataList()
  2649. },
  2650. // 子明细每页数
  2651. sizeChangeHandle2 (val) {
  2652. this.pageSize2 = val
  2653. },
  2654. // 子明细当前页
  2655. currentChangeHandle2 (val) {
  2656. this.pageIndex2 = val
  2657. },
  2658. // 多选
  2659. selectionChangeHandle (val) {
  2660. this.dataListSelections = val
  2661. },
  2662. async Transfer (type) {
  2663. if (type === '2') {
  2664. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  2665. this.$message.warning('请选择检验结论!')
  2666. return
  2667. }
  2668. if (this.detailData.inspectionResult === '不合格' && (this.detailData.disposalMeasures == null || this.detailData.disposalMeasures === '')) {
  2669. this.$message.warning('请选择处置措施!')
  2670. return
  2671. }
  2672. if (this.detailList.length > 0 && this.detailData.inspectionResult === '不合格') {
  2673. const flag = this.detailList.some(item => item.itemResult === 'N')
  2674. if (!flag) {
  2675. this.$message.warning('请选择不合格项目!')
  2676. return
  2677. }
  2678. }
  2679. if (this.detailData.inspectionResult !== '不合格') {
  2680. this.detailData.disposalMeasures = ''
  2681. this.detailData.disposalRemark = ''
  2682. }
  2683. }
  2684. this.saveDetailInformation(type)
  2685. },
  2686. // 新增明细信息
  2687. saveDetailInformation (type) {
  2688. this.saveInformationData.site = this.detailData.site
  2689. this.saveInformationData.buNo = this.detailData.buNo
  2690. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  2691. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  2692. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  2693. this.saveInformationData.inspectorNo = this.$store.state.user.name
  2694. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  2695. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  2696. this.saveInformationData.rollCount = this.detailData.rollCount
  2697. this.saveInformationData.samplingQty = this.detailData.samplingQty
  2698. this.saveInformationData.unqualifiedQty = this.detailData.unqualifiedQty
  2699. this.saveInformationData.poOrderNo = this.detailData.poOrderNo
  2700. this.saveInformationData.poItemNo = this.detailData.poItemNo
  2701. this.saveInformationData.partNo = this.detailData.partNo
  2702. this.saveInformationData.partDesc = this.detailData.partDesc
  2703. this.saveInformationData.sku = this.detailData.sku
  2704. this.saveInformationData.operator = this.detailData.operator
  2705. this.saveInformationData.responsiblePerson = this.detailData.responsiblePerson
  2706. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  2707. this.saveInformationData.type = type
  2708. this.saveInformationData.passQty = this.detailData.passQty == null ? 0 : this.detailData.passQty
  2709. this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
  2710. this.saveInformationData.batchQualifiedQty = this.detailData.batchQualifiedQty == null ? 0 : this.detailData.batchQualifiedQty
  2711. this.transferLoadFlag = true
  2712. // this.saveInformationData.subDetailList = this.acquisitionList
  2713. saveIQCDetailedRecord(this.saveInformationData).then(({data}) => {
  2714. if (data && data.code === 0) {
  2715. this.getDataList()
  2716. this.detailInformationFlag = false
  2717. this.$message.success('操作成功')
  2718. } else {
  2719. this.$message.error(data.msg)
  2720. }
  2721. this.transferLoadFlag = false
  2722. }).catch(()=>{
  2723. this.transferLoadFlag = false
  2724. })
  2725. },
  2726. // 开始检验
  2727. actionModal (row) {
  2728. this.actionData = {
  2729. site: row.site,
  2730. buNo: row.buNo,
  2731. inspectionNo: row.inspectionNo
  2732. }
  2733. getIQCItemObjectList(this.actionData).then(({data}) => {
  2734. if (data && data.code === 0) {
  2735. if (data.rows.length === 0) {
  2736. this.actionModal2()
  2737. } else {
  2738. this.itemObjectList = data.rows
  2739. this.ItemObjectModelFlag = true
  2740. }
  2741. } else {
  2742. this.$message.error(data.msg)
  2743. }
  2744. })
  2745. },
  2746. // 开始检验
  2747. actionModal2 () {
  2748. this.$confirm(`确认开始检验?`, '提示', {
  2749. confirmButtonText: '确定',
  2750. cancelButtonText: '取消',
  2751. type: 'warning'
  2752. }).then(() => {
  2753. let tempData = {
  2754. site: this.actionData.site,
  2755. buNo: this.actionData.buNo,
  2756. inspectionNo: this.actionData.inspectionNo,
  2757. actionBy: this.$store.state.user.name,
  2758. state: '待检验',
  2759. equipmentList: this.itemObjectList
  2760. }
  2761. actionIQCInspection(tempData).then(({data}) => {
  2762. if (data && data.code === 0) {
  2763. this.getDataList()
  2764. this.$message.success('操作成功')
  2765. this.ItemObjectModelFlag = false
  2766. } else {
  2767. this.$message.error(data.msg)
  2768. }
  2769. })
  2770. })
  2771. },
  2772. // 明细记录信息查询
  2773. detailModal (row) {
  2774. this.detailData.site = row.site
  2775. this.detailData.buNo = row.buNo
  2776. this.detailData.inspectionNo = row.inspectionNo
  2777. this.detailData.partNo = row.partNo
  2778. this.detailData.partDesc = row.partDesc
  2779. this.detailData.cinvSourceCode = row.cinvSourceCode
  2780. this.detailData.sku = row.sku
  2781. this.detailData.rollQty = row.rollQty
  2782. this.detailData.samplingQty = row.samplingQty
  2783. this.detailData.unqualifiedQty = row.unqualifiedQty
  2784. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  2785. this.detailData.submitFlag = row.submitFlag
  2786. this.detailData.disposalMeasures = row.disposalMeasures
  2787. this.detailData.disposalRemark = row.disposalRemark
  2788. this.detailData.inspectionResult = row.inspectionResult
  2789. this.detailData.inspectorNo = row.inspectorNo
  2790. this.detailData.inspectionRemark = row.inspectionRemark
  2791. this.detailData.umId = row.umId
  2792. this.detailData.rollCount = row.rollCount
  2793. this.detailData.poOrderNo = row.poOrderNo
  2794. this.detailData.poItemNo = row.poItemNo
  2795. this.detailData.operator = row.operator
  2796. this.detailData.operatorName = row.operatorName
  2797. this.detailData.responsiblePerson = row.responsiblePerson
  2798. this.detailData.responsiblePersonName = row.responsiblePersonName
  2799. this.detailData.invdefinetype = row.invdefinetype
  2800. this.detailData.state = row.state
  2801. if (row.state === '待检验') {
  2802. this.detailData.passQty = row.samplingQty
  2803. } else {
  2804. this.detailData.passQty = row.passQty
  2805. this.detailData.notPassQty = row.notPassQty
  2806. }
  2807. this.detailData.batchQualifiedQty = row.batchQualifiedQty
  2808. // 给批次不合格数量赋值
  2809. this.detailData.noBatchQualifiedQty = this.detailData.notPassQty
  2810. this.getInspectionFormData()
  2811. this.detailInformationFlag = true
  2812. },
  2813. // 检验单明细
  2814. getInspectionFormData () {
  2815. iqcDetailSearch(this.detailData).then(({data}) => {
  2816. if (data && data.code === 0) {
  2817. this.detailList = data.rows
  2818. } else {
  2819. this.detailList = []
  2820. }
  2821. })
  2822. },
  2823. // 子明细记录信息查询
  2824. subDetailModal (row) {
  2825. this.subDetailLoading = true
  2826. this.subDetailData = row
  2827. this.pageIndex2 = 1
  2828. selectIQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  2829. if (data.code === 0) {
  2830. this.tableData = data.rows
  2831. }
  2832. this.subDetailLoading = false
  2833. }).catch(()=>{
  2834. this.subDetailLoading = false
  2835. })
  2836. this.batchAddData = {
  2837. samplingLocation: '',
  2838. samplingLocationB: '',
  2839. samplingNumber: ''
  2840. }
  2841. this.subDetailFlag = true
  2842. },
  2843. // 子明细分页查询
  2844. subDetailModal2 () {
  2845. selectIQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  2846. if (data.code === 0) {
  2847. this.tableData = data.rows
  2848. }
  2849. })
  2850. },
  2851. // 删除检验记录
  2852. deleteModal () {
  2853. let tempData1 = '' // 记录是待审核和已完成状态的单号,不允许删除
  2854. if (this.IQCSelections.length === 0) {
  2855. this.$message.warning('请勾选要删除的检验单!')
  2856. return
  2857. }
  2858. for (let i = 0; i < this.IQCSelections.length; i++) {
  2859. if (this.IQCSelections[i].state === '待审核' || this.IQCSelections[i].state === '已完成') {
  2860. tempData1 = tempData1 + this.IQCSelections[i].inspectionNo + '、'
  2861. }
  2862. }
  2863. if (tempData1 !== '') {
  2864. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2865. this.$message.warning('检验单号 ' + tempData1 + ', 待审核和已完成的单据不允许删除!')
  2866. return
  2867. }
  2868. this.$confirm(`是否删除该 `+ this.IQCSelections.length +` 条检验记录?`, '提示', {
  2869. confirmButtonText: '确定',
  2870. cancelButtonText: '取消',
  2871. type: 'warning'
  2872. }).then(() => {
  2873. let tempData = {
  2874. site: '',
  2875. submitList: this.IQCSelections
  2876. }
  2877. iqcRecordDelete(tempData).then(({data}) => {
  2878. if (data && data.code === 0) {
  2879. this.getDataList()
  2880. this.IQCSelections = []
  2881. this.$message.success('操作成功')
  2882. } else {
  2883. this.$message.error(data.msg)
  2884. }
  2885. })
  2886. })
  2887. },
  2888. // 任务重载
  2889. overLoadModal () {
  2890. if (this.IQCSelections.length === 0) {
  2891. this.$message.warning('请勾选要重载的检验单!')
  2892. return
  2893. }
  2894. if (this.IQCSelections.every(val => val.state === '待检验' || val.state === '未开始')) {
  2895. this.$confirm(`是否重载该 `+ this.IQCSelections.length +` 条检验单?`, '提示', {
  2896. confirmButtonText: '确定',
  2897. cancelButtonText: '取消',
  2898. type: 'warning'
  2899. }).then(() => {
  2900. let tempData = {
  2901. site: '',
  2902. submitList: this.IQCSelections
  2903. }
  2904. iqcRecordOverLoad(tempData).then(({data}) => {
  2905. if (data && data.code === 0) {
  2906. this.getDataList()
  2907. this.IQCSelections = []
  2908. this.$message.success('操作成功')
  2909. } else {
  2910. this.$message.error(data.msg)
  2911. }
  2912. })
  2913. })
  2914. } else {
  2915. this.$message.warning('检验单必须为待检验状态!')
  2916. }
  2917. },
  2918. // 审核按钮
  2919. submitResult () {
  2920. let tempData1 = '' // 记录不是待审核状态的单号
  2921. let tempData2 = '' // 记录处置措施未填写的单号
  2922. if (this.IQCSelections.length === 0) {
  2923. this.$message.warning('请勾选要审核的检验单!')
  2924. return
  2925. }
  2926. for (let i = 0; i < this.IQCSelections.length; i++) {
  2927. if (this.IQCSelections[i].state !== '待审核'){
  2928. tempData1 = tempData1 + this.IQCSelections[i].inspectionNo + '、'
  2929. }
  2930. if (this.IQCSelections[i].inspectionResult === '不合格' && (this.IQCSelections[i].disposalMeasures === '' || this.IQCSelections[i].disposalMeasures == null)) {
  2931. tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、'
  2932. }
  2933. }
  2934. if (tempData1 !== '') {
  2935. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2936. this.$message.warning('检验单号 ' + tempData1 + ', 不是待审核状态!')
  2937. return
  2938. }
  2939. if (tempData2 !== '') {
  2940. tempData2 = tempData2.substring(0, tempData2.length - 1)
  2941. this.$message.warning('检验单号 ' + tempData2 + ', 的处置措施未选择!')
  2942. return
  2943. }
  2944. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.IQCSelections.length + ` 条记录`, '提示', {
  2945. confirmButtonText: '确定',
  2946. cancelButtonText: '取消',
  2947. type: 'warning'
  2948. }).then(() => {
  2949. this.submitData.submitList = this.IQCSelections
  2950. saveIQCSubmitResult(this.submitData).then(({data}) => {
  2951. if (data && data.code === 0) {
  2952. this.getDataList()
  2953. this.IQCSelections = []
  2954. this.$message.success('操作成功')
  2955. } else {
  2956. this.$message.error(data.msg)
  2957. }
  2958. })
  2959. })
  2960. },
  2961. // 取消审核
  2962. cancelApproval () {
  2963. let tempData1 = '' // 记录不是已完成状态的单号
  2964. let tempData2 = '' // 记录免检的单号
  2965. if (this.IQCSelections.length === 0) {
  2966. this.$message.warning('请勾选要取消审核的检验单!')
  2967. return
  2968. }
  2969. for (let i = 0; i < this.IQCSelections.length; i++) {
  2970. if (this.IQCSelections[i].state !== '已完成') {
  2971. tempData1 = tempData1 + this.IQCSelections[i].inspectionNo + '、'
  2972. }
  2973. if (this.IQCSelections[i].inspectionResult === '免检') {
  2974. tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、'
  2975. }
  2976. }
  2977. if (tempData1 !== '') {
  2978. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2979. this.$message.warning('检验单号 ' + tempData1 + ' ,不是已完成状态!')
  2980. return
  2981. }
  2982. if (tempData2 !== '') {
  2983. tempData2 = tempData2.substring(0, tempData2.length - 1)
  2984. this.$message.warning('检验单号 ' + tempData2 + ' , 免检的单据不允许取消审核!')
  2985. return
  2986. }
  2987. this.$confirm(`确定取消审核该 ` + this.IQCSelections.length + ` 条记录`, '提示', {
  2988. confirmButtonText: '确定',
  2989. cancelButtonText: '取消',
  2990. type: 'warning'
  2991. }).then(() => {
  2992. this.submitData.submitList = this.IQCSelections
  2993. cancelApproval(this.submitData).then(({data}) => {
  2994. if (data && data.code === 0) {
  2995. this.getDataList()
  2996. this.IQCSelections = []
  2997. this.$message.success('操作成功')
  2998. } else {
  2999. this.$message.error(data.msg)
  3000. }
  3001. })
  3002. })
  3003. },
  3004. // 子明细方法
  3005. // 表格的新增
  3006. rowClassName ({ row, rowIndex }) {
  3007. row.xh = rowIndex + 1
  3008. row.num = this.tableData.indexOf(row) + 1
  3009. },
  3010. // 单选框选中数据
  3011. handleDetailSelectionChange(selection) {
  3012. this.checkedDetail = selection
  3013. },
  3014. // 点击新增更多
  3015. handleAddBtn (td) {
  3016. checkIQCIsSubmit(td).then(({data}) => {
  3017. if (data.flag !== 1) {
  3018. let obj = {
  3019. subDetailValue: '',
  3020. samplingLocation: '',
  3021. samplingLocationB: '',
  3022. subDetailValueB: '',
  3023. subDetailValueC: '',
  3024. subDetailValueD: '',
  3025. subDetailValueE: '',
  3026. }
  3027. this.tableData.push(obj)
  3028. } else {
  3029. this.$alert("记录已提交!", '错误', {
  3030. confirmButtonText: '确定'
  3031. })
  3032. }
  3033. })
  3034. },
  3035. // 批量新增操作
  3036. batchHandleAdd (td) {
  3037. checkIQCIsSubmit(td).then(({data}) => {
  3038. if (data.flag !== 1) {
  3039. this.batchHandleAddModalFlag = true
  3040. } else {
  3041. this.$alert("记录已提交!", '错误', {
  3042. confirmButtonText: '确定'
  3043. })
  3044. }
  3045. })
  3046. },
  3047. // 批量新增行
  3048. batchHandleAddModal () {
  3049. for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
  3050. let obj = {
  3051. samplingLocation: this.batchAddData.samplingLocation,
  3052. samplingLocationB: this.batchAddData.samplingLocationB,
  3053. subDetailValue: '',
  3054. subDetailValueB: '',
  3055. subDetailValueC: '',
  3056. subDetailValueD: '',
  3057. subDetailValueE: '',
  3058. }
  3059. this.tableData.push(obj)
  3060. }
  3061. this.batchHandleAddModalFlag = false
  3062. },
  3063. // 回车事件
  3064. nextFocus1 (index) {
  3065. let a1 = `${index + 1}` + `a`
  3066. this.$nextTick(() => {
  3067. this.$refs[a1].focus()
  3068. })
  3069. },
  3070. nextFocus2 (index) {
  3071. let a2 = `${index + 1}` + `b`
  3072. this.$nextTick(() => {
  3073. this.$refs[a2].focus()
  3074. })
  3075. },
  3076. nextFocus3 (index) {
  3077. let a3 = `${index + 1}` + `c`
  3078. this.$nextTick(() => {
  3079. this.$refs[a3].focus()
  3080. })
  3081. },
  3082. nextFocus4 (index) {
  3083. let a = `${index + 1}` + `d`
  3084. this.$nextTick(() => {
  3085. this.$refs[a].focus()
  3086. })
  3087. },
  3088. nextFocus5 (index) {
  3089. let a = `${index + 1}` + `e`
  3090. this.$nextTick(() => {
  3091. this.$refs[a].focus()
  3092. })
  3093. },
  3094. nextFocus6 (index) {
  3095. let a = `${index + 1}` + `f`
  3096. this.$nextTick(() => {
  3097. this.$refs[a].focus()
  3098. })
  3099. },
  3100. nextFocus7 (index) {
  3101. let a = `${index + 1}` + `g`
  3102. this.$nextTick(() => {
  3103. this.$refs[a].focus()
  3104. })
  3105. },
  3106. focusNextInput (index, type) {
  3107. let aaa = ''
  3108. if (this.detailList.length - 1 === index) {
  3109. aaa = `${type}0`
  3110. } else {
  3111. aaa = `${type}${index + 1}`
  3112. }
  3113. this.$nextTick(() => {
  3114. this.$refs[aaa].focus()
  3115. })
  3116. },
  3117. updateItemResult(row){
  3118. if (row.maxValue == null && row.minValue == null&&row.defaultValue==null) {
  3119. return;
  3120. }
  3121. if (row.maxValue == null && row.minValue == null) {
  3122. if (row.numberValue!=row.defaultValue){
  3123. row.itemResult = 'N'
  3124. }
  3125. }else if (row.maxValue != null && row.minValue != null){
  3126. if (row.numberValue>row.maxValue ||row.numberValue<row.minValue){
  3127. row.itemResult = 'N'
  3128. }else {
  3129. row.itemResult = 'Y'
  3130. }
  3131. }else if(row.maxValue != null){
  3132. if ( row.numberValue>row.maxValue) {
  3133. row.itemResult = 'N'
  3134. }else {
  3135. row.itemResult = 'Y'
  3136. }
  3137. }else if(row.minValue != null){
  3138. if ( row.numberValue<row.minValue) {
  3139. row.itemResult = 'N'
  3140. }else {
  3141. row.itemResult = 'Y'
  3142. }
  3143. }
  3144. },
  3145. //删除
  3146. handleDeleteBtn (td) {
  3147. checkIQCIsSubmit(td).then(({data}) => {
  3148. if (data.flag !== 1) {
  3149. if (this.checkedDetail.length === 0) {
  3150. this.$alert("请先选择要删除的数据", "提示", {
  3151. confirmButtonText: "确定",
  3152. })
  3153. } else {
  3154. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  3155. confirmButtonText: "确定",
  3156. cancelButtonText: "取消",
  3157. type: "warning",
  3158. callback: (action) => {
  3159. if (action === "confirm") {
  3160. let val = this.checkedDetail
  3161. val.forEach((val, index) => {
  3162. this.tableData.splice(this.tableData.indexOf(val), 1)
  3163. if (this.templateTableData.length === 0) {
  3164. this.pageIndex2--
  3165. }
  3166. })
  3167. this.$message({
  3168. message: "删除成功!",
  3169. type: "success",
  3170. })
  3171. } else {
  3172. this.$message({
  3173. message: "已取消删除操作",
  3174. type: "warning",
  3175. })
  3176. }
  3177. },
  3178. })
  3179. }
  3180. } else {
  3181. this.$alert("记录已提交!", '错误', {
  3182. confirmButtonText: '确定'
  3183. })
  3184. }
  3185. })
  3186. },
  3187. // 新增子明细记录
  3188. saveSubDetailResult () {
  3189. for (let i = 0; i < this.tableData.length; i++) {
  3190. if(this.tableData[i].subDetailValue === '' || this.tableData[i].subDetailValue == null){
  3191. this.$message.warning('序号' + (i+1) +'未填写实测值!')
  3192. return
  3193. }
  3194. }
  3195. this.subDetailData.subDetailValues = this.tableData
  3196. saveIQCSubDetailed(this.subDetailData).then(({data}) => {
  3197. if (data && data.code === 0) {
  3198. if (data.count > 0) {
  3199. this.subDetailData.itemResult = 'N'
  3200. this.subDetailData.unqualifiedQuantity = data.count
  3201. }
  3202. if (this.subDetailData.subDetailValues.length > 0) {
  3203. this.subDetailData.subDetailRecordNum = 1
  3204. } else {
  3205. this.subDetailData.subDetailRecordNum = -1
  3206. this.subDetailData.unqualifiedQuantity = 0
  3207. this.subDetailData.itemResult = 'Y'
  3208. }
  3209. this.subDetailFlag = false
  3210. this.tableData = []
  3211. this.$message.success('操作成功')
  3212. } else {
  3213. this.$message.error(data.msg)
  3214. }
  3215. })
  3216. },
  3217. // 检验结论改变事件
  3218. resultChange () {
  3219. if (this.detailData.inspectionResult === '不合格') {
  3220. this.detailData.passQty = 0
  3221. }
  3222. },
  3223. // 校验用户是否收藏
  3224. favoriteIsOk () {
  3225. let userFavorite = {
  3226. userId: this.$store.state.user.id,
  3227. languageCode: this.$i18n.locale
  3228. }
  3229. userFavoriteList(userFavorite).then(({data}) => {
  3230. for (let i = 0; i < data.list.length; i++) {
  3231. if (this.$route.meta.menuId === data.list[i].menuId) {
  3232. this.favorite = true
  3233. }
  3234. }
  3235. })
  3236. },
  3237. // 收藏 OR 取消收藏
  3238. favoriteFunction () {
  3239. let userFavorite = {
  3240. userId: this.$store.state.user.id,
  3241. functionId: this.$route.meta.menuId,
  3242. }
  3243. if (this.favorite) {
  3244. removeUserFavorite(userFavorite).then(({data}) => {
  3245. this.$message.success(data.msg)
  3246. this.favorite = false
  3247. })
  3248. } else {
  3249. // 收藏
  3250. saveUserFavorite(userFavorite).then(({data}) => {
  3251. this.$message.success(data.msg)
  3252. this.favorite = true
  3253. })
  3254. }
  3255. },
  3256. async exportExcel() {
  3257. this.searchData.limit = -1
  3258. this.searchData.page = 1
  3259. excel.exportTable({
  3260. url: "/pms/qc/qcIQCInspectionSearch",
  3261. columnMapping: this.columnList, //可以直接用table,不需要的列就剔除
  3262. mergeSetting: [],//需要合并的列
  3263. params: this.searchData,
  3264. fileName: this.exportName+".xlsx",
  3265. rowFetcher: res => res.data,
  3266. columnFormatter: [],
  3267. dropColumns: [],
  3268. })
  3269. },
  3270. // 动态列开始 获取 用户保存的 格式列
  3271. async getTableUserColumn (tableId, columnId) {
  3272. let queryTableUser = {
  3273. userId: this.$store.state.user.name,
  3274. functionId: this.$route.meta.menuId,
  3275. tableId: tableId,
  3276. status: true,
  3277. languageCode: this.$i18n.locale
  3278. }
  3279. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3280. if (data.rows.length > 0) {
  3281. switch (columnId) {
  3282. case 1:
  3283. this.columnList1 = data.rows
  3284. break;
  3285. case 2:
  3286. this.detailColumnList = data.rows
  3287. break;
  3288. }
  3289. } else {
  3290. this.getColumnList(tableId, columnId)
  3291. }
  3292. })
  3293. },
  3294. // 获取 tableDefault 列
  3295. async getColumnList (tableId, columnId) {
  3296. let queryTable = {
  3297. functionId: this.$route.meta.menuId,
  3298. tableId: tableId,
  3299. languageCode: this.$i18n.locale
  3300. }
  3301. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3302. if (data.rows.length !== 0) {
  3303. switch (columnId) {
  3304. case 1:
  3305. this.columnList1 = data.rows
  3306. break;
  3307. case 2:
  3308. this.detailColumnList = data.rows
  3309. break;
  3310. }
  3311. }
  3312. })
  3313. },
  3314. // 明细导入后将返回值回传给父组件
  3315. changeMyString (val) {
  3316. for (let i = 0; i < this.detailList.length; i++) {
  3317. if (val[this.detailList[i].itemNo] !== undefined) {
  3318. this.detailList[i].unqualifiedQuantity = val[this.detailList[i].itemNo]
  3319. if (val[this.detailList[i].itemNo] != null) {
  3320. this.detailList[i].subDetailRecordNum = 1
  3321. }
  3322. if (val[this.detailList[i].itemNo] > 0) {
  3323. this.detailList[i].itemResult = 'N'
  3324. }
  3325. }
  3326. }
  3327. },
  3328. //获取按钮的权限数据
  3329. getButtonAuthData () {
  3330. let searchFlag = this.isAuth(this.menuId + ":search")
  3331. let checkFlag = this.isAuth(this.menuId + ":check")
  3332. let overLoadFlag = this.isAuth(this.menuId + ":overLoad")
  3333. let deleteFlag = this.isAuth(this.menuId + ":delete")
  3334. let detailFlag = this.isAuth(this.menuId + ":detail")
  3335. let fileFlag = this.isAuth(this.menuId + ":file")
  3336. let cancelCheckFlag = this.isAuth(this.menuId + ":cancelCheck")
  3337. //处理页面的权限数据
  3338. this.authSearch = !searchFlag
  3339. this.authCheck = !checkFlag
  3340. this.authOverLoad = !overLoadFlag
  3341. this.authDelete = !deleteFlag
  3342. this.authDetail = !detailFlag
  3343. this.authFile = !fileFlag
  3344. this.authCancelCheck = !cancelCheckFlag
  3345. },
  3346. // ======================== IQC检验项目操作相关方法 ========================
  3347. // 打开项目操作对话框
  3348. openItemOperationDialog() {
  3349. this.itemOperationQuery = {
  3350. itemNo: '',
  3351. itemDesc: '',
  3352. }
  3353. this.searchIQCItems()
  3354. this.itemOperationDialogFlag = true
  3355. },
  3356. // 查询IQC类型的检验项目
  3357. async searchIQCItems() {
  3358. try {
  3359. const params = {
  3360. site: this.detailData.site,
  3361. buNo: this.detailData.buNo,
  3362. inspectionNo: this.detailData.inspectionNo,
  3363. itemNo: this.itemOperationQuery.itemNo || '',
  3364. itemDesc: this.itemOperationQuery.itemDesc || ''
  3365. }
  3366. const { data } = await getIQCItemList(params)
  3367. if (data && data.code === 0) {
  3368. this.availableItemList = data.row1 || []
  3369. this.selectedItemList = data.row2 || []
  3370. }
  3371. } catch (error) {
  3372. this.$message.error('查询检验项目失败')
  3373. }
  3374. },
  3375. // 可选项目表格行点击
  3376. availableItemClickRow(row) {
  3377. this.$refs.availableItemTable.toggleRowSelection(row)
  3378. },
  3379. // 可选项目选择变化
  3380. availableItemSelectionChange(selection) {
  3381. this.availableItemSelections = selection
  3382. },
  3383. // 已选项目表格行点击
  3384. selectedItemClickRow(row) {
  3385. this.$refs.selectedItemTable.toggleRowSelection(row)
  3386. },
  3387. // 已选项目选择变化
  3388. selectedItemSelectionChange(selection) {
  3389. this.selectedItemSelections = selection
  3390. },
  3391. // 添加检验项目
  3392. async addInspectionItems() {
  3393. if (!this.availableItemSelections || this.availableItemSelections.length === 0) {
  3394. this.$message.warning('请选择要添加的项目')
  3395. return
  3396. }
  3397. this.$confirm('确认添加选中的检验项目吗?', '提示', {
  3398. confirmButtonText: '确定',
  3399. cancelButtonText: '取消',
  3400. type: 'warning'
  3401. }).then(async () => {
  3402. try {
  3403. const params = {
  3404. site: this.detailData.site,
  3405. buNo: this.detailData.buNo,
  3406. inspectionNo: this.detailData.inspectionNo,
  3407. itemList: this.availableItemSelections.map(item => ({
  3408. itemNo: item.itemNo
  3409. }))
  3410. }
  3411. const { data } = await addIQCItemDetails(params)
  3412. if (data && data.code === 0) {
  3413. this.$message.success('添加成功')
  3414. this.searchIQCItems()
  3415. } else {
  3416. this.$message.error(data.msg || '添加失败')
  3417. }
  3418. } catch (error) {
  3419. this.$message.error('添加失败,请检查')
  3420. }
  3421. }).catch(() => {
  3422. this.$message.info('已取消添加')
  3423. })
  3424. },
  3425. // 删除检验项目
  3426. async deleteInspectionItems() {
  3427. if (!this.selectedItemSelections || this.selectedItemSelections.length === 0) {
  3428. this.$message.warning('请选择要移除的项目')
  3429. return
  3430. }
  3431. this.$confirm('确认移除选中的检验项目吗?(将同时删除该项目的子明细数据)', '提示', {
  3432. confirmButtonText: '确定',
  3433. cancelButtonText: '取消',
  3434. type: 'warning'
  3435. }).then(async () => {
  3436. try {
  3437. const params = {
  3438. site: this.detailData.site,
  3439. buNo: this.detailData.buNo,
  3440. inspectionNo: this.detailData.inspectionNo,
  3441. itemList: this.selectedItemSelections.map(item => ({
  3442. itemNo: item.itemNo
  3443. }))
  3444. }
  3445. const { data } = await deleteIQCItemDetails(params)
  3446. if (data && data.code === 0) {
  3447. this.$message.success('移除成功')
  3448. this.searchIQCItems()
  3449. } else {
  3450. this.$message.error(data.msg || '移除失败')
  3451. }
  3452. } catch (error) {
  3453. this.$message.error('移除失败,请检查')
  3454. }
  3455. }).catch(() => {
  3456. this.$message.info('已取消移除')
  3457. })
  3458. },
  3459. // 刷新检验明细列表
  3460. refreshInspectionDetailList() {
  3461. if (this.detailInformationFlag) {
  3462. this.getInspectionFormData()
  3463. }
  3464. },
  3465. // ======================== IQC模板导入相关方法 ========================
  3466. // 打开模板导入对话框
  3467. openTemplateImportDialog() {
  3468. this.templateQuery = {
  3469. templateId: '',
  3470. templateDesc: '',
  3471. }
  3472. this.searchIQCTemplates()
  3473. this.templateImportDialogFlag = true
  3474. },
  3475. // 查询IQC检验模板
  3476. async searchIQCTemplates() {
  3477. try {
  3478. const params = {
  3479. site: this.detailData.site,
  3480. buNo: this.detailData.buNo,
  3481. templateId: this.templateQuery.templateId || '',
  3482. templateDesc: this.templateQuery.templateDesc || ''
  3483. }
  3484. const { data } = await getIQCTemplateList(params)
  3485. if (data && data.code === 0) {
  3486. this.templateList = data.rows || []
  3487. }
  3488. } catch (error) {
  3489. this.$message.error('查询模板失败')
  3490. }
  3491. },
  3492. // 模板表格行点击
  3493. templateClickRow(row) {
  3494. this.$refs.templateTable.toggleRowSelection(row)
  3495. },
  3496. // 模板选择变化
  3497. templateSelectionChange(selection) {
  3498. this.templateSelections = selection
  3499. },
  3500. // 确认导入模板
  3501. confirmImportTemplate() {
  3502. if (!this.templateSelections || this.templateSelections.length === 0) {
  3503. this.$message.warning('请选择要导入的模板')
  3504. return
  3505. }
  3506. this.$confirm(`确认导入选中的 ${this.templateSelections.length} 个模板吗?`, '提示', {
  3507. confirmButtonText: '确定',
  3508. cancelButtonText: '取消',
  3509. type: 'warning'
  3510. }).then(async () => {
  3511. this.importLoading = true
  3512. try {
  3513. const params = {
  3514. site: this.detailData.site,
  3515. buNo: this.detailData.buNo,
  3516. inspectionNo: this.detailData.inspectionNo,
  3517. templateList: this.templateSelections.map(item => ({
  3518. templateId: item.templateId
  3519. }))
  3520. }
  3521. const { data } = await importIQCTemplateItems(params)
  3522. if (data && data.code === 0) {
  3523. this.$message.success(`导入成功,共导入 ${data.importCount || 0} 个检验项目`)
  3524. this.templateImportDialogFlag = false
  3525. this.templateSelections = []
  3526. // 刷新检验明细列表
  3527. this.getInspectionFormData()
  3528. } else {
  3529. this.$message.error(data.msg || '导入失败')
  3530. }
  3531. } catch (error) {
  3532. this.$message.error('导入失败,请检查')
  3533. } finally {
  3534. this.importLoading = false
  3535. }
  3536. }).catch(() => {
  3537. this.$message.info('已取消导入')
  3538. })
  3539. },
  3540. // 重置项目查询条件
  3541. resetItemQuery() {
  3542. this.itemOperationQuery = {
  3543. itemNo: '',
  3544. itemDesc: '',
  3545. }
  3546. this.searchIQCItems()
  3547. },
  3548. // 重置模板查询条件
  3549. resetTemplateQuery() {
  3550. this.templateQuery = {
  3551. templateId: '',
  3552. templateDesc: '',
  3553. }
  3554. this.searchIQCTemplates()
  3555. },
  3556. }
  3557. }
  3558. </script>
  3559. <style scoped>
  3560. /* 搜索卡片样式 */
  3561. .search-card {
  3562. margin-bottom: 16px;
  3563. border-radius: 8px;
  3564. overflow: hidden;
  3565. transition: all 0.3s ease;
  3566. }
  3567. .search-card:hover {
  3568. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  3569. }
  3570. .search-card /deep/ .el-card__header {
  3571. padding: 5px 20px;
  3572. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  3573. border-bottom: none;
  3574. }
  3575. .search-header {
  3576. display: flex;
  3577. justify-content: space-between;
  3578. align-items: center;
  3579. }
  3580. .header-left {
  3581. display: flex;
  3582. align-items: center;
  3583. color: #fff;
  3584. }
  3585. .header-left i {
  3586. font-size: 16px;
  3587. margin-right: 8px;
  3588. }
  3589. .header-title {
  3590. font-size: 14px;
  3591. font-weight: 600;
  3592. letter-spacing: 0.5px;
  3593. }
  3594. .header-right {
  3595. color: #fff;
  3596. }
  3597. .collapse-btn {
  3598. color: #fff;
  3599. font-weight: 500;
  3600. transition: all 0.3s ease;
  3601. }
  3602. .collapse-btn:hover {
  3603. color: #f0f0f0;
  3604. transform: translateY(-1px);
  3605. }
  3606. .collapse-btn i {
  3607. transition: transform 0.3s ease;
  3608. }
  3609. /* 搜索表单样式 */
  3610. .search-form {
  3611. padding: 6px 0;
  3612. min-height: 0;
  3613. }
  3614. /* 卡片主体样式 */
  3615. .search-card /deep/ .el-card__body {
  3616. padding: 10px;
  3617. transition: all 0.3s ease;
  3618. }
  3619. /* 收起时的样式 */
  3620. .search-card.collapsed /deep/ .el-card__body {
  3621. padding: 10px 20px;
  3622. }
  3623. .search-form /deep/ .el-form-item {
  3624. margin-bottom: 12px;
  3625. }
  3626. .search-form /deep/ .el-form-item__label {
  3627. font-weight: 500;
  3628. color: #606266;
  3629. padding-bottom: 4px;
  3630. }
  3631. .search-form /deep/ .el-input__inner,
  3632. .search-form /deep/ .el-textarea__inner {
  3633. border-radius: 6px;
  3634. border: 1px solid #DCDFE6;
  3635. transition: all 0.3s ease;
  3636. }
  3637. .search-form /deep/ .el-input__inner:focus,
  3638. .search-form /deep/ .el-textarea__inner:focus {
  3639. border-color: #9ac3d0;
  3640. box-shadow: 0 0 0 2px rgba(154, 195, 208, 0.1);
  3641. }
  3642. .search-form /deep/ .el-select {
  3643. width: 100%;
  3644. }
  3645. .search-form /deep/ .el-date-editor.el-input {
  3646. width: 100%;
  3647. }
  3648. /* 状态下拉框优化 */
  3649. .search-form /deep/ .status-select {
  3650. width: 180px;
  3651. }
  3652. .search-form /deep/ .status-select .el-select__tags {
  3653. max-width: calc(100% - 30px);
  3654. }
  3655. .search-form /deep/ .status-select .el-tag {
  3656. max-width: 100%;
  3657. overflow: hidden;
  3658. text-overflow: ellipsis;
  3659. white-space: nowrap;
  3660. }
  3661. /* 操作按钮区域 */
  3662. .search-actions {
  3663. display: flex;
  3664. justify-content: space-between;
  3665. align-items: center;
  3666. padding: 8px 0 2px 0;
  3667. }
  3668. /* 展开时显示上边框 */
  3669. .search-card:not(.collapsed) .search-actions {
  3670. border-top: 1px solid #f0f0f0;
  3671. margin-top: 6px;
  3672. }
  3673. /* 收起时不显示上边框和上边距 */
  3674. .search-card.collapsed .search-actions {
  3675. border-top: none;
  3676. margin-top: 0;
  3677. padding-top: 0;
  3678. }
  3679. .action-left,
  3680. .action-right {
  3681. display: flex;
  3682. gap: 8px;
  3683. }
  3684. .search-actions .el-button {
  3685. border-radius: 4px;
  3686. padding: 5px 10px;
  3687. font-size: 12px;
  3688. font-weight: 500;
  3689. transition: all 0.3s ease;
  3690. }
  3691. .search-actions .el-button:hover {
  3692. transform: translateY(-2px);
  3693. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  3694. }
  3695. .search-actions .el-button--primary {
  3696. background: #60aeff;
  3697. border-color: #60aeff;
  3698. }
  3699. .search-actions .el-button--primary:hover {
  3700. background: #7dbdff;
  3701. border-color: #7dbdff;
  3702. }
  3703. .search-actions .el-button--success {
  3704. background: #67C23A;
  3705. border-color: #67C23A;
  3706. }
  3707. .search-actions .el-button--success:hover {
  3708. background: #85ce61;
  3709. border-color: #85ce61;
  3710. }
  3711. .search-actions .el-button--danger {
  3712. background: #F56C6C;
  3713. border-color: #F56C6C;
  3714. }
  3715. .search-actions .el-button--danger:hover {
  3716. background: #f78989;
  3717. border-color: #f78989;
  3718. }
  3719. .search-actions .el-button--warning {
  3720. background: #E6A23C;
  3721. border-color: #E6A23C;
  3722. }
  3723. .search-actions .el-button--warning:hover {
  3724. background: #ebb563;
  3725. border-color: #ebb563;
  3726. }
  3727. /* 响应式设计 */
  3728. @media (max-width: 1200px) {
  3729. .search-actions {
  3730. flex-direction: column;
  3731. gap: 10px;
  3732. }
  3733. .action-left,
  3734. .action-right {
  3735. width: 100%;
  3736. justify-content: center;
  3737. }
  3738. }
  3739. /deep/ .redElSelect .el-input--suffix .el-input__inner{
  3740. color: red;
  3741. font-weight: bold;
  3742. }
  3743. /deep/ .greenElSelect .el-input--suffix .el-input__inner{
  3744. color: rgb(103,194,58);
  3745. font-weight: bold;
  3746. }
  3747. .el-table /deep/ .cell{
  3748. height: auto;
  3749. line-height: 1.5;
  3750. }
  3751. /* ==================== IQC检验项目操作对话框样式 ==================== */
  3752. /deep/ .item-operation-dialog {
  3753. border-radius: 8px;
  3754. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  3755. }
  3756. /deep/ .item-operation-dialog .el-dialog__header {
  3757. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  3758. padding: 20px 24px;
  3759. border-radius: 8px 8px 0 0;
  3760. }
  3761. /deep/ .item-operation-dialog .el-dialog__title {
  3762. color: #ffffff;
  3763. font-size: 16px;
  3764. font-weight: 600;
  3765. letter-spacing: 0.5px;
  3766. }
  3767. /deep/ .item-operation-dialog .el-dialog__headerbtn .el-dialog__close {
  3768. color: #ffffff;
  3769. font-size: 20px;
  3770. font-weight: bold;
  3771. }
  3772. /deep/ .item-operation-dialog .el-dialog__headerbtn:hover .el-dialog__close {
  3773. color: #f0f0f0;
  3774. }
  3775. /deep/ .item-operation-dialog .el-dialog__body {
  3776. padding: 24px;
  3777. background: #f8f9fa;
  3778. }
  3779. /* 查询区域样式 */
  3780. .search-container {
  3781. background: #ffffff;
  3782. padding: 16px 20px;
  3783. border-radius: 6px;
  3784. margin-bottom: 20px;
  3785. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  3786. }
  3787. .search-container .el-form-item {
  3788. margin-bottom: 0;
  3789. }
  3790. .search-container .el-form-item__label {
  3791. font-weight: 500;
  3792. color: #606266;
  3793. }
  3794. /* 主内容区域 */
  3795. .item-operation-content {
  3796. display: flex;
  3797. gap: 16px;
  3798. align-items: stretch;
  3799. }
  3800. /* 项目面板 */
  3801. .item-panel {
  3802. flex: 1;
  3803. background: #ffffff;
  3804. border-radius: 6px;
  3805. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  3806. overflow: hidden;
  3807. transition: all 0.3s ease;
  3808. }
  3809. .item-panel:hover {
  3810. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  3811. }
  3812. .available-panel {
  3813. flex: 1.5;
  3814. }
  3815. .selected-panel {
  3816. flex: 1;
  3817. }
  3818. /* 面板头部 */
  3819. .panel-header {
  3820. padding: 8px 16px;
  3821. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  3822. border-bottom: 2px solid #9ac3d0;
  3823. display: flex;
  3824. align-items: center;
  3825. gap: 8px;
  3826. }
  3827. .panel-header i {
  3828. font-size: 18px;
  3829. color: #ffffff;
  3830. }
  3831. .panel-title {
  3832. font-size: 14px;
  3833. font-weight: 600;
  3834. color: #ffffff;
  3835. letter-spacing: 0.5px;
  3836. }
  3837. .item-count {
  3838. margin-left: auto;
  3839. font-size: 12px;
  3840. color: #ffffff;
  3841. background: rgba(255, 255, 255, 0.25);
  3842. padding: 2px 10px;
  3843. border-radius: 12px;
  3844. font-weight: 500;
  3845. }
  3846. /* 表格样式优化 */
  3847. .operation-table {
  3848. border: none !important;
  3849. }
  3850. .operation-table /deep/ .el-table__body tr:hover > td {
  3851. background-color: #f0f7ff !important;
  3852. }
  3853. .operation-table /deep/ .el-table__row.current-row > td {
  3854. background-color: #e6f2ff !important;
  3855. }
  3856. .operation-table /deep/ td {
  3857. border-bottom: 1px solid #f0f0f0;
  3858. }
  3859. .operation-table /deep/ .el-table__body {
  3860. font-size: 13px;
  3861. }
  3862. /* 操作按钮区域 */
  3863. .operation-buttons {
  3864. display: flex;
  3865. flex-direction: column;
  3866. justify-content: center;
  3867. align-items: center;
  3868. gap: 20px;
  3869. padding: 0 8px;
  3870. }
  3871. .operation-buttons .el-button {
  3872. width: 48px;
  3873. height: 48px;
  3874. font-size: 20px;
  3875. transition: all 0.3s ease;
  3876. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  3877. }
  3878. .operation-buttons .el-button:hover {
  3879. transform: scale(1.1);
  3880. box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  3881. }
  3882. .operation-buttons .el-button.is-disabled {
  3883. opacity: 0.4;
  3884. cursor: not-allowed;
  3885. }
  3886. .operation-buttons .el-button--primary {
  3887. background: linear-gradient(135deg, #409EFF 0%, #66b1ff 100%);
  3888. border: none;
  3889. }
  3890. .operation-buttons .el-button--danger {
  3891. background: linear-gradient(135deg, #F56C6C 0%, #f78989 100%);
  3892. border: none;
  3893. }
  3894. @media (max-width: 1200px) {
  3895. .item-operation-content {
  3896. flex-direction: column;
  3897. }
  3898. .operation-buttons {
  3899. flex-direction: row;
  3900. gap: 12px;
  3901. }
  3902. .operation-buttons .el-button {
  3903. width: 42px;
  3904. height: 42px;
  3905. font-size: 18px;
  3906. }
  3907. }
  3908. /* ==================== IQC模板导入对话框样式 ==================== */
  3909. /deep/ .template-import-dialog {
  3910. border-radius: 8px;
  3911. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  3912. }
  3913. /deep/ .template-import-dialog .el-dialog__header {
  3914. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  3915. padding: 20px 24px;
  3916. border-radius: 8px 8px 0 0;
  3917. }
  3918. /deep/ .template-import-dialog .el-dialog__title {
  3919. color: #ffffff;
  3920. font-size: 16px;
  3921. font-weight: 600;
  3922. letter-spacing: 0.5px;
  3923. }
  3924. /deep/ .template-import-dialog .el-dialog__headerbtn .el-dialog__close {
  3925. color: #ffffff;
  3926. font-size: 20px;
  3927. font-weight: bold;
  3928. }
  3929. /deep/ .template-import-dialog .el-dialog__headerbtn:hover .el-dialog__close {
  3930. color: #f0f0f0;
  3931. }
  3932. /deep/ .template-import-dialog .el-dialog__body {
  3933. padding: 24px;
  3934. background: #f8f9fa;
  3935. }
  3936. /* 模板列表容器 */
  3937. .template-list-container {
  3938. background: #ffffff;
  3939. border-radius: 6px;
  3940. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  3941. overflow: hidden;
  3942. transition: all 0.3s ease;
  3943. }
  3944. .template-list-container:hover {
  3945. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  3946. }
  3947. /* 模板表格 */
  3948. .template-table {
  3949. border: none !important;
  3950. }
  3951. .template-table /deep/ .el-table__body tr:hover > td {
  3952. background-color: #f0f7ff !important;
  3953. }
  3954. .template-table /deep/ .el-table__row.current-row > td {
  3955. background-color: #e6f2ff !important;
  3956. }
  3957. .template-table /deep/ td {
  3958. border-bottom: 1px solid #f0f0f0;
  3959. }
  3960. .template-table /deep/ .el-table__body {
  3961. font-size: 13px;
  3962. }
  3963. /* ==================== 按钮样式优化 ==================== */
  3964. .operation-btn {
  3965. position: relative;
  3966. padding: 8px 16px;
  3967. border: none;
  3968. border-radius: 4px;
  3969. font-size: 13px;
  3970. font-weight: 500;
  3971. cursor: pointer;
  3972. transition: all 0.3s ease;
  3973. overflow: hidden;
  3974. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  3975. }
  3976. .operation-btn:hover {
  3977. transform: translateY(-1px);
  3978. box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  3979. }
  3980. .operation-btn:active {
  3981. transform: translateY(0);
  3982. }
  3983. .operation-btn i {
  3984. margin-right: 4px;
  3985. font-size: 13px;
  3986. }
  3987. .operation-btn span {
  3988. position: relative;
  3989. z-index: 1;
  3990. }
  3991. /* 项目导入按钮 */
  3992. .item-operation-btn {
  3993. background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%);
  3994. color: #ffffff;
  3995. }
  3996. .item-operation-btn:hover {
  3997. background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%);
  3998. color: #ffffff;
  3999. }
  4000. /* 模板导入按钮 */
  4001. .template-import-btn {
  4002. background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%);
  4003. color: #ffffff;
  4004. margin-left: 10px;
  4005. }
  4006. .template-import-btn:hover {
  4007. background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%);
  4008. color: #ffffff;
  4009. }
  4010. </style>