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.

4378 lines
150 KiB

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