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.

1562 lines
53 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
  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" style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'状态'">
  15. <el-select v-model="searchData.state" style="width: 100px">
  16. <el-option label="全部" value=""></el-option>
  17. <el-option label="待检验" value="待检验"></el-option>
  18. <el-option label="待审核" value="待审核"></el-option>
  19. <el-option label="已完成" value="已完成"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item :label="'检验结论'">
  23. <el-select v-model="searchData.inspectionResult" style="width: 100px">
  24. <el-option label="全部" value=""></el-option>
  25. <el-option label="合格" value="合格"></el-option>
  26. <el-option label="不合格" value="不合格"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item :label="'检验类型'">
  30. <el-select v-model="searchData.checkType" style="width: 100px">
  31. <el-option label="全部" value=""></el-option>
  32. <el-option label="巡检" value="巡检"></el-option>
  33. <el-option label="末件检" value="末件检"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item :label="'工单号'">
  37. <el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
  38. </el-form-item>
  39. <el-form-item :label="'工序'">
  40. <el-input v-model="searchData.operationDesc" style="width: 120px"></el-input>
  41. </el-form-item>
  42. <el-form-item :label="'检验时间:'">
  43. <el-date-picker style="width: 150px" v-model="searchData.startDate" type="datetime"
  44. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="开始日期">
  45. </el-date-picker>
  46. -
  47. <el-date-picker style="width: 150px" v-model="searchData.endDate" type="datetime"
  48. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="结束日期">
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item :label="' '">
  52. <el-button @click="doEmpty()">清空</el-button>
  53. <el-button type="primary" @click="getDataList()">查询</el-button>
  54. <el-button type="primary" @click="addModal()">新增</el-button>
  55. <download-excel
  56. :fields="fields()"
  57. :data="exportData"
  58. type="xls"
  59. :name="exportName"
  60. :header="exportHeader"
  61. :footer="exportFooter"
  62. :fetch="createExportData"
  63. :before-generate="startDownload"
  64. :before-finish="finishDownload"
  65. worksheet="导出信息"
  66. class="el-button el-button--primary el-button--medium">
  67. {{ "导出" }}
  68. </download-excel>
  69. </el-form-item>
  70. </el-form>
  71. <!-- 检验记录展示列表 -->
  72. <el-table
  73. :height="height"
  74. :data="dataList"
  75. border
  76. v-loading="dataListLoading"
  77. style="width: 100%;">
  78. <el-table-column
  79. prop="state"
  80. header-align="center"
  81. align="left"
  82. label="状态">
  83. <template slot-scope="scope">
  84. <div :style="{fontWeight:'bold', color: scope.row.state =='待检验' ? 'red' : scope.row.state =='待审核' ? '#ffa500e0' : scope.row.state =='已完成' ? '#3ac252' : ''}">
  85. {{ scope.row.state }}
  86. </div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column
  90. v-for="(item,index) in columnList" :key="index"
  91. :sortable="item.columnSortable"
  92. :prop="item.columnProp"
  93. :header-align="item.headerAlign"
  94. :show-overflow-tooltip="item.showOverflowTooltip"
  95. :align="item.align"
  96. :fixed="item.fixed==''?false:item.fixed"
  97. :min-width="item.columnWidth"
  98. :label="item.columnLabel">
  99. <template slot-scope="scope">
  100. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  101. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column
  105. fixed="right"
  106. header-align="center"
  107. align="center"
  108. width="200"
  109. label="操作">
  110. <template slot-scope="scope">
  111. <a type="text" size="small" @click="detailModal(scope.row)">检验单</a>
  112. <a type="text" size="small" @click="getFileContentData(scope.row)">工作文件</a>
  113. <a type="text" size="small" @click="submitResult(scope.row)">审核</a>
  114. <a type="text" size="small" @click="deleteModal(scope.row)">删除</a>
  115. </template>
  116. </el-table-column>
  117. </el-table>
  118. <!-- 分页-->
  119. <el-pagination
  120. @size-change="sizeChangeHandle"
  121. @current-change="currentChangeHandle"
  122. :current-page="pageIndex"
  123. :page-sizes="[20, 50, 100, 1000]"
  124. :page-size="pageSize"
  125. :total="totalPage"
  126. layout="total, sizes, prev, pager, next, jumper">
  127. </el-pagination>
  128. <!-- 新增巡检记录 -->
  129. <el-dialog title="新增巡检记录" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
  130. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  131. <el-form-item >
  132. <span slot="label" style="" @click="getBaseList(1052)"><a herf="#">工单号</a></span>
  133. <el-input v-model="modalData.orderNo" style="width: 120px"></el-input>
  134. </el-form-item>
  135. <el-form-item label="工序">
  136. <el-select v-model="modalData.operationDesc" @change="getResourceList()" placeholder="请选择" style="width: 120px">
  137. <el-option
  138. v-for = "i in operationList"
  139. :key = "i.operationNo"
  140. :label = "i.operationDesc"
  141. :value = "i.operationDesc">
  142. </el-option>
  143. </el-select>
  144. </el-form-item>
  145. <el-form-item label="机台">
  146. <el-select v-model="modalData.resourceId" placeholder="请选择" style="width: 120px">
  147. <el-option
  148. v-for = "i in resourceList"
  149. :key = "i.resourceId"
  150. :label = "i.resourceDesc"
  151. :value = "i.resourceId">
  152. </el-option>
  153. </el-select>
  154. </el-form-item>
  155. <el-form-item label="物料">
  156. <el-select v-model="modalData.partNo" placeholder="请选择" style="width: 255px">
  157. <el-option
  158. v-for = "i in partList"
  159. :key = "i.partNo"
  160. :label = "i.partDesc"
  161. :value = "i.partNo">
  162. </el-option>
  163. </el-select>
  164. </el-form-item>
  165. <el-form-item label="送检数量:">
  166. <el-input v-model="modalData.rollQty" type="number" style="width: 120px"></el-input>
  167. </el-form-item>
  168. </el-form>
  169. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  170. <el-button type="primary" @click="saveData()">保存</el-button>
  171. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  172. </el-footer>
  173. </el-dialog>
  174. <!-- 检验单详情页 -->
  175. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1700px">
  176. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  177. <el-form-item :label="'物料编码'">
  178. <el-input v-model="detailData.partNo" disabled style="width: 100px"></el-input>
  179. </el-form-item>
  180. <el-form-item :label="'物料名称'">
  181. <el-input v-model="detailData.partDesc" disabled style="width: 200px"></el-input>
  182. </el-form-item>
  183. <el-form-item :label="'送检数量'">
  184. <el-input v-model="detailData.rollQty" disabled style="width: 100px"></el-input>
  185. </el-form-item>
  186. <el-form-item :label="'抽样数量'">
  187. <el-input v-model="detailData.samplingQty" disabled style="width: 100px"></el-input>
  188. </el-form-item>
  189. <el-form-item :label="'不合格项目数量'">
  190. <el-input v-if="detailData.submitFlag == 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 100px"></el-input>
  191. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.unqualifiedQty" type="number" style="width: 100px"></el-input>
  192. </el-form-item>
  193. <el-form-item :label="'处置措施'">
  194. <el-select v-if="detailData.submitFlag == 'Y'" v-model="detailData.disposalMeasures" disabled style="width: 100px">
  195. <el-option label="请选择" value=""></el-option>
  196. <el-option label="特采" value="特采"></el-option>
  197. <el-option label="拒收" value="拒收"></el-option>
  198. </el-select>
  199. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalMeasures" style="width: 100px">
  200. <el-option label="请选择" value=""></el-option>
  201. <el-option label="特采" value="特采"></el-option>
  202. <el-option label="拒收" value="拒收"></el-option>
  203. </el-select>
  204. </el-form-item>
  205. <el-form-item :label="'处置说明'">
  206. <el-input v-if="detailData.submitFlag == 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
  207. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalRemark" style="width: 200px"></el-input>
  208. </el-form-item>
  209. <el-form-item :label="'检验结论'">
  210. <el-select v-if="detailData.submitFlag == 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  211. <el-option label="合格" value="合格"></el-option>
  212. <el-option label="不合格" value="不合格"></el-option>
  213. </el-select>
  214. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionResult" style="width: 100px" placeholder="请选择">
  215. <el-option label="合格" value="合格"></el-option>
  216. <el-option label="不合格" value="不合格"></el-option>
  217. </el-select>
  218. </el-form-item>
  219. <el-form-item label="检验员">
  220. <el-select v-if="detailData.submitFlag == 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  221. <el-option
  222. v-for = "i in options"
  223. :key = "i.inspectorNo"
  224. :label = "i.inspectorName"
  225. :value = "i.inspectorNo">
  226. </el-option>
  227. </el-select>
  228. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectorNo" placeholder="请选择" style="width: 100px">
  229. <el-option
  230. v-for = "i in options"
  231. :key = "i.inspectorNo"
  232. :label = "i.inspectorName"
  233. :value = "i.inspectorNo">
  234. </el-option>
  235. </el-select>
  236. </el-form-item>
  237. <el-form-item :label="'质检备注'">
  238. <el-input v-if="detailData.submitFlag == 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 200px"></el-input>
  239. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionRemark" style="width: 200px"></el-input>
  240. </el-form-item>
  241. <el-form-item :label="' '">
  242. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  243. </el-form-item>
  244. <el-form-item :label="' '"></el-form-item>
  245. </el-form>
  246. <!-- 展示列表 -->
  247. <div class="rq ">
  248. <el-table
  249. :height="700"
  250. :data="detailList"
  251. border
  252. v-loading="dataListLoading"
  253. style="width: 100%;">
  254. <el-table-column
  255. v-for="(item,index) in detailColumnList" :key="index"
  256. :sortable="item.columnSortable"
  257. :prop="item.columnProp"
  258. :header-align="item.headerAlign"
  259. :show-overflow-tooltip="item.showOverflowTooltip"
  260. :align="item.align"
  261. :fixed="item.fixed==''?false:item.fixed"
  262. :min-width="item.columnWidth"
  263. :label="item.columnLabel">
  264. <template slot-scope="scope">
  265. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  266. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column
  270. prop=""
  271. header-align="center"
  272. align="center"
  273. min-width="80"
  274. label="子明细">
  275. <template slot-scope="scope">
  276. <el-button type="primary" @click="subDetailModal(scope.row) ">点击输入子明细</el-button>
  277. </template>
  278. </el-table-column>
  279. <el-table-column
  280. prop=""
  281. header-align="center"
  282. align="right"
  283. min-width="80"
  284. label="不合格数量">
  285. <template slot-scope="scope">
  286. <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>
  287. <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>
  288. </template>
  289. </el-table-column>
  290. <el-table-column
  291. prop=""
  292. header-align="center"
  293. align="right"
  294. min-width="75"
  295. label="项目检验结论">
  296. <template slot-scope="scope">
  297. <el-select v-if="detailData.submitFlag == 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
  298. <el-option label="合格" value="Y" style="color: green"></el-option>
  299. <el-option label="不合格" value="N" style="color: red"></el-option>
  300. </el-select>
  301. <el-select v-if="detailData.submitFlag != 'Y'" v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  302. <el-option label="合格" value="Y" style="color: green"></el-option>
  303. <el-option label="不合格" value="N" style="color: red"></el-option>
  304. </el-select>
  305. </template>
  306. </el-table-column>
  307. </el-table>
  308. </div>
  309. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  310. <el-button type="primary" @click="Transfer()">保存</el-button>
  311. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  312. </el-footer>
  313. </el-dialog>
  314. <!-- 子明细信息 -->
  315. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="471px">
  316. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  317. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  318. <div class="rq ">
  319. <el-table
  320. :height="300"
  321. :data="tableData"
  322. border
  323. :row-class-name="rowClassName"
  324. @selection-change="handleDetailSelectionChange"
  325. style="width: 100%;">
  326. <el-table-column type="selection" align="center" width="50"></el-table-column>
  327. <el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
  328. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="抽样位置" width="150">
  329. <template slot-scope="{row}">
  330. <el-input v-if="tableData[row.xh-1].isSubmit=='Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置"></el-input>
  331. <el-input v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocation" placeholder="请输入抽样位置"></el-input>
  332. </template>
  333. </el-table-column>
  334. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="200">
  335. <template slot-scope="{row}">
  336. <el-input v-if="tableData[row.xh-1].isSubmit=='Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  337. <el-input v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].subDetailValue" placeholder="请输入实测值"></el-input>
  338. </template>
  339. </el-table-column>
  340. </el-table>
  341. </div>
  342. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  343. <el-button type="primary" @click="saveSubDetailResult()">保存</el-button>
  344. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  345. </el-footer>
  346. </el-dialog>
  347. <!-- 文件清单 -->
  348. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="1000px">
  349. <el-table
  350. :height="400"
  351. :data="fileContentList"
  352. border
  353. v-loading="dataListLoading"
  354. style="width: 100%; ">
  355. <el-table-column
  356. v-for="(item,index) in fileColumnList" :key="index"
  357. :sortable="item.columnSortable"
  358. :prop="item.columnProp"
  359. :header-align="item.headerAlign"
  360. :show-overflow-tooltip="item.showOverflowTooltip"
  361. :align="item.align"
  362. :fixed="item.fixed==''?false:item.fixed"
  363. :min-width="item.columnWidth"
  364. :label="item.columnLabel">
  365. <template slot-scope="scope">
  366. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  367. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  368. </template>
  369. </el-table-column>
  370. <el-table-column
  371. fixed="right"
  372. header-align="center"
  373. align="center"
  374. width="100"
  375. label="操作">
  376. <template slot-scope="scope">
  377. <a @click="downloadFile(scope.row)" >下载</a>
  378. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  379. </template>
  380. </el-table-column>
  381. </el-table>
  382. </el-dialog>
  383. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  384. <!-- 上传文件的modal -->
  385. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="getDataList()" v-drag></qcFAIUploadFile>
  386. </div>
  387. </template>
  388. <script>
  389. import {
  390. qcIPQCInspectionSearch, // 查询IPQC的检验记录
  391. ipqcDetailSearch, // 查询IPQC的检验明细
  392. inspectorSearch, // 查询检验员
  393. ipqcRecordDelete, // 删除检验记录
  394. saveIPQCDetailedRecord, // 新增明细信息
  395. saveIPQCSubmitResult, // 审核
  396. saveIPQCSubDetailed, // 新增子明细信息
  397. selectIPQCSubDetailedRecord, // 子明细记录信息查询
  398. checkIPQCIsSubmit, // 检查是否已提交
  399. checkIPQCSubDetailValue, // 检查子明细中的实测值是否在规定范围
  400. getOperationList, // 查询工序列表
  401. getResourceList, // 查询机台列表
  402. getPartList, // 查询物料列表
  403. saveOsInspection, // 新增巡检记录
  404. } from "@/api/qc/qc.js";
  405. import Chooselist from '@/views/modules/common/Chooselist_eam';
  406. import {getFileContentList} from '@/api/eam/eam_object_list.js';
  407. import {deleteObjectFile} from '@/api/eam/eam.js';
  408. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  409. import qcFAIUploadFile from "./qc_FAI_upload_file";
  410. import axios from 'axios'
  411. import Vue from 'vue'
  412. /*上传文件的組件*/
  413. export default {
  414. components: {
  415. Chooselist,
  416. qcFAIUploadFile
  417. },
  418. watch: {
  419. },
  420. data () {
  421. return {
  422. inspectionNo: '',
  423. fileFlag: false,
  424. fileContentList: [],
  425. // 是否收藏
  426. favorite: false,
  427. // 导出 start
  428. exportData: [],
  429. exportName: "IPQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  430. exportHeader: ["IPQC检验录入"],
  431. exportFooter: [],
  432. exportList:[],
  433. // 导出 end
  434. checkCompletedData:{
  435. inspectionNo: ''
  436. },
  437. submitData:{
  438. site: this.$store.state.user.site,
  439. inspectionNo: '',
  440. submit_flag: '',
  441. inspectionResult: '',
  442. },
  443. tagNo:'',
  444. searchData: {
  445. site: this.$store.state.user.site,
  446. inspectionNo: '',
  447. state: '',
  448. inspectionResult: '',
  449. orderNo: '',
  450. operationDesc: '',
  451. startDate: '',
  452. endDate: '',
  453. checkType: '',
  454. page: 1,
  455. limit: 10,
  456. },
  457. pageIndex: 1,
  458. pageSize: 100,
  459. totalPage: 0,
  460. height: 200,
  461. dataList: [],
  462. dataListLoading: false,
  463. dataListSelections: [],
  464. modalData: {
  465. flag:'',
  466. site: this.$store.state.user.site,
  467. inspectionNo:'',
  468. partNo: '',
  469. partDesc: '',
  470. inspectionTypeNo:'101',
  471. inspectionTypeName:'IPQC',
  472. inspectorNo:'',
  473. inspectorName:'',
  474. submit_flag:'',
  475. orderNo: '',
  476. operationDesc: '',
  477. operationNo: '',
  478. resourceId: '',
  479. resourceDesc: '',
  480. rollQty: '',
  481. },
  482. // 展示列集
  483. columnList: [
  484. {
  485. columnProp: 'inspectionNo',
  486. headerAlign: "center",
  487. align: "left",
  488. columnLabel: '检验单号',
  489. columnHidden: false,
  490. columnImage: false,
  491. columnSortable: false,
  492. sortLv: 0,
  493. status: true,
  494. fixed: '',
  495. },
  496. {
  497. columnProp: 'inspectionResult',
  498. headerAlign: "center",
  499. align: "left",
  500. columnLabel: '检验结论',
  501. columnHidden: false,
  502. columnImage: false,
  503. columnSortable: false,
  504. sortLv: 0,
  505. status: true,
  506. fixed: '',
  507. },
  508. {
  509. columnProp: 'disposalMeasures',
  510. headerAlign: "center",
  511. align: "left",
  512. columnLabel: '处置措施',
  513. columnHidden: false,
  514. columnImage: false,
  515. columnSortable: false,
  516. sortLv: 0,
  517. status: true,
  518. fixed: '',
  519. },
  520. {
  521. columnProp: 'checkType',
  522. headerAlign: "center",
  523. align: "left",
  524. columnLabel: '检验类型',
  525. columnHidden: false,
  526. columnImage: false,
  527. columnSortable: false,
  528. sortLv: 0,
  529. status: true,
  530. fixed: '',
  531. },
  532. {
  533. columnProp: 'taskDate',
  534. headerAlign: "center",
  535. align: "left",
  536. columnLabel: '任务生成日期',
  537. columnHidden: false,
  538. columnImage: false,
  539. columnSortable: false,
  540. sortLv: 0,
  541. status: true,
  542. fixed: '',
  543. },
  544. {
  545. columnProp: 'inspectionCycle',
  546. headerAlign: "center",
  547. align: "left",
  548. columnLabel: '检验周期(h)',
  549. columnHidden: false,
  550. columnImage: false,
  551. columnSortable: false,
  552. sortLv: 0,
  553. status: true,
  554. fixed: '',
  555. },
  556. {
  557. columnProp: 'orderNo',
  558. headerAlign: "center",
  559. align: "left",
  560. columnLabel: '工单号',
  561. columnHidden: false,
  562. columnImage: false,
  563. columnSortable: false,
  564. sortLv: 0,
  565. status: true,
  566. fixed: '',
  567. },
  568. {
  569. columnProp: 'operationDesc',
  570. headerAlign: "center",
  571. align: "left",
  572. columnLabel: '工序',
  573. columnHidden: false,
  574. columnImage: false,
  575. columnSortable: false,
  576. sortLv: 0,
  577. status: true,
  578. fixed: '',
  579. },
  580. {
  581. columnProp: 'resourceDesc',
  582. headerAlign: "center",
  583. align: "left",
  584. columnLabel: '机台',
  585. columnHidden: false,
  586. columnImage: false,
  587. columnSortable: false,
  588. sortLv: 0,
  589. status: true,
  590. fixed: '',
  591. },
  592. {
  593. columnProp: 'partNo',
  594. headerAlign: "center",
  595. align: "left",
  596. columnLabel: '物料编码',
  597. columnHidden: false,
  598. columnImage: false,
  599. columnSortable: false,
  600. sortLv: 0,
  601. status: true,
  602. fixed: '',
  603. },
  604. {
  605. columnProp: 'partDesc',
  606. headerAlign: "center",
  607. align: "left",
  608. columnLabel: '物料名称',
  609. columnHidden: false,
  610. columnImage: false,
  611. columnSortable: false,
  612. sortLv: 0,
  613. status: true,
  614. fixed: '',
  615. },
  616. {
  617. columnProp: 'rollQty',
  618. headerAlign: "center",
  619. align: "left",
  620. columnLabel: '送检数量',
  621. columnHidden: false,
  622. columnImage: false,
  623. columnSortable: false,
  624. sortLv: 0,
  625. status: true,
  626. fixed: '',
  627. },
  628. {
  629. columnProp: 'samplingQty',
  630. headerAlign: "center",
  631. align: "left",
  632. columnLabel: '抽样数量',
  633. columnHidden: false,
  634. columnImage: false,
  635. columnSortable: false,
  636. sortLv: 0,
  637. status: true,
  638. fixed: '',
  639. },
  640. {
  641. columnProp: 'inspectionRemark',
  642. headerAlign: "center",
  643. align: "left",
  644. columnLabel: '质检备注',
  645. columnHidden: false,
  646. columnImage: false,
  647. columnSortable: false,
  648. sortLv: 0,
  649. status: true,
  650. fixed: '',
  651. },
  652. {
  653. columnProp: 'disposalRemark',
  654. headerAlign: "center",
  655. align: "left",
  656. columnLabel: '处置说明',
  657. columnHidden: false,
  658. columnImage: false,
  659. columnSortable: false,
  660. sortLv: 0,
  661. status: true,
  662. fixed: '',
  663. },
  664. {
  665. columnProp: 'inspectorDate',
  666. headerAlign: "center",
  667. align: "left",
  668. columnLabel: '检验时间',
  669. columnHidden: false,
  670. columnImage: false,
  671. columnSortable: false,
  672. sortLv: 0,
  673. status: true,
  674. fixed: '',
  675. },
  676. {
  677. columnProp: 'inspectorNo',
  678. headerAlign: "center",
  679. align: "left",
  680. columnLabel: '质检员',
  681. columnHidden: false,
  682. columnImage: false,
  683. columnSortable: false,
  684. sortLv: 0,
  685. status: true,
  686. fixed: '',
  687. },
  688. ],
  689. //项目清单
  690. detailData:{
  691. site: this.$store.state.user.site,
  692. inspectionNo:'',
  693. partNo:'',
  694. partDesc:'',
  695. rollQty:'',
  696. samplingQty: '',
  697. unqualifiedQty: 0,
  698. unqualifiedQuantity:'',
  699. disposalMeasures:'',
  700. disposalRemark: '',
  701. inspectionResult: '',
  702. inspectorNo: '',
  703. inspectionRemark: '',
  704. submitFlag: '',
  705. },
  706. detailInformationFlag:false,
  707. detailList:[],
  708. saveInformationData:{
  709. site: this.$store.state.user.site,
  710. inspectionNo:'',
  711. disposalMeasures: '',
  712. disposalRemark: '',
  713. inspectorNo: '',
  714. inspectionRemark: '',
  715. itemList:[],
  716. },
  717. detailColumnList: [
  718. {
  719. columnProp: 'itemDesc',
  720. headerAlign: "center",
  721. align: "left",
  722. columnLabel: '检验项目',
  723. columnHidden: false,
  724. columnImage: false,
  725. columnSortable: false,
  726. sortLv: 0,
  727. status: true,
  728. fixed: '',
  729. },
  730. {
  731. columnProp: 'samplingLevelDesc',
  732. headerAlign: "center",
  733. align: "left",
  734. columnLabel: '检验水平',
  735. columnHidden: false,
  736. columnImage: false,
  737. columnSortable: false,
  738. sortLv: 0,
  739. status: true,
  740. fixed: '',
  741. },
  742. {
  743. columnProp: 'samplingProgrammeDesc',
  744. headerAlign: "center",
  745. align: "left",
  746. columnLabel: '检验方案',
  747. columnHidden: false,
  748. columnImage: false,
  749. columnSortable: false,
  750. sortLv: 0,
  751. status: true,
  752. fixed: '',
  753. },
  754. {
  755. columnProp: 'objectDesc',
  756. headerAlign: "center",
  757. align: "left",
  758. columnLabel: '检测仪器',
  759. columnHidden: false,
  760. columnImage: false,
  761. columnSortable: false,
  762. sortLv: 0,
  763. status: true,
  764. fixed: '',
  765. },
  766. {
  767. columnProp: 'aql',
  768. headerAlign: "center",
  769. align: "left",
  770. columnLabel: 'AQL',
  771. columnHidden: false,
  772. columnImage: false,
  773. columnSortable: false,
  774. sortLv: 0,
  775. status: true,
  776. fixed: '',
  777. },
  778. {
  779. columnProp: 'ac',
  780. headerAlign: "center",
  781. align: "left",
  782. columnLabel: 'AC',
  783. columnHidden: false,
  784. columnImage: false,
  785. columnSortable: false,
  786. sortLv: 0,
  787. status: true,
  788. fixed: '',
  789. },
  790. {
  791. columnProp: 're',
  792. headerAlign: "center",
  793. align: "left",
  794. columnLabel: 'RE',
  795. columnHidden: false,
  796. columnImage: false,
  797. columnSortable: false,
  798. sortLv: 0,
  799. status: true,
  800. fixed: '',
  801. },
  802. {
  803. columnProp: 'defaultValue',
  804. headerAlign: "center",
  805. align: "left",
  806. columnLabel: '标准值',
  807. columnHidden: false,
  808. columnImage: false,
  809. columnSortable: false,
  810. sortLv: 0,
  811. status: true,
  812. fixed: '',
  813. },
  814. {
  815. columnProp: 'maxValue',
  816. headerAlign: "center",
  817. align: "left",
  818. columnLabel: '上限值',
  819. columnHidden: false,
  820. columnImage: false,
  821. columnSortable: false,
  822. sortLv: 0,
  823. status: true,
  824. fixed: '',
  825. },
  826. {
  827. columnProp: 'minValue',
  828. headerAlign: "center",
  829. align: "left",
  830. columnLabel: '下限值',
  831. columnHidden: false,
  832. columnImage: false,
  833. columnSortable: false,
  834. sortLv: 0,
  835. status: true,
  836. fixed: '',
  837. },
  838. {
  839. columnProp: 'valueType',
  840. headerAlign: "center",
  841. align: "left",
  842. columnLabel: '检测值类型',
  843. columnHidden: false,
  844. columnImage: false,
  845. columnSortable: false,
  846. sortLv: 0,
  847. status: true,
  848. fixed: '',
  849. },
  850. ],
  851. fileColumnList: [
  852. {
  853. columnProp: 'fileName',
  854. headerAlign: "center",
  855. align: "left",
  856. columnLabel: '文件名称',
  857. columnHidden: false,
  858. columnImage: false,
  859. columnSortable: false,
  860. sortLv: 0,
  861. status: true,
  862. fixed: '',
  863. },
  864. {
  865. columnProp: 'createdBy',
  866. headerAlign: "center",
  867. align: 'left',
  868. columnLabel: '上传人',
  869. columnHidden: false,
  870. columnImage: false,
  871. columnSortable: true,
  872. sortLv: 0,
  873. status: true,
  874. fixed: false
  875. },
  876. {
  877. columnProp: 'createDate',
  878. headerAlign: "center",
  879. align: 'left',
  880. columnLabel: '上传时间',
  881. columnHidden: false,
  882. columnImage: false,
  883. columnSortable: true,
  884. sortLv: 0,
  885. status: true,
  886. fixed: false
  887. },
  888. {
  889. columnProp: 'orderRef3',
  890. headerAlign: "center",
  891. align: 'left',
  892. columnLabel: '备注',
  893. columnHidden: false,
  894. columnImage: false,
  895. columnSortable: true,
  896. sortLv: 0,
  897. status: true,
  898. fixed: false
  899. },
  900. ],
  901. // 子明细数据对象
  902. tableData: [],
  903. checkedDetail: [],
  904. subDetailFlag: false,
  905. subDetailData: {
  906. site: this.$store.state.user.site,
  907. inspectionNo: '',
  908. itemNo: '',
  909. itemDesc: '',
  910. defaultValue: '',
  911. maxValue: '',
  912. minValue: '',
  913. subDetailValues:[]
  914. },
  915. options: [],
  916. modalDisableFlag: false,
  917. modalFlag: false,
  918. operationList: [],
  919. resourceList: [],
  920. partList: [],
  921. }
  922. },
  923. mounted () {
  924. this.$nextTick(() => {
  925. this.height = window.innerHeight - 210
  926. })
  927. },
  928. created () {
  929. this.getDataList()
  930. this.favoriteIsOk()
  931. },
  932. methods: {
  933. //刷新派设备文档的列表
  934. getFileContentData(row) {
  935. let currentData = {
  936. orderRef2: row.inspectionNo
  937. };
  938. getFileContentList(currentData).then(({data}) => {
  939. //区分请求成功和失败的状况
  940. if (data && data.code == 200) {
  941. this.fileContentList = data.rows;
  942. } else {
  943. this.fileContentList = [];
  944. }
  945. })
  946. this.fileFlag = true;
  947. },
  948. /*新增文件的modal*/
  949. addUploadFileModal(){
  950. let currentData = {
  951. site: this.$store.state.user.site,
  952. createBy: this.$store.state.user.name,
  953. inspectionNo: this.detailData.inspectionNo,
  954. remark: '',
  955. folder: 'qcIPQC',
  956. };
  957. //打开组件 去做新增业务
  958. this.$nextTick(() => {
  959. this.$refs.qcFAIUploadFile.init(currentData);
  960. })
  961. },
  962. downloadFile(row){
  963. axios.get('/proxyApi/pms/eamObject/downLoadObjectFile/' + row.id, {
  964. responseType: 'blob',
  965. headers: {
  966. 'Content-Type': 'application/json',
  967. 'token': Vue.cookie.get('token')
  968. }
  969. }).then(({data}) => {
  970. // 不限制文件下载类型
  971. const blob = new Blob([data], {type: "application/octet-stream"})
  972. // 下载文件名称
  973. const fileName = row.fileName
  974. // a标签下载
  975. const linkNode = document.createElement('a')
  976. // a标签的download属性规定下载文件的名称
  977. linkNode.download = fileName
  978. linkNode.style.display = 'none'
  979. // 生成一个Blob URL
  980. linkNode.href = URL.createObjectURL(blob)
  981. document.body.appendChild(linkNode)
  982. // 模拟在按钮上的一次鼠标单击
  983. linkNode.click()
  984. // 释放URL 对象
  985. URL.revokeObjectURL(linkNode.href)
  986. document.body.removeChild(linkNode)
  987. })
  988. },
  989. // 删除文件
  990. deleteFile(row){
  991. this.$confirm('确定要删除此文件?', '提示', {
  992. confirmButtonText: '确定',
  993. cancelButtonText: '取消',
  994. type: 'warning'
  995. }).then(() => {
  996. deleteObjectFile(row).then(({data}) => {
  997. if (data && data.code == 0) {
  998. this.getFileContentData(row);
  999. this.$message({
  1000. message: '操作成功',
  1001. type: 'success',
  1002. duration: 1500,
  1003. onClose: () => {
  1004. }
  1005. })
  1006. } else {
  1007. this.$alert(data.msg, '错误', {
  1008. confirmButtonText: '确定'
  1009. })
  1010. }
  1011. })
  1012. }).catch(() => {
  1013. })
  1014. },
  1015. // 查询检验类型
  1016. inspectorSearch(){
  1017. inspectorSearch().then(({data}) => {
  1018. if (data.code === 0) {
  1019. this.options = data.rows
  1020. }
  1021. })
  1022. },
  1023. // 清空搜索栏
  1024. doEmpty(){
  1025. this.searchData = {
  1026. site: this.$store.state.user.site,
  1027. inspectionNo: '',
  1028. state: '',
  1029. inspectionResult: '',
  1030. orderNo: '',
  1031. operationDesc: '',
  1032. startDate: '',
  1033. endDate: '',
  1034. checkType: '',
  1035. page: 1,
  1036. limit: 10,
  1037. }
  1038. },
  1039. // 获取基础数据列表S
  1040. getBaseList (val,type) {
  1041. this.tagNo = val
  1042. this.$nextTick(() => {
  1043. let strVal = ''
  1044. if (val === 1052) {
  1045. strVal = this.modalData.orderNo
  1046. this.$refs.baseList.init(val, strVal)
  1047. }
  1048. })
  1049. },
  1050. /* 列表方法的回调 */
  1051. getBaseData (val) {
  1052. if (this.tagNo === 1052) {
  1053. this.modalData.orderNo = val.orderno
  1054. this.getOperationList()
  1055. this.getPartList()
  1056. }
  1057. },
  1058. // 获取工序列表
  1059. getOperationList(){
  1060. getOperationList(this.modalData).then(({data}) => {
  1061. if (data && data.code === 0) {
  1062. this.operationList = data.rows
  1063. } else {
  1064. this.$alert(data.msg, '错误', {
  1065. confirmButtonText: '确定'
  1066. })
  1067. }
  1068. })
  1069. },
  1070. // 获取机台列表
  1071. getResourceList(){
  1072. getResourceList(this.modalData).then(({data}) => {
  1073. if (data && data.code === 0) {
  1074. this.resourceList = data.rows
  1075. } else {
  1076. this.$alert(data.msg, '错误', {
  1077. confirmButtonText: '确定'
  1078. })
  1079. }
  1080. })
  1081. },
  1082. // 获取物料列表
  1083. getPartList(){
  1084. getPartList(this.modalData).then(({data}) => {
  1085. if (data && data.code === 0) {
  1086. this.partList = data.rows
  1087. } else {
  1088. this.$alert(data.msg, '错误', {
  1089. confirmButtonText: '确定'
  1090. })
  1091. }
  1092. })
  1093. },
  1094. addModal(){
  1095. this.modalData={
  1096. flag: '1',
  1097. site: this.$store.state.user.site,
  1098. inspectionNo:'',
  1099. partNo: '',
  1100. partDesc: '',
  1101. inspectionTypeNo:'101',
  1102. inspectionTypeName:'IPQC',
  1103. inspectorNo:'',
  1104. inspectorName:'',
  1105. submit_flag:'',
  1106. orderNo: '',
  1107. operationDesc: '',
  1108. operationNo: '',
  1109. resourceId: '',
  1110. resourceDesc: '',
  1111. rollQty: '',
  1112. };
  1113. this.modalDisableFlag = false;
  1114. this.modalFlag = true;
  1115. },
  1116. // 新增IPQC巡检记录
  1117. saveData(){
  1118. if (this.modalData.orderNo == '' || this.modalData.orderNo == null) {
  1119. this.$alert('请选择工单!', '错误', {
  1120. confirmButtonText: '确定'
  1121. })
  1122. return false
  1123. }
  1124. if (this.modalData.partNo == '' || this.modalData.partNo == null) {
  1125. this.$alert('请选择物料!', '错误', {
  1126. confirmButtonText: '确定'
  1127. })
  1128. return false
  1129. }
  1130. if (this.modalData.operationDesc == '' || this.modalData.operationDesc == null) {
  1131. this.$alert('请选择工序!', '错误', {
  1132. confirmButtonText: '确定'
  1133. })
  1134. return false
  1135. }
  1136. if (this.modalData.resourceId == '' || this.modalData.resourceId == null) {
  1137. this.$alert('请选择机台!', '错误', {
  1138. confirmButtonText: '确定'
  1139. })
  1140. return false
  1141. }
  1142. if (this.modalData.rollQty == '' || this.modalData.rollQty == null) {
  1143. this.$alert('请填写送检数量!', '错误', {
  1144. confirmButtonText: '确定'
  1145. })
  1146. return false
  1147. }
  1148. if(this.modalData.flag=='1'){
  1149. saveOsInspection(this.modalData).then(({data}) => {
  1150. if (data && data.code === 0) {
  1151. this.getDataList()
  1152. this.operationList = []
  1153. this.resourceList = []
  1154. this.partList = []
  1155. this.modalFlag = false
  1156. this.$message({
  1157. message: '操作成功',
  1158. type: 'success',
  1159. duration: 1500,
  1160. onClose: () => {
  1161. }
  1162. })
  1163. } else {
  1164. this.$alert(data.msg, '错误', {
  1165. confirmButtonText: '确定'
  1166. })
  1167. }
  1168. })
  1169. }
  1170. },
  1171. // 获取主信息数据列表
  1172. getDataList () {
  1173. this.searchData.limit = this.pageSize
  1174. this.searchData.page = this.pageIndex
  1175. qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  1176. if (data.code == 0) {
  1177. this.dataList = data.page.list
  1178. this.pageIndex = data.page.currPage
  1179. this.pageSize = data.page.pageSize
  1180. this.totalPage = data.page.totalCount
  1181. }
  1182. this.dataListLoading = false
  1183. })
  1184. },
  1185. // 每页数
  1186. sizeChangeHandle (val) {
  1187. this.pageSize = val
  1188. this.pageIndex = 1
  1189. this.getDataList()
  1190. },
  1191. // 当前页
  1192. currentChangeHandle (val) {
  1193. this.pageIndex = val
  1194. this.getDataList()
  1195. },
  1196. // 多选
  1197. selectionChangeHandle (val) {
  1198. this.dataListSelections = val
  1199. },
  1200. // 删除检验记录
  1201. deleteModal (row) {
  1202. this.$confirm(`是否删除这条检验记录?`, '提示', {
  1203. confirmButtonText: '确定',
  1204. cancelButtonText: '取消',
  1205. type: 'warning'
  1206. }).then(() => {
  1207. ipqcRecordDelete(row).then(({data}) => {
  1208. if (data && data.code ==0) {
  1209. this.getDataList()
  1210. this.$message({
  1211. message: '操作成功',
  1212. type: 'success',
  1213. duration: 1500,
  1214. onClose: () => {
  1215. }
  1216. })
  1217. } else {
  1218. this.$alert(data.msg, '错误', {
  1219. confirmButtonText: '确定'
  1220. })
  1221. }
  1222. })
  1223. }).catch(() => {
  1224. })
  1225. },
  1226. Transfer(){
  1227. if (this.detailData.inspectionResult == '' || this.detailData.inspectionResult == null) {
  1228. this.$alert('请选择检验结论!', '错误', {
  1229. confirmButtonText: '确定'
  1230. })
  1231. return false
  1232. }
  1233. if (this.detailData.inspectorNo == '' || this.detailData.inspectorNo == null) {
  1234. this.$alert('请选择检验员!', '错误', {
  1235. confirmButtonText: '确定'
  1236. })
  1237. return false
  1238. }
  1239. // if (this.detailData.inspectionResult == 'Y' && (this.detailData.disposalMeasures == '特采' || this.detailData.disposalMeasures == '拒收')) {
  1240. // this.$alert('合格不予处置措施,请查看!', '错误', {
  1241. // confirmButtonText: '确定'
  1242. // })
  1243. // return false
  1244. // }
  1245. for (let i = 0; i < this.detailList.length; i++) {
  1246. if(this.detailList[i].itemResult == '' || this.detailList[i].itemResult == null){
  1247. // this.$alert(this.detailList[i].itemDesc+'是否合格未确认!', '错误', {
  1248. // confirmButtonText: '确定'
  1249. // })
  1250. // return false
  1251. this.detailList[i].itemResult = 'Y'
  1252. }
  1253. if(this.detailList[i].valueTypeDb == 'N') {
  1254. checkIPQCSubDetailValue(this.detailList[i]).then(({data}) => {
  1255. if (data.flag == 2 && this.detailList[i].itemResult == 'Y') {
  1256. this.$confirm(this.detailList[i].itemDesc + ' 中实测值不在合格范围!是否保存为合格?', '提示', {
  1257. confirmButtonText: '确定',
  1258. cancelButtonText: '取消',
  1259. type: 'warning'
  1260. }).then(() => {
  1261. this.saveDetailInformation()
  1262. }).then(() => {
  1263. return false
  1264. })
  1265. }else {
  1266. this.saveDetailInformation()
  1267. }
  1268. })
  1269. }
  1270. }
  1271. this.$message({message: '操作成功', type: 'success', duration: 1500, onClose: () => {}})
  1272. },
  1273. // 新增明细信息
  1274. saveDetailInformation(){
  1275. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  1276. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  1277. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  1278. this.saveInformationData.inspectorNo = this.detailData.inspectorNo
  1279. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  1280. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  1281. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  1282. saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => {
  1283. if (data && data.code == '0') {
  1284. this.getDataList()
  1285. this.detailInformationFlag = false
  1286. } else {
  1287. this.$alert(data.msg, '错误', {
  1288. confirmButtonText: '确定'
  1289. })
  1290. }
  1291. })
  1292. },
  1293. // 明细记录信息查询
  1294. detailModal(row){
  1295. this.detailData.site = this.$store.state.user.site,
  1296. this.detailData.inspectionNo = row.inspectionNo
  1297. this.detailData.partNo = row.partNo
  1298. this.detailData.partDesc = row.partDesc
  1299. this.detailData.rollQty = row.rollQty
  1300. this.detailData.samplingQty = row.samplingQty
  1301. this.detailData.unqualifiedQty = row.unqualifiedQty
  1302. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  1303. this.detailData.submitFlag = row.submitFlag
  1304. this.detailData.disposalMeasures = row.disposalMeasures
  1305. this.detailData.disposalRemark = row.disposalRemark
  1306. this.detailData.inspectionResult = row.inspectionResult
  1307. this.detailData.inspectorNo = row.inspectorNo
  1308. this.detailData.inspectionRemark = row.inspectionRemark
  1309. ipqcDetailSearch(this.detailData).then(({data}) => {
  1310. this.detailList = data.rows
  1311. })
  1312. this.inspectorSearch();
  1313. this.detailInformationFlag = true;
  1314. },
  1315. // 子明细记录信息查询
  1316. subDetailModal(row){
  1317. this.subDetailData.inspectionNo = row.inspectionNo;
  1318. this.subDetailData.itemNo = row.itemNo;
  1319. this.subDetailData.itemDesc = row.itemDesc;
  1320. this.subDetailData.defaultValue = row.defaultValue;
  1321. this.subDetailData.maxValue = row.maxValue;
  1322. this.subDetailData.minValue = row.minValue;
  1323. selectIPQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  1324. this.tableData = data.rows
  1325. })
  1326. this.subDetailFlag = true;
  1327. },
  1328. // 提交按钮
  1329. submitResult(row){
  1330. this.submitData.site = row.site
  1331. this.submitData.inspectionNo = row.inspectionNo
  1332. this.submitData.inspectionResult = row.inspectionResult
  1333. if (row.inspectionResult == '不合格' && (row.disposalMeasures == '' || row.disposalMeasures == null)){
  1334. this.$alert('处置措施未选择!', '错误', {
  1335. confirmButtonText: '确定'
  1336. })
  1337. return false
  1338. }
  1339. this.$confirm(`是否确认审核?`, '提示', {
  1340. confirmButtonText: '确定',
  1341. cancelButtonText: '取消',
  1342. type: 'warning'
  1343. }).then(() => {
  1344. saveIPQCSubmitResult(this.submitData).then(({data}) => {
  1345. if (data && data.code ==0) {
  1346. this.getDataList()
  1347. this.$message({
  1348. message: '操作成功',
  1349. type: 'success',
  1350. duration: 1500,
  1351. onClose: () => {
  1352. }
  1353. })
  1354. } else {
  1355. this.$alert(data.msg, '错误', {
  1356. confirmButtonText: '确定'
  1357. })
  1358. }
  1359. })
  1360. }).catch(() => {
  1361. })
  1362. },
  1363. // 子明细方法
  1364. //表格的新增
  1365. rowClassName({ row, rowIndex }) {
  1366. row.xh = rowIndex + 1;
  1367. },
  1368. //单选框选中数据
  1369. handleDetailSelectionChange(selection) {
  1370. this.checkedDetail = selection;
  1371. },
  1372. //点击新增更多
  1373. handleAddBtn(td) {
  1374. checkIPQCIsSubmit(td).then(({data}) => {
  1375. if (data.flag != 1) {
  1376. let obj = {};
  1377. obj.subDetailValue = "";
  1378. obj.samplingLocation = "";
  1379. this.tableData.push(obj);
  1380. console.log(this.tableData)
  1381. } else {
  1382. this.$alert("记录已提交!", '错误', {
  1383. confirmButtonText: '确定'
  1384. })
  1385. }
  1386. })
  1387. },
  1388. //删除
  1389. handleDeleteBtn(td) {
  1390. checkIPQCIsSubmit(td).then(({data}) => {
  1391. if (data.flag != 1) {
  1392. if (this.checkedDetail.length == 0) {
  1393. this.$alert("请先选择要删除的数据", "提示", {
  1394. confirmButtonText: "确定",
  1395. });
  1396. } else {
  1397. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  1398. confirmButtonText: "确定",
  1399. cancelButtonText: "取消",
  1400. type: "warning",
  1401. callback: (action) => {
  1402. if (action === "confirm") {
  1403. let val = this.checkedDetail;
  1404. val.forEach((val, index) => {
  1405. this.tableData.forEach((v, i) => {
  1406. if (val.xh === v.xh) {
  1407. this.tableData.splice(i, 1);
  1408. }
  1409. });
  1410. });
  1411. this.$message({
  1412. message: "删除成功,记得保存修改喔!",
  1413. type: "success",
  1414. });
  1415. return;
  1416. } else {
  1417. this.$message({
  1418. message: "已取消删除操作",
  1419. type: "warning",
  1420. });
  1421. return;
  1422. }
  1423. },
  1424. });
  1425. }
  1426. } else {
  1427. this.$alert("记录已提交!", '错误', {
  1428. confirmButtonText: '确定'
  1429. })
  1430. }
  1431. })
  1432. },
  1433. // 新增子明细记录
  1434. saveSubDetailResult(){
  1435. for (let i = 0; i < this.tableData.length; i++) {
  1436. if(this.tableData[i].subDetailValue == '' || this.tableData[i].subDetailValue == null){
  1437. this.$alert('序号' + (i+1) +'未填写实测值!', '错误', {
  1438. confirmButtonText: '确定'
  1439. })
  1440. return false
  1441. }
  1442. }
  1443. this.subDetailData.subDetailValues = this.tableData
  1444. saveIPQCSubDetailed(this.subDetailData).then(({data}) => {
  1445. if (data && data.code === 0) {
  1446. this.getDataList()
  1447. this.subDetailFlag = false
  1448. this.tableData = []
  1449. this.$message({
  1450. message: '操作成功',
  1451. type: 'success',
  1452. duration: 1500,
  1453. onClose: () => {
  1454. }
  1455. })
  1456. } else {
  1457. this.$alert(data.msg, '错误', {
  1458. confirmButtonText: '确定'
  1459. })
  1460. }
  1461. })
  1462. },
  1463. // 校验用户是否收藏
  1464. favoriteIsOk() {
  1465. let userFavorite = {
  1466. userId: this.$store.state.user.id,
  1467. languageCode: this.$i18n.locale
  1468. }
  1469. console.log(this.$route.meta.menuId)
  1470. userFavoriteList(userFavorite).then(({data}) => {
  1471. for (let i = 0; i < data.list.length; i++) {
  1472. // let flag=false;
  1473. if(this.$route.meta.menuId==data.list[i].menuId){
  1474. this.favorite = true
  1475. // flag=true;
  1476. }
  1477. }
  1478. })
  1479. },
  1480. // 收藏 OR 取消收藏
  1481. favoriteFunction() {
  1482. let userFavorite = {
  1483. userId: this.$store.state.user.id,
  1484. functionId: this.$route.meta.menuId,
  1485. }
  1486. if (this.favorite) {
  1487. // 取消收藏
  1488. // this.$confirm(`确定取消收藏`, '提示', {
  1489. // confirmButtonText: '确定',
  1490. // cancelButtonText: '取消',
  1491. // type: 'warning'
  1492. // }).then(() => {
  1493. removeUserFavorite(userFavorite).then(({data}) => {
  1494. this.$message.success(data.msg)
  1495. this.favorite = false
  1496. })
  1497. // })
  1498. } else {
  1499. // 收藏
  1500. saveUserFavorite(userFavorite).then(({data}) => {
  1501. this.$message.success(data.msg)
  1502. this.favorite = true
  1503. })
  1504. }
  1505. },
  1506. //导出excel
  1507. async createExportData() {
  1508. this.searchData.limit = -1
  1509. this.searchData.page = 1
  1510. await qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  1511. this.exportList= data.page.list;
  1512. })
  1513. return this.exportList;
  1514. },
  1515. startDownload() {
  1516. // this.exportData = this.dataList
  1517. },
  1518. finishDownload() {
  1519. },
  1520. fields() {
  1521. let json = "{"
  1522. this.columnList.forEach((item, index) => {
  1523. if (index == this.columnList.length - 1) {
  1524. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1525. } else {
  1526. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1527. }
  1528. })
  1529. json += "}"
  1530. let s = eval("(" + json + ")")
  1531. return s
  1532. },
  1533. // 导出 end
  1534. }
  1535. }
  1536. </script>
  1537. <style scoped>
  1538. </style>