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.

2490 lines
88 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 收藏 -->
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  9. <!-- 条件查询 -->
  10. <el-form :inline="true" label-position="top" :model="searchData" >
  11. <el-form-item :label="'检验单号'">
  12. <el-input v-model="searchData.inspectionNo" clearable style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'物料编码'">
  15. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="'状态'">
  18. <el-select v-model="searchData.state" style="width: 100px">
  19. <el-option label="全部" value=""></el-option>
  20. <el-option label="待检验" value="待检验"></el-option>
  21. <el-option label="待审核" value="待审核"></el-option>
  22. <el-option label="已完成" value="已完成"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item :label="'检验结论'">
  26. <el-select v-model="searchData.inspectionResult" style="width: 100px">
  27. <el-option label="全部" value=""></el-option>
  28. <el-option label="合格" value="合格"></el-option>
  29. <el-option label="不合格" value="不合格"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item :label="'检验类型'">
  33. <el-select v-model="searchData.inspectionTypeNo" style="width: 100px">
  34. <el-option label="全部" value=""></el-option>
  35. <el-option label="IPQC首检" value="101"></el-option>
  36. <el-option label="IPQC自检" value="102"></el-option>
  37. <el-option label="IPQC巡检" value="103"></el-option>
  38. <el-option label="IPQC末件检" value="104"></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item :label="'工单号'">
  42. <el-input v-model="searchData.orderNo" clearable style="width: 120px"></el-input>
  43. </el-form-item>
  44. </el-form>
  45. <el-form :inline="true" label-position="top" :model="searchData">
  46. <el-form-item :label="'工序'">
  47. <el-input v-model="searchData.operationDesc" clearable style="width: 120px"></el-input>
  48. </el-form-item>
  49. <el-form-item :label="'检验时间:'">
  50. <el-date-picker style="width: 150px" v-model="searchData.startDate" type="datetime" value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="开始日期"></el-date-picker>
  51. -
  52. <el-date-picker style="width: 150px" v-model="searchData.endDate" type="datetime" value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="结束日期"></el-date-picker>
  53. </el-form-item>
  54. <el-form-item :label="' '">
  55. <el-button type="primary" @click="getDataList()">查询</el-button>
  56. <el-button type="primary" @click="addModal()">新增</el-button>
  57. <el-button type="primary" @click="submitResult()">审核</el-button>
  58. <el-button type="primary" @click="deleteModal()">删除</el-button>
  59. <download-excel
  60. :fields="fields()"
  61. :data="exportData"
  62. type="xls"
  63. :name="exportName"
  64. :header="exportHeader"
  65. :footer="exportFooter"
  66. :fetch="createExportData"
  67. :before-generate="startDownload"
  68. :before-finish="finishDownload"
  69. worksheet="导出信息"
  70. class="el-button el-button--primary el-button--medium">
  71. {{ "导出" }}
  72. </download-excel>
  73. </el-form-item>
  74. </el-form>
  75. <!-- 检验记录展示列表 -->
  76. <el-table
  77. :height="height"
  78. :data="dataList"
  79. border
  80. ref="IPQCTable"
  81. @row-click="IPQCClickRow"
  82. @selection-change="selectionIPQC"
  83. v-loading="dataListLoading"
  84. style="width: 100%;">
  85. <el-table-column
  86. type="selection"
  87. header-align="center"
  88. align="center"
  89. :selectable="selectFlag"
  90. width="50">
  91. </el-table-column>
  92. <el-table-column
  93. prop="state"
  94. header-align="center"
  95. align="center"
  96. label="状态">
  97. <template slot-scope="scope">
  98. <div :style="{fontWeight:'bold', color: scope.row.state =='待检验' ? 'red' : scope.row.state =='待审核' ? '#ffa500e0' : scope.row.state =='已完成' ? '#3ac252' : ''}">
  99. {{ scope.row.state }}
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. v-for="(item,index) in columnList" :key="index"
  105. :sortable="item.columnSortable"
  106. :prop="item.columnProp"
  107. :header-align="item.headerAlign"
  108. :show-overflow-tooltip="item.showOverflowTooltip"
  109. :align="item.align"
  110. :fixed="item.fixed==''?false:item.fixed"
  111. :min-width="item.columnWidth"
  112. :label="item.columnLabel">
  113. <template slot-scope="scope">
  114. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  115. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. fixed="right"
  120. header-align="center"
  121. align="center"
  122. width="120"
  123. label="操作">
  124. <template slot-scope="scope">
  125. <a type="text" size="small" @click="detailModal(scope.row)">检验单</a>
  126. <a type="text" size="small" @click="getFileContentData(scope.row)">工作文件</a>
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. <!-- 分页-->
  131. <el-pagination
  132. @size-change="sizeChangeHandle"
  133. @current-change="currentChangeHandle"
  134. :current-page="pageIndex"
  135. :page-sizes="[20, 50, 100, 200, 500]"
  136. :page-size="pageSize"
  137. :total="totalPage"
  138. layout="total, sizes, prev, pager, next, jumper">
  139. </el-pagination>
  140. <!-- 新增巡检记录 -->
  141. <el-dialog title="新增巡检记录" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px">
  142. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  143. <el-form-item label="标签号">
  144. <!-- <el-autocomplete v-if="this.modalData.specialTaskFlag === 'Y'" disabled style="width: 456px" size="mini" v-model="modalData.rollNo" clearable-->
  145. <!-- :fetch-suggestions="querySearchAsync" @select="handleSelect"-->
  146. <!-- placeholder="请输入标签号">-->
  147. <!-- </el-autocomplete>-->
  148. <!-- <el-autocomplete v-if="this.modalData.specialTaskFlag !== 'Y'" style="width: 456px" size="mini" v-model="modalData.rollNo" clearable-->
  149. <!-- :fetch-suggestions="querySearchAsync" @select="handleSelect"-->
  150. <!-- placeholder="请输入标签号">-->
  151. <!-- </el-autocomplete>-->
  152. <el-input v-if="this.modalData.specialTaskFlag === 'Y'" disabled v-model="modalData.rollNo" style="width: 456px"></el-input>
  153. <el-input v-if="this.modalData.specialTaskFlag !== 'Y'" v-model="modalData.rollNo" @keyup.native.enter="rollNoEnter" clearable style="width: 456px"></el-input>
  154. </el-form-item>
  155. </el-form>
  156. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  157. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && (this.modalData.rollNo == '' || this.modalData.rollNo == null)" prop="orderNo" :rules="rules.seqNoType">
  158. <span slot="label" @click="getBaseList(1052)"><a herf="#">派工单号</a></span>
  159. <el-input v-model="modalData.seqNo" style="width: 221px"></el-input>
  160. </el-form-item>
  161. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && this.modalData.rollNo != '' && this.modalData.rollNo != null" prop="orderNo" :rules="rules.seqNoType">
  162. <span slot="label">派工单号</span>
  163. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  164. </el-form-item>
  165. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" prop="orderNo" :rules="rules.seqNoType">
  166. <span slot="label">派工单号</span>
  167. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  168. </el-form-item>
  169. <el-form-item label="工单号" prop="orderNo" :rules="rules.orderNoType">
  170. <el-input v-model="modalData.orderNo" style="width: 221px" disabled></el-input>
  171. </el-form-item>
  172. </el-form>
  173. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  174. <el-form-item label="工序" prop="operationDesc" :rules="rules.operationDescType">
  175. <el-select v-model="modalData.operationDesc" placeholder="请选择" style="width: 221px">
  176. <el-option
  177. v-for = "i in operationList"
  178. :key = "i.operationNo"
  179. :label = "i.operationDesc"
  180. :value = "i.operationDesc">
  181. </el-option>
  182. </el-select>
  183. <!-- <el-input v-model="modalData.operationDesc" style="width: 221px"></el-input>-->
  184. </el-form-item>
  185. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y'" label="机台" prop="resourceId" :rules="rules.resourceIdType">
  186. <!-- <el-select v-model="modalData.resourceDesc" placeholder="请选择" style="width: 221px">-->
  187. <!-- <el-option-->
  188. <!-- v-for = "i in resourceList"-->
  189. <!-- :key = "i.resourceId"-->
  190. <!-- :label = "i.resourceDesc"-->
  191. <!-- :value = "i.resourceId">-->
  192. <!-- </el-option>-->
  193. <!-- </el-select>-->
  194. <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>
  195. </el-form-item>
  196. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'">
  197. <span slot="label" @click="getBaseList(205)"><a herf="#">机台</a></span>
  198. <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>
  199. </el-form-item>
  200. </el-form>
  201. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  202. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y'" label="物料编码" prop="partNo" :rules="rules.partNoType">
  203. <el-input v-model="modalData.partNo" readonly style="width: 221px"></el-input>
  204. </el-form-item>
  205. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" :model="modalData">
  206. <span slot="label" @click="queryPartList()"><a herf="#">物料编码</a></span>
  207. <el-input v-model="modalData.partNo" style="width: 221px"></el-input>
  208. </el-form-item>
  209. <el-form-item label="物料名称">
  210. <el-input v-model="modalData.partDesc" readonly style="width: 221px"></el-input>
  211. </el-form-item>
  212. </el-form>
  213. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  214. <el-form-item label="物料类别">
  215. <el-input v-model="modalData.spec" readonly style="width: 221px"></el-input>
  216. </el-form-item>
  217. <el-form-item label="SKU">
  218. <el-input v-model="modalData.sku" readonly style="width: 221px"></el-input>
  219. </el-form-item>
  220. </el-form>
  221. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  222. <el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
  223. <el-select v-model="modalData.inspectionTypeNo" style="width: 221px">
  224. <el-option label="首件检" value="首件检"></el-option>
  225. <el-option label="自检" value="自检"></el-option>
  226. <el-option label="巡检" value="巡检"></el-option>
  227. <el-option label="末件检" value="末件检"></el-option>
  228. </el-select>
  229. </el-form-item>
  230. <el-form-item label="送检数量" prop="rollQty" :rules="rules.rollQtyType">
  231. <el-input v-model="modalData.rollQty" type="number" style="width: 221px"></el-input>
  232. </el-form-item>
  233. </el-form>
  234. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  235. <el-form-item>
  236. <span v-if="this.controlData.baseData === '控制'" slot="label" @click="queryTemplateList()"><a>检验模板</a></span>
  237. <span v-if="this.controlData.baseData === '未控制'" slot="label">检验模板</span>
  238. <el-input v-model="modalData.templateName" disabled style="width: 221px"></el-input>
  239. </el-form-item>
  240. <el-form-item label="无工单检验">
  241. <input type="checkbox" name="specialTask" v-model="checked" @click="changeSpecialTask()"/>
  242. </el-form-item>
  243. </el-form>
  244. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  245. <el-form-item label="老卷号">
  246. <el-input v-model="modalData.batchRollNo" style="width: 456px"></el-input>
  247. </el-form-item>
  248. </el-form>
  249. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  250. <el-form-item label="特殊要求">
  251. <el-input type="textarea" v-model="modalData.specialRequirements" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 456px;height: 30px"></el-input>
  252. </el-form-item>
  253. </el-form>
  254. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  255. <el-button type="primary" @click="saveData()">保存</el-button>
  256. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  257. </el-footer>
  258. </el-dialog>
  259. <!-- 检验单详情页 -->
  260. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1200px">
  261. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  262. <el-form-item :label="'物料编码'">
  263. <el-input v-model="detailData.partNo" readonly style="width: 100px"></el-input>
  264. </el-form-item>
  265. <el-form-item :label="'物料类别'">
  266. <el-input v-model="detailData.spec" readonly style="width: 200px"></el-input>
  267. </el-form-item>
  268. <el-form-item :label="'PN'">
  269. <el-input v-model="detailData.cinvSourceCode" readonly style="width: 100px"></el-input>
  270. </el-form-item>
  271. <el-form-item :label="'SKU'">
  272. <el-input v-model="detailData.sku" readonly style="width: 100px"></el-input>
  273. </el-form-item>
  274. <el-form-item :label="'物料名称'">
  275. <el-input v-model="detailData.partDesc" readonly style="width: 200px"></el-input>
  276. </el-form-item>
  277. <el-form-item :label="'送检数量'">
  278. <el-input v-model="detailData.rollQty" type="number" style="width: 80px"></el-input>
  279. </el-form-item>
  280. <el-form-item :label="'抽样数量'">
  281. <el-input v-model="detailData.samplingQty" type="number" style="width: 80px"></el-input>
  282. </el-form-item>
  283. </el-form>
  284. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  285. <el-form-item :label="'不合格项目数量'">
  286. <el-input v-if="detailData.submitFlag == 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
  287. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
  288. </el-form-item>
  289. <el-form-item :label="'处置措施'">
  290. <el-select v-if="detailData.submitFlag == 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
  291. <el-option
  292. v-for = "i in disposalMeasuresOptions"
  293. :key = "i.id"
  294. :label = "i.disposalMeasures"
  295. :value = "i.disposalMeasures">
  296. </el-option>
  297. </el-select>
  298. <el-select v-if="detailData.submitFlag != 'Y'" clearable v-model="detailData.disposalMeasures" style="width: 100px">
  299. <el-option
  300. v-for = "i in disposalMeasuresOptions"
  301. :key = "i.id"
  302. :label = "i.disposalMeasures"
  303. :value = "i.disposalMeasures">
  304. </el-option>
  305. </el-select>
  306. </el-form-item>
  307. <el-form-item :label="'处置说明'">
  308. <el-input v-if="detailData.submitFlag == 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
  309. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalRemark" style="width: 200px"></el-input>
  310. </el-form-item>
  311. <el-form-item :label="'检验结论'">
  312. <el-select v-if="detailData.submitFlag == 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  313. <el-option label="合格" value="合格"></el-option>
  314. <el-option label="不合格" value="不合格"></el-option>
  315. </el-select>
  316. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionResult" style="width: 100px" placeholder="请选择">
  317. <el-option label="合格" value="合格"></el-option>
  318. <el-option label="不合格" value="不合格"></el-option>
  319. </el-select>
  320. </el-form-item>
  321. <el-form-item label="检验员">
  322. <el-select v-if="detailData.submitFlag == 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  323. <el-option
  324. v-for = "i in options"
  325. :key = "i.inspectorNo"
  326. :label = "i.inspectorName"
  327. :value = "i.inspectorNo">
  328. </el-option>
  329. </el-select>
  330. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  331. <el-option
  332. v-for = "i in options"
  333. :key = "i.inspectorNo"
  334. :label = "i.inspectorName"
  335. :value = "i.inspectorNo">
  336. </el-option>
  337. </el-select>
  338. </el-form-item>
  339. <el-form-item :label="'质检备注'">
  340. <el-input v-if="detailData.submitFlag == 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 200px"></el-input>
  341. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionRemark" style="width: 200px"></el-input>
  342. </el-form-item>
  343. <el-form-item :label="' '">
  344. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  345. </el-form-item>
  346. <el-form-item :label="' '"></el-form-item>
  347. </el-form>
  348. <!-- 展示列表 -->
  349. <div class="rq ">
  350. <el-table
  351. :height="500"
  352. :data="detailList"
  353. border
  354. v-loading="dataListLoading"
  355. style="width: 100%;">
  356. <el-table-column
  357. prop=""
  358. header-align="center"
  359. align="center"
  360. min-width="40"
  361. label="操作">
  362. <template slot-scope="scope">
  363. <el-button class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  364. </template>
  365. </el-table-column>
  366. <el-table-column
  367. v-for="(item,index) in detailColumnList" :key="index"
  368. :sortable="item.columnSortable"
  369. :prop="item.columnProp"
  370. :header-align="item.headerAlign"
  371. :show-overflow-tooltip="item.showOverflowTooltip"
  372. :align="item.align"
  373. :fixed="item.fixed==''?false:item.fixed"
  374. :min-width="item.columnWidth"
  375. :label="item.columnLabel">
  376. <template slot-scope="scope">
  377. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  378. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  379. </template>
  380. </el-table-column>
  381. <el-table-column
  382. prop=""
  383. header-align="center"
  384. align="center"
  385. min-width="80"
  386. label="子明细">
  387. <template slot-scope="scope">
  388. <el-button v-if="scope.row.subDetailRecordNum <= 0" type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  389. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
  390. </template>
  391. </el-table-column>
  392. <el-table-column
  393. prop=""
  394. header-align="center"
  395. align="right"
  396. min-width="80"
  397. label="抽样数量">
  398. <template slot-scope="scope">
  399. <el-input v-if="detailData.submitFlag == 'Y'" v-model="scope.row.samplingQty" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  400. <el-input v-if="detailData.submitFlag != 'Y'" v-model="scope.row.samplingQty" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  401. </template>
  402. </el-table-column>
  403. <el-table-column
  404. prop=""
  405. header-align="center"
  406. align="right"
  407. min-width="80"
  408. label="不合格数量">
  409. <template slot-scope="scope">
  410. <el-input v-if="detailData.submitFlag == 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  411. <el-input v-if="detailData.submitFlag != 'Y'" v-model="scope.row.unqualifiedQuantity" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  412. </template>
  413. </el-table-column>
  414. <el-table-column
  415. prop=""
  416. header-align="center"
  417. align="right"
  418. min-width="75"
  419. label="项目检验结论">
  420. <template slot-scope="scope">
  421. <el-select v-if="detailData.submitFlag == 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px">
  422. <el-option label="合格" value="Y" style="color: green"></el-option>
  423. <el-option label="不合格" value="N" style="color: red"></el-option>
  424. </el-select>
  425. <el-select v-if="detailData.submitFlag != 'Y'" v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  426. <el-option label="合格" value="Y" style="color: green"></el-option>
  427. <el-option label="不合格" value="N" style="color: red"></el-option>
  428. </el-select>
  429. </template>
  430. </el-table-column>
  431. </el-table>
  432. </div>
  433. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  434. <el-button type="primary" @click="Transfer()">保存</el-button>
  435. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  436. </el-footer>
  437. </el-dialog>
  438. <!-- 子明细信息 -->
  439. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="572px">
  440. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  441. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  442. <el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
  443. <div class="rq ">
  444. <el-table
  445. :height="400"
  446. :data="tableData"
  447. border
  448. :row-class-name="rowClassName"
  449. @selection-change="handleDetailSelectionChange"
  450. style="width: 100%;">
  451. <el-table-column type="selection" align="center" width="50"></el-table-column>
  452. <el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
  453. <el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150">
  454. <template slot-scope="{row}">
  455. <el-input v-if="tableData[row.xh-1].isSubmit=='Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
  456. <el-input :ref="`${row.xh-1}` + `a`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
  457. </template>
  458. </el-table-column>
  459. <el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150">
  460. <template slot-scope="{row}">
  461. <el-input v-if="tableData[row.xh-1].isSubmit=='Y'" v-model="tableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
  462. <el-input :ref="`${row.xh-1}` + `b`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
  463. </template>
  464. </el-table-column>
  465. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="150">
  466. <template slot-scope="{row}">
  467. <el-input v-if="tableData[row.xh-1].isSubmit=='Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  468. <el-input :ref="`${row.xh-1}` + `c`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值"></el-input>
  469. </template>
  470. </el-table-column>
  471. </el-table>
  472. </div>
  473. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  474. <el-button type="primary" @click="saveSubDetailResult()">保存</el-button>
  475. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  476. </el-footer>
  477. </el-dialog>
  478. <!-- 批量新增子明细操作-->
  479. <el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
  480. <el-form :inline="true" label-position="top">
  481. <el-form-item :label="'默认抽样位置A'">
  482. <el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
  483. </el-form-item>
  484. <el-form-item :label="'默认抽样位置B'">
  485. <el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
  486. </el-form-item>
  487. <el-form-item :label="'抽样数量'">
  488. <el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
  489. </el-form-item>
  490. </el-form>
  491. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  492. <el-button type="primary" @click="batchHandleAddModal()">保存</el-button>
  493. <el-button type="primary" @click="batchHandleAddModalFlag=false">关闭</el-button>
  494. </el-footer>
  495. </el-dialog>
  496. <!-- 检验模板 -->
  497. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="templateModelFlag" width="520px">
  498. <div class="rq">
  499. <el-form :inline="true" label-position="top" :model="templateData">
  500. <el-form-item :label="'模板编码'">
  501. <el-input v-model="templateData.templateId" clearable style="width: 120px"></el-input>
  502. </el-form-item>
  503. <el-form-item :label="'模板名称'">
  504. <el-input v-model="templateData.templateName" clearable style="width: 120px"></el-input>
  505. </el-form-item>
  506. <el-form-item :label="'检验类型'">
  507. <el-select v-model="templateData.inspectionTypeNo" style="width: 100px">
  508. <el-option
  509. v-for = "i in typeOptions"
  510. :key = "i.inspectionTypeNo"
  511. :label = "i.inspectionTypeName"
  512. :value = "i.inspectionTypeNo">
  513. </el-option>
  514. </el-select>
  515. </el-form-item>
  516. <el-form-item :label="' '">
  517. <el-button type="primary" @click="queryTemplateList()">查询</el-button>
  518. </el-form-item>
  519. </el-form>
  520. <el-table
  521. :height="300"
  522. :data="templateList"
  523. @row-dblclick="getRowData"
  524. border
  525. v-loading="dataListLoading"
  526. style="width: 100%;">
  527. <el-table-column
  528. v-for="(item,index) in templateDetailList" :key="index"
  529. :sortable="item.columnSortable"
  530. :prop="item.columnProp"
  531. :header-align="item.headerAlign"
  532. :show-overflow-tooltip="item.showOverflowTooltip"
  533. :align="item.align"
  534. :fixed="item.fixed==''?false:item.fixed"
  535. :min-width="item.columnWidth"
  536. :label="item.columnLabel">
  537. <template slot-scope="scope">
  538. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  539. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  540. </template>
  541. </el-table-column>
  542. </el-table>
  543. </div>
  544. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  545. <el-button type="primary" @click="templateModelFlag=false">关闭</el-button>
  546. </el-footer>
  547. </el-dialog>
  548. <!-- 物料 -->
  549. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="520px">
  550. <div class="rq">
  551. <el-form :inline="true" label-position="top" :model="partData">
  552. <el-form-item :label="'物料编码'">
  553. <el-input v-model="partData.partNo" clearable style="width: 120px"></el-input>
  554. </el-form-item>
  555. <el-form-item :label="'物料名称'">
  556. <el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
  557. </el-form-item>
  558. <el-form-item :label="'SKU'">
  559. <el-input v-model="partData.sku" clearable style="width: 120px"></el-input>
  560. </el-form-item>
  561. <el-form-item :label="' '">
  562. <el-button type="primary" @click="queryPartList()">查询</el-button>
  563. </el-form-item>
  564. </el-form>
  565. <el-table
  566. :height="300"
  567. :data="partList"
  568. @row-dblclick="getRowData2"
  569. border
  570. v-loading="dataListLoading"
  571. style="width: 100%;">
  572. <el-table-column
  573. v-for="(item,index) in partDetailList" :key="index"
  574. :sortable="item.columnSortable"
  575. :prop="item.columnProp"
  576. :header-align="item.headerAlign"
  577. :show-overflow-tooltip="item.showOverflowTooltip"
  578. :align="item.align"
  579. :fixed="item.fixed==''?false:item.fixed"
  580. :min-width="item.columnWidth"
  581. :label="item.columnLabel">
  582. <template slot-scope="scope">
  583. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  584. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  585. </template>
  586. </el-table-column>
  587. </el-table>
  588. </div>
  589. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  590. <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
  591. </el-footer>
  592. </el-dialog>
  593. <!-- 文件清单 -->
  594. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  595. <el-table
  596. :height="350"
  597. :data="fileContentList"
  598. border
  599. v-loading="dataListLoading"
  600. style="width: 100%; ">
  601. <el-table-column
  602. v-for="(item,index) in fileColumnList" :key="index"
  603. :sortable="item.columnSortable"
  604. :prop="item.columnProp"
  605. :header-align="item.headerAlign"
  606. :show-overflow-tooltip="item.showOverflowTooltip"
  607. :align="item.align"
  608. :fixed="item.fixed==''?false:item.fixed"
  609. :min-width="item.columnWidth"
  610. :label="item.columnLabel">
  611. <template slot-scope="scope">
  612. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  613. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  614. </template>
  615. </el-table-column>
  616. <el-table-column
  617. fixed="right"
  618. header-align="center"
  619. align="center"
  620. width="100"
  621. label="操作">
  622. <template slot-scope="scope">
  623. <a @click="downloadFile(scope.row)" >下载</a>
  624. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  625. </template>
  626. </el-table-column>
  627. </el-table>
  628. </el-dialog>
  629. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  630. <!-- 上传文件的modal -->
  631. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="getDataList()" v-drag></qcFAIUploadFile>
  632. <!-- 上传文件的modal -->
  633. <comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData()" v-drag></comQcItemImageUploadFile>
  634. </div>
  635. </template>
  636. <script>
  637. import {
  638. qcIPQCInspectionSearch, // 查询IPQC的检验记录
  639. ipqcDetailSearch, // 查询IPQC的检验明细
  640. inspectorSearch, // 查询检验员
  641. ipqcRecordDelete, // 删除检验记录
  642. saveIPQCDetailedRecord, // 新增明细信息
  643. saveIPQCSubmitResult, // 审核
  644. saveIPQCSubDetailed, // 新增子明细信息
  645. selectIPQCSubDetailedRecord, // 子明细记录信息查询
  646. checkIPQCIsSubmit, // 检查是否已提交
  647. getOperationList, // 查询工序列表
  648. getResourceList, // 查询机台列表
  649. getPartList, // 查询物料列表
  650. saveOsInspection, // 新增检验记录
  651. queryController, // 检查动控
  652. queryTemplateList, // 获取检验模板列表
  653. getPartInformation, // 获取物料信息
  654. getSpecialOperationList, // 获取特殊工序列表
  655. InspectionTypeSearch, // 搜索所有检验类型
  656. disposalMeasuresSearch, // 获取处置措施列表
  657. getRollNo, // 模糊查询标签号
  658. rollNoEnter, // 标签号回车事件
  659. queryPartList // 查询物料集合
  660. } from "@/api/qc/qc.js"
  661. import Chooselist from '@/views/modules/common/Chooselist_eam'
  662. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  663. import {deleteObjectFile} from '@/api/eam/eam.js'
  664. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  665. import qcFAIUploadFile from "./qc_FAI_upload_file"
  666. import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
  667. /*上传文件的組件*/
  668. export default {
  669. components: {
  670. Chooselist,
  671. qcFAIUploadFile,
  672. comQcItemImageUploadFile
  673. },
  674. data () {
  675. return {
  676. inspectionNo: '',
  677. fileFlag: false,
  678. fileContentList: [],
  679. // 是否收藏
  680. favorite: false,
  681. // 导出 start
  682. exportData: [],
  683. exportName: "IPQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  684. exportHeader: ["IPQC检验录入"],
  685. exportFooter: [],
  686. exportList:[],
  687. // 导出 end
  688. checkCompletedData:{
  689. inspectionNo: ''
  690. },
  691. submitData:{
  692. site: this.$store.state.user.site,
  693. inspectionNo: '',
  694. submit_flag: '',
  695. inspectionResult: '',
  696. submitList: [],
  697. },
  698. tagNo:'',
  699. searchData: {
  700. site: this.$store.state.user.site,
  701. inspectionNo: '',
  702. state: '',
  703. inspectionResult: '',
  704. orderNo: '',
  705. operationDesc: '',
  706. startDate: '',
  707. endDate: '',
  708. inspectionTypeNo: '',
  709. partNo: '',
  710. page: 1,
  711. limit: 10,
  712. },
  713. pageIndex: 1,
  714. pageSize: 50,
  715. totalPage: 0,
  716. height: 200,
  717. dataList: [],
  718. dataListLoading: false,
  719. dataListSelections: [],
  720. modalData: {
  721. flag:'',
  722. site: this.$store.state.user.site,
  723. inspectionNo:'',
  724. partNo: '',
  725. partDesc: '',
  726. inspectionTypeNo:'',
  727. inspectionTypeName:'',
  728. inspectorNo:'',
  729. inspectorName:'',
  730. submit_flag:'',
  731. orderNo: '',
  732. operationDesc: '',
  733. operationNo: '',
  734. resourceId: '',
  735. resourceDesc: '',
  736. rollQty: '',
  737. seqNo: '',
  738. batchRollNo: '',
  739. spec: '',
  740. sku: '',
  741. specialRequirements: '',
  742. templateId: '',
  743. templateName: '',
  744. specialTaskFlag: '',
  745. workCenterNo: '',
  746. rollNo: ''
  747. },
  748. // 展示列集
  749. columnList: [
  750. {
  751. columnProp: 'inspectionNo',
  752. headerAlign: "center",
  753. align: "center",
  754. columnLabel: '检验单号',
  755. columnHidden: false,
  756. columnImage: false,
  757. columnSortable: false,
  758. sortLv: 0,
  759. status: true,
  760. fixed: '',
  761. columnWidth: 120,
  762. },
  763. {
  764. columnProp: 'batchRollNo',
  765. headerAlign: "center",
  766. align: "center",
  767. columnLabel: '老卷号',
  768. columnHidden: false,
  769. columnImage: false,
  770. columnSortable: false,
  771. sortLv: 0,
  772. status: true,
  773. fixed: '',
  774. columnWidth: 100,
  775. },
  776. {
  777. columnProp: 'rollNo',
  778. headerAlign: "center",
  779. align: "center",
  780. columnLabel: '标签条码',
  781. columnHidden: false,
  782. columnImage: false,
  783. columnSortable: false,
  784. sortLv: 0,
  785. status: true,
  786. fixed: '',
  787. columnWidth: 100,
  788. },
  789. {
  790. columnProp: 'inspectionResult',
  791. headerAlign: "center",
  792. align: "center",
  793. columnLabel: '检验结论',
  794. columnHidden: false,
  795. columnImage: false,
  796. columnSortable: false,
  797. sortLv: 0,
  798. status: true,
  799. fixed: '',
  800. columnWidth: 80,
  801. },
  802. {
  803. columnProp: 'disposalMeasures',
  804. headerAlign: "center",
  805. align: "center",
  806. columnLabel: '处置措施',
  807. columnHidden: false,
  808. columnImage: false,
  809. columnSortable: false,
  810. sortLv: 0,
  811. status: true,
  812. fixed: '',
  813. columnWidth: 100,
  814. },
  815. {
  816. columnProp: 'inspectionTypeNo',
  817. headerAlign: "center",
  818. align: "center",
  819. columnLabel: '检验类型',
  820. columnHidden: false,
  821. columnImage: false,
  822. columnSortable: false,
  823. sortLv: 0,
  824. status: true,
  825. fixed: '',
  826. columnWidth: 80,
  827. },
  828. {
  829. columnProp: 'taskDate',
  830. headerAlign: "center",
  831. align: "center",
  832. columnLabel: '任务生成日期',
  833. columnHidden: false,
  834. columnImage: false,
  835. columnSortable: false,
  836. sortLv: 0,
  837. status: true,
  838. fixed: '',
  839. columnWidth: 120,
  840. },
  841. {
  842. columnProp: 'inspectionCycle',
  843. headerAlign: "center",
  844. align: "right",
  845. columnLabel: '检验周期(h)',
  846. columnHidden: false,
  847. columnImage: false,
  848. columnSortable: false,
  849. sortLv: 0,
  850. status: true,
  851. fixed: '',
  852. columnWidth: 80,
  853. },
  854. {
  855. columnProp: 'orderNo',
  856. headerAlign: "center",
  857. align: "center",
  858. columnLabel: '工单号',
  859. columnHidden: false,
  860. columnImage: false,
  861. columnSortable: false,
  862. sortLv: 0,
  863. status: true,
  864. fixed: '',
  865. columnWidth: 120,
  866. },
  867. {
  868. columnProp: 'seqNo',
  869. headerAlign: "center",
  870. align: "center",
  871. columnLabel: '派工单号',
  872. columnHidden: false,
  873. columnImage: false,
  874. columnSortable: false,
  875. sortLv: 0,
  876. status: true,
  877. fixed: '',
  878. columnWidth: 150,
  879. },
  880. {
  881. columnProp: 'operationDesc',
  882. headerAlign: "center",
  883. align: "center",
  884. columnLabel: '工序',
  885. columnHidden: false,
  886. columnImage: false,
  887. columnSortable: false,
  888. sortLv: 0,
  889. status: true,
  890. fixed: '',
  891. columnWidth: 100,
  892. },
  893. {
  894. columnProp: 'resourceDesc',
  895. headerAlign: "center",
  896. align: "center",
  897. columnLabel: '机台',
  898. columnHidden: false,
  899. columnImage: false,
  900. columnSortable: false,
  901. sortLv: 0,
  902. status: true,
  903. fixed: '',
  904. columnWidth: 100,
  905. },
  906. {
  907. columnProp: 'partNo',
  908. headerAlign: "center",
  909. align: "center",
  910. columnLabel: '物料编码',
  911. columnHidden: false,
  912. columnImage: false,
  913. columnSortable: false,
  914. sortLv: 0,
  915. status: true,
  916. fixed: '',
  917. columnWidth: 100,
  918. },
  919. {
  920. columnProp: 'spec',
  921. headerAlign: "center",
  922. align: "center",
  923. columnLabel: '物料类别',
  924. columnHidden: false,
  925. columnImage: false,
  926. columnSortable: false,
  927. sortLv: 0,
  928. status: true,
  929. fixed: '',
  930. columnWidth: 150,
  931. },
  932. {
  933. columnProp: 'cinvSourceCode',
  934. headerAlign: "center",
  935. align: "center",
  936. columnLabel: 'PN',
  937. columnHidden: false,
  938. columnImage: false,
  939. columnSortable: false,
  940. sortLv: 0,
  941. status: true,
  942. fixed: '',
  943. columnWidth: 100,
  944. },
  945. {
  946. columnProp: 'sku',
  947. headerAlign: "center",
  948. align: "center",
  949. columnLabel: 'SKU',
  950. columnHidden: false,
  951. columnImage: false,
  952. columnSortable: false,
  953. sortLv: 0,
  954. status: true,
  955. fixed: '',
  956. columnWidth: 100,
  957. },
  958. {
  959. columnProp: 'partDesc',
  960. headerAlign: "center",
  961. align: "center",
  962. columnLabel: '物料名称',
  963. columnHidden: false,
  964. columnImage: false,
  965. columnSortable: false,
  966. sortLv: 0,
  967. status: true,
  968. fixed: '',
  969. columnWidth: 150,
  970. },
  971. {
  972. columnProp: 'rollQty',
  973. headerAlign: "center",
  974. align: "right",
  975. columnLabel: '送检数量',
  976. columnHidden: false,
  977. columnImage: false,
  978. columnSortable: false,
  979. sortLv: 0,
  980. status: true,
  981. fixed: '',
  982. columnWidth: 80,
  983. },
  984. {
  985. columnProp: 'samplingQty',
  986. headerAlign: "center",
  987. align: "right",
  988. columnLabel: '抽样数量',
  989. columnHidden: false,
  990. columnImage: false,
  991. columnSortable: false,
  992. sortLv: 0,
  993. status: true,
  994. fixed: '',
  995. columnWidth: 80,
  996. },
  997. {
  998. columnProp: 'inspectionRemark',
  999. headerAlign: "center",
  1000. align: "center",
  1001. columnLabel: '质检备注',
  1002. columnHidden: false,
  1003. columnImage: false,
  1004. columnSortable: false,
  1005. sortLv: 0,
  1006. status: true,
  1007. fixed: '',
  1008. columnWidth: 120,
  1009. },
  1010. {
  1011. columnProp: 'disposalRemark',
  1012. headerAlign: "center",
  1013. align: "center",
  1014. columnLabel: '处置说明',
  1015. columnHidden: false,
  1016. columnImage: false,
  1017. columnSortable: false,
  1018. sortLv: 0,
  1019. status: true,
  1020. fixed: '',
  1021. columnWidth: 120,
  1022. },
  1023. {
  1024. columnProp: 'inspectorDate',
  1025. headerAlign: "center",
  1026. align: "center",
  1027. columnLabel: '检验时间',
  1028. columnHidden: false,
  1029. columnImage: false,
  1030. columnSortable: false,
  1031. sortLv: 0,
  1032. status: true,
  1033. fixed: '',
  1034. columnWidth: 120,
  1035. },
  1036. {
  1037. columnProp: 'inspectorName',
  1038. headerAlign: "center",
  1039. align: "center",
  1040. columnLabel: '质检员',
  1041. columnHidden: false,
  1042. columnImage: false,
  1043. columnSortable: false,
  1044. sortLv: 0,
  1045. status: true,
  1046. fixed: '',
  1047. columnWidth: 100,
  1048. },
  1049. {
  1050. columnProp: 'specialRequirements',
  1051. headerAlign: "center",
  1052. align: "center",
  1053. columnLabel: '特殊要求',
  1054. columnHidden: false,
  1055. columnImage: false,
  1056. columnSortable: false,
  1057. sortLv: 0,
  1058. status: true,
  1059. fixed: '',
  1060. columnWidth: 120,
  1061. },
  1062. ],
  1063. //项目清单
  1064. detailData:{
  1065. site: this.$store.state.user.site,
  1066. inspectionNo:'',
  1067. partNo:'',
  1068. partDesc:'',
  1069. rollQty:'',
  1070. samplingQty: '',
  1071. unqualifiedQty: 0,
  1072. unqualifiedQuantity:'',
  1073. disposalMeasures:'',
  1074. disposalRemark: '',
  1075. inspectionResult: '',
  1076. inspectorNo: '',
  1077. inspectorName: '',
  1078. inspectionRemark: '',
  1079. submitFlag: '',
  1080. cinvSourceCode: '',
  1081. sku: '',
  1082. spec: ''
  1083. },
  1084. detailInformationFlag:false,
  1085. detailList:[],
  1086. saveInformationData:{
  1087. site: this.$store.state.user.site,
  1088. inspectionNo:'',
  1089. disposalMeasures: '',
  1090. disposalRemark: '',
  1091. inspectorNo: '',
  1092. inspectionRemark: '',
  1093. samplingQty: '',
  1094. rollQty: '',
  1095. itemList:[],
  1096. },
  1097. detailColumnList: [
  1098. {
  1099. columnProp: 'itemDesc',
  1100. headerAlign: "center",
  1101. align: "center",
  1102. columnLabel: '检验项目',
  1103. columnHidden: false,
  1104. columnImage: false,
  1105. columnSortable: false,
  1106. sortLv: 0,
  1107. status: true,
  1108. fixed: '',
  1109. },
  1110. {
  1111. columnProp: 'samplingLevelDesc',
  1112. headerAlign: "center",
  1113. align: "center",
  1114. columnLabel: '检验水平',
  1115. columnHidden: false,
  1116. columnImage: false,
  1117. columnSortable: false,
  1118. sortLv: 0,
  1119. status: true,
  1120. fixed: '',
  1121. },
  1122. {
  1123. columnProp: 'samplingProgrammeDesc',
  1124. headerAlign: "center",
  1125. align: "center",
  1126. columnLabel: '检验方案',
  1127. columnHidden: false,
  1128. columnImage: false,
  1129. columnSortable: false,
  1130. sortLv: 0,
  1131. status: true,
  1132. fixed: '',
  1133. },
  1134. {
  1135. columnProp: 'objectDesc',
  1136. headerAlign: "center",
  1137. align: "center",
  1138. columnLabel: '检测仪器',
  1139. columnHidden: false,
  1140. columnImage: false,
  1141. columnSortable: false,
  1142. sortLv: 0,
  1143. status: true,
  1144. fixed: '',
  1145. },
  1146. {
  1147. columnProp: 'aql',
  1148. headerAlign: "center",
  1149. align: "center",
  1150. columnLabel: 'AQL',
  1151. columnHidden: false,
  1152. columnImage: false,
  1153. columnSortable: false,
  1154. sortLv: 0,
  1155. status: true,
  1156. fixed: '',
  1157. },
  1158. {
  1159. columnProp: 'ac',
  1160. headerAlign: "center",
  1161. align: "center",
  1162. columnLabel: 'AC',
  1163. columnHidden: false,
  1164. columnImage: false,
  1165. columnSortable: false,
  1166. sortLv: 0,
  1167. status: true,
  1168. fixed: '',
  1169. },
  1170. {
  1171. columnProp: 're',
  1172. headerAlign: "center",
  1173. align: "center",
  1174. columnLabel: 'RE',
  1175. columnHidden: false,
  1176. columnImage: false,
  1177. columnSortable: false,
  1178. sortLv: 0,
  1179. status: true,
  1180. fixed: '',
  1181. },
  1182. {
  1183. columnProp: 'defaultValue',
  1184. headerAlign: "center",
  1185. align: "center",
  1186. columnLabel: '标准值',
  1187. columnHidden: false,
  1188. columnImage: false,
  1189. columnSortable: false,
  1190. sortLv: 0,
  1191. status: true,
  1192. fixed: '',
  1193. },
  1194. {
  1195. columnProp: 'maxValue',
  1196. headerAlign: "center",
  1197. align: "center",
  1198. columnLabel: '上限值',
  1199. columnHidden: false,
  1200. columnImage: false,
  1201. columnSortable: false,
  1202. sortLv: 0,
  1203. status: true,
  1204. fixed: '',
  1205. },
  1206. {
  1207. columnProp: 'minValue',
  1208. headerAlign: "center",
  1209. align: "center",
  1210. columnLabel: '下限值',
  1211. columnHidden: false,
  1212. columnImage: false,
  1213. columnSortable: false,
  1214. sortLv: 0,
  1215. status: true,
  1216. fixed: '',
  1217. },
  1218. {
  1219. columnProp: 'valueType',
  1220. headerAlign: "center",
  1221. align: "center",
  1222. columnLabel: '检测值类型',
  1223. columnHidden: false,
  1224. columnImage: false,
  1225. columnSortable: false,
  1226. sortLv: 0,
  1227. status: true,
  1228. fixed: '',
  1229. },
  1230. ],
  1231. fileColumnList: [
  1232. {
  1233. columnProp: 'fileName',
  1234. headerAlign: "center",
  1235. align: "center",
  1236. columnLabel: '文件名称',
  1237. columnHidden: false,
  1238. columnImage: false,
  1239. columnSortable: false,
  1240. sortLv: 0,
  1241. status: true,
  1242. fixed: '',
  1243. },
  1244. {
  1245. columnProp: 'createdBy',
  1246. headerAlign: "center",
  1247. align: 'center',
  1248. columnLabel: '上传人',
  1249. columnHidden: false,
  1250. columnImage: false,
  1251. columnSortable: true,
  1252. sortLv: 0,
  1253. status: true,
  1254. fixed: false
  1255. },
  1256. {
  1257. columnProp: 'createDate',
  1258. headerAlign: "center",
  1259. align: 'center',
  1260. columnLabel: '上传时间',
  1261. columnHidden: false,
  1262. columnImage: false,
  1263. columnSortable: true,
  1264. sortLv: 0,
  1265. status: true,
  1266. fixed: false
  1267. },
  1268. {
  1269. columnProp: 'orderRef3',
  1270. headerAlign: "center",
  1271. align: 'center',
  1272. columnLabel: '备注',
  1273. columnHidden: false,
  1274. columnImage: false,
  1275. columnSortable: true,
  1276. sortLv: 0,
  1277. status: true,
  1278. fixed: false
  1279. },
  1280. ],
  1281. // 子明细数据对象
  1282. tableData: [],
  1283. checkedDetail: [],
  1284. subDetailFlag: false,
  1285. subDetailData: {
  1286. site: this.$store.state.user.site,
  1287. inspectionNo: '',
  1288. itemNo: '',
  1289. itemDesc: '',
  1290. defaultValue: '',
  1291. maxValue: '',
  1292. minValue: '',
  1293. subDetailValues:[]
  1294. },
  1295. options: [],
  1296. modalDisableFlag: false,
  1297. modalFlag: false,
  1298. operationList: [],
  1299. resourceList: [],
  1300. partList: [],
  1301. IPQCSelections: [],
  1302. rules:{
  1303. seqNoType: [
  1304. {
  1305. required: true,
  1306. message: ' ',
  1307. trigger: 'change'
  1308. }
  1309. ],
  1310. orderNoType: [
  1311. {
  1312. required: true,
  1313. message: ' ',
  1314. trigger: 'change'
  1315. }
  1316. ],
  1317. operationDescType: [
  1318. {
  1319. required: true,
  1320. message: ' ',
  1321. trigger: 'change'
  1322. }
  1323. ],
  1324. resourceIdType: [
  1325. {
  1326. required: true,
  1327. message: ' ',
  1328. trigger: 'change'
  1329. }
  1330. ],
  1331. rollQtyType: [
  1332. {
  1333. required: true,
  1334. message: ' ',
  1335. trigger: 'change'
  1336. }
  1337. ],
  1338. inspectionTypeNoType: [
  1339. {
  1340. required: true,
  1341. message: ' ',
  1342. trigger: 'change'
  1343. }
  1344. ],
  1345. partNoType: [
  1346. {
  1347. required: true,
  1348. message: ' ',
  1349. trigger: 'change'
  1350. }
  1351. ]
  1352. },
  1353. batchHandleAddModalFlag: false,
  1354. batchAddData: {
  1355. samplingLocation: '',
  1356. samplingLocationB: '',
  1357. samplingNumber: ''
  1358. },
  1359. controlData: {},
  1360. templateData: {
  1361. site: this.$store.state.user.site,
  1362. templateId: '',
  1363. templateName: '',
  1364. inspectionTypeNo: '',
  1365. inspectionTypeName: ''
  1366. },
  1367. partData: {
  1368. site: this.$store.state.user.site,
  1369. partNo: '',
  1370. partDesc: '',
  1371. sku: ''
  1372. },
  1373. templateList: [],
  1374. templateModelFlag: false,
  1375. templateDetailList: [
  1376. {
  1377. columnProp: 'templateId',
  1378. headerAlign: "center",
  1379. align: "center",
  1380. columnLabel: '模板编码',
  1381. columnHidden: false,
  1382. columnImage: false,
  1383. columnSortable: false,
  1384. sortLv: 0,
  1385. status: true,
  1386. fixed: '',
  1387. },
  1388. {
  1389. columnProp: 'templateName',
  1390. headerAlign: "center",
  1391. align: "center",
  1392. columnLabel: '模板名称',
  1393. columnHidden: false,
  1394. columnImage: false,
  1395. columnSortable: false,
  1396. sortLv: 0,
  1397. status: true,
  1398. fixed: '',
  1399. },
  1400. {
  1401. columnProp: 'inspectionTypeName',
  1402. headerAlign: "center",
  1403. align: "center",
  1404. columnLabel: '检验类型',
  1405. columnHidden: false,
  1406. columnImage: false,
  1407. columnSortable: false,
  1408. sortLv: 0,
  1409. status: true,
  1410. fixed: '',
  1411. },
  1412. ],
  1413. partDetailList: [
  1414. {
  1415. columnProp: 'partNo',
  1416. headerAlign: "center",
  1417. align: "center",
  1418. columnLabel: '物料编码',
  1419. columnHidden: false,
  1420. columnImage: false,
  1421. columnSortable: false,
  1422. sortLv: 0,
  1423. status: true,
  1424. fixed: '',
  1425. },
  1426. {
  1427. columnProp: 'partDesc',
  1428. headerAlign: "center",
  1429. align: "center",
  1430. columnLabel: '物料名称',
  1431. columnHidden: false,
  1432. columnImage: false,
  1433. columnSortable: false,
  1434. sortLv: 0,
  1435. status: true,
  1436. fixed: '',
  1437. },
  1438. {
  1439. columnProp: 'sku',
  1440. headerAlign: "center",
  1441. align: "center",
  1442. columnLabel: 'SKU',
  1443. columnHidden: false,
  1444. columnImage: false,
  1445. columnSortable: false,
  1446. sortLv: 0,
  1447. status: true,
  1448. fixed: '',
  1449. },
  1450. ],
  1451. checked: false,
  1452. typeOptions: [],
  1453. disposalMeasuresOptions: [],
  1454. timeout: null,
  1455. partModelFlag: false
  1456. }
  1457. },
  1458. mounted () {
  1459. this.$nextTick(() => {
  1460. this.height = window.innerHeight - 210
  1461. })
  1462. },
  1463. created () {
  1464. this.getDataList()
  1465. this.favoriteIsOk()
  1466. this.InspectionTypeSearch()
  1467. this.disposalMeasuresSearch()
  1468. },
  1469. methods: {
  1470. // 标签号回车事件
  1471. rollNoEnter () {
  1472. let tempData = {
  1473. site: this.$store.state.user.site,
  1474. rollNo: this.modalData.rollNo
  1475. }
  1476. rollNoEnter(tempData).then(({data}) => {
  1477. if (data && data.code === 0) {
  1478. this.operationList = data.rows
  1479. this.modalData.seqNo = data.rows[0].seqNo
  1480. this.modalData.orderNo = data.rows[0].orderNo
  1481. this.modalData.operationDesc = data.rows[0].operationDesc
  1482. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1483. this.modalData.resourceId = data.rows[0].resourceId
  1484. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1485. this.modalData.partNo = data.rows[0].partNo
  1486. this.modalData.partDesc = data.rows[0].partDesc
  1487. this.modalData.spec = data.rows[0].spec
  1488. this.modalData.sku = data.rows[0].sku
  1489. } else {
  1490. this.$alert(data.msg, '错误', {
  1491. confirmButtonText: '确定'
  1492. })
  1493. }
  1494. })
  1495. },
  1496. // input 模糊搜索
  1497. querySearchAsync (queryString, cb) {
  1498. clearTimeout(this.timeout)
  1499. let results = []
  1500. if (queryString == '') {
  1501. cb(results)
  1502. } else {
  1503. // 掉接口需要的参数
  1504. let find = {
  1505. rollNo: queryString, //上面输入框绑定的数据
  1506. site: this.$store.state.user.site,
  1507. }
  1508. // 这里去调后端的接口.根据自己接口的情况进行赋值
  1509. getRollNo(find).then(({data}) => {
  1510. if (data.code === 0) {
  1511. let result = data.rows
  1512. // 循环放到一个远程搜索需要的数组
  1513. for (let i = 0; i < result.length; i++) {
  1514. const element = result[i]
  1515. results.push({
  1516. value: element.rollNo,
  1517. seqNo: element.seqNo,
  1518. orderNo: element.orderNo
  1519. })
  1520. }
  1521. cb(results)
  1522. } else {
  1523. results = []
  1524. cb(results)
  1525. }
  1526. })
  1527. }
  1528. },
  1529. // 点击出现搜索后点击的每一项
  1530. handleSelect (item) {
  1531. this.modalData.rollNo = item.value
  1532. this.modalData.seqNo = item.seqNo
  1533. this.modalData.orderNo = item.orderNo
  1534. this.getOperationList()
  1535. //this.getPartList()
  1536. },
  1537. // 获取处置措施列表
  1538. disposalMeasuresSearch(){
  1539. let tempData = {
  1540. inspectionTypeNo: '101'
  1541. }
  1542. disposalMeasuresSearch(tempData).then(({data}) => {
  1543. if (data.code === 0) {
  1544. this.disposalMeasuresOptions = data.rows
  1545. }
  1546. })
  1547. },
  1548. // 查询检验类型
  1549. InspectionTypeSearch(){
  1550. let tempData = {
  1551. site: this.$store.state.user.site
  1552. }
  1553. InspectionTypeSearch(tempData).then(({data}) => {
  1554. if (data.code === 0) {
  1555. this.typeOptions = data.rows
  1556. }
  1557. })
  1558. },
  1559. selectFlag(){
  1560. return true;
  1561. },
  1562. // 单机选中
  1563. IPQCClickRow(row){
  1564. this.$refs.IPQCTable.toggleRowSelection(row);
  1565. },
  1566. // 复选
  1567. selectionIPQC(val){
  1568. this.IPQCSelections = val
  1569. },
  1570. //刷新派设备文档的列表
  1571. getFileContentData(row) {
  1572. let currentData = {
  1573. orderRef1: row.site,
  1574. orderRef2: row.inspectionNo
  1575. };
  1576. getFileContentList(currentData).then(({data}) => {
  1577. //区分请求成功和失败的状况
  1578. if (data && data.code == 200) {
  1579. this.fileContentList = data.rows;
  1580. } else {
  1581. this.fileContentList = [];
  1582. }
  1583. })
  1584. this.fileFlag = true;
  1585. },
  1586. /*新增文件的modal*/
  1587. addUploadFileModal(){
  1588. let currentData = {
  1589. titleCon: 'IPQC文件上传',
  1590. site: this.$store.state.user.site,
  1591. createBy: this.$store.state.user.name,
  1592. inspectionNo: this.detailData.inspectionNo,
  1593. remark: '',
  1594. folder: 'qcIPQC',
  1595. };
  1596. //打开组件 去做新增业务
  1597. this.$nextTick(() => {
  1598. this.$refs.qcFAIUploadFile.init(currentData);
  1599. })
  1600. },
  1601. // 上传项目图片
  1602. uploadImageModal (row) {
  1603. let currentData = {
  1604. site: this.$store.state.user.site,
  1605. createBy: this.$store.state.user.name,
  1606. inspectionNo: this.detailData.inspectionNo,
  1607. itemNo: row.itemNo,
  1608. folder: 'IPQCItemImageFile'
  1609. }
  1610. //打开组件 去做新增业务
  1611. this.$nextTick(() => {
  1612. this.$refs.comQcItemImageUploadFile.init(currentData)
  1613. })
  1614. },
  1615. downloadFile(row){
  1616. downLoadObjectFile(row)
  1617. .then(({data}) => {
  1618. // 不限制文件下载类型
  1619. const blob = new Blob([data], {type: "application/octet-stream"})
  1620. // 下载文件名称
  1621. const fileName = row.fileName
  1622. // a标签下载
  1623. const linkNode = document.createElement('a')
  1624. // a标签的download属性规定下载文件的名称
  1625. linkNode.download = fileName
  1626. linkNode.style.display = 'none'
  1627. // 生成一个Blob URL
  1628. linkNode.href = URL.createObjectURL(blob)
  1629. document.body.appendChild(linkNode)
  1630. // 模拟在按钮上的一次鼠标单击
  1631. linkNode.click()
  1632. // 释放URL 对象
  1633. URL.revokeObjectURL(linkNode.href)
  1634. document.body.removeChild(linkNode)
  1635. })
  1636. },
  1637. // 删除文件
  1638. deleteFile (row) {
  1639. let tempData = {
  1640. site: row.orderRef1,
  1641. inspectionNo: row.orderRef2
  1642. }
  1643. this.$confirm('确定要删除此文件?', '提示', {
  1644. confirmButtonText: '确定',
  1645. cancelButtonText: '取消',
  1646. type: 'warning'
  1647. }).then(() => {
  1648. deleteObjectFile(row).then(({data}) => {
  1649. if (data && data.code == 0) {
  1650. this.getFileContentData(tempData);
  1651. this.$message({
  1652. message: '操作成功',
  1653. type: 'success',
  1654. duration: 1500,
  1655. onClose: () => {
  1656. }
  1657. })
  1658. } else {
  1659. this.$alert(data.msg, '错误', {
  1660. confirmButtonText: '确定'
  1661. })
  1662. }
  1663. })
  1664. }).catch(() => {
  1665. })
  1666. },
  1667. // 查询检验类型
  1668. inspectorSearch(){
  1669. inspectorSearch().then(({data}) => {
  1670. if (data.code === 0) {
  1671. this.options = data.rows
  1672. }
  1673. })
  1674. },
  1675. // 获取基础数据列表S
  1676. getBaseList (val,type) {
  1677. this.tagNo = val
  1678. this.$nextTick(() => {
  1679. let strVal = ''
  1680. if (val === 1052) {
  1681. strVal = this.modalData.seqNo
  1682. this.$refs.baseList.init(val, strVal)
  1683. }
  1684. if (val === 205) {
  1685. strVal = this.modalData.resourceDesc
  1686. this.$refs.baseList.init(val, strVal)
  1687. }
  1688. // if (val === 206) {
  1689. // strVal = this.modalData.partNo
  1690. // this.$refs.baseList.init(val, strVal)
  1691. // }
  1692. })
  1693. },
  1694. /* 列表方法的回调 */
  1695. getBaseData (val) {
  1696. if (this.tagNo === 1052) {
  1697. this.modalData.seqNo = val.seqno
  1698. this.modalData.orderNo = val.orderno
  1699. this.modalData.operationDesc = ''
  1700. this.modalData.resourceId = ''
  1701. this.getOperationList()
  1702. //this.getPartList()
  1703. }
  1704. if (this.tagNo === 205) {
  1705. this.modalData.resourceId = val.resource_id
  1706. this.modalData.resourceDesc = val.resource_desc
  1707. }
  1708. // if (this.tagNo === 206) {
  1709. // this.modalData.partNo = val.part_no
  1710. // this.modalData.partDesc = val.part_desc
  1711. // // 获取物料的其他信息
  1712. // this.getPartInformation()
  1713. // }
  1714. },
  1715. // // 获取物料其它信息
  1716. // getPartInformation () {
  1717. // getPartInformation(this.modalData).then(({data}) => {
  1718. // if (data && data.code === 0) {
  1719. // this.modalData.spec = data.rows[0].spec
  1720. // this.modalData.sku = data.rows[0].sku
  1721. // } else {
  1722. // this.$alert(data.msg, '错误', {
  1723. // confirmButtonText: '确定'
  1724. // })
  1725. // }
  1726. // })
  1727. // },
  1728. // 获取工序列表
  1729. getOperationList () {
  1730. getOperationList(this.modalData).then(({data}) => {
  1731. if (data && data.code === 0) {
  1732. this.operationList = data.rows
  1733. this.modalData.operationDesc = data.rows[0].operationDesc
  1734. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1735. this.modalData.resourceId = data.rows[0].resourceId
  1736. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1737. this.modalData.partNo = data.rows[0].partNo
  1738. this.modalData.partDesc = data.rows[0].partDesc
  1739. this.modalData.spec = data.rows[0].spec
  1740. this.modalData.sku = data.rows[0].sku
  1741. } else {
  1742. this.$alert(data.msg, '错误', {
  1743. confirmButtonText: '确定'
  1744. })
  1745. }
  1746. })
  1747. },
  1748. // 获取机台列表
  1749. getResourceList(){
  1750. // 判断是否为特殊任务,特殊任务的机台不随工序改变
  1751. if (this.modalData.specialTaskFlag === 'Y') {
  1752. return
  1753. } else {
  1754. getResourceList(this.modalData).then(({data}) => {
  1755. if (data && data.code === 0) {
  1756. //this.resourceList = data.rows
  1757. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1758. this.modalData.resourceId = data.rows[0].resourceId
  1759. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1760. } else {
  1761. this.$alert(data.msg, '错误', {
  1762. confirmButtonText: '确定'
  1763. })
  1764. }
  1765. })
  1766. }
  1767. },
  1768. // 获取物料列表
  1769. getPartList(){
  1770. getPartList(this.modalData).then(({data}) => {
  1771. if (data && data.code === 0) {
  1772. this.partList = data.rows
  1773. this.modalData.partNo = this.partList[0].partNo
  1774. this.modalData.partDesc = this.partList[0].partDesc
  1775. this.modalData.spec = this.partList[0].spec
  1776. this.modalData.sku = this.partList[0].sku
  1777. } else {
  1778. this.$alert(data.msg, '错误', {
  1779. confirmButtonText: '确定'
  1780. })
  1781. }
  1782. })
  1783. },
  1784. // 检查动控是否开启
  1785. queryController () {
  1786. let tempData = {
  1787. controlNo: '10004',
  1788. site: this.$store.state.user.site,
  1789. }
  1790. queryController(tempData).then(({data}) => {
  1791. if (data && data.code === 0) {
  1792. this.controlData = data.rows
  1793. } else {
  1794. this.$alert(data.msg, '错误', {
  1795. confirmButtonText: '确定'
  1796. })
  1797. }
  1798. })
  1799. },
  1800. addModal(){
  1801. // 查看 质量任务生成规则控制 动控是否开启
  1802. this.queryController()
  1803. this.modalData = {
  1804. flag: '1',
  1805. site: this.$store.state.user.site,
  1806. inspectionNo:'',
  1807. partNo: '',
  1808. partDesc: '',
  1809. inspectionTypeNo:'',
  1810. inspectionTypeName:'',
  1811. inspectorNo:'',
  1812. inspectorName:'',
  1813. submit_flag:'',
  1814. orderNo: '',
  1815. operationDesc: '',
  1816. operationNo: '',
  1817. resourceId: '',
  1818. resourceDesc: '',
  1819. rollQty: '',
  1820. seqNo: '',
  1821. batchRollNo: '',
  1822. spec: '',
  1823. sku: '',
  1824. specialRequirements: '',
  1825. templateId: '',
  1826. templateName: '',
  1827. specialTaskFlag: '',
  1828. workCenterNo: '',
  1829. rollNo: ''
  1830. }
  1831. this.operationList = []
  1832. this.resourceList = []
  1833. this.partList = []
  1834. this.modalDisableFlag = false
  1835. this.modalFlag = true
  1836. this.checked = false
  1837. },
  1838. // 获取检验模板列表
  1839. queryTemplateList () {
  1840. // 查询所有检验模板
  1841. queryTemplateList(this.templateData).then(({data}) => {
  1842. if (data && data.code === 0) {
  1843. this.templateList = data.rows
  1844. this.templateModelFlag = true
  1845. }else {
  1846. this.$alert(data.msg, '错误', {
  1847. confirmButtonText: '确定'
  1848. })
  1849. }
  1850. })
  1851. },
  1852. // 获取物料列表
  1853. queryPartList () {
  1854. // 查询所有物料
  1855. queryPartList(this.partData).then(({data}) => {
  1856. if (data && data.code === 0) {
  1857. this.partList = data.rows
  1858. this.partModelFlag = true
  1859. }else {
  1860. this.$alert(data.msg, '错误', {
  1861. confirmButtonText: '确定'
  1862. })
  1863. }
  1864. })
  1865. },
  1866. // 选中检验模板
  1867. getRowData (row) {
  1868. this.modalData.templateId = row.templateId
  1869. this.modalData.templateName = row.templateName
  1870. this.templateModelFlag = false
  1871. },
  1872. // 选中物料
  1873. getRowData2 (row) {
  1874. this.modalData.partNo = row.partNo
  1875. this.modalData.partDesc = row.partDesc
  1876. this.modalData.sku = row.sku
  1877. this.modalData.spec = row.spec
  1878. this.partModelFlag = false
  1879. },
  1880. // 是否新增特殊任务
  1881. changeSpecialTask () {
  1882. // 先重置数据
  1883. this.modalData = {
  1884. flag: '1',
  1885. site: this.$store.state.user.site,
  1886. inspectionNo:'',
  1887. partNo: '',
  1888. partDesc: '',
  1889. inspectionTypeNo:'',
  1890. inspectionTypeName:'',
  1891. inspectorNo:'',
  1892. inspectorName:'',
  1893. submit_flag:'',
  1894. orderNo: '',
  1895. operationDesc: '',
  1896. operationNo: '',
  1897. resourceId: '',
  1898. resourceDesc: '',
  1899. rollQty: '',
  1900. seqNo: '',
  1901. batchRollNo: '',
  1902. spec: '',
  1903. sku: '',
  1904. specialRequirements: '',
  1905. templateId: '',
  1906. templateName: '',
  1907. specialTaskFlag: '',
  1908. workCenterNo: '',
  1909. rollNo: ''
  1910. }
  1911. // 获取选中框
  1912. let obj = document.getElementsByName('specialTask')
  1913. // 判断是否打勾
  1914. if (obj[0].checked) {
  1915. let tempData = {
  1916. site: this.$store.state.user.site
  1917. }
  1918. this.modalData.specialTaskFlag = 'Y'
  1919. // 获取特殊工序列表
  1920. getSpecialOperationList(tempData).then(({data}) => {
  1921. if (data && data.code === 0) {
  1922. this.operationList = data.rows
  1923. } else {
  1924. this.$alert(data.msg, '错误', {
  1925. confirmButtonText: '确定'
  1926. })
  1927. }
  1928. })
  1929. // 派工单和工单号赋值
  1930. this.modalData.seqNo = '000#1TSGD'
  1931. this.modalData.orderNo = '000#1'
  1932. } else {
  1933. this.modalData.specialTaskFlag = ''
  1934. }
  1935. },
  1936. // 新增IPQC巡检记录
  1937. saveData(){
  1938. if (this.modalData.seqNo === '' || this.modalData.seqNo == null) {
  1939. this.$message.warning('请选择派工单!')
  1940. return
  1941. }
  1942. if (this.modalData.orderNo === '' || this.modalData.orderNo == null) {
  1943. this.$message.warning('请选择工单!')
  1944. return
  1945. }
  1946. if (this.modalData.inspectionTypeNo === '' || this.modalData.inspectionTypeNo == null) {
  1947. this.$message.warning('请选择检验类型!')
  1948. return
  1949. }
  1950. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.partNo === '' || this.modalData.partNo == null)) {
  1951. this.$message.warning('请选择物料!')
  1952. return
  1953. }
  1954. if (this.modalData.operationDesc === '' || this.modalData.operationDesc == null) {
  1955. this.$message.warning('请选择工序!')
  1956. return
  1957. }
  1958. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.resourceId === '' || this.modalData.resourceId == null)) {
  1959. this.$message.warning('请选择机台!')
  1960. return
  1961. }
  1962. if (this.modalData.rollQty === '' || this.modalData.rollQty == null) {
  1963. this.$message.warning('请填写送检数量!')
  1964. return
  1965. }
  1966. if (this.controlData.baseData === '控制' && (this.modalData.templateId == null || this.modalData.templateId === '')) {
  1967. this.$message.warning('请选择检验模板!')
  1968. return
  1969. }
  1970. if(this.modalData.flag === '1'){
  1971. saveOsInspection(this.modalData).then(({data}) => {
  1972. if (data && data.code === 0) {
  1973. this.getDataList()
  1974. this.operationList = []
  1975. this.resourceList = []
  1976. this.partList = []
  1977. this.modalFlag = false
  1978. this.$message({
  1979. message: '操作成功',
  1980. type: 'success',
  1981. duration: 1500,
  1982. onClose: () => {}
  1983. })
  1984. } else {
  1985. this.$alert(data.msg, '错误', {
  1986. confirmButtonText: '确定'
  1987. })
  1988. }
  1989. })
  1990. }
  1991. },
  1992. // 获取主信息数据列表
  1993. getDataList () {
  1994. this.searchData.limit = this.pageSize
  1995. this.searchData.page = this.pageIndex
  1996. qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  1997. if (data.code == 0) {
  1998. this.dataList = data.page.list
  1999. this.pageIndex = data.page.currPage
  2000. this.pageSize = data.page.pageSize
  2001. this.totalPage = data.page.totalCount
  2002. }
  2003. this.dataListLoading = false
  2004. })
  2005. },
  2006. // 每页数
  2007. sizeChangeHandle (val) {
  2008. this.pageSize = val
  2009. this.pageIndex = 1
  2010. this.getDataList()
  2011. },
  2012. // 当前页
  2013. currentChangeHandle (val) {
  2014. this.pageIndex = val
  2015. this.getDataList()
  2016. },
  2017. // 多选
  2018. selectionChangeHandle (val) {
  2019. this.dataListSelections = val
  2020. },
  2021. // 删除检验记录
  2022. deleteModal () {
  2023. if(this.IPQCSelections.length === 0){
  2024. this.$alert('请勾选要删除的检验单!', '提示', {
  2025. confirmButtonText: '确定'
  2026. })
  2027. return false
  2028. }
  2029. this.$confirm(`是否删除该 `+ this.IPQCSelections.length +` 条检验记录?`, '提示', {
  2030. confirmButtonText: '确定',
  2031. cancelButtonText: '取消',
  2032. type: 'warning'
  2033. }).then(() => {
  2034. let tempData = {
  2035. site: this.$store.state.user.site,
  2036. submitList: this.IPQCSelections
  2037. }
  2038. ipqcRecordDelete(tempData).then(({data}) => {
  2039. if (data && data.code ==0) {
  2040. this.getDataList()
  2041. this.IPQCSelections = []
  2042. this.$message({
  2043. message: '操作成功',
  2044. type: 'success',
  2045. duration: 1500,
  2046. onClose: () => {
  2047. }
  2048. })
  2049. } else {
  2050. this.$alert(data.msg, '错误', {
  2051. confirmButtonText: '确定'
  2052. })
  2053. }
  2054. })
  2055. }).catch(() => {
  2056. })
  2057. },
  2058. Transfer(){
  2059. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  2060. this.$message.warning('请选择检验结论!')
  2061. return
  2062. }
  2063. // if (this.detailData.inspectorNo === '' || this.detailData.inspectorNo == null) {
  2064. // this.$message.warning('请选择检验员!')
  2065. // return
  2066. // }
  2067. for (let i = 0; i < this.detailList.length; i++) {
  2068. if(this.detailList[i].itemResult === '' || this.detailList[i].itemResult == null){
  2069. this.detailList[i].itemResult = 'Y'
  2070. }
  2071. // if(this.detailList[i].valueTypeDb === 'N') {
  2072. // checkIPQCSubDetailValue(this.detailList[i]).then(({data}) => {
  2073. // if (data.flag === 2 && this.detailList[i].itemResult ==='Y') {
  2074. // this.$confirm(this.detailList[i].itemDesc + ' 中实测值不在合格范围!是否保存为合格?', '提示', {
  2075. // confirmButtonText: '确定',
  2076. // cancelButtonText: '取消',
  2077. // type: 'warning'
  2078. // }).then(() => {
  2079. //
  2080. // }).then(() => {
  2081. // return false
  2082. // })
  2083. // }
  2084. // })
  2085. // }
  2086. }
  2087. this.saveDetailInformation()
  2088. this.$message({message: '操作成功', type: 'success', duration: 1500, onClose: () => {}})
  2089. },
  2090. // 新增明细信息
  2091. saveDetailInformation(){
  2092. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  2093. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  2094. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  2095. this.saveInformationData.inspectorNo = this.$store.state.user.name
  2096. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  2097. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  2098. this.saveInformationData.rollQty = this.detailData.rollQty
  2099. this.saveInformationData.samplingQty = this.detailData.samplingQty
  2100. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  2101. saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => {
  2102. if (data && data.code === 0) {
  2103. this.getDataList()
  2104. this.detailInformationFlag = false
  2105. } else {
  2106. this.$alert(data.msg, '错误', {
  2107. confirmButtonText: '确定'
  2108. })
  2109. }
  2110. })
  2111. },
  2112. // 明细记录信息查询
  2113. detailModal(row){
  2114. this.detailData.site = this.$store.state.user.site
  2115. this.detailData.inspectionNo = row.inspectionNo
  2116. this.detailData.partNo = row.partNo
  2117. this.detailData.partDesc = row.partDesc
  2118. this.detailData.rollQty = row.rollQty
  2119. this.detailData.samplingQty = row.samplingQty
  2120. this.detailData.unqualifiedQty = row.unqualifiedQty
  2121. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  2122. this.detailData.submitFlag = row.submitFlag
  2123. this.detailData.disposalMeasures = row.disposalMeasures
  2124. this.detailData.disposalRemark = row.disposalRemark
  2125. this.detailData.inspectionResult = row.inspectionResult
  2126. this.detailData.inspectorNo = row.inspectorNo
  2127. this.detailData.inspectorName = row.inspectorName
  2128. this.detailData.inspectionRemark = row.inspectionRemark
  2129. this.detailData.cinvSourceCode = row.cinvSourceCode
  2130. this.detailData.sku = row.sku
  2131. this.detailData.spec = row.spec
  2132. this.getInspectionFormData()
  2133. this.inspectorSearch()
  2134. this.detailInformationFlag = true
  2135. },
  2136. // 检验单明细
  2137. getInspectionFormData(){
  2138. ipqcDetailSearch(this.detailData).then(({data}) => {
  2139. if (data && data.code === 0) {
  2140. this.detailList = data.rows
  2141. } else {
  2142. this.detailList = []
  2143. }
  2144. })
  2145. },
  2146. // 子明细记录信息查询
  2147. subDetailModal(row){
  2148. this.subDetailData.inspectionNo = row.inspectionNo
  2149. this.subDetailData.itemNo = row.itemNo
  2150. this.subDetailData.itemDesc = row.itemDesc
  2151. this.subDetailData.defaultValue = row.defaultValue
  2152. this.subDetailData.maxValue = row.maxValue
  2153. this.subDetailData.minValue = row.minValue
  2154. selectIPQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  2155. this.tableData = data.rows
  2156. })
  2157. this.batchAddData = {
  2158. samplingLocation: '',
  2159. samplingLocationB: '',
  2160. samplingNumber: ''
  2161. }
  2162. this.subDetailFlag = true
  2163. },
  2164. // 审核按钮
  2165. submitResult(){
  2166. let tempData1 = '' // 记录不是待审核状态的单号
  2167. let tempData2 = '' // 记录处置措施未填写的单号
  2168. if(this.IPQCSelections.length == 0){
  2169. this.$alert('请勾选要审核的检验单!', '提示', {
  2170. confirmButtonText: '确定'
  2171. })
  2172. return false
  2173. }
  2174. for (let i = 0; i < this.IPQCSelections.length; i++) {
  2175. if (this.IPQCSelections[i].state != '待审核'){
  2176. tempData1 = tempData1 + this.IPQCSelections[i].inspectionNo + '、'
  2177. }
  2178. if (this.IPQCSelections[i].inspectionResult == '不合格' && (this.IPQCSelections[i].disposalMeasures == '' || this.IPQCSelections[i].disposalMeasures == null)){
  2179. tempData2 = tempData2 + this.IPQCSelections[i].inspectionNo + '、'
  2180. }
  2181. }
  2182. if (tempData1 != ''){
  2183. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2184. this.$alert('检验单号 ' + tempData1 + ' 不是待审核状态!', '提示', {
  2185. confirmButtonText: '确定'
  2186. })
  2187. return false
  2188. }
  2189. if (tempData2 != ''){
  2190. tempData2 = tempData2.substring(0, tempData2.length - 1)
  2191. this.$alert('检验单号 ' + tempData2 + ' 的处置措施未选择!', '提示', {
  2192. confirmButtonText: '确定'
  2193. })
  2194. return false
  2195. }
  2196. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.IPQCSelections.length + ` 条记录`, '提示', {
  2197. confirmButtonText: '确定',
  2198. cancelButtonText: '取消',
  2199. type: 'warning'
  2200. }).then(() => {
  2201. this.submitData.submitList = this.IPQCSelections
  2202. saveIPQCSubmitResult(this.submitData).then(({data}) => {
  2203. if (data && data.code ==0) {
  2204. this.getDataList()
  2205. this.IPQCSelections = []
  2206. this.$message({
  2207. message: '操作成功',
  2208. type: 'success',
  2209. duration: 1500,
  2210. onClose: () => {
  2211. }
  2212. })
  2213. } else {
  2214. this.$alert(data.msg, '错误', {
  2215. confirmButtonText: '确定'
  2216. })
  2217. }
  2218. })
  2219. }).catch(() => {
  2220. })
  2221. },
  2222. // 子明细方法
  2223. //表格的新增
  2224. rowClassName({ row, rowIndex }) {
  2225. row.xh = rowIndex + 1;
  2226. },
  2227. //单选框选中数据
  2228. handleDetailSelectionChange(selection) {
  2229. this.checkedDetail = selection;
  2230. },
  2231. //点击新增更多
  2232. handleAddBtn(td) {
  2233. checkIPQCIsSubmit(td).then(({data}) => {
  2234. if (data.flag != 1) {
  2235. let obj = {};
  2236. obj.subDetailValue = "";
  2237. obj.samplingLocation = "";
  2238. this.tableData.push(obj);
  2239. } else {
  2240. this.$alert("记录已提交!", '错误', {
  2241. confirmButtonText: '确定'
  2242. })
  2243. }
  2244. })
  2245. },
  2246. // 批量新增操作
  2247. batchHandleAdd (td) {
  2248. checkIPQCIsSubmit(td).then(({data}) => {
  2249. if (data.flag != 1) {
  2250. this.batchHandleAddModalFlag = true
  2251. } else {
  2252. this.$alert("记录已提交!", '错误', {
  2253. confirmButtonText: '确定'
  2254. })
  2255. }
  2256. })
  2257. },
  2258. // 批量新增行
  2259. batchHandleAddModal () {
  2260. for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
  2261. let obj = {}
  2262. obj.samplingLocation = this.batchAddData.samplingLocation
  2263. obj.samplingLocationB = this.batchAddData.samplingLocationB
  2264. obj.subDetailValue = ""
  2265. this.tableData.push(obj)
  2266. }
  2267. this.batchHandleAddModalFlag = false
  2268. },
  2269. // 回车事件
  2270. nextFocus1 (index) {
  2271. let a1 = `${index + 1}` + `a`
  2272. this.$nextTick(() => {
  2273. this.$refs[a1].focus()
  2274. })
  2275. },
  2276. nextFocus2 (index) {
  2277. let a2 = `${index + 1}` + `b`
  2278. this.$nextTick(() => {
  2279. this.$refs[a2].focus()
  2280. })
  2281. },
  2282. nextFocus3 (index) {
  2283. let a3 = `${index + 1}` + `c`
  2284. this.$nextTick(() => {
  2285. this.$refs[a3].focus()
  2286. })
  2287. },
  2288. //删除
  2289. handleDeleteBtn(td) {
  2290. checkIPQCIsSubmit(td).then(({data}) => {
  2291. if (data.flag != 1) {
  2292. if (this.checkedDetail.length == 0) {
  2293. this.$alert("请先选择要删除的数据", "提示", {
  2294. confirmButtonText: "确定",
  2295. });
  2296. } else {
  2297. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  2298. confirmButtonText: "确定",
  2299. cancelButtonText: "取消",
  2300. type: "warning",
  2301. callback: (action) => {
  2302. if (action === "confirm") {
  2303. let val = this.checkedDetail;
  2304. val.forEach((val, index) => {
  2305. this.tableData.forEach((v, i) => {
  2306. if (val.xh === v.xh) {
  2307. this.tableData.splice(i, 1);
  2308. }
  2309. });
  2310. });
  2311. this.$message({
  2312. message: "删除成功!",
  2313. type: "success",
  2314. });
  2315. return;
  2316. } else {
  2317. this.$message({
  2318. message: "已取消删除操作",
  2319. type: "warning",
  2320. });
  2321. return;
  2322. }
  2323. },
  2324. });
  2325. }
  2326. } else {
  2327. this.$alert("记录已提交!", '错误', {
  2328. confirmButtonText: '确定'
  2329. })
  2330. }
  2331. })
  2332. },
  2333. // 新增子明细记录
  2334. saveSubDetailResult(){
  2335. for (let i = 0; i < this.tableData.length; i++) {
  2336. if(this.tableData[i].subDetailValue == '' || this.tableData[i].subDetailValue == null){
  2337. this.$message.warning('序号' + (i+1) +'未填写实测值!')
  2338. return
  2339. }
  2340. }
  2341. this.subDetailData.subDetailValues = this.tableData
  2342. saveIPQCSubDetailed(this.subDetailData).then(({data}) => {
  2343. if (data && data.code === 0) {
  2344. ipqcDetailSearch(this.detailData).then(({data}) => {
  2345. this.detailList = data.rows
  2346. })
  2347. this.subDetailFlag = false
  2348. this.tableData = []
  2349. this.$message({
  2350. message: '操作成功',
  2351. type: 'success',
  2352. duration: 1500,
  2353. onClose: () => {}
  2354. })
  2355. } else {
  2356. this.$alert(data.msg, '错误', {
  2357. confirmButtonText: '确定'
  2358. })
  2359. }
  2360. })
  2361. },
  2362. // 校验用户是否收藏
  2363. favoriteIsOk() {
  2364. let userFavorite = {
  2365. userId: this.$store.state.user.id,
  2366. languageCode: this.$i18n.locale
  2367. }
  2368. userFavoriteList(userFavorite).then(({data}) => {
  2369. for (let i = 0; i < data.list.length; i++) {
  2370. if(this.$route.meta.menuId==data.list[i].menuId){
  2371. this.favorite = true
  2372. }
  2373. }
  2374. })
  2375. },
  2376. // 收藏 OR 取消收藏
  2377. favoriteFunction() {
  2378. let userFavorite = {
  2379. userId: this.$store.state.user.id,
  2380. functionId: this.$route.meta.menuId,
  2381. }
  2382. if (this.favorite) {
  2383. removeUserFavorite(userFavorite).then(({data}) => {
  2384. this.$message.success(data.msg)
  2385. this.favorite = false
  2386. })
  2387. } else {
  2388. // 收藏
  2389. saveUserFavorite(userFavorite).then(({data}) => {
  2390. this.$message.success(data.msg)
  2391. this.favorite = true
  2392. })
  2393. }
  2394. },
  2395. //导出excel
  2396. async createExportData() {
  2397. this.searchData.limit = -1
  2398. this.searchData.page = 1
  2399. await qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  2400. this.exportList= data.page.list;
  2401. })
  2402. return this.exportList;
  2403. },
  2404. startDownload() {
  2405. },
  2406. finishDownload() {
  2407. },
  2408. fields() {
  2409. let json = "{"
  2410. this.columnList.forEach((item, index) => {
  2411. if (index == this.columnList.length - 1) {
  2412. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  2413. } else {
  2414. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  2415. }
  2416. })
  2417. json += "}"
  2418. let s = eval("(" + json + ")")
  2419. return s
  2420. },
  2421. }
  2422. }
  2423. </script>
  2424. <style scoped>
  2425. </style>