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.

4343 lines
148 KiB

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