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.

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