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.

4670 lines
170 KiB

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