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.

4616 lines
152 KiB

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