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.

3280 lines
108 KiB

4 months ago
  1. <template>
  2. <div class="process-inspection">
  3. <el-dialog
  4. title="过程检验"
  5. :close-on-click-modal="false"
  6. v-drag
  7. :visible.sync="visible"
  8. width="1400px"
  9. :append-to-body="true"
  10. @close="handleClose">
  11. <!-- 查询条件 -->
  12. <el-form :inline="true" label-position="top" :model="searchData">
  13. <el-form-item label=" ">
  14. <el-button type="primary" @click="addModal">新增</el-button>
  15. <el-button type="primary" @click="submitResult">审核</el-button>
  16. <el-button type="primary" @click="deleteModal">删除</el-button>
  17. </el-form-item>
  18. </el-form>
  19. <!-- 检验记录展示列表 -->
  20. <el-table
  21. :height="400"
  22. :data="dataList"
  23. border
  24. ref="IPQCTable"
  25. @row-click="IPQCClickRow"
  26. @selection-change="selectionIPQC"
  27. style="width: 100%;">
  28. <el-table-column
  29. type="selection"
  30. header-align="center"
  31. align="center"
  32. :selectable="selectFlag"
  33. width="50">
  34. </el-table-column>
  35. <el-table-column
  36. prop="state"
  37. header-align="center"
  38. align="center"
  39. label="状态">
  40. <template slot-scope="scope">
  41. <div :style="{fontWeight:'bold', color: scope.row.state =='待检验' ? 'red' : scope.row.state =='待审核' ? '#ffa500e0' : scope.row.state =='已完成' ? '#3ac252' : ''}">
  42. {{ scope.row.state }}
  43. </div>
  44. </template>
  45. </el-table-column>
  46. <el-table-column
  47. v-for="(item,index) in columnList1" :key="index"
  48. v-if="!item.columnHidden"
  49. :sortable="item.columnSortable"
  50. :prop="item.columnProp"
  51. :header-align="item.headerAlign"
  52. :show-overflow-tooltip="item.showOverflowTooltip"
  53. :align="item.align"
  54. :fixed="item.fixed==''?false:item.fixed"
  55. :min-width="item.columnWidth"
  56. :label="item.columnLabel">
  57. <template slot-scope="scope">
  58. <span v-if="!item.columnImage"> {{ scope.row[item.columnProp] }}</span>
  59. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. fixed="right"
  64. header-align="center"
  65. align="center"
  66. width="130"
  67. label="操作">
  68. <template slot-scope="scope">
  69. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state === '未开始'" @click="actionModal(scope.row)">开始检验</el-link>
  70. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">检验单</el-link>
  71. <el-link style="cursor: pointer" v-if="!authFile" @click="getFileContentData(scope.row)">工作文件</el-link>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <!-- 分页 -->
  76. <el-pagination
  77. style="margin-top: 0px"
  78. @size-change="sizeChangeHandle"
  79. @current-change="currentChangeHandle"
  80. :current-page="pageIndex"
  81. :page-sizes="[20, 50, 100, 200, 500]"
  82. :page-size="pageSize"
  83. :total="totalPage"
  84. layout="total, sizes, prev, pager, next, jumper">
  85. </el-pagination>
  86. <!-- 新增检验记录弹窗 -->
  87. <el-dialog title="新增检验记录" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px" :append-to-body="true">
  88. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  89. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  90. <el-select v-model="modalData.bu" placeholder="请选择" @change="buChange" style="width: 221px">
  91. <el-option
  92. v-for="i in userBuList"
  93. :key="i.buNo"
  94. :label="i.sitename"
  95. :value="i.buNo">
  96. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  97. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  98. {{ i.buDesc }}
  99. </span>
  100. </el-option>
  101. </el-select>
  102. </el-form-item>
  103. <el-form-item label="标签号">
  104. <el-input v-if="this.modalData.specialTaskFlag === 'Y'" disabled v-model="modalData.rollNo" style="width: 221px"></el-input>
  105. <el-input v-else v-model="modalData.rollNo" @keyup.native.enter="rollNoEnter" clearable style="width: 221px"></el-input>
  106. </el-form-item>
  107. </el-form>
  108. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
  109. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && (this.modalData.rollNo === '' || this.modalData.rollNo == null)" prop="orderNo" :rules="rules.seqNoType">
  110. <span style="cursor: pointer" slot="label" @click="getBaseList(1052)"><a herf="#">派工单号</a></span>
  111. <el-input v-model="modalData.seqNo" style="width: 221px"></el-input>
  112. </el-form-item>
  113. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && this.modalData.rollNo !== '' && this.modalData.rollNo != null" prop="orderNo" :rules="rules.seqNoType">
  114. <span slot="label">派工单号</span>
  115. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  116. </el-form-item>
  117. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" prop="orderNo" :rules="rules.seqNoType">
  118. <span slot="label">派工单号</span>
  119. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  120. </el-form-item>
  121. <el-form-item label="工单号" prop="orderNo" :rules="rules.orderNoType">
  122. <el-input v-model="modalData.orderNo" style="width: 221px" disabled></el-input>
  123. </el-form-item>
  124. </el-form>
  125. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
  126. <el-form-item label="工序" prop="operationDesc" :rules="rules.operationDescType">
  127. <el-select v-model="modalData.operationDesc" placeholder="请选择" style="width: 221px">
  128. <el-option
  129. v-for="i in operationList"
  130. :key="i.operationNo"
  131. :label="i.operationDesc"
  132. :value="i.operationDesc">
  133. </el-option>
  134. </el-select>
  135. </el-form-item>
  136. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'">
  137. <span style="cursor: pointer" slot="label" @click="getBaseList(505)"><a herf="#">机台</a></span>
  138. <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>
  139. </el-form-item>
  140. <el-form-item v-else label="机台" prop="resourceId" :rules="rules.resourceIdType">
  141. <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>
  142. </el-form-item>
  143. </el-form>
  144. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px">
  145. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" :model="modalData">
  146. <span style="cursor: pointer" slot="label" @click="queryPartList"><a herf="#">物料编码</a></span>
  147. <el-input v-model="modalData.partNo" style="width: 221px"></el-input>
  148. </el-form-item>
  149. <el-form-item v-else label="物料编码" prop="partNo" :rules="rules.partNoType">
  150. <el-input v-model="modalData.partNo" readonly style="width: 221px"></el-input>
  151. </el-form-item>
  152. <el-form-item label="物料名称">
  153. <el-input v-model="modalData.partDesc" readonly style="width: 221px"></el-input>
  154. </el-form-item>
  155. </el-form>
  156. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px">
  157. <el-form-item label="物料类别">
  158. <el-input v-model="modalData.invdefinetype" readonly style="width: 221px"></el-input>
  159. </el-form-item>
  160. <el-form-item label="SKU">
  161. <el-input v-model="modalData.sku" readonly style="width: 221px"></el-input>
  162. </el-form-item>
  163. </el-form>
  164. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
  165. <el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
  166. <el-select v-model="modalData.inspectionTypeNo" style="width: 221px">
  167. <el-option label="首件检" value="首件检"></el-option>
  168. <el-option label="自检" value="自检"></el-option>
  169. <el-option label="巡检" value="巡检"></el-option>
  170. <el-option label="末件检" value="末件检"></el-option>
  171. </el-select>
  172. </el-form-item>
  173. <el-form-item label="送检数量" prop="rollQty" :rules="rules.rollQtyType">
  174. <el-input v-model="modalData.rollQty" type="number" style="width: 103px"></el-input>
  175. </el-form-item>
  176. <el-form-item label="单位" prop="umId" :rules="rules.umIdType">
  177. <el-select v-model="modalData.umId" placeholder="请选择" style="width: 103px">
  178. <el-option
  179. v-for="i in umList"
  180. :key="i.umId"
  181. :label="i.umName"
  182. :value="i.umId">
  183. </el-option>
  184. </el-select>
  185. </el-form-item>
  186. </el-form>
  187. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px">
  188. <el-form-item prop="templateId" :rules="rules.templateId">
  189. <span style="cursor: pointer" v-if="this.controlData.baseData === '控制'" slot="label" @click="queryTemplateList"><a>检验模板</a></span>
  190. <span v-else slot="label">检验模板</span>
  191. <el-input v-model="modalData.templateName" disabled style="width: 221px"></el-input>
  192. </el-form-item>
  193. <el-form-item label="送检总数">
  194. <el-input v-model="modalData.sjzs" disabled style="width: 120px"></el-input>
  195. </el-form-item>
  196. <el-form-item label=" ">
  197. <input type="checkbox" id="specialTask" name="specialTask" v-model="checked" @click="changeSpecialTask"/> <label for="specialTask">无工单检验</label>
  198. </el-form-item>
  199. </el-form>
  200. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px">
  201. <el-form-item label="老卷号">
  202. <el-input v-model="modalData.batchRollNo" style="width: 456px"></el-input>
  203. </el-form-item>
  204. </el-form>
  205. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px">
  206. <el-form-item label="特殊要求">
  207. <el-input type="textarea" v-model="modalData.specialRequirements" :rows="3" resize='none' show-word-limit style="width: 456px;height: 30px"></el-input>
  208. </el-form-item>
  209. </el-form>
  210. <el-footer style="height:40px;margin-top: 55px;text-align:center">
  211. <el-button type="primary" :loading="saveLoading" @click="saveData">保存</el-button>
  212. <el-button @click="modalFlag = false">关闭</el-button>
  213. </el-footer>
  214. </el-dialog>
  215. <!-- 派工单号弹出框 -->
  216. <el-dialog title="派工单号" @close="closeSeqDialog" :close-on-click-modal="false" v-drag :visible.sync="seqDetailFlag" width="952px" :append-to-body="true">
  217. <el-form :inline="true" label-position="top" :model="seqDetailData" style="margin-left: 7px;margin-top: -5px;">
  218. <el-form-item label="工单号">
  219. <el-input v-model="seqDetailData.orderNo" clearable style="width: 150px"></el-input>
  220. </el-form-item>
  221. <el-form-item label="派工单号">
  222. <el-input v-model="seqDetailData.seqNo" clearable style="width: 150px"></el-input>
  223. </el-form-item>
  224. <el-form-item label="SKU">
  225. <el-input v-model="seqDetailData.sku" clearable style="width: 150px"></el-input>
  226. </el-form-item>
  227. <el-form-item label="物料编码">
  228. <el-input v-model="seqDetailData.partNo" clearable style="width: 150px"></el-input>
  229. </el-form-item>
  230. <el-form-item label="物料名称">
  231. <el-input v-model="seqDetailData.partDesc" clearable style="width: 150px"></el-input>
  232. </el-form-item>
  233. <el-form-item label="工序">
  234. <el-input v-model="seqDetailData.operationDesc" clearable style="width: 150px"></el-input>
  235. </el-form-item>
  236. <el-form-item label=" ">
  237. <el-button type="primary" @click="searchSeqInfo" style="margin-top: 24px">查询</el-button>
  238. </el-form-item>
  239. </el-form>
  240. <el-table
  241. :height="400"
  242. :data="seqInfoList"
  243. @row-dblclick="getRowData1"
  244. border
  245. style="width: 100%;">
  246. <el-table-column
  247. v-for="(item,index) in seqDetailColumnList" :key="index"
  248. :sortable="item.columnSortable"
  249. :prop="item.columnProp"
  250. :header-align="item.headerAlign"
  251. :show-overflow-tooltip="item.showOverflowTooltip"
  252. :align="item.align"
  253. :fixed="item.fixed==''?false:item.fixed"
  254. :min-width="item.columnWidth"
  255. :label="item.columnLabel">
  256. <template slot-scope="scope">
  257. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  258. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  259. </template>
  260. </el-table-column>
  261. </el-table>
  262. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  263. <el-button type="primary" @click="seqDetailFlag=false">关闭</el-button>
  264. </el-footer>
  265. </el-dialog>
  266. <!-- 检验模板弹出框 -->
  267. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="templateModelFlag" width="520px" :append-to-body="true">
  268. <div class="rq">
  269. <el-form :inline="true" label-position="top" :model="templateData">
  270. <el-form-item :label="'模板编码'">
  271. <el-input v-model="templateData.templateId" clearable style="width: 120px"></el-input>
  272. </el-form-item>
  273. <el-form-item :label="'模板名称'">
  274. <el-input v-model="templateData.templateName" clearable style="width: 120px"></el-input>
  275. </el-form-item>
  276. <el-form-item :label="' '">
  277. <el-button type="primary" @click="queryTemplateList">查询</el-button>
  278. </el-form-item>
  279. </el-form>
  280. <el-table
  281. :height="300"
  282. :data="templateList"
  283. @row-dblclick="getRowData"
  284. border
  285. style="width: 100%;">
  286. <el-table-column
  287. v-for="(item,index) in templateDetailList" :key="index"
  288. :sortable="item.columnSortable"
  289. :prop="item.columnProp"
  290. :header-align="item.headerAlign"
  291. :show-overflow-tooltip="item.showOverflowTooltip"
  292. :align="item.align"
  293. :fixed="item.fixed==''?false:item.fixed"
  294. :min-width="item.columnWidth"
  295. :label="item.columnLabel">
  296. <template slot-scope="scope">
  297. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  298. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  299. </template>
  300. </el-table-column>
  301. </el-table>
  302. </div>
  303. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  304. <el-button type="primary" @click="templateModelFlag=false">关闭</el-button>
  305. </el-footer>
  306. </el-dialog>
  307. <!-- 检验单详情对话框 -->
  308. <el-dialog
  309. title="检验明细清单"
  310. :close-on-click-modal="false"
  311. v-drag
  312. :visible.sync="detailInformationFlag"
  313. width="1200px"
  314. top="2vh"
  315. :append-to-body="true"
  316. custom-class="ipqc-inspection-dialog">
  317. <!-- 单据信息卡片 -->
  318. <div class="inspection-info-card">
  319. <div class="info-section">
  320. <div class="section-title">
  321. <i class="el-icon-document"></i>
  322. <span>检验单信息</span>
  323. </div>
  324. <!-- 第一行物料信息 + 人员信息 -->
  325. <el-row :gutter="12" class="info-row">
  326. <el-col :span="3">
  327. <div class="info-item">
  328. <label>物料编码</label>
  329. <el-input v-model="detailData.partNo" disabled size="small"></el-input>
  330. </div>
  331. </el-col>
  332. <el-col :span="3">
  333. <div class="info-item">
  334. <label>物料类别</label>
  335. <el-input v-model="detailData.invdefinetype" readonly size="small"></el-input>
  336. </div>
  337. </el-col>
  338. <el-col :span="6">
  339. <div class="info-item">
  340. <label>物料名称</label>
  341. <el-input v-model="detailData.partDesc" disabled size="small"></el-input>
  342. </div>
  343. </el-col>
  344. <el-col :span="3">
  345. <div class="info-item">
  346. <label>规格型号</label>
  347. <el-input v-model="detailData.spec" disabled size="small"></el-input>
  348. </div>
  349. </el-col>
  350. <el-col :span="2">
  351. <div class="info-item">
  352. <label>单位</label>
  353. <el-input v-model="detailData.umName" disabled size="small"></el-input>
  354. </div>
  355. </el-col>
  356. <el-col :span="3">
  357. <div class="info-item">
  358. <label>
  359. <span v-if="detailData.submitFlag === 'Y'">协同人员</span>
  360. <a v-else style="cursor: pointer" @click="getOperatorListModal">协同人员</a>
  361. </label>
  362. <el-input v-model="detailData.operatorName" readonly size="small"></el-input>
  363. </div>
  364. </el-col>
  365. <el-col :span="4">
  366. <div class="info-item">
  367. <label>
  368. <span v-if="detailData.submitFlag === 'Y'">责任人</span>
  369. <a v-else style="cursor: pointer" @click="getResponsiblePersonListModal">责任人</a>
  370. </label>
  371. <el-input v-model="detailData.responsiblePersonName" readonly size="small"></el-input>
  372. </div>
  373. </el-col>
  374. </el-row>
  375. <!-- 第二行数量信息 -->
  376. <el-row :gutter="12" class="info-row" style="margin-top: 12px">
  377. <el-col :span="4">
  378. <div class="info-item">
  379. <label>送检数量</label>
  380. <el-input-number :controls="false" :step="0" v-model="detailData.rollQty" size="small" style="width: 100%"></el-input-number>
  381. </div>
  382. </el-col>
  383. <el-col :span="4">
  384. <div class="info-item">
  385. <label>抽样数量</label>
  386. <el-input-number :controls="false" :step="0" v-model="detailData.samplingQty" size="small" style="width: 100%"></el-input-number>
  387. </div>
  388. </el-col>
  389. <el-col :span="4">
  390. <div class="info-item">
  391. <label>合格数量</label>
  392. <el-input-number :controls="false" :step="0" min="0" v-if="detailData.submitFlag === 'Y'" v-model="detailData.passQty" disabled size="small" style="width: 100%"></el-input-number>
  393. <el-input-number :controls="false" :step="0" min="0" v-else v-model="detailData.passQty" size="small" style="width: 100%"></el-input-number>
  394. </div>
  395. </el-col>
  396. <el-col :span="4">
  397. <div class="info-item">
  398. <label>不合格数量</label>
  399. <el-input-number :controls="false" :step="0" min="0" v-model="detailData.notPassQty" disabled size="small" style="width: 100%"></el-input-number>
  400. </div>
  401. </el-col>
  402. <el-col :span="4">
  403. <div class="info-item">
  404. <label>不合格项目数量</label>
  405. <el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled size="small" style="width: 100%"></el-input-number>
  406. <el-input-number :controls="false" :step="0" v-else v-model="detailData.unqualifiedQty" size="small" style="width: 100%"></el-input-number>
  407. </div>
  408. </el-col>
  409. <el-col :span="4">
  410. <div class="info-item">
  411. <label>批次合格数</label>
  412. <el-input-number :controls="false" :step="0" min="0" v-model="detailData.batchQualifiedQty" disabled size="small" style="width: 100%"></el-input-number>
  413. </div>
  414. </el-col>
  415. </el-row>
  416. </div>
  417. <div class="info-section" style="margin-top: 10px">
  418. <div class="section-title">
  419. <i class="el-icon-finished"></i>
  420. <span>检验结论</span>
  421. </div>
  422. <el-row :gutter="12" class="info-row">
  423. <el-col :span="3">
  424. <div class="info-item">
  425. <label>检验结论</label>
  426. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled size="small" placeholder="请选择" style="width: 100%">
  427. <el-option label="合格" value="合格"></el-option>
  428. <el-option label="不合格" value="不合格"></el-option>
  429. </el-select>
  430. <el-select v-else v-model="detailData.inspectionResult" @change="resultChange" size="small" placeholder="请选择" style="width: 100%">
  431. <el-option label="合格" value="合格"></el-option>
  432. <el-option label="不合格" value="不合格"></el-option>
  433. </el-select>
  434. </div>
  435. </el-col>
  436. <el-col :span="7">
  437. <div class="info-item">
  438. <label>质检备注</label>
  439. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled size="small"></el-input>
  440. <el-input v-else v-model="detailData.inspectionRemark" size="small"></el-input>
  441. </div>
  442. </el-col>
  443. <el-col :span="3" v-show="detailData.inspectionResult === '不合格'">
  444. <div class="info-item">
  445. <label>处置措施</label>
  446. <el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled size="small" style="width: 100%">
  447. <el-option
  448. v-for="i in disposalMeasuresOptions"
  449. :key="i.id"
  450. :label="i.disposalMeasures"
  451. :value="i.disposalMeasures">
  452. </el-option>
  453. </el-select>
  454. <el-select v-else clearable v-model="detailData.disposalMeasures" size="small" style="width: 100%">
  455. <el-option
  456. v-for="i in disposalMeasuresOptions"
  457. :key="i.id"
  458. :label="i.disposalMeasures"
  459. :value="i.disposalMeasures">
  460. </el-option>
  461. </el-select>
  462. </div>
  463. </el-col>
  464. <el-col :span="7" v-show="detailData.inspectionResult === '不合格'">
  465. <div class="info-item">
  466. <label>处置说明</label>
  467. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled size="small"></el-input>
  468. <el-input v-else v-model="detailData.disposalRemark" size="small"></el-input>
  469. </div>
  470. </el-col>
  471. </el-row>
  472. </div>
  473. <!-- 操作按钮区域 -->
  474. <div class="action-buttons">
  475. <div class="left-actions">
  476. <el-button v-if="detailData.submitFlag !== 'Y'" type="primary" size="small" :loading="loadFlag" @click="handleDataAcquisition" icon="el-icon-download">
  477. 数据采集
  478. </el-button>
  479. <el-button type="info" size="small" @click="getFileContentData(detailData)" icon="el-icon-folder-opened">
  480. 文件清单
  481. </el-button>
  482. </div>
  483. <div class="right-actions">
  484. <el-button type="success" size="small" @click="openItemOperationDialog" icon="el-icon-setting">
  485. 项目导入
  486. </el-button>
  487. <el-button type="primary" size="small" @click="openTemplateImportDialog" icon="el-icon-download">
  488. 模板导入
  489. </el-button>
  490. </div>
  491. </div>
  492. </div>
  493. <!-- 检验项目列表 -->
  494. <div class="inspection-table-wrapper">
  495. <div class="table-header">
  496. <span class="table-title">
  497. <i class="el-icon-tickets"></i>
  498. 检验项目明细
  499. </span>
  500. </div>
  501. <el-table
  502. :height="435"
  503. :data="detailList"
  504. border
  505. stripe
  506. style="width: 100%;"
  507. class="inspection-table">
  508. <el-table-column
  509. prop=""
  510. header-align="center"
  511. align="center"
  512. width="80"
  513. label="操作">
  514. <template slot-scope="scope">
  515. <el-button icon="el-icon-edit-outline" type="success" size="mini" :loading="loadFlag" @click="dataAcquisitionByItemHandle(scope.row)" title="数据采集"></el-button>
  516. </template>
  517. </el-table-column>
  518. <el-table-column
  519. prop="itemNo"
  520. header-align="center"
  521. align="center"
  522. min-width="80"
  523. label="项目编号">
  524. </el-table-column>
  525. <el-table-column
  526. prop="itemDesc"
  527. header-align="center"
  528. align="left"
  529. min-width="150"
  530. show-overflow-tooltip
  531. label="项目名称">
  532. </el-table-column>
  533. <el-table-column
  534. prop="defaultValue"
  535. header-align="center"
  536. align="center"
  537. min-width="100"
  538. label="标准值">
  539. </el-table-column>
  540. <el-table-column
  541. prop=""
  542. header-align="center"
  543. align="right"
  544. min-width="80"
  545. label="实测值">
  546. <template slot-scope="scope">
  547. <el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numberValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" type="number" @change="updateItemResult(scope.row)" style="height: 11px; width: 98%"></el-input>
  548. <el-input :ref="`textValue${scope.$index}`" v-else v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px; width: 98%"></el-input>
  549. </template>
  550. </el-table-column>
  551. <el-table-column
  552. prop=""
  553. header-align="center"
  554. align="right"
  555. min-width="80"
  556. label="抽样数量">
  557. <template slot-scope="scope">
  558. <el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.samplingQty" disabled style="height: 11px; width:98%"></el-input-number>
  559. <el-input-number :controls="false" :step="0" v-else :ref="`samplingQty${scope.$index}`" v-model="scope.row.samplingQty" @keyup.enter.native="focusNextInput(scope.$index, 'samplingQty')" style="height: 11px; width: 98%"></el-input-number>
  560. </template>
  561. </el-table-column>
  562. <el-table-column
  563. prop=""
  564. header-align="center"
  565. align="right"
  566. min-width="80"
  567. label="不合格数量">
  568. <template slot-scope="scope">
  569. <el-input-number :controls="false" :step="0" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled style="height: 11px; width:98%"></el-input-number>
  570. <el-input-number :controls="false" :step="0" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input-number>
  571. </template>
  572. </el-table-column>
  573. <el-table-column
  574. prop=""
  575. header-align="center"
  576. align="right"
  577. min-width="90"
  578. label="项目检验结论">
  579. <template slot-scope="scope">
  580. <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">
  581. <el-option label="合格" value="Y" style="color: green"></el-option>
  582. <el-option label="不合格" value="N" style="color: red"></el-option>
  583. </el-select>
  584. <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="合格">
  585. <el-option label="合格" value="Y" style="color: green"></el-option>
  586. <el-option label="不合格" value="N" style="color: red"></el-option>
  587. </el-select>
  588. </template>
  589. </el-table-column>
  590. </el-table>
  591. </div>
  592. <!-- 底部操作按钮 -->
  593. <div class="dialog-footer">
  594. <el-button v-if="detailData.state === '待检验'" type="primary" :loading="transferLoadFlag" @click="Transfer('1')">应用</el-button>
  595. <el-button v-if="detailData.state === '待检验' || detailData.state === '待审核'" type="primary" :loading="transferLoadFlag" @click="Transfer('2')">保存</el-button>
  596. <el-button @click="detailInformationFlag=false">关闭</el-button>
  597. </div>
  598. </el-dialog>
  599. <!-- 人员清单弹窗 -->
  600. <el-dialog title="人员清单" :close-on-click-modal="false" v-drag :visible.sync="operatorModelFlag" width="820px" :append-to-body="true">
  601. <div class="rq">
  602. <el-form :inline="true" label-position="top" :model="operatorData">
  603. <el-form-item v-if="operatorData.flag !== '2'" :label="'所属角色'">
  604. <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px">
  605. <el-option
  606. v-for="i in roleList"
  607. :key="i.roleId"
  608. :label="i.roleName"
  609. :value="i.roleId">
  610. </el-option>
  611. </el-select>
  612. </el-form-item>
  613. <el-form-item :label="'用户编码'">
  614. <el-input v-model="operatorData.adminID" clearable style="width: 120px"></el-input>
  615. </el-form-item>
  616. <el-form-item :label="'用户姓名'">
  617. <el-input v-model="operatorData.adminName" clearable style="width: 120px"></el-input>
  618. </el-form-item>
  619. <el-form-item :label="' '">
  620. <el-button type="primary" @click="getOperatorList2">查询</el-button>
  621. </el-form-item>
  622. </el-form>
  623. <el-table
  624. :height="300"
  625. :data="operatorList"
  626. ref="operatorTable"
  627. @row-click="operatorClickRow"
  628. @selection-change="selectionChangeHandle2"
  629. border
  630. style="width: 100%;">
  631. <el-table-column
  632. type="selection"
  633. header-align="center"
  634. align="center"
  635. width="50">
  636. </el-table-column>
  637. <el-table-column
  638. v-for="(item,index) in operatorDetailList" :key="index"
  639. :sortable="item.columnSortable"
  640. :prop="item.columnProp"
  641. :header-align="item.headerAlign"
  642. :show-overflow-tooltip="item.showOverflowTooltip"
  643. :align="item.align"
  644. :fixed="item.fixed==''?false:item.fixed"
  645. :min-width="item.columnWidth"
  646. :label="item.columnLabel">
  647. <template slot-scope="scope">
  648. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  649. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  650. </template>
  651. </el-table-column>
  652. </el-table>
  653. </div>
  654. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  655. <el-button type="primary" @click="confirmOperator">确认</el-button>
  656. <el-button type="primary" @click="operatorModelFlag = false">关闭</el-button>
  657. </el-footer>
  658. </el-dialog>
  659. <!-- 项目操作对话框 -->
  660. <el-dialog
  661. title="检验项目操作"
  662. @close="refreshInspectionDetailList"
  663. :close-on-click-modal="false"
  664. v-drag
  665. :visible.sync="itemOperationDialogFlag"
  666. width="1200px"
  667. :append-to-body="true"
  668. custom-class="item-operation-dialog">
  669. <!-- 查询区域 -->
  670. <div class="search-container">
  671. <el-form :inline="true" size="small">
  672. <el-form-item label="项目编码">
  673. <el-input
  674. v-model="itemOperationQuery.itemNo"
  675. placeholder="请输入项目编码"
  676. clearable
  677. prefix-icon="el-icon-search"
  678. style="width: 160px">
  679. </el-input>
  680. </el-form-item>
  681. <el-form-item label="项目名称">
  682. <el-input
  683. v-model="itemOperationQuery.itemDesc"
  684. placeholder="请输入项目名称"
  685. clearable
  686. prefix-icon="el-icon-search"
  687. style="width: 200px">
  688. </el-input>
  689. </el-form-item>
  690. <el-form-item>
  691. <el-button type="primary" icon="el-icon-search" @click="searchIPQCItems" size="small">查询</el-button>
  692. <el-button icon="el-icon-refresh" @click="resetItemQuery" size="small">重置</el-button>
  693. </el-form-item>
  694. </el-form>
  695. </div>
  696. <!-- 主内容区域 -->
  697. <div class="item-operation-content">
  698. <!-- 可选项目 -->
  699. <div class="item-panel available-panel">
  700. <div class="panel-header">
  701. <i class="el-icon-s-unfold"></i>
  702. <span class="panel-title">可选项目</span>
  703. <span class="item-count">({{ availableItemList.length }})</span>
  704. </div>
  705. <el-table
  706. height="420px"
  707. :data="availableItemList"
  708. ref="availableItemTable"
  709. @row-click="availableItemClickRow"
  710. @selection-change="availableItemSelectionChange"
  711. highlight-current-row
  712. class="operation-table"
  713. :header-cell-style="{background: '#f5f7fa', color: '#606266', fontWeight: '500'}">
  714. <el-table-column
  715. type="selection"
  716. width="45"
  717. align="center">
  718. </el-table-column>
  719. <el-table-column
  720. prop="itemNo"
  721. align="center"
  722. width="100"
  723. label="编码">
  724. </el-table-column>
  725. <el-table-column
  726. prop="itemDesc"
  727. align="left"
  728. min-width="140"
  729. show-overflow-tooltip
  730. label="名称">
  731. </el-table-column>
  732. <el-table-column
  733. prop="defaultValue"
  734. align="center"
  735. width="80"
  736. show-overflow-tooltip
  737. label="标准值">
  738. </el-table-column>
  739. <el-table-column
  740. align="center"
  741. width="100"
  742. label="范围">
  743. <template slot-scope="scope">
  744. <span v-if="scope.row.minValue || scope.row.maxValue" style="font-size: 12px; color: #909399;">
  745. {{ scope.row.minValue || '-' }} ~ {{ scope.row.maxValue || '-' }}
  746. </span>
  747. </template>
  748. </el-table-column>
  749. </el-table>
  750. </div>
  751. <!-- 操作按钮 -->
  752. <div class="operation-buttons">
  753. <el-tooltip content="添加选中项目" placement="left">
  754. <el-button
  755. type="primary"
  756. icon="el-icon-d-arrow-right"
  757. circle
  758. @click="addInspectionItems"
  759. :disabled="!availableItemSelections || availableItemSelections.length === 0">
  760. </el-button>
  761. </el-tooltip>
  762. <el-tooltip content="移除选中项目" placement="right">
  763. <el-button
  764. type="danger"
  765. icon="el-icon-d-arrow-left"
  766. circle
  767. @click="deleteInspectionItems"
  768. :disabled="!selectedItemSelections || selectedItemSelections.length === 0">
  769. </el-button>
  770. </el-tooltip>
  771. </div>
  772. <!-- 已有项目 -->
  773. <div class="item-panel selected-panel">
  774. <div class="panel-header">
  775. <i class="el-icon-s-check"></i>
  776. <span class="panel-title">已有项目</span>
  777. <span class="item-count">({{ selectedItemList.length }})</span>
  778. </div>
  779. <el-table
  780. height="420px"
  781. :data="selectedItemList"
  782. ref="selectedItemTable"
  783. @row-click="selectedItemClickRow"
  784. @selection-change="selectedItemSelectionChange"
  785. highlight-current-row
  786. class="operation-table"
  787. :header-cell-style="{background: '#f5f7fa', color: '#606266', fontWeight: '500'}">
  788. <el-table-column
  789. type="selection"
  790. width="45"
  791. align="center">
  792. </el-table-column>
  793. <el-table-column
  794. prop="itemNo"
  795. align="center"
  796. width="100"
  797. label="编码">
  798. </el-table-column>
  799. <el-table-column
  800. prop="itemDesc"
  801. align="left"
  802. min-width="200"
  803. show-overflow-tooltip
  804. label="名称">
  805. </el-table-column>
  806. </el-table>
  807. </div>
  808. </div>
  809. <!-- 底部按钮 -->
  810. <div slot="footer" class="dialog-footer">
  811. <el-button @click="itemOperationDialogFlag = false" size="small" style="width: 80px;">关闭</el-button>
  812. </div>
  813. </el-dialog>
  814. <!-- 模板导入对话框 -->
  815. <el-dialog
  816. title="检验模板导入"
  817. :close-on-click-modal="false"
  818. v-drag
  819. :visible.sync="templateImportDialogFlag"
  820. width="800px"
  821. :append-to-body="true"
  822. custom-class="template-import-dialog">
  823. <!-- 查询区域 -->
  824. <div class="search-container">
  825. <el-form :inline="true" size="small">
  826. <el-form-item label="模板编码">
  827. <el-input
  828. v-model="templateQuery.templateId"
  829. placeholder="请输入模板编码"
  830. clearable
  831. prefix-icon="el-icon-search"
  832. style="width: 160px">
  833. </el-input>
  834. </el-form-item>
  835. <el-form-item label="模板名称">
  836. <el-input
  837. v-model="templateQuery.templateDesc"
  838. placeholder="请输入模板名称"
  839. clearable
  840. prefix-icon="el-icon-search"
  841. style="width: 200px">
  842. </el-input>
  843. </el-form-item>
  844. <el-form-item>
  845. <el-button type="primary" icon="el-icon-search" @click="searchIPQCTemplates" size="small">查询</el-button>
  846. <el-button icon="el-icon-refresh" @click="resetTemplateQuery" size="small">重置</el-button>
  847. </el-form-item>
  848. </el-form>
  849. </div>
  850. <!-- 模板列表 -->
  851. <div class="template-list-container">
  852. <el-table
  853. height="400px"
  854. :data="templateImportList"
  855. ref="templateTable"
  856. @row-click="templateClickRow"
  857. @selection-change="templateSelectionChange"
  858. highlight-current-row
  859. class="template-table"
  860. :header-cell-style="{background: '#f5f7fa', color: '#606266', fontWeight: '500'}">
  861. <el-table-column
  862. type="selection"
  863. width="50"
  864. align="center">
  865. </el-table-column>
  866. <el-table-column
  867. prop="templateId"
  868. align="center"
  869. width="150"
  870. label="模板编码">
  871. </el-table-column>
  872. <el-table-column
  873. prop="templateName"
  874. align="left"
  875. min-width="200"
  876. show-overflow-tooltip
  877. label="模板名称">
  878. </el-table-column>
  879. <el-table-column
  880. prop="inspectionTypeName"
  881. align="center"
  882. width="120"
  883. label="检验类型">
  884. </el-table-column>
  885. </el-table>
  886. </div>
  887. <!-- 底部按钮 -->
  888. <div slot="footer" class="dialog-footer">
  889. <el-button type="primary" :loading="importLoading" @click="confirmImportTemplate" size="small">确认导入</el-button>
  890. <el-button @click="templateImportDialogFlag = false" size="small">关闭</el-button>
  891. </div>
  892. </el-dialog>
  893. </el-dialog>
  894. </div>
  895. </template>
  896. <script>
  897. import {
  898. qcIPQCInspectionSearch, // 查询IPQC的检验记录
  899. ipqcRecordDelete, // 删除检验记录
  900. saveOsInspection, // 新增检验记录
  901. saveIPQCSubmitResult, // 审核
  902. getSiteAndBuByUserName, // 获取用户BU列表
  903. ipqcDetailSearch, // 查询IPQC的检验明细
  904. actionIPQCInspection, // 开始检验
  905. getIPQCItemObjectList, // 查询项目设备
  906. getOperationList, // 查询工序列表
  907. queryController, // 检查动控
  908. umSearch, // 查询单位列表
  909. queryTemplateList, // 获取检验模板列表
  910. queryPartList, // 查询物料集合
  911. rollNoEnter as rollNoEnterAPI, // 标签号回车事件
  912. searchSeqInfo, // 派工单号查询
  913. getSiteAndBuByUserName2, // 获取BU列表
  914. saveIPQCDetailedRecord, // 保存检验明细记录
  915. getSpecialOperationList, // 获取特殊工序列表
  916. inspectionTypeSearch, // 搜索所有检验类型
  917. disposalMeasuresSearch, // 获取处置措施列表
  918. getUserRoleList, // 获取用户角色列表
  919. getOperatorList, // 获取协同人员列表
  920. getResponsibleOperatorList, // 获取责任人列表
  921. dataAcquisition, // 数据采集
  922. dataAcquisitionByItem, // 按项目数据采集
  923. getIPQCItemList, // 获取IPQC检验项目列表
  924. addIPQCItemDetails, // 添加检验项目
  925. deleteIPQCItemDetails, // 删除检验项目
  926. getIPQCTemplateList, // 获取IPQC模板列表
  927. importIPQCTemplateItems, // 导入模板项目
  928. } from "@/api/qc/qc.js"
  929. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  930. import { getInspectionFile } from '@/api/eam/eam_object_list.js'
  931. export default {
  932. name: 'ComProcessInspection',
  933. props: {
  934. visible: {
  935. type: Boolean,
  936. default: false
  937. },
  938. orderNo: {
  939. type: String,
  940. default: ''
  941. },
  942. resourceId: {
  943. type: String,
  944. default: ''
  945. },
  946. seqNo: {
  947. type: String,
  948. default: ''
  949. },
  950. site: {
  951. type: String,
  952. default: ''
  953. },
  954. buNo: {
  955. type: String,
  956. default: ''
  957. }
  958. },
  959. data() {
  960. return {
  961. // 查询参数
  962. searchData: {
  963. userName: this.$store.state.user.name,
  964. buNo: '',
  965. inspectionNo: '',
  966. partNo: '',
  967. sku: '',
  968. partDesc: '',
  969. inspectionResult: '',
  970. inspectionTypeNo: '',
  971. cinvSourceCode: '',
  972. orderNo: '',
  973. seqNo: '',
  974. operationDesc: '',
  975. states: [],
  976. startDate2: '',
  977. endDate2: '',
  978. startDate: '',
  979. endDate: '',
  980. limit: 20,
  981. page: 1
  982. },
  983. searchLoading: false,
  984. // 列表数据
  985. dataList: [],
  986. IPQCSelections: [],
  987. // 分页
  988. pageIndex: 1,
  989. pageSize: 20,
  990. totalPage: 0,
  991. // BU列表
  992. buList: [],
  993. userBuList: [],
  994. // 列配置
  995. columnList1: [
  996. {
  997. userId: this.$store.state.user.name,
  998. functionId: 301014,
  999. serialNumber: '301014Table1BuDesc',
  1000. tableId: "301014Table1",
  1001. tableName: "IPQC检验记录表",
  1002. columnProp: 'buDesc',
  1003. headerAlign: "center",
  1004. align: "center",
  1005. columnLabel: 'BU',
  1006. columnHidden: false,
  1007. columnImage: false,
  1008. columnSortable: false,
  1009. sortLv: 0,
  1010. status: true,
  1011. fixed: '',
  1012. columnWidth: 100,
  1013. showOverflowTooltip: true
  1014. },
  1015. {
  1016. userId: this.$store.state.user.name,
  1017. functionId: 301014,
  1018. serialNumber: '301014Table1InspectionNo',
  1019. tableId: "301014Table1",
  1020. tableName: "IPQC检验记录表",
  1021. columnProp: 'inspectionNo',
  1022. headerAlign: "center",
  1023. align: "center",
  1024. columnLabel: '检验单号',
  1025. columnHidden: false,
  1026. columnImage: false,
  1027. columnSortable: false,
  1028. sortLv: 0,
  1029. status: true,
  1030. fixed: '',
  1031. columnWidth: 120,
  1032. showOverflowTooltip: true
  1033. },
  1034. {
  1035. userId: this.$store.state.user.name,
  1036. functionId: 301014,
  1037. serialNumber: '301014Table1InspectionResult',
  1038. tableId: "301014Table1",
  1039. tableName: "IPQC检验记录表",
  1040. columnProp: 'inspectionResult',
  1041. headerAlign: "center",
  1042. align: "center",
  1043. columnLabel: '检验结论',
  1044. columnHidden: false,
  1045. columnImage: false,
  1046. columnSortable: false,
  1047. sortLv: 0,
  1048. status: true,
  1049. fixed: '',
  1050. columnWidth: 100,
  1051. showOverflowTooltip: true
  1052. },
  1053. {
  1054. userId: this.$store.state.user.name,
  1055. functionId: 301014,
  1056. serialNumber: '301014Table1DisposalMeasures',
  1057. tableId: "301014Table1",
  1058. tableName: "IPQC检验记录表",
  1059. columnProp: 'disposalMeasures',
  1060. headerAlign: "center",
  1061. align: "center",
  1062. columnLabel: '处置措施',
  1063. columnHidden: false,
  1064. columnImage: false,
  1065. columnSortable: false,
  1066. sortLv: 0,
  1067. status: true,
  1068. fixed: '',
  1069. columnWidth: 100,
  1070. showOverflowTooltip: true
  1071. },
  1072. {
  1073. userId: this.$store.state.user.name,
  1074. functionId: 301014,
  1075. serialNumber: '301014Table1InspectionTypeNo',
  1076. tableId: "301014Table1",
  1077. tableName: "IPQC检验记录表",
  1078. columnProp: 'inspectionTypeNo',
  1079. headerAlign: "center",
  1080. align: "center",
  1081. columnLabel: '检验类型',
  1082. columnHidden: false,
  1083. columnImage: false,
  1084. columnSortable: false,
  1085. sortLv: 0,
  1086. status: true,
  1087. fixed: '',
  1088. columnWidth: 100,
  1089. showOverflowTooltip: true
  1090. },
  1091. {
  1092. userId: this.$store.state.user.name,
  1093. functionId: 301014,
  1094. serialNumber: '301014Table1TaskDate',
  1095. tableId: "301014Table1",
  1096. tableName: "IPQC检验记录表",
  1097. columnProp: 'taskDate',
  1098. headerAlign: "center",
  1099. align: "center",
  1100. columnLabel: '送检日期',
  1101. columnHidden: false,
  1102. columnImage: false,
  1103. columnSortable: false,
  1104. sortLv: 0,
  1105. status: true,
  1106. fixed: '',
  1107. columnWidth: 130,
  1108. showOverflowTooltip: true
  1109. },
  1110. {
  1111. userId: this.$store.state.user.name,
  1112. functionId: 301014,
  1113. serialNumber: '301014Table1InspectionCycle',
  1114. tableId: "301014Table1",
  1115. tableName: "IPQC检验记录表",
  1116. columnProp: 'inspectionCycle',
  1117. headerAlign: "center",
  1118. align: "right",
  1119. columnLabel: '检验周期(h)',
  1120. columnHidden: false,
  1121. columnImage: false,
  1122. columnSortable: false,
  1123. sortLv: 0,
  1124. status: true,
  1125. fixed: '',
  1126. columnWidth: 100,
  1127. showOverflowTooltip: true
  1128. },
  1129. {
  1130. userId: this.$store.state.user.name,
  1131. functionId: 301014,
  1132. serialNumber: '301014Table1SeqNo',
  1133. tableId: "301014Table1",
  1134. tableName: "IPQC检验记录表",
  1135. columnProp: 'seqNo',
  1136. headerAlign: "center",
  1137. align: "left",
  1138. columnLabel: '派工单号',
  1139. columnHidden: false,
  1140. columnImage: false,
  1141. columnSortable: false,
  1142. sortLv: 0,
  1143. status: true,
  1144. fixed: '',
  1145. columnWidth: 200,
  1146. showOverflowTooltip: true
  1147. },
  1148. {
  1149. userId: this.$store.state.user.name,
  1150. functionId: 301014,
  1151. serialNumber: '301014Table1PartNo',
  1152. tableId: "301014Table1",
  1153. tableName: "IPQC检验记录表",
  1154. columnProp: 'partNo',
  1155. headerAlign: "center",
  1156. align: "center",
  1157. columnLabel: '物料编码',
  1158. columnHidden: false,
  1159. columnImage: false,
  1160. columnSortable: false,
  1161. sortLv: 0,
  1162. status: true,
  1163. fixed: '',
  1164. columnWidth: 120,
  1165. showOverflowTooltip: true
  1166. },
  1167. {
  1168. userId: this.$store.state.user.name,
  1169. functionId: 301014,
  1170. serialNumber: '301014Table1PartDesc',
  1171. tableId: "301014Table1",
  1172. tableName: "IPQC检验记录表",
  1173. columnProp: 'partDesc',
  1174. headerAlign: "center",
  1175. align: "left",
  1176. columnLabel: '物料名称',
  1177. columnHidden: false,
  1178. columnImage: false,
  1179. columnSortable: false,
  1180. sortLv: 0,
  1181. status: true,
  1182. fixed: '',
  1183. columnWidth: 300,
  1184. showOverflowTooltip: true
  1185. },
  1186. ],
  1187. // 新增弹窗
  1188. modalFlag: false,
  1189. modalData: {
  1190. flag: '1',
  1191. site: '',
  1192. bu: '',
  1193. rollNo: '',
  1194. seqNo: '',
  1195. orderNo: '',
  1196. operationDesc: '',
  1197. operationNo: '',
  1198. resourceId: '',
  1199. resourceDesc: '',
  1200. workCenterNo: '',
  1201. partNo: '',
  1202. partDesc: '',
  1203. invdefinetype: '',
  1204. sku: '',
  1205. cinvSourceCode: '',
  1206. inspectionTypeNo: '',
  1207. rollQty: '',
  1208. umId: '',
  1209. umName: '',
  1210. templateId: '',
  1211. templateName: '',
  1212. sjzs: '',
  1213. batchRollNo: '',
  1214. specialRequirements: '',
  1215. specialTaskFlag: 'N'
  1216. },
  1217. saveLoading: false,
  1218. checked: false,
  1219. // 下拉列表数据
  1220. operationList: [],
  1221. umList: [],
  1222. controlData: { baseData: '' },
  1223. // 权限控制
  1224. authDetail: false,
  1225. authFile: false,
  1226. // 详情弹窗相关
  1227. detailInformationFlag: false,
  1228. detailData: {
  1229. site: '',
  1230. buNo: '',
  1231. inspectionNo: '',
  1232. partNo: '',
  1233. partDesc: '',
  1234. spec: '',
  1235. rollQty: '',
  1236. samplingQty: '',
  1237. unqualifiedQty: '',
  1238. unqualifiedQuantity: '',
  1239. submitFlag: '',
  1240. disposalMeasures: '',
  1241. disposalRemark: '',
  1242. inspectionResult: '',
  1243. inspectorNo: '',
  1244. inspectorName: '',
  1245. inspectionRemark: '',
  1246. cinvSourceCode: '',
  1247. sku: '',
  1248. invdefinetype: '',
  1249. umId: '',
  1250. umName: '',
  1251. operator: '',
  1252. operatorName: '',
  1253. responsiblePerson: '',
  1254. responsiblePersonName: '',
  1255. state: '',
  1256. passQty: '',
  1257. notPassQty: '',
  1258. batchQualifiedQty: '',
  1259. orderNo: '',
  1260. templateId: ''
  1261. },
  1262. // 处置措施选项
  1263. disposalMeasuresOptions: [],
  1264. // 协同人员/责任人相关
  1265. roleList: [],
  1266. operatorModelFlag: false,
  1267. operatorData: {
  1268. flag: '',
  1269. site: '',
  1270. bu: '',
  1271. adminID: '',
  1272. adminName: '',
  1273. roleName: '',
  1274. roleId: '',
  1275. userName: ''
  1276. },
  1277. operatorList: [],
  1278. operatorDetailList: [
  1279. {
  1280. columnProp: 'adminID',
  1281. headerAlign: "center",
  1282. align: "center",
  1283. columnLabel: '用户编码',
  1284. columnHidden: false,
  1285. columnImage: false,
  1286. columnSortable: false,
  1287. fixed: '',
  1288. columnWidth: 100,
  1289. showOverflowTooltip: true
  1290. },
  1291. {
  1292. columnProp: 'adminName',
  1293. headerAlign: "center",
  1294. align: "center",
  1295. columnLabel: '用户姓名',
  1296. columnHidden: false,
  1297. columnImage: false,
  1298. columnSortable: false,
  1299. fixed: '',
  1300. columnWidth: 100,
  1301. showOverflowTooltip: true
  1302. },
  1303. {
  1304. columnProp: 'roleName',
  1305. headerAlign: "center",
  1306. align: "center",
  1307. columnLabel: '角色',
  1308. columnHidden: false,
  1309. columnImage: false,
  1310. columnSortable: false,
  1311. fixed: '',
  1312. columnWidth: 150,
  1313. showOverflowTooltip: true
  1314. }
  1315. ],
  1316. dataListSelections2: [],
  1317. // 数据采集loading
  1318. loadFlag: false,
  1319. // 项目导入相关
  1320. itemOperationDialogFlag: false,
  1321. itemOperationQuery: {
  1322. itemNo: '',
  1323. itemDesc: ''
  1324. },
  1325. availableItemList: [],
  1326. selectedItemList: [],
  1327. availableItemSelections: [],
  1328. selectedItemSelections: [],
  1329. // 模板导入相关
  1330. templateImportDialogFlag: false,
  1331. templateQuery: {
  1332. templateId: '',
  1333. templateDesc: ''
  1334. },
  1335. templateImportList: [],
  1336. templateSelections: [],
  1337. importLoading: false,
  1338. detailList: [],
  1339. transferLoadFlag: false,
  1340. saveInformationData: {
  1341. site: '',
  1342. buNo: '',
  1343. inspectionNo:'',
  1344. detailList: [],
  1345. type: ''
  1346. },
  1347. // 开始检验相关
  1348. ItemObjectModelFlag: false,
  1349. actionData: {
  1350. site: '',
  1351. buNo: '',
  1352. inspectionNo: ''
  1353. },
  1354. itemObjectList: [],
  1355. // 工作文件相关
  1356. fileFlag: false,
  1357. fileContentList: [],
  1358. fileLoading: false,
  1359. // 派工单号相关
  1360. seqDetailFlag: false,
  1361. seqInfoList: [],
  1362. seqDetailData: {
  1363. orderNo: '',
  1364. seqNo: '',
  1365. sku: '',
  1366. partNo: '',
  1367. partDesc: '',
  1368. operationDesc: '',
  1369. status: ''
  1370. },
  1371. seqDetailColumnList: [
  1372. {
  1373. columnProp: 'orderNo',
  1374. headerAlign: "center",
  1375. align: "center",
  1376. columnLabel: '工单号',
  1377. columnHidden: false,
  1378. columnImage: false,
  1379. columnSortable: false,
  1380. fixed: '',
  1381. columnWidth: 80,
  1382. showOverflowTooltip: true
  1383. },
  1384. {
  1385. columnProp: 'seqNo',
  1386. headerAlign: "center",
  1387. align: "center",
  1388. columnLabel: '派工单号',
  1389. columnHidden: false,
  1390. columnImage: false,
  1391. columnSortable: false,
  1392. fixed: '',
  1393. columnWidth: 80,
  1394. showOverflowTooltip: true
  1395. },
  1396. {
  1397. columnProp: 'sku',
  1398. headerAlign: "center",
  1399. align: "center",
  1400. columnLabel: 'SKU',
  1401. columnHidden: false,
  1402. columnImage: false,
  1403. columnSortable: false,
  1404. fixed: '',
  1405. columnWidth: 80,
  1406. showOverflowTooltip: true
  1407. },
  1408. {
  1409. columnProp: 'partNo',
  1410. headerAlign: "center",
  1411. align: "center",
  1412. columnLabel: '物料编码',
  1413. columnHidden: false,
  1414. columnImage: false,
  1415. columnSortable: false,
  1416. fixed: '',
  1417. columnWidth: 80,
  1418. showOverflowTooltip: true
  1419. },
  1420. {
  1421. columnProp: 'partDesc',
  1422. headerAlign: "center",
  1423. align: "center",
  1424. columnLabel: '物料名称',
  1425. columnHidden: false,
  1426. columnImage: false,
  1427. columnSortable: false,
  1428. fixed: '',
  1429. columnWidth: 80,
  1430. showOverflowTooltip: true
  1431. },
  1432. {
  1433. columnProp: 'lotsize',
  1434. headerAlign: "center",
  1435. align: "right",
  1436. columnLabel: '批量',
  1437. columnHidden: false,
  1438. columnImage: false,
  1439. columnSortable: false,
  1440. fixed: '',
  1441. columnWidth: 80,
  1442. showOverflowTooltip: true
  1443. },
  1444. {
  1445. columnProp: 'qtyrequired',
  1446. headerAlign: "center",
  1447. align: "right",
  1448. columnLabel: '需求数量',
  1449. columnHidden: false,
  1450. columnImage: false,
  1451. columnSortable: false,
  1452. fixed: '',
  1453. columnWidth: 80,
  1454. showOverflowTooltip: true
  1455. },
  1456. {
  1457. columnProp: 'sjzs',
  1458. headerAlign: "center",
  1459. align: "right",
  1460. columnLabel: '送检总数',
  1461. columnHidden: false,
  1462. columnImage: false,
  1463. columnSortable: false,
  1464. fixed: '',
  1465. columnWidth: 80,
  1466. showOverflowTooltip: true
  1467. },
  1468. {
  1469. columnProp: 'operationDesc',
  1470. headerAlign: "center",
  1471. align: "center",
  1472. columnLabel: '工序',
  1473. columnHidden: false,
  1474. columnImage: false,
  1475. columnSortable: false,
  1476. fixed: '',
  1477. columnWidth: 80,
  1478. showOverflowTooltip: true
  1479. }
  1480. ],
  1481. // 检验模板相关
  1482. templateModelFlag: false,
  1483. templateData: {
  1484. site: '',
  1485. bu: '',
  1486. templateId: '',
  1487. templateName: '',
  1488. inspectionTypeNo: '',
  1489. inspectionTypeName: ''
  1490. },
  1491. templateList: [],
  1492. templateDetailList: [
  1493. {
  1494. columnProp: 'templateId',
  1495. headerAlign: "center",
  1496. align: "center",
  1497. columnLabel: '模板编码',
  1498. columnHidden: false,
  1499. columnImage: false,
  1500. columnSortable: false,
  1501. fixed: '',
  1502. columnWidth: 120,
  1503. showOverflowTooltip: true
  1504. },
  1505. {
  1506. columnProp: 'templateName',
  1507. headerAlign: "center",
  1508. align: "center",
  1509. columnLabel: '模板名称',
  1510. columnHidden: false,
  1511. columnImage: false,
  1512. columnSortable: false,
  1513. fixed: '',
  1514. columnWidth: 200,
  1515. showOverflowTooltip: true
  1516. },
  1517. {
  1518. columnProp: 'inspectionTypeName',
  1519. headerAlign: "center",
  1520. align: "center",
  1521. columnLabel: '检验类型',
  1522. columnHidden: false,
  1523. columnImage: false,
  1524. columnSortable: false,
  1525. fixed: '',
  1526. columnWidth: 100,
  1527. showOverflowTooltip: true
  1528. }
  1529. ],
  1530. rules: {
  1531. bu: [{ required: true, message: '请选择BU', trigger: ['blur','change']}],
  1532. seqNoType: [{ required: true, message: '请输入派工单号', trigger: ['blur','change'] }],
  1533. orderNoType: [{ required: true, message: '请输入工单号', trigger: ['blur','change'] }],
  1534. operationDescType: [{ required: true, message: '请选择工序', trigger: ['blur','change'] }],
  1535. resourceIdType: [{ required: true, message: '请输入机台', trigger: ['blur','change'] }],
  1536. partNoType: [{ required: true, message: '请输入物料编码', trigger: ['blur','change'] }],
  1537. inspectionTypeNoType: [{ required: true, message: '请选择检验类型', trigger: ['blur','change'] }],
  1538. rollQtyType: [{ required: true, message: '请输入送检数量', trigger: ['blur','change'] }],
  1539. umIdType: [{ required: true, message: '请选择单位', trigger: ['blur','change'] }],
  1540. templateId: [{ required: true, message: '请选择检验模板', trigger: ['blur','change'] }]
  1541. },
  1542. typeOptions: [],
  1543. }
  1544. },
  1545. watch: {
  1546. visible(val) {
  1547. if (val) {
  1548. this.init()
  1549. }
  1550. }
  1551. },
  1552. methods: {
  1553. // 初始化
  1554. init() {
  1555. // 设置订单号参数
  1556. if (this.orderNo) {
  1557. this.searchData.orderNo = this.orderNo
  1558. }
  1559. // // 设置机台ID参数
  1560. // if (this.resourceId) {
  1561. // this.searchData.resourceId = this.resourceId
  1562. // }
  1563. if (this.seqNo) {
  1564. this.searchData.seqNo = this.seqNo
  1565. }
  1566. this.getDataList()
  1567. this.getSiteAndBuByUserName2()
  1568. this.getUmList()
  1569. // 查看 质量任务生成规则控制 动控是否开启
  1570. this.queryController()
  1571. this.inspectionTypeSearch()
  1572. // 获取处置措施列表
  1573. this.getDisposalMeasuresOptions()
  1574. // 获取用户角色列表
  1575. this.getUserRoleListData()
  1576. },
  1577. // 查询检验类型
  1578. inspectionTypeSearch () {
  1579. let tempData = {
  1580. site: this.site
  1581. }
  1582. inspectionTypeSearch(tempData).then(({data}) => {
  1583. if (data.code === 0) {
  1584. this.typeOptions = data.rows
  1585. this.typeOptions.forEach(val => {
  1586. if (val.inspectionTypeName.includes('IPQC')) {
  1587. this.templateData.inspectionTypeNo = val.inspectionTypeNo
  1588. this.templateData.inspectionTypeName = val.inspectionTypeName
  1589. }
  1590. })
  1591. }
  1592. })
  1593. },
  1594. // 检查动控是否开启
  1595. queryController () {
  1596. let tempData = {
  1597. controlNo: '10004',
  1598. site: this.site,
  1599. }
  1600. queryController(tempData).then(({data}) => {
  1601. if (data && data.code === 0) {
  1602. this.controlData = data.rows
  1603. } else {
  1604. this.$message.error(data.msg)
  1605. }
  1606. })
  1607. },
  1608. // 获取用户BU列表
  1609. getSiteAndBuByUserName2() {
  1610. let tempData = {
  1611. username: this.$store.state.user.name,
  1612. }
  1613. getSiteAndBuByUserName(tempData).then(({data}) => {
  1614. if (data && data.code === 0) {
  1615. this.userBuList = data.rows
  1616. if (this.userBuList.length > 0) {
  1617. this.modalData.bu = this.userBuList[0].buNo
  1618. }
  1619. }
  1620. })
  1621. getSiteAndBuByUserName2(tempData).then(({data}) => {
  1622. if (data && data.code === 0) {
  1623. this.buList = data.rows
  1624. }
  1625. })
  1626. },
  1627. // 获取数据列表
  1628. getDataList() {
  1629. this.searchLoading = true
  1630. this.searchData.limit = this.pageSize
  1631. this.searchData.page = this.pageIndex
  1632. qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  1633. if (data.code === 0) {
  1634. this.dataList = data.page.list
  1635. this.pageIndex = data.page.currPage
  1636. this.pageSize = data.page.pageSize
  1637. this.totalPage = data.page.totalCount
  1638. this.searchLoading = false
  1639. } else {
  1640. this.$message.error(data.msg)
  1641. }
  1642. }).catch(() => {
  1643. this.searchLoading = false
  1644. })
  1645. },
  1646. // 行点击事件
  1647. IPQCClickRow(row) {
  1648. console.log('点击行:', row)
  1649. },
  1650. // 选择变化事件
  1651. selectionIPQC(selection) {
  1652. this.IPQCSelections = selection
  1653. },
  1654. // 选择标志
  1655. selectFlag(row, index) {
  1656. return true
  1657. },
  1658. // 分页大小变化
  1659. sizeChangeHandle(val) {
  1660. this.pageSize = val
  1661. this.pageIndex = 1
  1662. this.getDataList()
  1663. },
  1664. // 当前页变化
  1665. currentChangeHandle(val) {
  1666. this.pageIndex = val
  1667. this.getDataList()
  1668. },
  1669. // 新增弹窗
  1670. addModal() {
  1671. this.modalData = {
  1672. flag: '1',
  1673. site: '',
  1674. bu: this.userBuList.length > 0 ? this.userBuList[0].buNo : '',
  1675. rollNo: '',
  1676. seqNo: '',
  1677. orderNo: '',
  1678. operationDesc: '',
  1679. operationNo: '',
  1680. resourceId: '',
  1681. resourceDesc: '',
  1682. workCenterNo: '',
  1683. partNo: '',
  1684. partDesc: '',
  1685. invdefinetype: '',
  1686. sku: '',
  1687. cinvSourceCode: '',
  1688. inspectionTypeNo: '',
  1689. rollQty: '',
  1690. umId: this.umList.length > 0 ? this.umList[0].umId : '',
  1691. umName: this.umList.length > 0 ? this.umList[0].umName : '',
  1692. templateId: '',
  1693. templateName: '',
  1694. sjzs: '',
  1695. batchRollNo: '',
  1696. specialRequirements: '',
  1697. specialTaskFlag: 'N'
  1698. }
  1699. this.operationList = []
  1700. this.checked = false
  1701. this.modalFlag = true
  1702. },
  1703. // BU变化事件
  1704. buChange() {
  1705. if (this.modalData.specialTaskFlag !== 'Y') { // 正常检验
  1706. this.modalData.templateId = ''
  1707. this.modalData.templateName = ''
  1708. } else { // 无工单检验
  1709. this.modalData.partNo = ''
  1710. this.modalData.partDesc = ''
  1711. this.modalData.invdefinetype = ''
  1712. this.modalData.sku = ''
  1713. this.modalData.templateId = ''
  1714. this.modalData.templateName = ''
  1715. }
  1716. },
  1717. // 标签号回车事件
  1718. rollNoEnter() {
  1719. if (this.modalData.rollNo) {
  1720. rollNoEnterAPI(this.modalData).then(({data}) => {
  1721. if (data && data.code === 0) {
  1722. const rollData = data.rows[0]
  1723. this.modalData.seqNo = rollData.seqNo
  1724. this.modalData.orderNo = rollData.orderNo
  1725. this.modalData.partNo = rollData.partNo
  1726. this.modalData.partDesc = rollData.partDesc
  1727. this.modalData.invdefinetype = rollData.invdefinetype
  1728. this.modalData.sku = rollData.sku
  1729. this.modalData.operationDesc = rollData.operationDesc
  1730. this.modalData.resourceDesc = rollData.resourceDesc
  1731. this.getOperationList()
  1732. } else {
  1733. this.$message.error(data.msg || '标签号查询失败')
  1734. }
  1735. }).catch(() => {
  1736. this.$message.error('标签号查询失败')
  1737. })
  1738. }
  1739. },
  1740. // 获取工序列表
  1741. getOperationList() {
  1742. getOperationList(this.modalData).then(({data}) => {
  1743. if (data && data.code === 0) {
  1744. this.operationList = data.rows
  1745. if (data.rows.length > 0) {
  1746. this.modalData.operationDesc = data.rows[0].operationDesc
  1747. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1748. this.modalData.resourceId = data.rows[0].resourceId
  1749. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1750. }
  1751. }
  1752. })
  1753. },
  1754. // 获取单位列表
  1755. getUmList() {
  1756. let tempData = {
  1757. site: this.site,
  1758. active: 'Y'
  1759. }
  1760. umSearch(tempData).then(({data}) => {
  1761. if (data && data.code === 0) {
  1762. this.umList = data.rows
  1763. }
  1764. })
  1765. },
  1766. // 获取基础列表
  1767. getBaseList(type) {
  1768. this.$nextTick(() => {
  1769. if (type === 1052) {
  1770. this.searchSeqInfo()
  1771. this.seqDetailFlag = true
  1772. }
  1773. if (type === 505) {
  1774. // 机台选择逻辑
  1775. console.log('机台选择:', type)
  1776. }
  1777. })
  1778. },
  1779. // 查询物料列表
  1780. queryPartList() {
  1781. console.log('查询物料列表')
  1782. },
  1783. // 查询检验模板列表
  1784. queryTemplateList() {
  1785. this.templateData.bu = this.modalData.bu
  1786. // 查询所有检验模板
  1787. queryTemplateList(this.templateData).then(({data}) => {
  1788. if (data && data.code === 0) {
  1789. this.templateList = data.rows
  1790. this.templateModelFlag = true
  1791. } else {
  1792. this.$message.error(data.msg)
  1793. }
  1794. })
  1795. },
  1796. // 选中检验模板
  1797. getRowData(row) {
  1798. this.modalData.templateId = row.templateId
  1799. this.modalData.templateName = row.templateName
  1800. this.templateModelFlag = false
  1801. },
  1802. // 派工单号查询
  1803. searchSeqInfo() {
  1804. let tempData = {
  1805. bu: this.modalData.bu,
  1806. seqNo: this.seqDetailData.seqNo,
  1807. orderNo: this.seqDetailData.orderNo,
  1808. sku: this.seqDetailData.sku,
  1809. partDesc: this.seqDetailData.partDesc,
  1810. partNo: this.seqDetailData.partNo,
  1811. operationDesc: this.seqDetailData.operationDesc,
  1812. status: this.seqDetailData.status
  1813. }
  1814. if (!this.seqDetailData.seqNo && !this.seqDetailData.orderNo && !this.seqDetailData.sku && !this.seqDetailData.partNo && !this.seqDetailData.partDesc && !this.seqDetailData.operationDesc){
  1815. this.seqInfoList = []
  1816. } else {
  1817. searchSeqInfo(tempData).then(({data}) => {
  1818. if (data && data.code === 0) {
  1819. this.seqInfoList = data.rows
  1820. } else {
  1821. this.$message.error(data.msg)
  1822. }
  1823. })
  1824. }
  1825. },
  1826. // 选中派工单号
  1827. getRowData1(row) {
  1828. this.modalData.seqNo = row.seqno || row.seqNo
  1829. this.modalData.orderNo = row.orderno || row.orderNo
  1830. this.modalData.partNo = row.partNo
  1831. this.modalData.partDesc = row.partDesc
  1832. this.modalData.sku = row.sku
  1833. this.modalData.operationDesc = row.operationDesc
  1834. this.modalData.sjzs = row.sjzs
  1835. this.seqDetailFlag = false
  1836. this.getOperationList()
  1837. },
  1838. // 关闭派工单号弹窗
  1839. closeSeqDialog() {
  1840. this.seqDetailData = {
  1841. seqNo: '',
  1842. orderNo: '',
  1843. sku: '',
  1844. partNo: '',
  1845. partDesc: '',
  1846. operationDesc: '',
  1847. status: ''
  1848. }
  1849. this.seqInfoList = []
  1850. },
  1851. // 无工单检验变化
  1852. changeSpecialTask() {
  1853. // 先重置数据
  1854. this.modalData = {
  1855. flag: '1',
  1856. site: '',
  1857. bu: this.userBuList.length > 0 ? this.userBuList[0].buNo : '',
  1858. rollNo: '',
  1859. seqNo: '',
  1860. orderNo: '',
  1861. operationDesc: '',
  1862. operationNo: '',
  1863. resourceId: '',
  1864. resourceDesc: '',
  1865. workCenterNo: '',
  1866. partNo: '',
  1867. partDesc: '',
  1868. invdefinetype: '',
  1869. sku: '',
  1870. cinvSourceCode: '',
  1871. inspectionTypeNo: '',
  1872. rollQty: '',
  1873. umId: this.umList.length > 0 ? this.umList[0].umId : '',
  1874. umName: this.umList.length > 0 ? this.umList[0].umName : '',
  1875. templateId: '',
  1876. templateName: '',
  1877. sjzs: '',
  1878. batchRollNo: '',
  1879. specialRequirements: '',
  1880. specialTaskFlag: ''
  1881. }
  1882. // 获取选中框
  1883. let obj = document.getElementsByName('specialTask')
  1884. // 判断是否打勾
  1885. if (obj[0].checked) {
  1886. let tempData = {
  1887. site: '',
  1888. bu: this.modalData.bu
  1889. }
  1890. this.modalData.specialTaskFlag = 'Y'
  1891. // 获取特殊工序列表
  1892. getSpecialOperationList(tempData).then(({data}) => {
  1893. if (data && data.code === 0) {
  1894. this.operationList = data.rows
  1895. } else {
  1896. this.$message.error(data.msg)
  1897. }
  1898. })
  1899. // 派工单和工单号赋值
  1900. this.modalData.seqNo = '000#1TSGD'
  1901. this.modalData.orderNo = '000#1'
  1902. } else {
  1903. this.operationList = []
  1904. this.modalData.specialTaskFlag = ''
  1905. }
  1906. },
  1907. // 保存数据
  1908. saveData() {
  1909. // 验证 BU
  1910. if (this.modalData.bu === '' || this.modalData.bu == null) {
  1911. this.$message.warning('请选择BU!')
  1912. return
  1913. }
  1914. // 验证派工单号
  1915. if (this.modalData.seqNo === '' || this.modalData.seqNo == null) {
  1916. this.$message.warning('请选择派工单!')
  1917. return
  1918. }
  1919. // 验证工单号
  1920. if (this.modalData.orderNo === '' || this.modalData.orderNo == null) {
  1921. this.$message.warning('请选择工单!')
  1922. return
  1923. }
  1924. // 验证检验类型
  1925. if (this.modalData.inspectionTypeNo === '' || this.modalData.inspectionTypeNo == null) {
  1926. this.$message.warning('请选择检验类型!')
  1927. return
  1928. }
  1929. // 验证物料编码(非无工单检验)
  1930. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.partNo === '' || this.modalData.partNo == null)) {
  1931. this.$message.warning('请选择物料!')
  1932. return
  1933. }
  1934. // 验证工序
  1935. if (this.modalData.operationDesc === '' || this.modalData.operationDesc == null) {
  1936. this.$message.warning('请选择工序!')
  1937. return
  1938. }
  1939. // 验证机台(非无工单检验)
  1940. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.resourceId === '' || this.modalData.resourceId == null)) {
  1941. this.$message.warning('请选择机台!')
  1942. return
  1943. }
  1944. // 验证送检数量
  1945. if (this.modalData.rollQty === '' || this.modalData.rollQty == null) {
  1946. this.$message.warning('请填写送检数量!')
  1947. return
  1948. }
  1949. // 验证单位
  1950. if (this.modalData.umId === '' || this.modalData.umId == null) {
  1951. this.$message.warning('请选择单位!')
  1952. return
  1953. }
  1954. // 验证检验模板(动控开启时)
  1955. if (this.controlData.baseData === '控制' && (this.modalData.templateId == null || this.modalData.templateId === '')) {
  1956. this.$message.warning('请选择检验模板!')
  1957. return
  1958. }
  1959. this.saveLoading = true
  1960. if (this.modalData.flag === '1') {
  1961. saveOsInspection(this.modalData).then(({data}) => {
  1962. if (data && data.code === 0) {
  1963. this.getDataList()
  1964. this.operationList = []
  1965. this.modalFlag = false
  1966. this.$message.success('操作成功')
  1967. } else {
  1968. this.$message.error(data.msg)
  1969. }
  1970. this.saveLoading = false
  1971. }).catch(() => {
  1972. this.saveLoading = false
  1973. })
  1974. }
  1975. },
  1976. // 删除
  1977. deleteModal() {
  1978. if (this.IPQCSelections.length === 0) {
  1979. this.$alert('请勾选要删除的检验单!', '提示', {
  1980. confirmButtonText: '确定'
  1981. })
  1982. return false
  1983. }
  1984. this.$confirm(`是否删除该 ${this.IPQCSelections.length} 条检验记录?`, '提示', {
  1985. confirmButtonText: '确定',
  1986. cancelButtonText: '取消',
  1987. type: 'warning'
  1988. }).then(() => {
  1989. let tempData = {
  1990. submitList: this.IPQCSelections
  1991. }
  1992. ipqcRecordDelete(tempData).then(({data}) => {
  1993. if (data && data.code === 0) {
  1994. this.getDataList()
  1995. this.IPQCSelections = []
  1996. this.$message.success('操作成功')
  1997. } else {
  1998. this.$message.error(data.msg)
  1999. }
  2000. })
  2001. })
  2002. },
  2003. // 审核
  2004. submitResult() {
  2005. if (this.IPQCSelections.length === 0) {
  2006. this.$alert('请勾选要审核的检验单!', '提示', {
  2007. confirmButtonText: '确定'
  2008. })
  2009. return false
  2010. }
  2011. this.$confirm(`是否审核该 ${this.IPQCSelections.length} 条检验记录?`, '提示', {
  2012. confirmButtonText: '确定',
  2013. cancelButtonText: '取消',
  2014. type: 'warning'
  2015. }).then(() => {
  2016. let tempData = {
  2017. submitList: this.IPQCSelections
  2018. }
  2019. saveIPQCSubmitResult(tempData).then(({data}) => {
  2020. if (data && data.code === 0) {
  2021. this.getDataList()
  2022. this.IPQCSelections = []
  2023. this.$message.success('操作成功')
  2024. } else {
  2025. this.$message.error(data.msg)
  2026. }
  2027. })
  2028. })
  2029. },
  2030. // 开始检验
  2031. actionModal(row) {
  2032. this.actionData = {
  2033. site: row.site,
  2034. buNo: row.buNo,
  2035. inspectionNo: row.inspectionNo
  2036. }
  2037. getIPQCItemObjectList(this.actionData).then(({data}) => {
  2038. if (data && data.code === 0) {
  2039. if (data.rows.length === 0) {
  2040. this.actionModal2()
  2041. } else {
  2042. this.itemObjectList = data.rows
  2043. this.ItemObjectModelFlag = true
  2044. }
  2045. } else {
  2046. this.$message.error(data.msg)
  2047. }
  2048. })
  2049. },
  2050. // 开始检验确认
  2051. actionModal2() {
  2052. this.$confirm(`确认开始检验?`, '提示', {
  2053. confirmButtonText: '确定',
  2054. cancelButtonText: '取消',
  2055. type: 'warning'
  2056. }).then(() => {
  2057. let tempData = {
  2058. site: this.actionData.site,
  2059. buNo: this.actionData.buNo,
  2060. inspectionNo: this.actionData.inspectionNo,
  2061. actionBy: this.$store.state.user.name,
  2062. state: '待检验',
  2063. equipmentList: this.itemObjectList
  2064. }
  2065. actionIPQCInspection(tempData).then(({data}) => {
  2066. if (data && data.code === 0) {
  2067. this.getDataList()
  2068. this.$message.success('操作成功')
  2069. this.ItemObjectModelFlag = false
  2070. } else {
  2071. this.$message.error(data.msg)
  2072. }
  2073. })
  2074. })
  2075. },
  2076. // 明细记录信息查询
  2077. detailModal(row) {
  2078. this.detailData.site = row.site
  2079. this.detailData.buNo = row.buNo
  2080. this.detailData.inspectionNo = row.inspectionNo
  2081. this.detailData.partNo = row.partNo
  2082. this.detailData.partDesc = row.partDesc
  2083. this.detailData.spec = row.spec || ''
  2084. this.detailData.rollQty = row.rollQty
  2085. this.detailData.samplingQty = row.samplingQty
  2086. this.detailData.unqualifiedQty = row.unqualifiedQty
  2087. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  2088. this.detailData.submitFlag = row.submitFlag
  2089. this.detailData.disposalMeasures = row.disposalMeasures || ''
  2090. this.detailData.disposalRemark = row.disposalRemark || ''
  2091. this.detailData.inspectionResult = row.inspectionResult
  2092. this.detailData.inspectorNo = row.inspectorNo
  2093. this.detailData.inspectorName = row.inspectorName
  2094. this.detailData.inspectionRemark = row.inspectionRemark
  2095. this.detailData.cinvSourceCode = row.cinvSourceCode
  2096. this.detailData.sku = row.sku
  2097. this.detailData.invdefinetype = row.invdefinetype
  2098. this.detailData.umId = row.umId
  2099. this.detailData.umName = row.umName
  2100. this.detailData.operator = row.operator || ''
  2101. this.detailData.operatorName = row.operatorName || ''
  2102. this.detailData.responsiblePerson = row.responsiblePerson || ''
  2103. this.detailData.responsiblePersonName = row.responsiblePersonName || ''
  2104. this.detailData.state = row.state
  2105. this.detailData.orderNo = row.orderNo || ''
  2106. this.detailData.templateId = row.templateId || ''
  2107. if (row.state === '待检验') {
  2108. this.detailData.passQty = row.samplingQty
  2109. } else {
  2110. this.detailData.passQty = row.passQty
  2111. this.detailData.notPassQty = row.notPassQty
  2112. }
  2113. this.detailData.batchQualifiedQty = row.batchQualifiedQty
  2114. this.getInspectionFormData()
  2115. this.detailInformationFlag = true
  2116. },
  2117. // 检验单明细
  2118. getInspectionFormData() {
  2119. ipqcDetailSearch(this.detailData).then(({data}) => {
  2120. if (data && data.code === 0) {
  2121. this.detailList = data.rows
  2122. } else {
  2123. this.detailList = []
  2124. }
  2125. })
  2126. },
  2127. // 刷新派设备文档的列表
  2128. getFileContentData(row) {
  2129. let currentData = {
  2130. orderRef1: row.site,
  2131. orderRef2: row.inspectionNo,
  2132. orderRef4: row.buNo,
  2133. partNo: row.partNo
  2134. }
  2135. this.fileLoading = true
  2136. getInspectionFile(currentData).then(({data}) => {
  2137. //区分请求成功和失败的状况
  2138. if (data && data.code === 0) {
  2139. this.fileContentList = data.rows
  2140. } else {
  2141. this.fileContentList = []
  2142. }
  2143. this.fileLoading = false
  2144. }).catch(()=>{
  2145. this.fileLoading = false
  2146. })
  2147. this.fileFlag = true
  2148. },
  2149. // 保存检验明细(应用/保存)
  2150. Transfer(type) {
  2151. // 保存时校验
  2152. if (type === '2') {
  2153. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  2154. this.$message.warning('请选择检验结论!')
  2155. return
  2156. }
  2157. if (this.detailData.inspectionResult === '不合格' && (this.detailData.disposalMeasures == null || this.detailData.disposalMeasures === '')) {
  2158. this.$message.warning('请选择处置措施!')
  2159. return
  2160. }
  2161. if (this.detailList.length > 0 && this.detailData.inspectionResult === '不合格') {
  2162. const flag = this.detailList.some(item => item.itemResult === 'N')
  2163. if (!flag) {
  2164. this.$message.warning('请选择不合格项目!')
  2165. return
  2166. }
  2167. }
  2168. if (this.detailData.inspectionResult !== '不合格') {
  2169. this.detailData.disposalMeasures = ''
  2170. this.detailData.disposalRemark = ''
  2171. }
  2172. }
  2173. this.saveDetailInformation(type)
  2174. },
  2175. // 保存检验明细信息
  2176. saveDetailInformation(type) {
  2177. this.saveInformationData.site = this.detailData.site
  2178. this.saveInformationData.buNo = this.detailData.buNo
  2179. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  2180. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  2181. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  2182. this.saveInformationData.inspectorNo = this.$store.state.user.name
  2183. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  2184. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  2185. this.saveInformationData.rollQty = this.detailData.rollQty
  2186. this.saveInformationData.samplingQty = this.detailData.samplingQty
  2187. this.saveInformationData.unqualifiedQty = this.detailData.unqualifiedQty
  2188. this.saveInformationData.partNo = this.detailData.partNo
  2189. this.saveInformationData.partDesc = this.detailData.partDesc
  2190. this.saveInformationData.operator = this.detailData.operator
  2191. this.saveInformationData.responsiblePerson = this.detailData.responsiblePerson
  2192. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  2193. this.saveInformationData.passQty = this.detailData.passQty == null ? 0 : this.detailData.passQty
  2194. this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
  2195. this.saveInformationData.batchQualifiedQty = this.detailData.batchQualifiedQty == null ? 0 : this.detailData.batchQualifiedQty
  2196. this.saveInformationData.type = type
  2197. this.transferLoadFlag = true
  2198. saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => {
  2199. if (data && data.code === 0) {
  2200. this.getDataList()
  2201. this.detailInformationFlag = false
  2202. this.$message.success('操作成功')
  2203. } else {
  2204. this.$message.error(data.msg)
  2205. }
  2206. this.transferLoadFlag = false
  2207. }).catch(() => {
  2208. this.transferLoadFlag = false
  2209. })
  2210. },
  2211. // 检验结论变化事件
  2212. resultChange() {
  2213. if (this.detailData.inspectionResult !== '不合格') {
  2214. this.detailData.disposalMeasures = ''
  2215. this.detailData.disposalRemark = ''
  2216. }
  2217. },
  2218. // 获取处置措施列表
  2219. getDisposalMeasuresOptions() {
  2220. let tempData = {
  2221. inspectionTypeNo: '101'
  2222. }
  2223. disposalMeasuresSearch(tempData).then(({data}) => {
  2224. if (data.code === 0) {
  2225. this.disposalMeasuresOptions = data.rows
  2226. }
  2227. })
  2228. },
  2229. // 获取用户角色列表
  2230. getUserRoleListData() {
  2231. getUserRoleList().then(({data}) => {
  2232. if (data.code === 0) {
  2233. this.roleList = data.rows
  2234. } else {
  2235. this.roleList = []
  2236. }
  2237. })
  2238. },
  2239. // 获取协同人员列表
  2240. getOperatorListModal() {
  2241. this.operatorData.flag = '1'
  2242. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2243. this.operatorData.userName = this.$store.state.user.name
  2244. if (this.roleList.length > 0) {
  2245. let filterList = this.roleList.filter(item => item.roleName === '机修人员')
  2246. if (filterList.length > 0) {
  2247. this.operatorData.roleId = filterList[0].roleId
  2248. } else {
  2249. this.operatorData.roleId = this.roleList[0].roleId
  2250. }
  2251. } else {
  2252. this.operatorData.roleId = ''
  2253. }
  2254. // 先清空缓存选中
  2255. this.$nextTick(() => {
  2256. if (this.$refs.operatorTable) {
  2257. this.$refs.operatorTable.clearSelection()
  2258. }
  2259. })
  2260. // 拿到选中的人员编号
  2261. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2262. getOperatorList(this.operatorData).then(({data}) => {
  2263. if (data && data.code === 0) {
  2264. this.operatorList = data.rows
  2265. this.operatorList.forEach(val => {
  2266. // 回显选中
  2267. if (tempDataList.includes(val.adminID)) {
  2268. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2269. }
  2270. })
  2271. this.operatorModelFlag = true
  2272. } else {
  2273. this.$message.error(data.msg)
  2274. }
  2275. })
  2276. },
  2277. // 获取责任人员列表
  2278. getResponsiblePersonListModal() {
  2279. this.operatorData.flag = '2'
  2280. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2281. this.operatorData.userName = this.$store.state.user.name
  2282. // 先清空缓存选中
  2283. this.$nextTick(() => {
  2284. if (this.$refs.operatorTable) {
  2285. this.$refs.operatorTable.clearSelection()
  2286. }
  2287. })
  2288. // 拿到选中的人员编号
  2289. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2290. getResponsibleOperatorList(this.operatorData).then(({data}) => {
  2291. if (data && data.code === 0) {
  2292. this.operatorList = data.rows
  2293. this.operatorList.forEach(val => {
  2294. // 回显选中
  2295. if (tempDataList.includes(val.adminID)) {
  2296. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2297. }
  2298. })
  2299. this.operatorModelFlag = true
  2300. } else {
  2301. this.$message.error(data.msg)
  2302. }
  2303. })
  2304. },
  2305. // 查询人员列表
  2306. getOperatorList2() {
  2307. if (this.operatorData.flag === '1') {
  2308. // 拿到选中的人员编号
  2309. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2310. getOperatorList(this.operatorData).then(({data}) => {
  2311. if (data && data.code === 0) {
  2312. this.operatorList = data.rows
  2313. this.operatorList.forEach(val => {
  2314. // 回显选中的部门
  2315. if (tempDataList.includes(val.adminID)) {
  2316. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2317. }
  2318. })
  2319. } else {
  2320. this.operatorList = []
  2321. }
  2322. })
  2323. } else {
  2324. // 拿到选中的人员编号
  2325. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2326. getResponsibleOperatorList(this.operatorData).then(({data}) => {
  2327. if (data && data.code === 0) {
  2328. this.operatorList = data.rows
  2329. this.operatorList.forEach(val => {
  2330. // 回显选中的部门
  2331. if (tempDataList.includes(val.adminID)) {
  2332. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2333. }
  2334. })
  2335. } else {
  2336. this.operatorList = []
  2337. }
  2338. })
  2339. }
  2340. },
  2341. // 点击行选中复选框
  2342. operatorClickRow(row) {
  2343. this.$refs.operatorTable.toggleRowSelection(row)
  2344. },
  2345. // 多选
  2346. selectionChangeHandle2(val) {
  2347. this.dataListSelections2 = val
  2348. },
  2349. // 确认多选协同人员
  2350. confirmOperator() {
  2351. if (this.dataListSelections2.length === 0) {
  2352. this.$message.warning('请勾选人员!')
  2353. return
  2354. }
  2355. if (this.operatorData.flag === '1') {
  2356. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2357. if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) {
  2358. this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName
  2359. this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID
  2360. }
  2361. }
  2362. if (this.detailData.operator.charAt(0) === ';') {
  2363. this.detailData.operator = this.detailData.operator.substring(1)
  2364. this.detailData.operatorName = this.detailData.operatorName.substring(1)
  2365. }
  2366. } else {
  2367. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2368. if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) {
  2369. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName
  2370. this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID
  2371. }
  2372. }
  2373. if (this.detailData.responsiblePerson.charAt(0) === ';') {
  2374. this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1)
  2375. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1)
  2376. }
  2377. }
  2378. this.operatorData = {
  2379. flag: '',
  2380. site: '',
  2381. bu: '',
  2382. adminID: '',
  2383. adminName: '',
  2384. roleName: '',
  2385. roleId: '',
  2386. userName: this.$store.state.user.name
  2387. }
  2388. this.operatorModelFlag = false
  2389. },
  2390. // 数据采集
  2391. handleDataAcquisition() {
  2392. this.loadFlag = true
  2393. let tempDate = {
  2394. site: this.detailData.site,
  2395. buNo: this.detailData.buNo,
  2396. inspectionNo: this.detailData.inspectionNo,
  2397. flag: 'ipqc'
  2398. }
  2399. dataAcquisition(tempDate).then(({data}) => {
  2400. if (data.code === 0) {
  2401. this.changeMyString(data.rows)
  2402. this.$message.success('数据采集成功')
  2403. } else {
  2404. this.$message.error(data.msg)
  2405. }
  2406. this.loadFlag = false
  2407. })
  2408. },
  2409. // 根据项目数据采集
  2410. dataAcquisitionByItemHandle(row) {
  2411. this.loadFlag = true
  2412. let tempDate = {
  2413. site: row.site,
  2414. buNo: row.buNo,
  2415. inspectionNo: row.inspectionNo,
  2416. templateId: row.templateId,
  2417. itemNo: row.itemNo,
  2418. flag: 'ipqc'
  2419. }
  2420. dataAcquisitionByItem(tempDate).then(({data}) => {
  2421. if (data.code === 0) {
  2422. this.changeMyString(data.rows)
  2423. this.$message.success('数据采集成功')
  2424. } else {
  2425. this.$message.error(data.msg)
  2426. }
  2427. this.loadFlag = false
  2428. })
  2429. },
  2430. // 更新检验明细列表数据
  2431. changeMyString(rows) {
  2432. if (rows && rows.length > 0) {
  2433. rows.forEach(row => {
  2434. const index = this.detailList.findIndex(item => item.itemNo === row.itemNo)
  2435. if (index !== -1) {
  2436. if (row.valueTypeDb === 'N') {
  2437. this.detailList[index].numberValue = row.numberValue
  2438. } else {
  2439. this.detailList[index].textValue = row.textValue
  2440. }
  2441. }
  2442. })
  2443. }
  2444. },
  2445. // 根据实测值更新项目检验结论
  2446. updateItemResult(row) {
  2447. if (row.valueTypeDb === 'N' && row.numberValue !== '' && row.numberValue != null) {
  2448. const numValue = parseFloat(row.numberValue)
  2449. const minValue = row.minValue != null ? parseFloat(row.minValue) : null
  2450. const maxValue = row.maxValue != null ? parseFloat(row.maxValue) : null
  2451. if (minValue != null && maxValue != null) {
  2452. row.itemResult = (numValue >= minValue && numValue <= maxValue) ? 'Y' : 'N'
  2453. }
  2454. }
  2455. },
  2456. // 焦点跳转到下一个输入框
  2457. focusNextInput(currentIndex, fieldType) {
  2458. const nextIndex = currentIndex + 1
  2459. if (nextIndex < this.detailList.length) {
  2460. this.$nextTick(() => {
  2461. const ref = this.$refs[`${fieldType}${nextIndex}`]
  2462. if (ref) {
  2463. if (Array.isArray(ref)) {
  2464. ref[0].focus()
  2465. } else {
  2466. ref.focus()
  2467. }
  2468. }
  2469. })
  2470. }
  2471. },
  2472. // ======================== 项目操作相关方法 ========================
  2473. // 打开项目操作对话框
  2474. openItemOperationDialog() {
  2475. this.itemOperationQuery = {
  2476. itemNo: '',
  2477. itemDesc: '',
  2478. }
  2479. this.searchIPQCItems()
  2480. this.itemOperationDialogFlag = true
  2481. },
  2482. // 查询IPQC类型的检验项目
  2483. async searchIPQCItems() {
  2484. try {
  2485. const {data} = await getIPQCItemList({
  2486. site: this.detailData.site,
  2487. buNo: this.detailData.buNo,
  2488. inspectionNo: this.detailData.inspectionNo,
  2489. templateId: this.detailData.templateId,
  2490. itemNo: this.itemOperationQuery.itemNo,
  2491. itemDesc: this.itemOperationQuery.itemDesc,
  2492. })
  2493. if (data && data.code === 0) {
  2494. this.availableItemList = data.row1 || []
  2495. this.selectedItemList = data.row2 || []
  2496. } else {
  2497. this.$message.error(data.msg || '查询失败')
  2498. }
  2499. } catch (error) {
  2500. this.$message.error('查询失败,请检查')
  2501. }
  2502. },
  2503. // 重置查询条件
  2504. resetItemQuery() {
  2505. this.itemOperationQuery = {
  2506. itemNo: '',
  2507. itemDesc: '',
  2508. }
  2509. this.searchIPQCItems()
  2510. },
  2511. // 可选项目行点击
  2512. availableItemClickRow(row) {
  2513. this.$refs.availableItemTable.toggleRowSelection(row)
  2514. },
  2515. // 可选项目选择变化
  2516. availableItemSelectionChange(selection) {
  2517. this.availableItemSelections = selection
  2518. },
  2519. // 已有项目行点击
  2520. selectedItemClickRow(row) {
  2521. this.$refs.selectedItemTable.toggleRowSelection(row)
  2522. },
  2523. // 已有项目选择变化
  2524. selectedItemSelectionChange(selection) {
  2525. this.selectedItemSelections = selection
  2526. },
  2527. // 添加检验项目
  2528. async addInspectionItems() {
  2529. if (!this.availableItemSelections || this.availableItemSelections.length === 0) {
  2530. this.$message.warning('请选择可选项目!')
  2531. return
  2532. }
  2533. try {
  2534. const {data} = await addIPQCItemDetails({
  2535. site: this.detailData.site,
  2536. buNo: this.detailData.buNo,
  2537. inspectionNo: this.detailData.inspectionNo,
  2538. templateId: this.detailData.templateId,
  2539. orderNo: this.detailData.orderNo,
  2540. itemList: this.availableItemSelections,
  2541. })
  2542. if (data && data.code === 0) {
  2543. this.$message.success('添加成功')
  2544. this.searchIPQCItems()
  2545. this.availableItemSelections = []
  2546. } else {
  2547. this.$message.error(data.msg || '添加失败')
  2548. }
  2549. } catch (error) {
  2550. this.$message.error('添加失败,请检查')
  2551. }
  2552. },
  2553. // 删除检验项目
  2554. async deleteInspectionItems() {
  2555. if (!this.selectedItemSelections || this.selectedItemSelections.length === 0) {
  2556. this.$message.warning('请选择已有项目!')
  2557. return
  2558. }
  2559. this.$confirm('确定删除选中的检验项目吗?删除后将同时删除该项目的子明细数据。', '提示', {
  2560. confirmButtonText: '确定',
  2561. cancelButtonText: '取消',
  2562. type: 'warning'
  2563. }).then(async () => {
  2564. try {
  2565. const {data} = await deleteIPQCItemDetails({
  2566. site: this.detailData.site,
  2567. buNo: this.detailData.buNo,
  2568. inspectionNo: this.detailData.inspectionNo,
  2569. templateId: this.detailData.templateId,
  2570. itemList: this.selectedItemSelections,
  2571. })
  2572. if (data && data.code === 0) {
  2573. this.$message.success('删除成功')
  2574. this.searchIPQCItems()
  2575. this.selectedItemSelections = []
  2576. } else {
  2577. this.$message.error(data.msg || '删除失败')
  2578. }
  2579. } catch (error) {
  2580. this.$message.error('删除失败,请检查')
  2581. }
  2582. }).catch(() => {
  2583. this.$message.info('已取消删除')
  2584. })
  2585. },
  2586. // 刷新检验明细列表
  2587. refreshInspectionDetailList() {
  2588. if (this.detailInformationFlag) {
  2589. this.getInspectionFormData()
  2590. }
  2591. },
  2592. // ======================== 模板导入相关方法 ========================
  2593. // 打开模板导入对话框
  2594. openTemplateImportDialog() {
  2595. this.templateQuery = {
  2596. templateId: '',
  2597. templateDesc: '',
  2598. }
  2599. this.searchIPQCTemplates()
  2600. this.templateImportDialogFlag = true
  2601. },
  2602. // 查询IPQC检验模板
  2603. async searchIPQCTemplates() {
  2604. try {
  2605. const {data} = await getIPQCTemplateList({
  2606. site: this.detailData.site,
  2607. buNo: this.detailData.buNo,
  2608. templateId: this.templateQuery.templateId,
  2609. templateDesc: this.templateQuery.templateDesc,
  2610. })
  2611. if (data && data.code === 0) {
  2612. this.templateImportList = data.rows || []
  2613. } else {
  2614. this.$message.error(data.msg || '查询失败')
  2615. }
  2616. } catch (error) {
  2617. this.$message.error('查询失败,请检查')
  2618. }
  2619. },
  2620. // 重置模板查询条件
  2621. resetTemplateQuery() {
  2622. this.templateQuery = {
  2623. templateId: '',
  2624. templateDesc: '',
  2625. }
  2626. this.searchIPQCTemplates()
  2627. },
  2628. // 模板行点击
  2629. templateClickRow(row) {
  2630. this.$refs.templateTable.toggleRowSelection(row)
  2631. },
  2632. // 模板选择变化
  2633. templateSelectionChange(selection) {
  2634. this.templateSelections = selection
  2635. },
  2636. // 确认导入模板
  2637. async confirmImportTemplate() {
  2638. if (!this.templateSelections || this.templateSelections.length === 0) {
  2639. this.$message.warning('请选择要导入的模板!')
  2640. return
  2641. }
  2642. this.$confirm(`确定要导入选中的 ${this.templateSelections.length} 个模板吗?`, '提示', {
  2643. confirmButtonText: '确定',
  2644. cancelButtonText: '取消',
  2645. type: 'warning'
  2646. }).then(async () => {
  2647. this.importLoading = true
  2648. try {
  2649. const {data} = await importIPQCTemplateItems({
  2650. site: this.detailData.site,
  2651. buNo: this.detailData.buNo,
  2652. inspectionNo: this.detailData.inspectionNo,
  2653. orderNo: this.detailData.orderNo,
  2654. templateList: this.templateSelections.map(t => ({
  2655. templateId: t.templateId,
  2656. templateName: t.templateName
  2657. }))
  2658. })
  2659. if (data && data.code === 0) {
  2660. this.$message.success(`导入成功!共导入 ${data.importCount || 0} 个检验项目`)
  2661. this.templateImportDialogFlag = false
  2662. this.templateSelections = []
  2663. // 刷新检验明细列表
  2664. this.getInspectionFormData()
  2665. } else {
  2666. this.$message.error(data.msg || '导入失败')
  2667. }
  2668. } catch (error) {
  2669. this.$message.error('导入失败,请检查')
  2670. } finally {
  2671. this.importLoading = false
  2672. }
  2673. }).catch(() => {
  2674. this.$message.info('已取消导入')
  2675. })
  2676. },
  2677. // 关闭弹窗
  2678. handleClose() {
  2679. this.$emit('update:visible', false)
  2680. }
  2681. }
  2682. }
  2683. </script>
  2684. <style scoped>
  2685. .process-inspection {
  2686. }
  2687. .demo-form-inline .el-form-item {
  2688. margin-bottom: 10px;
  2689. }
  2690. /* ==================== 检验单对话框样式 ==================== */
  2691. /deep/ .ipqc-inspection-dialog .el-dialog__header {
  2692. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  2693. padding: 20px 24px;
  2694. border-radius: 8px 8px 0 0;
  2695. }
  2696. /deep/ .ipqc-inspection-dialog .el-dialog__title {
  2697. color: #ffffff;
  2698. font-size: 18px;
  2699. font-weight: 600;
  2700. letter-spacing: 0.5px;
  2701. }
  2702. /deep/ .ipqc-inspection-dialog .el-dialog__headerbtn .el-dialog__close {
  2703. color: #ffffff;
  2704. font-size: 20px;
  2705. }
  2706. /deep/ .ipqc-inspection-dialog .el-dialog__body {
  2707. padding: 0;
  2708. background: #f5f7fa;
  2709. }
  2710. /* 单据信息卡片 */
  2711. .inspection-info-card {
  2712. background: #ffffff;
  2713. padding: 0px 0px;
  2714. }
  2715. .info-section {
  2716. margin-bottom: 0;
  2717. background: #f9fafb;
  2718. border-radius: 6px;
  2719. padding: 12px;
  2720. border: 1px solid #e8eaed;
  2721. transition: all 0.3s ease;
  2722. }
  2723. .info-section:hover {
  2724. box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  2725. border-color: #d0d4d9;
  2726. }
  2727. .info-section:last-child {
  2728. margin-bottom: 0;
  2729. }
  2730. .section-title {
  2731. display: flex;
  2732. align-items: center;
  2733. margin-bottom: 12px;
  2734. padding-bottom: 8px;
  2735. border-bottom: 2px solid #e8eaed;
  2736. font-size: 14px;
  2737. font-weight: 600;
  2738. color: #303133;
  2739. }
  2740. .section-title i {
  2741. font-size: 18px;
  2742. margin-right: 8px;
  2743. color: #667eea;
  2744. }
  2745. .info-row {
  2746. margin-bottom: 0 !important;
  2747. }
  2748. .info-item {
  2749. margin-bottom: 0;
  2750. }
  2751. .info-item label {
  2752. display: block;
  2753. margin-bottom: 6px;
  2754. font-size: 12px;
  2755. font-weight: 500;
  2756. color: #606266;
  2757. }
  2758. .info-item label a {
  2759. color: #409eff;
  2760. text-decoration: none;
  2761. transition: color 0.3s;
  2762. }
  2763. .info-item label a:hover {
  2764. color: #66b1ff;
  2765. text-decoration: underline;
  2766. }
  2767. .info-item /deep/ .el-input--small .el-input__inner,
  2768. .info-item /deep/ .el-input-number--small .el-input__inner {
  2769. border-radius: 4px;
  2770. border: 1px solid #dcdfe6;
  2771. transition: all 0.3s;
  2772. }
  2773. .info-item /deep/ .el-input--small .el-input__inner:focus,
  2774. .info-item /deep/ .el-input-number--small .el-input__inner:focus {
  2775. border-color: #667eea;
  2776. box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
  2777. }
  2778. .info-item /deep/ .el-select {
  2779. width: 100%;
  2780. }
  2781. /* 操作按钮区域 */
  2782. .action-buttons {
  2783. display: flex;
  2784. justify-content: space-between;
  2785. align-items: center;
  2786. padding: 10px 12px;
  2787. background: #ffffff;
  2788. border-radius: 6px;
  2789. border: 1px solid #e8eaed;
  2790. margin-top: 10px;
  2791. }
  2792. .left-actions,
  2793. .right-actions {
  2794. display: flex;
  2795. gap: 10px;
  2796. }
  2797. .action-buttons .el-button {
  2798. border-radius: 6px;
  2799. font-weight: 500;
  2800. transition: all 0.3s ease;
  2801. }
  2802. .action-buttons .el-button:hover {
  2803. transform: translateY(-2px);
  2804. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  2805. }
  2806. /* 检验项目列表 */
  2807. .inspection-table-wrapper {
  2808. background: #ffffff;
  2809. padding: 0px 0px;
  2810. }
  2811. .table-header {
  2812. display: flex;
  2813. align-items: center;
  2814. justify-content: space-between;
  2815. margin-bottom: 10px;
  2816. margin-top: 10px;
  2817. border-bottom: 2px solid #e8eaed;
  2818. }
  2819. .table-title {
  2820. font-size: 15px;
  2821. font-weight: 600;
  2822. color: #303133;
  2823. display: flex;
  2824. align-items: center;
  2825. }
  2826. .table-title i {
  2827. font-size: 18px;
  2828. margin-right: 8px;
  2829. color: #667eea;
  2830. }
  2831. .inspection-table {
  2832. border-radius: 8px;
  2833. overflow: hidden;
  2834. }
  2835. .inspection-table /deep/ .el-table__header-wrapper th {
  2836. background: linear-gradient(135deg, #f5f7fa 0%, #e8eaed 100%);
  2837. color: #606266;
  2838. font-weight: 500;
  2839. }
  2840. /* 底部操作按钮 */
  2841. .dialog-footer {
  2842. display: flex;
  2843. justify-content: center;
  2844. align-items: center;
  2845. gap: 12px;
  2846. padding: 12px 16px;
  2847. background: #ffffff;
  2848. }
  2849. .dialog-footer .el-button {
  2850. min-width: 100px;
  2851. border-radius: 6px;
  2852. font-weight: 500;
  2853. transition: all 0.3s ease;
  2854. }
  2855. .dialog-footer .el-button:hover {
  2856. transform: translateY(-2px);
  2857. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  2858. }
  2859. .dialog-footer .el-button--success {
  2860. background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  2861. border: none;
  2862. }
  2863. .dialog-footer .el-button--success:hover {
  2864. background: linear-gradient(135deg, #15b39d 0%, #4af58e 100%);
  2865. }
  2866. /* 项目检验结论颜色 */
  2867. /deep/ .redElSelect .el-input--suffix .el-input__inner {
  2868. color: red;
  2869. font-weight: bold;
  2870. }
  2871. /deep/ .greenElSelect .el-input--suffix .el-input__inner {
  2872. color: rgb(103,194,58);
  2873. font-weight: bold;
  2874. }
  2875. /* 表格单元格高度修复 */
  2876. .inspection-table /deep/ .cell {
  2877. height: auto;
  2878. line-height: 1.5;
  2879. }
  2880. .inspection-table /deep/ .el-table__body-wrapper .el-table__row {
  2881. transition: all 0.3s ease;
  2882. }
  2883. .inspection-table /deep/ .el-table__body-wrapper .el-table__row:hover {
  2884. background: #f5f7fa;
  2885. }
  2886. .inspection-table /deep/ .el-table__body-wrapper .el-table__row.el-table__row--striped {
  2887. background: #fafbfc;
  2888. }
  2889. .inspection-table /deep/ .el-table__body-wrapper .el-table__row.el-table__row--striped:hover {
  2890. background: #f0f2f5;
  2891. }
  2892. .inspection-table /deep/ .el-button--mini {
  2893. padding: 7px 10px;
  2894. border-radius: 4px;
  2895. font-size: 12px;
  2896. }
  2897. .inspection-table /deep/ .el-table__header-wrapper th {
  2898. background: linear-gradient(135deg, #f5f7fa 0%, #e8eaed 100%);
  2899. color: #303133;
  2900. font-weight: 600;
  2901. font-size: 13px;
  2902. padding: 12px 0;
  2903. }
  2904. /* ==================== 项目操作对话框样式 ==================== */
  2905. /deep/ .item-operation-dialog {
  2906. border-radius: 8px;
  2907. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  2908. }
  2909. /deep/ .item-operation-dialog .el-dialog__header {
  2910. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  2911. padding: 20px 24px;
  2912. border-radius: 8px 8px 0 0;
  2913. }
  2914. /deep/ .item-operation-dialog .el-dialog__title {
  2915. color: #ffffff;
  2916. font-size: 16px;
  2917. font-weight: 600;
  2918. letter-spacing: 0.5px;
  2919. }
  2920. /deep/ .item-operation-dialog .el-dialog__headerbtn .el-dialog__close {
  2921. color: #ffffff;
  2922. font-size: 20px;
  2923. font-weight: bold;
  2924. }
  2925. /deep/ .item-operation-dialog .el-dialog__headerbtn:hover .el-dialog__close {
  2926. color: #f0f0f0;
  2927. }
  2928. /deep/ .item-operation-dialog .el-dialog__body {
  2929. padding: 24px;
  2930. background: #f8f9fa;
  2931. }
  2932. /* 查询区域样式 */
  2933. .search-container {
  2934. background: #ffffff;
  2935. padding: 16px 20px;
  2936. border-radius: 6px;
  2937. margin-bottom: 20px;
  2938. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  2939. }
  2940. .search-container .el-form-item {
  2941. margin-bottom: 0;
  2942. }
  2943. .search-container .el-form-item__label {
  2944. font-weight: 500;
  2945. color: #606266;
  2946. }
  2947. /* 主内容区域 */
  2948. .item-operation-content {
  2949. display: flex;
  2950. gap: 16px;
  2951. align-items: stretch;
  2952. }
  2953. /* 项目面板 */
  2954. .item-panel {
  2955. flex: 1;
  2956. background: #ffffff;
  2957. border-radius: 6px;
  2958. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  2959. overflow: hidden;
  2960. transition: all 0.3s ease;
  2961. }
  2962. .item-panel:hover {
  2963. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  2964. }
  2965. .available-panel {
  2966. flex: 1.5;
  2967. }
  2968. .selected-panel {
  2969. flex: 1;
  2970. }
  2971. /* 面板头部 */
  2972. .panel-header {
  2973. padding: 8px 16px;
  2974. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  2975. border-bottom: 2px solid #9ac3d0;
  2976. display: flex;
  2977. align-items: center;
  2978. gap: 8px;
  2979. }
  2980. .panel-header i {
  2981. font-size: 18px;
  2982. color: #ffffff;
  2983. }
  2984. .panel-title {
  2985. font-size: 14px;
  2986. font-weight: 600;
  2987. color: #ffffff;
  2988. letter-spacing: 0.5px;
  2989. }
  2990. .item-count {
  2991. margin-left: auto;
  2992. font-size: 12px;
  2993. color: #ffffff;
  2994. background: rgba(255, 255, 255, 0.25);
  2995. padding: 2px 10px;
  2996. border-radius: 12px;
  2997. font-weight: 500;
  2998. }
  2999. /* 表格样式优化 */
  3000. .operation-table {
  3001. border: none !important;
  3002. }
  3003. .operation-table /deep/ .el-table__body tr:hover > td {
  3004. background-color: #f0f7ff !important;
  3005. }
  3006. .operation-table /deep/ .el-table__row.current-row > td {
  3007. background-color: #e6f2ff !important;
  3008. }
  3009. .operation-table /deep/ td {
  3010. border-bottom: 1px solid #f0f0f0;
  3011. }
  3012. .operation-table /deep/ .el-table__body {
  3013. font-size: 13px;
  3014. }
  3015. /* 操作按钮区域 */
  3016. .operation-buttons {
  3017. display: flex;
  3018. flex-direction: column;
  3019. justify-content: center;
  3020. align-items: center;
  3021. gap: 20px;
  3022. padding: 0 8px;
  3023. }
  3024. .operation-buttons .el-button {
  3025. width: 48px;
  3026. height: 48px;
  3027. font-size: 20px;
  3028. transition: all 0.3s ease;
  3029. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  3030. }
  3031. .operation-buttons .el-button:hover {
  3032. transform: scale(1.1);
  3033. box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  3034. }
  3035. .operation-buttons .el-button.is-disabled {
  3036. opacity: 0.4;
  3037. cursor: not-allowed;
  3038. }
  3039. .operation-buttons .el-button--primary {
  3040. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  3041. border: none;
  3042. }
  3043. .operation-buttons .el-button--danger {
  3044. background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  3045. border: none;
  3046. }
  3047. /* ==================== 模板导入对话框样式 ==================== */
  3048. /deep/ .template-import-dialog {
  3049. border-radius: 8px;
  3050. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  3051. }
  3052. /deep/ .template-import-dialog .el-dialog__header {
  3053. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  3054. padding: 20px 24px;
  3055. border-radius: 8px 8px 0 0;
  3056. }
  3057. /deep/ .template-import-dialog .el-dialog__title {
  3058. color: #ffffff;
  3059. font-size: 16px;
  3060. font-weight: 600;
  3061. letter-spacing: 0.5px;
  3062. }
  3063. /deep/ .template-import-dialog .el-dialog__headerbtn .el-dialog__close {
  3064. color: #ffffff;
  3065. font-size: 20px;
  3066. font-weight: bold;
  3067. }
  3068. /deep/ .template-import-dialog .el-dialog__headerbtn:hover .el-dialog__close {
  3069. color: #f0f0f0;
  3070. }
  3071. /deep/ .template-import-dialog .el-dialog__body {
  3072. padding: 24px;
  3073. background: #f8f9fa;
  3074. }
  3075. /* 模板列表容器 */
  3076. .template-list-container {
  3077. background: #ffffff;
  3078. border-radius: 6px;
  3079. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  3080. overflow: hidden;
  3081. transition: all 0.3s ease;
  3082. }
  3083. .template-list-container:hover {
  3084. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  3085. }
  3086. /* 模板表格 */
  3087. .template-table {
  3088. border: none !important;
  3089. }
  3090. .template-table /deep/ .el-table__body tr:hover > td {
  3091. background-color: #f0f7ff !important;
  3092. }
  3093. .template-table /deep/ .el-table__row.current-row > td {
  3094. background-color: #e6f2ff !important;
  3095. }
  3096. .template-table /deep/ td {
  3097. border-bottom: 1px solid #f0f0f0;
  3098. }
  3099. .template-table /deep/ .el-table__body {
  3100. font-size: 13px;
  3101. }
  3102. </style>