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.

4580 lines
156 KiB

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