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.

1426 lines
50 KiB

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