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.

4590 lines
167 KiB

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