祥兆质量前端
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.

3741 lines
138 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 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" @keyup.enter.native="getDataList">
  11. <el-form-item :label="'BU'">
  12. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 75px">
  13. <el-option
  14. v-for = "i in userBuList"
  15. :key = "i.buNo"
  16. :label = "i.buDesc"
  17. :value = "i.buDesc">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'检验单号'">
  22. <el-input v-model="searchData.inspectionNo" clearable style="width: 140px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'单据号'">
  25. <el-input v-model="searchData.poOrderNo" clearable style="width: 150px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'单据行号'">
  28. <el-input v-model="searchData.poItemNo" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'物料编码'">
  31. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  32. </el-form-item>
  33. <el-form-item :label="'物料名称'">
  34. <el-input v-model="searchData.partDesc" clearable style="width: 315px"></el-input>
  35. </el-form-item>
  36. </el-form>
  37. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  38. <el-form-item :label="'通知单号'">
  39. <el-input v-model="searchData.receiptNo" clearable style="width: 144px"></el-input>
  40. </el-form-item>
  41. <el-form-item :label="'关联单号1'">
  42. <el-input v-model="searchData.refInfo1" clearable style="width: 155px"></el-input>
  43. </el-form-item>
  44. <el-form-item :label="'关联单号2'">
  45. <el-input v-model="searchData.refInfo2" clearable style="width: 155px"></el-input>
  46. </el-form-item>
  47. <el-form-item :label="'关联单号3'">
  48. <el-input v-model="searchData.refInfo3" clearable style="width: 155px"></el-input>
  49. </el-form-item>
  50. <el-form-item :label="'关联单号4'">
  51. <el-input v-model="searchData.refInfo4" clearable style="width: 155px"></el-input>
  52. </el-form-item>
  53. <el-form-item :label="'关联单号5'">
  54. <el-input v-model="searchData.refInfo5" clearable style="width: 155px"></el-input>
  55. </el-form-item>
  56. </el-form>
  57. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  58. <el-form-item :label="'质检员'">
  59. <el-input v-model="searchData.inspectorName" clearable style="width: 120px"></el-input>
  60. </el-form-item>
  61. <el-form-item>
  62. <span slot="label" @click="getBaseList(509,1)"><a herf="#">供应商编码</a></span>
  63. <el-input v-model="searchData.supplierNo" clearable style="width: 145px"></el-input>
  64. </el-form-item>
  65. <el-form-item>
  66. <span slot="label" @click="getBaseList(508)"><a herf="#">仓库编码</a></span>
  67. <el-input v-model="searchData.warehouseId" clearable style="width: 130px"></el-input>
  68. </el-form-item>
  69. <el-form-item :label="'仓库名称'">
  70. <el-input v-model="searchData.warehouseName" clearable style="width: 200px"></el-input>
  71. </el-form-item>
  72. <el-form-item :label="'状态'">
  73. <el-select v-model="searchData.states" multiple style="width: 340px">
  74. <el-option label="未开始" value="未开始"></el-option>
  75. <el-option label="待检验" value="待检验"></el-option>
  76. <el-option label="待审核" value="待审核"></el-option>
  77. <el-option label="已完成" value="已完成"></el-option>
  78. </el-select>
  79. </el-form-item>
  80. </el-form>
  81. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  82. <el-form-item :label="'检验结论'">
  83. <el-select v-model="searchData.inspectionResult" clearable style="width: 80px">
  84. <el-option label="合格" value="合格"></el-option>
  85. <el-option label="不合格" value="不合格"></el-option>
  86. <el-option label="免检" value="免检"></el-option>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item :label="'处置措施'">
  90. <el-select v-model="searchData.disposalMeasures" clearable style="width: 90px">
  91. <el-option
  92. v-for = "i in disposalMeasuresOptions"
  93. :key = "i.id"
  94. :label = "i.disposalMeasures"
  95. :value = "i.disposalMeasures">
  96. </el-option>
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item :label="'送检日期'">
  100. <el-date-picker style="width: 120px" v-model="searchData.startDate2" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="开始日期"></el-date-picker>
  101. -
  102. <el-date-picker style="width: 120px" v-model="searchData.endDate2" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="结束日期"></el-date-picker>
  103. </el-form-item>
  104. <el-form-item :label="'检验日期'">
  105. <el-date-picker style="width: 120px" v-model="searchData.startDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="开始日期"></el-date-picker>
  106. -
  107. <el-date-picker style="width: 120px" v-model="searchData.endDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="结束日期"></el-date-picker>
  108. </el-form-item>
  109. <el-form-item :label="' '">
  110. <el-button v-if="!authSearch" type="primary" @click="getDataList">查询</el-button>
  111. <el-button v-if="!authCheck" type="primary" @click="submitResult">审核</el-button>
  112. <el-button v-if="!authDelete" type="primary" @click="deleteModal">删除</el-button>
  113. <el-button v-if="!authOverLoad" type="primary" @click="overLoadModal">任务重载</el-button>
  114. <el-button v-if="!authOverLoad" type="primary" @click="batchQualifiedModal">批量合格处理</el-button>
  115. <download-excel
  116. :fields="fields()"
  117. :data="exportData"
  118. type="xls"
  119. :name="exportName"
  120. :header="exportHeader"
  121. :footer="exportFooter"
  122. :fetch="createExportData"
  123. :before-generate="startDownload"
  124. :before-finish="finishDownload"
  125. worksheet="导出信息"
  126. class="el-button el-button--primary el-button--medium">
  127. {{ "导出" }}
  128. </download-excel>
  129. </el-form-item>
  130. </el-form>
  131. <!-- 检验记录展示列表 -->
  132. <el-table
  133. :height="height - 45"
  134. :data="dataList"
  135. border
  136. ref="IQCTable"
  137. show-summary
  138. :summary-method="getSummaries"
  139. :row-style="rowStyle"
  140. @row-click="IQCClickRow"
  141. @selection-change="selectionIQC"
  142. style="width: 100%;">
  143. <el-table-column
  144. type="selection"
  145. header-align="center"
  146. align="center"
  147. width="50">
  148. </el-table-column>
  149. <el-table-column
  150. prop="state"
  151. header-align="center"
  152. align="center"
  153. label="状态">
  154. <template slot-scope="scope">
  155. <div :style="{fontWeight:'bold', color: scope.row.state === '待检验' ? 'red' : scope.row.state === '待审核' ? '#ffa500e0' : scope.row.state === '已完成' ? '#3ac252' : ''}">
  156. {{ scope.row.state }}
  157. </div>
  158. </template>
  159. </el-table-column>
  160. <el-table-column
  161. v-for="(item,index) in columnList1" :key="index"
  162. :sortable="item.columnSortable"
  163. :prop="item.columnProp"
  164. :header-align="item.headerAlign"
  165. :show-overflow-tooltip="item.showOverflowTooltip"
  166. :align="item.align"
  167. :fixed="item.fixed===''?false:item.fixed"
  168. :min-width="item.columnWidth"
  169. :label="item.columnLabel">
  170. <template slot-scope="scope">
  171. <div v-if="item.columnProp === 'inspectionResult' && scope.row.inspectionResult === '不合格' && scope.row.disposalMeasures === '拒收退回'">
  172. <span v-if="!item.columnHidden" style="color: red"> {{ scope.row[item.columnProp] }}</span>
  173. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  174. </div>
  175. <div v-else>
  176. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  177. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  178. </div>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. fixed="right"
  183. header-align="center"
  184. align="center"
  185. width="100"
  186. label="操作">
  187. <template slot-scope="scope">
  188. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state === '未开始'" @click="actionModal(scope.row)">开始检验</el-link>
  189. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">检验单</el-link>
  190. <el-dropdown trigger="click">
  191. <el-link style="cursor: pointer;font-size: 12px">更多</el-link>
  192. <el-dropdown-menu slot="dropdown">
  193. <el-dropdown-item v-if="!authFile" @click.native="getFileContentData(scope.row)">工作文件</el-dropdown-item>
  194. <el-dropdown-item v-if="!authChange && scope.row.state === '待检验'" @click.native="changeInspectionModal(scope.row)">更改检验方式</el-dropdown-item>
  195. </el-dropdown-menu>
  196. </el-dropdown>
  197. </template>
  198. </el-table-column>
  199. </el-table>
  200. <!-- 分页-->
  201. <el-pagination
  202. @size-change="sizeChangeHandle"
  203. @current-change="currentChangeHandle"
  204. :current-page="pageIndex"
  205. :page-sizes="[20, 50, 100, 200, 500]"
  206. :page-size="pageSize"
  207. :total="totalPage"
  208. layout="total, sizes, prev, pager, next, jumper">
  209. </el-pagination>
  210. <!-- 检验单详情页 -->
  211. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1200px">
  212. <el-form :inline="true" label-position="top">
  213. <el-form-item :label="'物料编码'">
  214. <el-input v-model="detailData.partNo" disabled style="width: 120px"></el-input>
  215. </el-form-item>
  216. <el-form-item :label="'物料名称'">
  217. <el-input v-model="detailData.partDesc" disabled style="width: 220px"></el-input>
  218. </el-form-item>
  219. <el-form-item :label="'计量单位'">
  220. <el-input v-model="detailData.umId" disabled style="width: 80px"></el-input>
  221. </el-form-item>
  222. <el-form-item :label="'到货数量'">
  223. <el-input class="inlineNumber numInput" v-model="detailData.rollQty" type="number" disabled style="width: 80px"></el-input>
  224. </el-form-item>
  225. <el-form-item :label="'送检数量'">
  226. <el-input class="inlineNumber numInput" v-model="detailData.rollCount" type="number" style="width: 80px"></el-input>
  227. </el-form-item>
  228. <el-form-item :label="'抽样数量'">
  229. <el-input class="inlineNumber numInput" v-model="detailData.samplingQty" type="number" style="width: 80px"></el-input>
  230. </el-form-item>
  231. <el-form-item :label="'不合格项目数量'">
  232. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
  233. <el-input class="inlineNumber numInput" v-else @input="handleInput(detailData.unqualifiedQty,1)" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
  234. </el-form-item>
  235. <el-form-item :label="'合格数量'">
  236. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="detailData.passQty" disabled type="number" style="width: 80px"></el-input>
  237. <el-input class="inlineNumber numInput" v-else @input="handleInput(detailData.passQty,2)" v-model="detailData.passQty" type="number" style="width: 80px"></el-input>
  238. </el-form-item>
  239. <el-form-item :label="'不合格数量'">
  240. <el-input class="inlineNumber numInput" v-model="detailData.notPassQty" type="number" disabled style="width: 80px"></el-input>
  241. </el-form-item>
  242. <!-- <el-form-item :label="' '" style="margin-left: 38px">-->
  243. <!-- <el-button v-if="detailData.submitFlag !== 'Y'" type="primary" :loading="loadFlag" @click="dataAcquisition">数据采集</el-button>-->
  244. <!-- </el-form-item>-->
  245. <el-form-item :label="' '" style="margin-left: 25px">
  246. <el-button type="primary" @click="getFileContentData(detailData)">工作文件</el-button>
  247. </el-form-item>
  248. </el-form>
  249. <el-form :inline="true" label-position="top">
  250. <el-form-item :label="'检验结论'">
  251. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  252. <el-option label="合格" value="合格"></el-option>
  253. <el-option label="不合格" value="不合格"></el-option>
  254. </el-select>
  255. <el-select v-else v-model="detailData.inspectionResult" @change="resultChange" style="width: 100px" placeholder="请选择">
  256. <el-option label="合格" value="合格"></el-option>
  257. <el-option label="不合格" value="不合格"></el-option>
  258. </el-select>
  259. </el-form-item>
  260. <el-form-item :label="'质检备注'">
  261. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 310px"></el-input>
  262. <el-input v-else v-model="detailData.inspectionRemark" style="width: 310px"></el-input>
  263. </el-form-item>
  264. <el-form-item label="检验员">
  265. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  266. <el-option
  267. v-for = "i in options"
  268. :key = "i.inspectorNo"
  269. :label = "i.inspectorName"
  270. :value = "i.inspectorNo">
  271. </el-option>
  272. </el-select>
  273. <el-select v-else v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  274. <el-option
  275. v-for = "i in options"
  276. :key = "i.inspectorNo"
  277. :label = "i.inspectorName"
  278. :value = "i.inspectorNo">
  279. </el-option>
  280. </el-select>
  281. </el-form-item>
  282. <el-form-item>
  283. <span v-if="detailData.submitFlag === 'Y'" slot="label">协同人员</span>
  284. <span v-else style="cursor: pointer" slot="label" @click="getOperatorList"><a>协同人员</a></span>
  285. <el-input v-model="detailData.operatorName" readonly style="width: 224px"></el-input>
  286. </el-form-item>
  287. <el-form-item>
  288. <span v-if="detailData.submitFlag === 'Y'" slot="label">责任人(供应商)</span>
  289. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(509,2)" ><a>责任人(供应商)</a></span>
  290. <!-- <span v-else style="cursor: pointer" slot="label" @click="getResponsiblePersonList"><a>责任人</a></span>-->
  291. <el-input v-model="detailData.responsiblePerson" :readonly="detailData.submitFlag === 'Y'" style="width: 224px"></el-input>
  292. </el-form-item>
  293. <el-form-item :label="' '" style="margin-left: 20px">
  294. <el-button type="primary" icon="el-icon-upload" @click="subDetailUpload">明细导入</el-button>
  295. </el-form-item>
  296. </el-form>
  297. <el-form v-show="detailData.inspectionResult === '不合格'" :inline="true" label-position="top">
  298. <el-form-item :label="'处置措施'">
  299. <el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
  300. <el-option
  301. v-for = "i in disposalMeasuresOptions"
  302. :key = "i.id"
  303. :label = "i.disposalMeasures"
  304. :value = "i.disposalMeasures">
  305. </el-option>
  306. </el-select>
  307. <el-select v-else clearable v-model="detailData.disposalMeasures" style="width: 100px">
  308. <el-option
  309. v-for = "i in disposalMeasuresOptions"
  310. :key = "i.id"
  311. :label = "i.disposalMeasures"
  312. :value = "i.disposalMeasures">
  313. </el-option>
  314. </el-select>
  315. </el-form-item>
  316. <el-form-item :label="'处置说明'">
  317. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
  318. <el-input v-else v-model="detailData.disposalRemark" style="width: 280px"></el-input>
  319. </el-form-item>
  320. </el-form>
  321. <!-- 展示列表 -->
  322. <div class="rq ">
  323. <el-table
  324. :height="500"
  325. :data="detailList"
  326. border
  327. :row-style="rowDetailStyle"
  328. @row-click="IQCDetailClickRow"
  329. style="width: 100%;">
  330. <el-table-column
  331. prop=""
  332. header-align="center"
  333. align="center"
  334. min-width="60"
  335. label="操作">
  336. <template slot-scope="scope">
  337. <el-button v-if="scope.row.detailImageNum > 0" type="success" class="el-icon-picture" @click="uploadImageModal(scope.row)"></el-button>
  338. <el-button v-else class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  339. </template>
  340. </el-table-column>
  341. <el-table-column
  342. v-for="(item,index) in detailColumnList" :key="index"
  343. :sortable="item.columnSortable"
  344. :prop="item.columnProp"
  345. :header-align="item.headerAlign"
  346. :show-overflow-tooltip="item.showOverflowTooltip"
  347. :align="item.align"
  348. :fixed="item.fixed===''?false:item.fixed"
  349. :min-width="item.columnWidth"
  350. :label="item.columnLabel">
  351. <template slot-scope="scope">
  352. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  353. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column
  357. prop=""
  358. header-align="center"
  359. align="right"
  360. min-width="80"
  361. label="实测值">
  362. <template slot-scope="scope">
  363. <el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numberValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" type="number" style="height: 11px; width: 98%"></el-input>
  364. <el-input :ref="`textValue${scope.$index}`" v-else v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px; width: 98%"></el-input>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. prop=""
  369. header-align="center"
  370. align="center"
  371. min-width="80"
  372. label="检验明细">
  373. <template slot-scope="scope">
  374. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
  375. <el-button v-else type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. prop=""
  380. header-align="center"
  381. align="right"
  382. min-width="80"
  383. label="抽样数量">
  384. <template slot-scope="scope">
  385. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.samplingQty" disabled type="number" style="height: 11px; width: 98%"></el-input>
  386. <el-input class="inlineNumber numInput" v-else :ref="`samplingQty${scope.$index}`" v-model="scope.row.samplingQty" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'samplingQty')" style="height: 11px; width: 98%"></el-input>
  387. </template>
  388. </el-table-column>
  389. <el-table-column
  390. prop=""
  391. header-align="center"
  392. align="right"
  393. min-width="80"
  394. label="不合格数量">
  395. <template slot-scope="scope">
  396. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px; width: 98%"></el-input>
  397. <el-input class="inlineNumber numInput" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input>
  398. </template>
  399. </el-table-column>
  400. <el-table-column
  401. prop=""
  402. header-align="center"
  403. align="right"
  404. min-width="90"
  405. label="项目检验结论">
  406. <template slot-scope="scope">
  407. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
  408. <el-option label="合格" value="Y" style="color: green"></el-option>
  409. <el-option label="不合格" value="N" style="color: red"></el-option>
  410. </el-select>
  411. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  412. <el-option label="合格" value="Y" style="color: green"></el-option>
  413. <el-option label="不合格" value="N" style="color: red"></el-option>
  414. </el-select>
  415. </template>
  416. </el-table-column>
  417. </el-table>
  418. </div>
  419. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  420. <el-button type="primary" @click="Transfer">保存</el-button>
  421. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  422. </el-footer>
  423. </el-dialog>
  424. <!-- 文件清单 -->
  425. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  426. <el-form :inline="true" label-position="top">
  427. <el-form-item v-if="detailInformationFlag || batchInformationFlag">
  428. <el-button type="primary" @click="addUploadFileModal">上传文件</el-button>
  429. </el-form-item>
  430. </el-form>
  431. <el-table
  432. :height="350"
  433. :data="fileContentList"
  434. border
  435. style="width: 100%; ">
  436. <el-table-column
  437. v-for="(item,index) in fileColumnList" :key="index"
  438. :sortable="item.columnSortable"
  439. :prop="item.columnProp"
  440. :header-align="item.headerAlign"
  441. :show-overflow-tooltip="item.showOverflowTooltip"
  442. :align="item.align"
  443. :fixed="item.fixed===''?false:item.fixed"
  444. :min-width="item.columnWidth"
  445. :label="item.columnLabel">
  446. <template slot-scope="scope">
  447. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  448. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  449. </template>
  450. </el-table-column>
  451. <el-table-column
  452. fixed="right"
  453. header-align="center"
  454. align="center"
  455. width="100"
  456. label="操作">
  457. <template slot-scope="scope">
  458. <el-link style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link>
  459. <el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link>
  460. <el-link v-if="scope.row.fileType2 !== 'sop'" style="cursor: pointer" @click="deleteFile(scope.row)">删除</el-link>
  461. </template>
  462. </el-table-column>
  463. </el-table>
  464. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  465. <el-button type="primary" @click="fileFlag=false">关闭</el-button>
  466. </el-footer>
  467. </el-dialog>
  468. <!-- 子明细信息 -->
  469. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="622px">
  470. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  471. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  472. <el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
  473. <div class="rq ">
  474. <el-table
  475. :height="400"
  476. :data="templateTableData"
  477. border
  478. :row-class-name="rowClassName"
  479. @selection-change="handleDetailSelectionChange"
  480. style="width: 100%;">
  481. <el-table-column type="selection" align="center" width="50"></el-table-column>
  482. <el-table-column label="序号" align="center" prop="rowI" width="50"></el-table-column>
  483. <el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150">
  484. <template slot-scope="{row}">
  485. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
  486. <el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
  487. </template>
  488. </el-table-column>
  489. <el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150">
  490. <template slot-scope="{row}">
  491. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
  492. <el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
  493. </template>
  494. </el-table-column>
  495. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="200">
  496. <template slot-scope="{row}">
  497. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  498. <el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值"></el-input>
  499. </template>
  500. </el-table-column>
  501. </el-table>
  502. <!-- 分页-->
  503. <el-pagination
  504. @size-change="sizeChangeHandle2"
  505. @current-change="currentChangeHandle2"
  506. :current-page="pageIndex2"
  507. :page-sizes="[20, 50, 100, 200, 500]"
  508. :page-size="pageSize2"
  509. :total="tableData.length"
  510. layout="total, sizes, prev, pager, next, jumper">
  511. </el-pagination>
  512. </div>
  513. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  514. <el-button v-if="detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">保存</el-button>
  515. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  516. </el-footer>
  517. </el-dialog>
  518. <!-- 批量新增子明细操作-->
  519. <el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
  520. <el-form :inline="true" label-position="top">
  521. <el-form-item :label="'默认抽样位置A'">
  522. <el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
  523. </el-form-item>
  524. <el-form-item :label="'默认抽样位置B'">
  525. <el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
  526. </el-form-item>
  527. <el-form-item :label="'抽样数量'">
  528. <el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
  529. </el-form-item>
  530. </el-form>
  531. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  532. <el-button type="primary" @click="batchHandleAddModal">保存</el-button>
  533. <el-button type="primary" @click="batchHandleAddModalFlag = false">关闭</el-button>
  534. </el-footer>
  535. </el-dialog>
  536. <!-- 机修人员清单 -->
  537. <el-dialog title="人员清单" :close-on-click-modal="false" v-drag :visible.sync="operatorModelFlag" width="820px">
  538. <div class="rq">
  539. <el-form :inline="true" label-position="top" :model="operatorData">
  540. <el-form-item :label="'所属角色'">
  541. <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px">
  542. <el-option
  543. v-for = "i in roleList"
  544. :key = "i.roleId"
  545. :label = "i.roleName"
  546. :value = "i.roleId">
  547. </el-option>
  548. </el-select>
  549. </el-form-item>
  550. <el-form-item :label="'用户编码'">
  551. <el-input v-model="operatorData.adminID" clearable style="width: 120px"></el-input>
  552. </el-form-item>
  553. <el-form-item :label="'用户姓名'">
  554. <el-input v-model="operatorData.adminName" clearable style="width: 120px"></el-input>
  555. </el-form-item>
  556. <el-form-item :label="' '">
  557. <el-button type="primary" @click="getOperatorList2">查询</el-button>
  558. </el-form-item>
  559. </el-form>
  560. <el-table
  561. :height="300"
  562. :data="operatorList"
  563. ref="operatorTable"
  564. @row-click="operatorClickRow"
  565. @selection-change="selectionChangeHandle2"
  566. border
  567. style="width: 100%;">
  568. <el-table-column
  569. type="selection"
  570. header-align="center"
  571. align="center"
  572. width="50">
  573. </el-table-column>
  574. <el-table-column
  575. v-for="(item,index) in operatorDetailList" :key="index"
  576. :sortable="item.columnSortable"
  577. :prop="item.columnProp"
  578. :header-align="item.headerAlign"
  579. :show-overflow-tooltip="item.showOverflowTooltip"
  580. :align="item.align"
  581. :fixed="item.fixed==''?false:item.fixed"
  582. :min-width="item.columnWidth"
  583. :label="item.columnLabel">
  584. <template slot-scope="scope">
  585. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  586. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  587. </template>
  588. </el-table-column>
  589. </el-table>
  590. </div>
  591. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  592. <el-button type="primary" @click="confirmOperator">确认</el-button>
  593. <el-button type="primary" @click="operatorModelFlag = false">关闭</el-button>
  594. </el-footer>
  595. </el-dialog>
  596. <!-- 批量处理检验单 -->
  597. <el-dialog title="批量合格处理" :close-on-click-modal="false" v-drag :visible.sync="batchInformationFlag" width="1200px">
  598. <el-form :inline="true" label-position="top">
  599. <el-form-item style="margin-left: 25px">
  600. <el-button type="primary" @click="getFileContentData(detailData)">工作文件</el-button>
  601. </el-form-item>
  602. <el-form-item style="margin-left: 20px">
  603. <el-button type="primary" icon="el-icon-upload" @click="subDetailUpload">明细导入</el-button>
  604. </el-form-item>
  605. <el-tabs v-model="batchInformationTable" style="width: 100%;height: auto;" type="border-card">
  606. <el-tab-pane label="所选检验单" name="batchInfo" style="padding: 0">
  607. <div class="rq ">
  608. <el-table
  609. :height="500"
  610. :data="IQCSelections"
  611. border
  612. style="width: 100%;">
  613. <el-table-column
  614. v-for="(item,index) in batchColumnList" :key="index"
  615. :sortable="item.columnSortable"
  616. :prop="item.columnProp"
  617. :header-align="item.headerAlign"
  618. :show-overflow-tooltip="item.showOverflowTooltip"
  619. :align="item.align"
  620. :fixed="item.fixed===''?false:item.fixed"
  621. :min-width="item.columnWidth"
  622. :label="item.columnLabel">
  623. <template slot-scope="scope">
  624. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  625. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  626. </template>
  627. </el-table-column>
  628. <el-table-column
  629. prop=""
  630. header-align="center"
  631. align="center"
  632. min-width="170"
  633. label="协同人员">
  634. <template slot-scope="scope">
  635. <el-input v-model="scope.row.operator" readonly style="width:77%"></el-input>
  636. <el-button type="primary" @click="batchGetOperatorList(scope.$index)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  637. </template>
  638. </el-table-column>
  639. <el-table-column
  640. prop=""
  641. header-align="center"
  642. align="center"
  643. min-width="170"
  644. label="责任人">
  645. <template slot-scope="scope">
  646. <el-input v-model="scope.row.responsiblePerson" readonly style="width:77%"></el-input>
  647. <el-button type="primary" @click="batchGetResponsiblePersonList(scope.$index)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  648. </template>
  649. </el-table-column>
  650. <el-table-column
  651. prop=""
  652. header-align="center"
  653. align="center"
  654. min-width="200"
  655. label="质检备注">
  656. <template slot-scope="scope">
  657. <el-input v-model="scope.row.inspectionRemark" style="height: 11px; width: 98%"></el-input>
  658. </template>
  659. </el-table-column>
  660. <el-table-column
  661. prop=""
  662. header-align="center"
  663. align="center"
  664. min-width="60"
  665. fixed="right"
  666. label="操作">
  667. <template slot-scope="scope">
  668. <el-link style="cursor: pointer" @click="deleteBatch(scope.row)">删除</el-link>
  669. </template>
  670. </el-table-column>
  671. </el-table>
  672. </div>
  673. </el-tab-pane>
  674. <el-tab-pane label="检验单明细" name="detailInfo" style="padding: 0">
  675. <div class="rq ">
  676. <el-table
  677. :height="500"
  678. :data="batchDetailList"
  679. border
  680. style="width: 100%;">
  681. <el-table-column
  682. prop=""
  683. header-align="center"
  684. align="center"
  685. min-width="60"
  686. label="操作">
  687. <template slot-scope="scope">
  688. <el-button v-if="scope.row.detailImageNum > 0" type="success" class="el-icon-picture" @click="uploadImageModal(scope.row)"></el-button>
  689. <el-button v-else class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  690. </template>
  691. </el-table-column>
  692. <el-table-column
  693. v-for="(item,index) in detailColumnList" :key="index"
  694. :sortable="item.columnSortable"
  695. :prop="item.columnProp"
  696. :header-align="item.headerAlign"
  697. :show-overflow-tooltip="item.showOverflowTooltip"
  698. :align="item.align"
  699. :fixed="item.fixed===''?false:item.fixed"
  700. :min-width="item.columnWidth"
  701. :label="item.columnLabel">
  702. <template slot-scope="scope">
  703. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  704. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  705. </template>
  706. </el-table-column>
  707. <el-table-column
  708. prop=""
  709. header-align="center"
  710. align="right"
  711. min-width="80"
  712. label="实测值">
  713. <template slot-scope="scope">
  714. <el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numberValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" type="number" style="height: 11px; width: 98%"></el-input>
  715. <el-input :ref="`textValue${scope.$index}`" v-else v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px; width: 98%"></el-input>
  716. </template>
  717. </el-table-column>
  718. <el-table-column
  719. prop=""
  720. header-align="center"
  721. align="center"
  722. min-width="80"
  723. label="检验明细">
  724. <template slot-scope="scope">
  725. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
  726. <el-button v-else type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  727. </template>
  728. </el-table-column>
  729. <el-table-column
  730. prop=""
  731. header-align="center"
  732. align="right"
  733. min-width="90"
  734. label="项目检验结论">
  735. <template slot-scope="scope">
  736. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
  737. <el-option label="合格" value="Y" style="color: green"></el-option>
  738. <el-option label="不合格" value="N" style="color: red"></el-option>
  739. </el-select>
  740. </template>
  741. </el-table-column>
  742. </el-table>
  743. </div>
  744. </el-tab-pane>
  745. </el-tabs>
  746. </el-form>
  747. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  748. <el-button type="primary" :loading="batchLoading" @click="batchSave">保存</el-button>
  749. <el-button type="primary" @click="batchInformationFlag=false">关闭</el-button>
  750. </el-footer>
  751. </el-dialog>
  752. <!-- 更改检验方式 -->
  753. <el-dialog title="更改检验方式" top="25vh" :close-on-click-modal="false" v-drag :visible.sync="changeModalFlag" width="500px">
  754. <el-form :inline="true" label-position="top" :model="changeData" style="margin-left: 7px;margin-top: -5px;">
  755. <el-form-item label="检验方式">
  756. <el-select v-model="changeData.inspectCode" style="width: 210px">
  757. <el-option label="全检" value="全检"></el-option>
  758. <el-option label="数量抽检" value="数量抽检"></el-option>
  759. <el-option label="比例抽检" value="比例抽检"></el-option>
  760. <el-option label="不固定抽检" value="不固定抽检"></el-option>
  761. </el-select>
  762. </el-form-item>
  763. <el-form-item label="抽检数量">
  764. <el-input class="inlineNumber numInput" v-model="changeData.qtySample" type="number" style="width: 110px"></el-input>
  765. </el-form-item>
  766. <el-form-item label="抽检比例">
  767. <el-input class="inlineNumber numInput" v-model="changeData.percentSample" type="number" style="width: 110px"></el-input>
  768. </el-form-item>
  769. </el-form>
  770. <el-form :inline="true" label-position="top" :model="changeData" style="margin-left: 7px;margin-top: -5px;">
  771. <el-form-item>
  772. <span slot="label" @click="getBaseList(207)"><a herf="#">抽样方案编码</a></span>
  773. <el-input v-model="changeData.samplingProgrammeNo" style="width: 143px"></el-input>
  774. </el-form-item>
  775. <el-form-item label="抽样方案名称">
  776. <el-input v-model="changeData.samplingProgrammeDesc" disabled style="width: 300px"></el-input>
  777. </el-form-item>
  778. </el-form>
  779. <el-form :inline="true" label-position="top" :model="changeData" style="margin-left: 7px;margin-top: -5px;">
  780. <el-form-item>
  781. <span slot="label" @click="getBaseList(208)"><a herf="#">检验水平编码</a></span>
  782. <el-input v-model="changeData.samplingLevelNo" style="width: 143px"></el-input>
  783. </el-form-item>
  784. <el-form-item label="检验水平名称">
  785. <el-input v-model="changeData.samplingLevelDesc" disabled style="width: 300px"></el-input>
  786. </el-form-item>
  787. </el-form>
  788. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  789. <el-button type="primary" @click="changeInspectionWay">保存</el-button>
  790. <el-button type="primary" @click="changeModalFlag = false">关闭</el-button>
  791. </el-footer>
  792. </el-dialog>
  793. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  794. <!-- 上传文件的modal -->
  795. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="()=>{this.getFileContentData(this.detailData)}" v-drag></qcFAIUploadFile>
  796. <!-- 上传文件的modal -->
  797. <comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData" v-drag></comQcItemImageUploadFile>
  798. <!-- 子明细导入 -->
  799. <subDetailUpload @changeEvent="changeMyString" ref="subDetailUpload" @refreshPageTables="getInspectionFormData" v-drag></subDetailUpload>
  800. </div>
  801. </template>
  802. <script>
  803. import {
  804. qcIQCInspectionSearch, // IQC检验记录查询
  805. iqcDetailSearch, // iqc检验记录查询
  806. inspectorSearch, // 检验员查询
  807. selectIQCSubDetailedRecord, // 查询子明细记录
  808. checkIQCSubDetailValue, // 检查子明细中的实测值是否在规定范围
  809. saveIQCDetailedRecord, // 新增明细信息
  810. checkIQCIsSubmit, // 检查是否已提交
  811. saveIQCSubDetailed, // 新增子明细信息
  812. saveIQCSubmitResult, // 审核
  813. iqcRecordDelete, // 删除检验记录
  814. disposalMeasuresSearch, // 获取处置措施列表
  815. iqcRecordOverLoad, // 重载检验单
  816. getSiteAndBuByUserName,
  817. orderTypeSearch, // 获取采购类型
  818. actionIQCInspection, // 开始检验
  819. dataAcquisition, // 数据采集
  820. batchSaveIQCDetailedRecord, // 批量合格处理
  821. changeInspectionWay, // 更改检验方式
  822. } from "@/api/qc/qc.js"
  823. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  824. import Chooselist from '@/views/modules/common/Chooselist_eam'
  825. import {getFileContentList2, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  826. import {
  827. deleteObjectFile,
  828. getUserRoleList, // 获取用户角色列表
  829. getOperatorList
  830. } from '@/api/eam/eam.js'
  831. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  832. import qcFAIUploadFile from "./qc_FAI_upload_file"
  833. import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
  834. import subDetailUpload from "./sub_detail_upload"
  835. export default {
  836. components: {
  837. Chooselist,
  838. qcFAIUploadFile,
  839. comQcItemImageUploadFile,
  840. subDetailUpload
  841. },
  842. computed: {
  843. templateTableData () {
  844. let start = (this.pageIndex2 - 1) * this.pageSize2
  845. let end = start + this.pageSize2
  846. if (end > this.tableData.length){
  847. end = this.tableData.length
  848. }
  849. return this.tableData.slice(start,end)
  850. }
  851. },
  852. watch: {
  853. detailData: {
  854. deep: true,
  855. handler: function (newV, oldV) {
  856. this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
  857. }
  858. },
  859. detailList: {
  860. deep: true,
  861. handler: function (newV, oldV) {
  862. let num = 0
  863. for (let i = 0; i < this.detailList.length; i++) {
  864. if (this.detailList[i].itemResult === 'N') {
  865. num++
  866. }
  867. }
  868. this.detailData.unqualifiedQty = num
  869. }
  870. },
  871. },
  872. data () {
  873. return {
  874. loadFlag: false,
  875. // 是否收藏
  876. favorite: false,
  877. // 导出 start
  878. exportData: [],
  879. exportName: "IQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  880. exportHeader: ["IQC检验录入"],
  881. exportFooter: [],
  882. exportList: [],
  883. // 导出 end
  884. submitData: {
  885. site: '',
  886. inspectionNo: '',
  887. isQualified: '',
  888. isQualifiedChinese: '',
  889. submitList: [],
  890. updateBy: this.$store.state.user.name,
  891. },
  892. tagNo:'',
  893. tagType: '',
  894. searchData: {
  895. site: '',
  896. userName: this.$store.state.user.name,
  897. inspectionNo: '',
  898. inspectionTypeNo:'105',
  899. isQualified: '',
  900. buDesc: '',
  901. startDate: '',
  902. endDate: '',
  903. startDate2: '',
  904. endDate2: '',
  905. partNo:'',
  906. partDesc:'',
  907. state: '',
  908. inspectionResult: '',
  909. supplierNo: '',
  910. disposalMeasures: '',
  911. inspectorName: '',
  912. page: 1,
  913. limit: 10,
  914. poOrderNo: '',
  915. poItemNo: '',
  916. orderType: '',
  917. states: ['未开始','待检验'],
  918. warehouseId: '',
  919. warehouseName: '',
  920. receiptNo: '',
  921. refInfo1: '',
  922. refInfo2: '',
  923. refInfo3: '',
  924. refInfo4: '',
  925. refInfo5: '',
  926. },
  927. pageIndex: 1,
  928. pageSize: 50,
  929. totalPage: 0,
  930. pageIndex2: 1,
  931. pageSize2: 20,
  932. totalPage2: 0,
  933. height: 200,
  934. dataList: [],
  935. dataListSelections: [],
  936. submitFlag: false,
  937. modalData: {
  938. flag:'',
  939. functionType:'',
  940. site: '',
  941. bu: '',
  942. inspectionNo:'',
  943. workOrderNumber: '',
  944. workOrderQuantity: '',
  945. reelNumber: '',
  946. partNo: '',
  947. rollingQuantity: '',
  948. sampleQuantity: '',
  949. detailCodeNo:'',
  950. detailCodeDesc:'',
  951. inspectionTypeNo:'105',
  952. inspectionTypeName:'IQC',
  953. inspectorNo:'',
  954. inspectorName:'',
  955. isQualified:'',
  956. isQualifiedChinese:''
  957. },
  958. // 展示列集
  959. // columnList1: [],
  960. columnList1: [
  961. {
  962. userId: this.$store.state.user.name,
  963. functionId: 301006,
  964. serialNumber: '301006Table1BuDesc',
  965. tableId: "301006Table1",
  966. tableName: "IQC检验记录表",
  967. columnProp: 'buDesc',
  968. headerAlign: "center",
  969. align: "center",
  970. columnLabel: 'BU',
  971. columnHidden: false,
  972. columnImage: false,
  973. columnSortable: false,
  974. sortLv: 0,
  975. status: true,
  976. fixed: '',
  977. columnWidth: 100,
  978. },
  979. {
  980. userId: this.$store.state.user.name,
  981. functionId: 301006,
  982. serialNumber: '301006Table1InspectionNo',
  983. tableId: "301006Table1",
  984. tableName: "IQC检验记录表",
  985. columnProp: 'inspectionNo',
  986. headerAlign: "center",
  987. align: "center",
  988. columnLabel: '检验单号',
  989. columnHidden: false,
  990. columnImage: false,
  991. columnSortable: false,
  992. sortLv: 0,
  993. status: true,
  994. fixed: '',
  995. columnWidth: 120,
  996. },
  997. {
  998. userId: this.$store.state.user.name,
  999. functionId: 301006,
  1000. serialNumber: '301006Table1InspectionResult',
  1001. tableId: "301006Table1",
  1002. tableName: "IQC检验记录表",
  1003. columnProp: 'inspectionResult',
  1004. headerAlign: "center",
  1005. align: "center",
  1006. columnLabel: '检验结论',
  1007. columnHidden: false,
  1008. columnImage: false,
  1009. columnSortable: false,
  1010. sortLv: 0,
  1011. status: true,
  1012. fixed: '',
  1013. columnWidth: 100,
  1014. },
  1015. {
  1016. userId: this.$store.state.user.name,
  1017. functionId: 301006,
  1018. serialNumber: '301006Table1TaskDate',
  1019. tableId: "301006Table1",
  1020. tableName: "IQC检验记录表",
  1021. columnProp: 'taskDate',
  1022. headerAlign: "center",
  1023. align: "center",
  1024. columnLabel: '送检日期',
  1025. columnHidden: false,
  1026. columnImage: false,
  1027. columnSortable: false,
  1028. sortLv: 0,
  1029. status: true,
  1030. fixed: '',
  1031. columnWidth: 130,
  1032. },
  1033. {
  1034. userId: this.$store.state.user.name,
  1035. functionId: 301006,
  1036. serialNumber: '301006Table1InspectionCycle',
  1037. tableId: "301006Table1",
  1038. tableName: "IQC检验记录表",
  1039. columnProp: 'inspectionCycle',
  1040. headerAlign: "center",
  1041. align: "right",
  1042. columnLabel: '检验周期(h)',
  1043. columnHidden: false,
  1044. columnImage: false,
  1045. columnSortable: false,
  1046. sortLv: 0,
  1047. status: true,
  1048. fixed: '',
  1049. columnWidth: 100,
  1050. },
  1051. {
  1052. userId: this.$store.state.user.name,
  1053. functionId: 301006,
  1054. serialNumber: '301006Table1RollNo',
  1055. tableId: "301006Table1",
  1056. tableName: "IQC检验记录表",
  1057. columnProp: 'rollNo',
  1058. headerAlign: "center",
  1059. align: "center",
  1060. columnLabel: '标签条码',
  1061. columnHidden: false,
  1062. columnImage: false,
  1063. columnSortable: false,
  1064. sortLv: 0,
  1065. status: true,
  1066. fixed: '',
  1067. columnWidth: 120,
  1068. },
  1069. {
  1070. userId: this.$store.state.user.name,
  1071. functionId: 301006,
  1072. serialNumber: '301006Table1WarehouseName',
  1073. tableId: "301006Table1",
  1074. tableName: "IQC检验记录表",
  1075. columnProp: 'warehouseName',
  1076. headerAlign: "center",
  1077. align: "left",
  1078. columnLabel: '仓库',
  1079. columnHidden: false,
  1080. columnImage: false,
  1081. columnSortable: false,
  1082. sortLv: 0,
  1083. status: true,
  1084. fixed: '',
  1085. columnWidth: 200,
  1086. },
  1087. {
  1088. userId: this.$store.state.user.name,
  1089. functionId: 301006,
  1090. serialNumber: '301006Table1PartNo',
  1091. tableId: "301006Table1",
  1092. tableName: "IQC检验记录表",
  1093. columnProp: 'partNo',
  1094. headerAlign: "center",
  1095. align: "center",
  1096. columnLabel: '物料编码',
  1097. columnHidden: false,
  1098. columnImage: false,
  1099. columnSortable: false,
  1100. sortLv: 0,
  1101. status: true,
  1102. fixed: '',
  1103. columnWidth: 120,
  1104. },
  1105. {
  1106. userId: this.$store.state.user.name,
  1107. functionId: 301006,
  1108. serialNumber: '301006Table1PartDesc',
  1109. tableId: "301006Table1",
  1110. tableName: "IQC检验记录表",
  1111. columnProp: 'partDesc',
  1112. headerAlign: "center",
  1113. align: "left",
  1114. columnLabel: '物料名称',
  1115. columnHidden: false,
  1116. columnImage: false,
  1117. columnSortable: false,
  1118. sortLv: 0,
  1119. status: true,
  1120. fixed: '',
  1121. columnWidth: 350,
  1122. },
  1123. {
  1124. userId: this.$store.state.user.name,
  1125. functionId: 301006,
  1126. serialNumber: '301006Table1Umid',
  1127. tableId: "301006Table1",
  1128. tableName: "IQC检验记录表",
  1129. columnProp: 'umId',
  1130. headerAlign: "center",
  1131. align: "left",
  1132. columnLabel: '计量单位',
  1133. columnHidden: false,
  1134. columnImage: false,
  1135. columnSortable: false,
  1136. sortLv: 0,
  1137. status: true,
  1138. fixed: '',
  1139. columnWidth: 100,
  1140. },
  1141. {
  1142. userId: this.$store.state.user.name,
  1143. functionId: 301006,
  1144. serialNumber: '301006Table1RollQty',
  1145. tableId: "301006Table1",
  1146. tableName: "IQC检验记录表",
  1147. columnProp: 'rollQty',
  1148. headerAlign: "center",
  1149. align: "right",
  1150. columnLabel: '到货数量',
  1151. columnHidden: false,
  1152. columnImage: false,
  1153. columnSortable: false,
  1154. sortLv: 0,
  1155. status: true,
  1156. fixed: '',
  1157. columnWidth: 100,
  1158. },
  1159. {
  1160. userId: this.$store.state.user.name,
  1161. functionId: 301006,
  1162. serialNumber: '301006Table1RollCount',
  1163. tableId: "301006Table1",
  1164. tableName: "IQC检验记录表",
  1165. columnProp: 'rollCount',
  1166. headerAlign: "center",
  1167. align: "right",
  1168. columnLabel: '送检数量',
  1169. columnHidden: false,
  1170. columnImage: false,
  1171. columnSortable: false,
  1172. sortLv: 0,
  1173. status: true,
  1174. fixed: '',
  1175. columnWidth: 100,
  1176. },
  1177. {
  1178. userId: this.$store.state.user.name,
  1179. functionId: 301006,
  1180. serialNumber: '301006Table1SamplingQty',
  1181. tableId: "301006Table1",
  1182. tableName: "IQC检验记录表",
  1183. columnProp: 'samplingQty',
  1184. headerAlign: "center",
  1185. align: "right",
  1186. columnLabel: '抽样数量',
  1187. columnHidden: false,
  1188. columnImage: false,
  1189. columnSortable: false,
  1190. sortLv: 0,
  1191. status: true,
  1192. fixed: '',
  1193. columnWidth: 100,
  1194. },
  1195. {
  1196. userId: this.$store.state.user.name,
  1197. functionId: 301006,
  1198. serialNumber: '301006Table1PoOrderNo',
  1199. tableId: "301006Table1",
  1200. tableName: "IQC检验记录表",
  1201. columnProp: 'poOrderNo',
  1202. headerAlign: "center",
  1203. align: "center",
  1204. columnLabel: '单据号',
  1205. columnHidden: false,
  1206. columnImage: false,
  1207. columnSortable: false,
  1208. sortLv: 0,
  1209. status: true,
  1210. fixed: '',
  1211. columnWidth: 130,
  1212. },
  1213. {
  1214. userId: this.$store.state.user.name,
  1215. functionId: 301006,
  1216. serialNumber: '301006Table1ReceiptNo',
  1217. tableId: "301006Table1",
  1218. tableName: "IQC检验记录表",
  1219. columnProp: 'receiptNo',
  1220. headerAlign: "center",
  1221. align: "center",
  1222. columnLabel: '通知单号',
  1223. columnHidden: false,
  1224. columnImage: false,
  1225. columnSortable: false,
  1226. sortLv: 0,
  1227. status: true,
  1228. fixed: '',
  1229. columnWidth: 130,
  1230. },
  1231. {
  1232. userId: this.$store.state.user.name,
  1233. functionId: 301006,
  1234. serialNumber: '301006Table1ReceiptItemNo',
  1235. tableId: "301006Table1",
  1236. tableName: "IQC检验记录表",
  1237. columnProp: 'receiptItemNo',
  1238. headerAlign: "center",
  1239. align: "center",
  1240. columnLabel: '通知单序号',
  1241. columnHidden: false,
  1242. columnImage: false,
  1243. columnSortable: false,
  1244. sortLv: 0,
  1245. status: true,
  1246. fixed: '',
  1247. columnWidth: 100,
  1248. },
  1249. {
  1250. userId: this.$store.state.user.name,
  1251. functionId: 301006,
  1252. serialNumber: '301006Table1RefInfo1',
  1253. tableId: "301006Table1",
  1254. tableName: "IQC检验记录表",
  1255. columnProp: 'refInfo1',
  1256. headerAlign: "center",
  1257. align: "center",
  1258. columnLabel: '关联单号1',
  1259. columnHidden: false,
  1260. columnImage: false,
  1261. columnSortable: false,
  1262. sortLv: 0,
  1263. status: true,
  1264. fixed: '',
  1265. columnWidth: 130,
  1266. },
  1267. {
  1268. userId: this.$store.state.user.name,
  1269. functionId: 301006,
  1270. serialNumber: '301006Table1RefInfo2',
  1271. tableId: "301006Table1",
  1272. tableName: "IQC检验记录表",
  1273. columnProp: 'refInfo2',
  1274. headerAlign: "center",
  1275. align: "center",
  1276. columnLabel: '关联单号2',
  1277. columnHidden: false,
  1278. columnImage: false,
  1279. columnSortable: false,
  1280. sortLv: 0,
  1281. status: true,
  1282. fixed: '',
  1283. columnWidth: 130,
  1284. },
  1285. {
  1286. userId: this.$store.state.user.name,
  1287. functionId: 301006,
  1288. serialNumber: '301006Table1RefInfo3',
  1289. tableId: "301006Table1",
  1290. tableName: "IQC检验记录表",
  1291. columnProp: 'refInfo3',
  1292. headerAlign: "center",
  1293. align: "center",
  1294. columnLabel: '关联单号3',
  1295. columnHidden: false,
  1296. columnImage: false,
  1297. columnSortable: false,
  1298. sortLv: 0,
  1299. status: true,
  1300. fixed: '',
  1301. columnWidth: 130,
  1302. },
  1303. {
  1304. userId: this.$store.state.user.name,
  1305. functionId: 301006,
  1306. serialNumber: '301006Table1RefInfo4',
  1307. tableId: "301006Table1",
  1308. tableName: "IQC检验记录表",
  1309. columnProp: 'refInfo4',
  1310. headerAlign: "center",
  1311. align: "center",
  1312. columnLabel: '关联单号4',
  1313. columnHidden: false,
  1314. columnImage: false,
  1315. columnSortable: false,
  1316. sortLv: 0,
  1317. status: true,
  1318. fixed: '',
  1319. columnWidth: 130,
  1320. },
  1321. {
  1322. userId: this.$store.state.user.name,
  1323. functionId: 301006,
  1324. serialNumber: '301006Table1RefInfo5',
  1325. tableId: "301006Table1",
  1326. tableName: "IQC检验记录表",
  1327. columnProp: 'refInfo5',
  1328. headerAlign: "center",
  1329. align: "center",
  1330. columnLabel: '关联单号5',
  1331. columnHidden: false,
  1332. columnImage: false,
  1333. columnSortable: false,
  1334. sortLv: 0,
  1335. status: true,
  1336. fixed: '',
  1337. columnWidth: 130,
  1338. },
  1339. {
  1340. userId: this.$store.state.user.name,
  1341. functionId: 301006,
  1342. serialNumber: '301006Table1OrderType',
  1343. tableId: "301006Table1",
  1344. tableName: "IQC检验记录表",
  1345. columnProp: 'orderType',
  1346. headerAlign: "center",
  1347. align: "center",
  1348. columnLabel: '采购类型',
  1349. columnHidden: false,
  1350. columnImage: false,
  1351. columnSortable: false,
  1352. sortLv: 0,
  1353. status: true,
  1354. fixed: '',
  1355. columnWidth: 100,
  1356. },
  1357. {
  1358. userId: this.$store.state.user.name,
  1359. functionId: 301006,
  1360. serialNumber: '301006Table1PoItemNo',
  1361. tableId: "301006Table1",
  1362. tableName: "IQC检验记录表",
  1363. columnProp: 'poItemNo',
  1364. headerAlign: "center",
  1365. align: "right",
  1366. columnLabel: '单据行号',
  1367. columnHidden: false,
  1368. columnImage: false,
  1369. columnSortable: false,
  1370. sortLv: 0,
  1371. status: true,
  1372. fixed: '',
  1373. columnWidth: 100,
  1374. },
  1375. {
  1376. userId: this.$store.state.user.name,
  1377. functionId: 301006,
  1378. serialNumber: '301006Table1SupplierDesc',
  1379. tableId: "301006Table1",
  1380. tableName: "IQC检验记录表",
  1381. columnProp: 'supplierDesc',
  1382. headerAlign: "center",
  1383. align: "left",
  1384. columnLabel: '供应商',
  1385. columnHidden: false,
  1386. columnImage: false,
  1387. columnSortable: false,
  1388. sortLv: 0,
  1389. status: true,
  1390. fixed: '',
  1391. columnWidth: 200,
  1392. },
  1393. {
  1394. userId: this.$store.state.user.name,
  1395. functionId: 301006,
  1396. serialNumber: '301006Table1InspectionRemark',
  1397. tableId: "301006Table1",
  1398. tableName: "IQC检验记录表",
  1399. columnProp: 'inspectionRemark',
  1400. headerAlign: "center",
  1401. align: "left",
  1402. columnLabel: '质检备注',
  1403. columnHidden: false,
  1404. columnImage: false,
  1405. columnSortable: false,
  1406. sortLv: 0,
  1407. status: true,
  1408. fixed: '',
  1409. columnWidth: 200,
  1410. },
  1411. {
  1412. userId: this.$store.state.user.name,
  1413. functionId: 301006,
  1414. serialNumber: '301006Table1DisposalMeasures',
  1415. tableId: "301006Table1",
  1416. tableName: "IQC检验记录表",
  1417. columnProp: 'disposalMeasures',
  1418. headerAlign: "center",
  1419. align: "center",
  1420. columnLabel: '处置措施',
  1421. columnHidden: false,
  1422. columnImage: false,
  1423. columnSortable: false,
  1424. sortLv: 0,
  1425. status: true,
  1426. fixed: '',
  1427. columnWidth: 120,
  1428. },
  1429. {
  1430. userId: this.$store.state.user.name,
  1431. functionId: 301006,
  1432. serialNumber: '301006Table1DisposalRemark',
  1433. tableId: "301006Table1",
  1434. tableName: "IQC检验记录表",
  1435. columnProp: 'disposalRemark',
  1436. headerAlign: "center",
  1437. align: "left",
  1438. columnLabel: '处置说明',
  1439. columnHidden: false,
  1440. columnImage: false,
  1441. columnSortable: false,
  1442. sortLv: 0,
  1443. status: true,
  1444. fixed: '',
  1445. columnWidth: 200,
  1446. },
  1447. {
  1448. userId: this.$store.state.user.name,
  1449. functionId: 301006,
  1450. serialNumber: '301006Table1ActionDate',
  1451. tableId: "301006Table1",
  1452. tableName: "IQC检验记录表",
  1453. columnProp: 'actionDate',
  1454. headerAlign: "center",
  1455. align: "center",
  1456. columnLabel: '开始检验时间',
  1457. columnHidden: false,
  1458. columnImage: false,
  1459. columnSortable: false,
  1460. sortLv: 0,
  1461. status: true,
  1462. fixed: '',
  1463. columnWidth: 170,
  1464. },
  1465. {
  1466. userId: this.$store.state.user.name,
  1467. functionId: 301006,
  1468. serialNumber: '301006Table1InspectorDate',
  1469. tableId: "301006Table1",
  1470. tableName: "IQC检验记录表",
  1471. columnProp: 'inspectorDate',
  1472. headerAlign: "center",
  1473. align: "center",
  1474. columnLabel: '检验时间',
  1475. columnHidden: false,
  1476. columnImage: false,
  1477. columnSortable: false,
  1478. sortLv: 0,
  1479. status: true,
  1480. fixed: '',
  1481. columnWidth: 170,
  1482. },
  1483. {
  1484. userId: this.$store.state.user.name,
  1485. functionId: 301006,
  1486. serialNumber: '301006Table1InspectorName',
  1487. tableId: "301006Table1",
  1488. tableName: "IQC检验记录表",
  1489. columnProp: 'inspectorName',
  1490. headerAlign: "center",
  1491. align: "center",
  1492. columnLabel: '质检员',
  1493. columnHidden: false,
  1494. columnImage: false,
  1495. columnSortable: false,
  1496. sortLv: 0,
  1497. status: true,
  1498. fixed: '',
  1499. columnWidth: 100,
  1500. },
  1501. ],
  1502. detailColumnList: [
  1503. {
  1504. userId: this.$store.state.user.name,
  1505. functionId: 301006,
  1506. serialNumber: '301006Table2ItemNo',
  1507. tableId: "301006Table2",
  1508. tableName: "检验单明细表",
  1509. columnProp: 'itemNo',
  1510. headerAlign: "center",
  1511. align: "center",
  1512. columnLabel: '检验项目编码',
  1513. columnHidden: false,
  1514. columnImage: false,
  1515. columnSortable: false,
  1516. sortLv: 0,
  1517. status: true,
  1518. fixed: '',
  1519. columnWidth: 120,
  1520. },
  1521. {
  1522. userId: this.$store.state.user.name,
  1523. functionId: 301006,
  1524. serialNumber: '301006Table2ItemDesc',
  1525. tableId: "301006Table2",
  1526. tableName: "检验单明细表",
  1527. columnProp: 'itemDesc',
  1528. headerAlign: "center",
  1529. align: "left",
  1530. columnLabel: '检验项目',
  1531. columnHidden: false,
  1532. columnImage: false,
  1533. columnSortable: false,
  1534. sortLv: 0,
  1535. status: true,
  1536. fixed: '',
  1537. columnWidth: 150,
  1538. },
  1539. {
  1540. userId: this.$store.state.user.name,
  1541. functionId: 301006,
  1542. serialNumber: '301006Table2SamplingLevelDesc',
  1543. tableId: "301006Table2",
  1544. tableName: "检验单明细表",
  1545. columnProp: 'samplingLevelDesc',
  1546. headerAlign: "center",
  1547. align: "left",
  1548. columnLabel: '检验水平',
  1549. columnHidden: false,
  1550. columnImage: false,
  1551. columnSortable: false,
  1552. sortLv: 0,
  1553. status: true,
  1554. fixed: '',
  1555. columnWidth: 150,
  1556. },
  1557. {
  1558. userId: this.$store.state.user.name,
  1559. functionId: 301006,
  1560. serialNumber: '301006Table2SamplingProgrammeDesc',
  1561. tableId: "301006Table2",
  1562. tableName: "检验单明细表",
  1563. columnProp: 'samplingProgrammeDesc',
  1564. headerAlign: "center",
  1565. align: "left",
  1566. columnLabel: '检验方案',
  1567. columnHidden: false,
  1568. columnImage: false,
  1569. columnSortable: false,
  1570. sortLv: 0,
  1571. status: true,
  1572. fixed: '',
  1573. columnWidth: 150,
  1574. },
  1575. {
  1576. userId: this.$store.state.user.name,
  1577. functionId: 301006,
  1578. serialNumber: '301006Table2MethodName',
  1579. tableId: "301006Table2",
  1580. tableName: "检验单明细表",
  1581. columnProp: 'methodName',
  1582. headerAlign: "center",
  1583. align: "left",
  1584. columnLabel: '检验方法',
  1585. columnHidden: false,
  1586. columnImage: false,
  1587. columnSortable: false,
  1588. sortLv: 0,
  1589. status: true,
  1590. fixed: '',
  1591. columnWidth: 150,
  1592. },
  1593. {
  1594. userId: this.$store.state.user.name,
  1595. functionId: 301006,
  1596. serialNumber: '301006Table2MethodRemark',
  1597. tableId: "301006Table2",
  1598. tableName: "检验单明细表",
  1599. columnProp: 'methodRemark',
  1600. headerAlign: "center",
  1601. align: "left",
  1602. columnLabel: '检验方法说明',
  1603. columnHidden: false,
  1604. columnImage: false,
  1605. columnSortable: false,
  1606. sortLv: 0,
  1607. status: true,
  1608. fixed: '',
  1609. columnWidth: 200,
  1610. },
  1611. {
  1612. userId: this.$store.state.user.name,
  1613. functionId: 301006,
  1614. serialNumber: '301006Table2DefectLevelDescription',
  1615. tableId: "301006Table2",
  1616. tableName: "检验单明细表",
  1617. columnProp: 'defectLevelDescription',
  1618. headerAlign: "center",
  1619. align: "left",
  1620. columnLabel: '缺陷等级名称',
  1621. columnHidden: false,
  1622. columnImage: false,
  1623. columnSortable: false,
  1624. sortLv: 0,
  1625. status: true,
  1626. fixed: '',
  1627. columnWidth: 150,
  1628. },
  1629. {
  1630. userId: this.$store.state.user.name,
  1631. functionId: 301006,
  1632. serialNumber: '301006Table2ObjectDesc',
  1633. tableId: "301006Table2",
  1634. tableName: "检验单明细表",
  1635. columnProp: 'objectDesc',
  1636. headerAlign: "center",
  1637. align: "left",
  1638. columnLabel: '检测仪器',
  1639. columnHidden: false,
  1640. columnImage: false,
  1641. columnSortable: false,
  1642. sortLv: 0,
  1643. status: true,
  1644. fixed: '',
  1645. columnWidth: 150,
  1646. },
  1647. {
  1648. userId: this.$store.state.user.name,
  1649. functionId: 301006,
  1650. serialNumber: '301006Table2Aql',
  1651. tableId: "301006Table2",
  1652. tableName: "检验单明细表",
  1653. columnProp: 'aql',
  1654. headerAlign: "center",
  1655. align: "right",
  1656. columnLabel: 'AQL',
  1657. columnHidden: false,
  1658. columnImage: false,
  1659. columnSortable: false,
  1660. sortLv: 0,
  1661. status: true,
  1662. fixed: '',
  1663. columnWidth: 100,
  1664. },
  1665. {
  1666. userId: this.$store.state.user.name,
  1667. functionId: 301006,
  1668. serialNumber: '301006Table2Ac',
  1669. tableId: "301006Table2",
  1670. tableName: "检验单明细表",
  1671. columnProp: 'ac',
  1672. headerAlign: "center",
  1673. align: "right",
  1674. columnLabel: 'AC',
  1675. columnHidden: false,
  1676. columnImage: false,
  1677. columnSortable: false,
  1678. sortLv: 0,
  1679. status: true,
  1680. fixed: '',
  1681. columnWidth: 100,
  1682. },
  1683. {
  1684. userId: this.$store.state.user.name,
  1685. functionId: 301006,
  1686. serialNumber: '301006Table2Re',
  1687. tableId: "301006Table2",
  1688. tableName: "检验单明细表",
  1689. columnProp: 're',
  1690. headerAlign: "center",
  1691. align: "right",
  1692. columnLabel: 'RE',
  1693. columnHidden: false,
  1694. columnImage: false,
  1695. columnSortable: false,
  1696. sortLv: 0,
  1697. status: true,
  1698. fixed: '',
  1699. columnWidth: 100,
  1700. },
  1701. {
  1702. userId: this.$store.state.user.name,
  1703. functionId: 301006,
  1704. serialNumber: '301006Table2DefaultValue',
  1705. tableId: "301006Table2",
  1706. tableName: "检验单明细表",
  1707. columnProp: 'defaultValue',
  1708. headerAlign: "center",
  1709. align: "right",
  1710. columnLabel: '标准值',
  1711. columnHidden: false,
  1712. columnImage: false,
  1713. columnSortable: false,
  1714. sortLv: 0,
  1715. status: true,
  1716. fixed: '',
  1717. columnWidth: 100,
  1718. },
  1719. {
  1720. userId: this.$store.state.user.name,
  1721. functionId: 301006,
  1722. serialNumber: '301006Table2MaxValue',
  1723. tableId: "301006Table2",
  1724. tableName: "检验单明细表",
  1725. columnProp: 'maxValue',
  1726. headerAlign: "center",
  1727. align: "right",
  1728. columnLabel: '最大值',
  1729. columnHidden: false,
  1730. columnImage: false,
  1731. columnSortable: false,
  1732. sortLv: 0,
  1733. status: true,
  1734. fixed: '',
  1735. columnWidth: 100,
  1736. },
  1737. {
  1738. userId: this.$store.state.user.name,
  1739. functionId: 301006,
  1740. serialNumber: '301006Table2MinValue',
  1741. tableId: "301006Table2",
  1742. tableName: "检验单明细表",
  1743. columnProp: 'minValue',
  1744. headerAlign: "center",
  1745. align: "right",
  1746. columnLabel: '最小值',
  1747. columnHidden: false,
  1748. columnImage: false,
  1749. columnSortable: false,
  1750. sortLv: 0,
  1751. status: true,
  1752. fixed: '',
  1753. columnWidth: 100,
  1754. },
  1755. {
  1756. userId: this.$store.state.user.name,
  1757. functionId: 301006,
  1758. serialNumber: '301006Table2ValueType',
  1759. tableId: "301006Table2",
  1760. tableName: "检验单明细表",
  1761. columnProp: 'valueType',
  1762. headerAlign: "center",
  1763. align: "center",
  1764. columnLabel: '检测值类型',
  1765. columnHidden: false,
  1766. columnImage: false,
  1767. columnSortable: false,
  1768. sortLv: 0,
  1769. status: true,
  1770. fixed: '',
  1771. columnWidth: 100,
  1772. },
  1773. ],
  1774. fileColumnList: [
  1775. {
  1776. columnProp: 'fileName',
  1777. headerAlign: "center",
  1778. align: "center",
  1779. columnLabel: '文件名称',
  1780. columnHidden: false,
  1781. columnImage: false,
  1782. columnSortable: false,
  1783. sortLv: 0,
  1784. status: true,
  1785. fixed: '',
  1786. },
  1787. {
  1788. columnProp: 'createdBy',
  1789. headerAlign: "center",
  1790. align: 'center',
  1791. columnLabel: '上传人',
  1792. columnHidden: false,
  1793. columnImage: false,
  1794. columnSortable: true,
  1795. sortLv: 0,
  1796. status: true,
  1797. fixed: false
  1798. },
  1799. {
  1800. columnProp: 'createDate',
  1801. headerAlign: "center",
  1802. align: 'center',
  1803. columnLabel: '上传时间',
  1804. columnHidden: false,
  1805. columnImage: false,
  1806. columnSortable: true,
  1807. sortLv: 0,
  1808. status: true,
  1809. fixed: false
  1810. },
  1811. {
  1812. columnProp: 'orderRef3',
  1813. headerAlign: "center",
  1814. align: 'center',
  1815. columnLabel: '备注',
  1816. columnHidden: false,
  1817. columnImage: false,
  1818. columnSortable: true,
  1819. sortLv: 0,
  1820. status: true,
  1821. fixed: false
  1822. },
  1823. ],
  1824. detailData: {
  1825. site: '',
  1826. buNo: '',
  1827. inspectionNo: '',
  1828. partNo: '',
  1829. partDesc: '',
  1830. rollQty: '',
  1831. samplingQty: '',
  1832. unqualifiedQty: 0,
  1833. unqualifiedQuantity: '',
  1834. disposalMeasures: '',
  1835. disposalRemark: '',
  1836. inspectionResult: '',
  1837. inspectorNo: '',
  1838. inspectionRemark: '',
  1839. submitFlag: '',
  1840. supplierNo: '',
  1841. umId: '',
  1842. rollCount: '',
  1843. poOrderNo: '',
  1844. poItemNo: '',
  1845. operator: '',
  1846. operatorName: '',
  1847. responsiblePerson: '',
  1848. responsiblePersonName: '',
  1849. passQty: '',
  1850. notPassQty: ''
  1851. },
  1852. detailInformationFlag: false,
  1853. detailList: [],
  1854. saveInformationData: {
  1855. site: '',
  1856. buNo: '',
  1857. inspectionNo:'',
  1858. disposalMeasures: '',
  1859. disposalRemark: '',
  1860. inspectorNo: '',
  1861. inspectionRemark: '',
  1862. itemList:[],
  1863. unqualifiedQty: '',
  1864. rollCount: '',
  1865. samplingQty: '',
  1866. poOrderNo: '',
  1867. poItemNo: '',
  1868. partNo: '',
  1869. partDesc: '',
  1870. operator: '',
  1871. operatorName: '',
  1872. responsiblePerson: '',
  1873. responsiblePersonName: '',
  1874. subDetailList: [],
  1875. passQty: '',
  1876. notPassQty: ''
  1877. },
  1878. // 子明细数据对象
  1879. tableData: [],
  1880. checkedDetail: [],
  1881. subDetailFlag: false,
  1882. subDetailData: {
  1883. site: '',
  1884. buNo: '',
  1885. inspectionNo: '',
  1886. itemNo: '',
  1887. itemDesc: '',
  1888. defaultValue: '',
  1889. maxValue: '',
  1890. minValue: '',
  1891. valueTypeDb: '',
  1892. subDetailValues:[]
  1893. },
  1894. options: [],
  1895. fileFlag: false,
  1896. fileContentList: [],
  1897. IQCSelections: [],
  1898. batchHandleAddModalFlag: false,
  1899. batchAddData: {
  1900. samplingLocation: '',
  1901. samplingLocationB: '',
  1902. samplingNumber: ''
  1903. },
  1904. disposalMeasuresOptions: [],
  1905. orderTypeList: [],
  1906. userBuList: [],
  1907. authSearch: false,
  1908. authCheck: false,
  1909. authOverLoad: false,
  1910. authDelete: false,
  1911. authDetail: false,
  1912. authFile: false,
  1913. authChange: false,
  1914. menuId: this.$route.meta.menuId,
  1915. roleList: [],
  1916. operatorList: [],
  1917. operatorData: {
  1918. flag: '',
  1919. site: '',
  1920. bu: '',
  1921. adminID: '',
  1922. adminName: '',
  1923. roleName: '',
  1924. roleId: '',
  1925. },
  1926. operatorModelFlag: false,
  1927. dataListSelections2: [],
  1928. operatorDetailList: [
  1929. {
  1930. columnProp: 'adminID',
  1931. headerAlign: "center",
  1932. align: "center",
  1933. columnLabel: '用户账号',
  1934. columnHidden: false,
  1935. columnImage: false,
  1936. columnSortable: false,
  1937. sortLv: 0,
  1938. status: true,
  1939. fixed: '',
  1940. },
  1941. {
  1942. columnProp: 'adminName',
  1943. headerAlign: "center",
  1944. align: "center",
  1945. columnLabel: '用户名称',
  1946. columnHidden: false,
  1947. columnImage: false,
  1948. columnSortable: false,
  1949. sortLv: 0,
  1950. status: true,
  1951. fixed: '',
  1952. },
  1953. {
  1954. columnProp: 'email',
  1955. headerAlign: "center",
  1956. align: "center",
  1957. columnLabel: '邮箱',
  1958. columnHidden: false,
  1959. columnImage: false,
  1960. columnSortable: false,
  1961. sortLv: 0,
  1962. status: true,
  1963. fixed: '',
  1964. },
  1965. {
  1966. columnProp: 'phone',
  1967. headerAlign: "center",
  1968. align: "center",
  1969. columnLabel: '手机号',
  1970. columnHidden: false,
  1971. columnImage: false,
  1972. columnSortable: false,
  1973. sortLv: 0,
  1974. status: true,
  1975. fixed: '',
  1976. },
  1977. ],
  1978. acquisitionList: [],
  1979. fileData: {
  1980. site: '',
  1981. buNo: '',
  1982. inspectionNo: '',
  1983. partNo: '',
  1984. inspectionTypeNo: ''
  1985. },
  1986. batchInformationFlag: false,
  1987. batchDetailList: [],
  1988. batchInformationTable: 'batchInfo',
  1989. batchColumnList: [
  1990. {
  1991. columnProp: 'inspectionNo',
  1992. headerAlign: "center",
  1993. align: "center",
  1994. columnLabel: '检验单号',
  1995. columnHidden: false,
  1996. columnImage: false,
  1997. columnSortable: false,
  1998. sortLv: 0,
  1999. status: true,
  2000. fixed: '',
  2001. columnWidth: 120,
  2002. },
  2003. {
  2004. columnProp: 'partNo',
  2005. headerAlign: "center",
  2006. align: "center",
  2007. columnLabel: '物料编码',
  2008. columnHidden: false,
  2009. columnImage: false,
  2010. columnSortable: false,
  2011. sortLv: 0,
  2012. status: true,
  2013. fixed: '',
  2014. columnWidth: 120,
  2015. },
  2016. {
  2017. columnProp: 'partDesc',
  2018. headerAlign: "center",
  2019. align: "left",
  2020. columnLabel: '物料名称',
  2021. columnHidden: false,
  2022. columnImage: false,
  2023. columnSortable: false,
  2024. sortLv: 0,
  2025. status: true,
  2026. fixed: '',
  2027. columnWidth: 200,
  2028. },
  2029. {
  2030. columnProp: 'rollQty',
  2031. headerAlign: "center",
  2032. align: "right",
  2033. columnLabel: '到货数量',
  2034. columnHidden: false,
  2035. columnImage: false,
  2036. columnSortable: false,
  2037. sortLv: 0,
  2038. status: true,
  2039. fixed: '',
  2040. columnWidth: 80,
  2041. },
  2042. {
  2043. columnProp: 'rollCount',
  2044. headerAlign: "center",
  2045. align: "right",
  2046. columnLabel: '送检数量',
  2047. columnHidden: false,
  2048. columnImage: false,
  2049. columnSortable: false,
  2050. sortLv: 0,
  2051. status: true,
  2052. fixed: '',
  2053. columnWidth: 80,
  2054. },
  2055. {
  2056. columnProp: 'samplingQty',
  2057. headerAlign: "center",
  2058. align: "right",
  2059. columnLabel: '抽样数量',
  2060. columnHidden: false,
  2061. columnImage: false,
  2062. columnSortable: false,
  2063. sortLv: 0,
  2064. status: true,
  2065. fixed: '',
  2066. columnWidth: 80,
  2067. },
  2068. // {
  2069. // columnProp: 'passQty',
  2070. // headerAlign: "center",
  2071. // align: "right",
  2072. // columnLabel: '合格数量',
  2073. // columnHidden: false,
  2074. // columnImage: false,
  2075. // columnSortable: false,
  2076. // sortLv: 0,
  2077. // status: true,
  2078. // fixed: '',
  2079. // columnWidth: 80,
  2080. // },
  2081. ],
  2082. batchIndex: '',
  2083. currentRow: {},
  2084. currentDetailRow: {},
  2085. changeData: {
  2086. site: '',
  2087. buNo: '',
  2088. inspectionNo: '',
  2089. rollCount: '',
  2090. inspectCode: '',
  2091. qtySample: '',
  2092. percentSample: '',
  2093. samplingProgrammeNo: '',
  2094. samplingProgrammeDesc: '',
  2095. samplingLevelNo: '',
  2096. samplingLevelDesc: '',
  2097. receiptNo: '',
  2098. receiptItemNo: '',
  2099. inspectionTypeNo: ''
  2100. },
  2101. changeModalFlag: false,
  2102. batchLoading: false
  2103. }
  2104. },
  2105. mounted () {
  2106. this.$nextTick(() => {
  2107. this.height = window.innerHeight - 250
  2108. })
  2109. },
  2110. updated() {
  2111. this.$nextTick(()=>{
  2112. this.$refs.IQCTable.doLayout()
  2113. })
  2114. },
  2115. created () {
  2116. // 按钮控制
  2117. this.getButtonAuthData()
  2118. // 获取用户的 site 和 bu
  2119. this.getSiteAndBuByUserName()
  2120. this.favoriteIsOk()
  2121. this.disposalMeasuresSearch()
  2122. //this.orderTypeSearch()
  2123. // 动态列
  2124. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2125. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  2126. if (!this.authSearch) {
  2127. // 获取数据列表
  2128. this.getDataList()
  2129. }
  2130. // 获取用户角色
  2131. this.getUserRoleList()
  2132. },
  2133. methods: {
  2134. // 删除所选
  2135. deleteBatch (row) {
  2136. if (this.IQCSelections.length === 1) {
  2137. this.$message.warning('检验单数量为1,不允许删除!')
  2138. return
  2139. }
  2140. this.$confirm(`确认删除所选检验单?`, '提示', {
  2141. confirmButtonText: '确定',
  2142. cancelButtonText: '取消',
  2143. type: 'warning'
  2144. }).then(() => {
  2145. this.$refs.IQCTable.toggleRowSelection(row, false)
  2146. })
  2147. },
  2148. // 批量合格处理
  2149. batchQualifiedModal () {
  2150. if (this.IQCSelections.length === 0) {
  2151. this.$message.warning('请勾选要批量处理的检验单!')
  2152. return
  2153. }
  2154. // 判断检验单状态
  2155. if (this.IQCSelections.every(val => val.state === '待检验')) {
  2156. // 校验检验明细
  2157. if (this.IQCSelections.some(val => val.templateId == null || val.templateId === '')) {
  2158. this.$message.warning('检验单不存在检验明细!')
  2159. return
  2160. }
  2161. // 校验模板和供应商
  2162. // 获取第一个对象的属性值作为参考
  2163. const firstItem = this.IQCSelections[0]
  2164. const firstTemplateId = firstItem.templateId
  2165. const firstSupplierNo = firstItem.supplierNo
  2166. if (!this.IQCSelections.every(item => item.templateId === firstTemplateId && item.supplierNo === firstSupplierNo)) {
  2167. this.$message.warning('所选检验单模板和供应商必须一致!')
  2168. return
  2169. }
  2170. this.IQCSelections.forEach((item, index) => {
  2171. this.$set(this.IQCSelections[index], 'inspectorNo', this.$store.state.user.name)
  2172. })
  2173. this.detailModal2(this.IQCSelections[0])
  2174. } else {
  2175. this.$message.warning('检验单必须为待检验状态!')
  2176. return
  2177. }
  2178. },
  2179. // 获取协同人员列表
  2180. batchGetOperatorList (index) {
  2181. this.operatorData.flag = '3'
  2182. this.operatorData.bu = this.IQCSelections[index].site + '_' + this.IQCSelections[index].buNo
  2183. if (this.roleList.length > 0) {
  2184. let filterList = this.roleList.filter(item => item.roleName === '机修人员')
  2185. if (filterList.length > 0) {
  2186. this.operatorData.roleId = filterList[0].roleId
  2187. } else {
  2188. this.operatorData.roleId = this.roleList[0].roleId
  2189. }
  2190. } else {
  2191. this.operatorData.roleId = ''
  2192. }
  2193. // 先清空缓存选中
  2194. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2195. // 拿到选中的人员编号
  2196. let tempDataList = (this.IQCSelections[index].operator == null ? '' : this.IQCSelections[index].operator).split(';')
  2197. getOperatorList(this.operatorData).then(({data}) => {
  2198. if (data && data.code === 0) {
  2199. this.operatorList = data.rows
  2200. this.operatorList.forEach(val => {
  2201. // 回显选中
  2202. if (tempDataList.includes(val.adminID)) {
  2203. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2204. }
  2205. })
  2206. this.batchIndex = index
  2207. this.operatorModelFlag = true
  2208. } else {
  2209. this.$alert(data.msg, '错误', {
  2210. confirmButtonText: '确定'
  2211. })
  2212. }
  2213. })
  2214. },
  2215. // 获取责任人列表
  2216. batchGetResponsiblePersonList (index) {
  2217. this.operatorData.flag = '4'
  2218. this.operatorData.bu = this.IQCSelections[index].site + '_' + this.IQCSelections[index].buNo
  2219. if (this.roleList.length > 0) {
  2220. let filterList = this.roleList.filter(item => item.roleName === '系统管理员')
  2221. if (filterList.length > 0) {
  2222. this.operatorData.roleId = filterList[0].roleId
  2223. } else {
  2224. this.operatorData.roleId = this.roleList[0].roleId
  2225. }
  2226. } else {
  2227. this.operatorData.roleId = ''
  2228. }
  2229. // 先清空缓存选中
  2230. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2231. // 拿到选中的人员编号
  2232. let tempDataList = (this.IQCSelections[index].responsiblePerson == null ? '' : this.IQCSelections[index].responsiblePerson).split(';')
  2233. getOperatorList(this.operatorData).then(({data}) => {
  2234. if (data && data.code === 0) {
  2235. this.operatorList = data.rows
  2236. this.operatorList.forEach(val => {
  2237. // 回显选中
  2238. if (tempDataList.includes(val.adminID)) {
  2239. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2240. }
  2241. })
  2242. this.batchIndex = index
  2243. this.operatorModelFlag = true
  2244. } else {
  2245. this.$alert(data.msg, '错误', {
  2246. confirmButtonText: '确定'
  2247. })
  2248. }
  2249. })
  2250. },
  2251. // 保存批量合格信息
  2252. batchSave () {
  2253. this.$confirm(`确认保存检验数据?`, '提示', {
  2254. confirmButtonText: '确定',
  2255. cancelButtonText: '取消',
  2256. type: 'warning'
  2257. }).then(() => {
  2258. let tempData = {
  2259. submitList: JSON.parse(JSON.stringify(this.IQCSelections)),
  2260. itemList: JSON.parse(JSON.stringify(this.batchDetailList))
  2261. }
  2262. this.batchLoading = true
  2263. batchSaveIQCDetailedRecord(tempData).then(({data}) => {
  2264. if (data && data.code === 0) {
  2265. this.getDataList()
  2266. this.batchInformationFlag = false
  2267. this.$message({
  2268. message: '操作成功',
  2269. type: 'success',
  2270. duration: 1500,
  2271. onClose: () => {}
  2272. })
  2273. } else {
  2274. this.$alert(data.msg, '错误', {
  2275. confirmButtonText: '确定'
  2276. })
  2277. }
  2278. this.batchLoading = false
  2279. }).catch(()=>{
  2280. this.batchLoading = false
  2281. })
  2282. })
  2283. },
  2284. // 列表数据总结
  2285. getSummaries (param) {
  2286. const { columns, data } = param
  2287. const sums = []
  2288. columns.forEach((column, index) => {
  2289. if (index === 0) {
  2290. sums[index] = '总计'
  2291. return
  2292. }
  2293. if (column.property !== 'rollQty' && column.property !== 'rollCount') {
  2294. sums[index] = ''
  2295. return
  2296. }
  2297. const values = data.map(item => Number(item[column.property]))
  2298. if (!values.every(value => isNaN(value))) {
  2299. sums[index] = values.reduce((prev, curr) => {
  2300. const value = Number(curr)
  2301. if (!isNaN(value)) {
  2302. return prev + curr
  2303. } else {
  2304. return prev
  2305. }
  2306. }, 0)
  2307. } else {
  2308. sums[index] = ''
  2309. }
  2310. })
  2311. return sums
  2312. },
  2313. // 检验结论改变事件
  2314. resultChange () {
  2315. if (this.detailData.inspectionResult === '不合格') {
  2316. this.detailData.passQty = 0
  2317. }
  2318. },
  2319. // 数据采集
  2320. dataAcquisition () {
  2321. this.loadFlag = true
  2322. let tempDate = {
  2323. site: this.detailData.site,
  2324. buNo: this.detailData.buNo,
  2325. inspectionNo: this.detailData.inspectionNo,
  2326. flag: 'iqc'
  2327. }
  2328. dataAcquisition(tempDate).then(({data}) => {
  2329. if (data.code === 0) {
  2330. // this.acquisitionList = data.rows
  2331. this.changeMyString(data.rows)
  2332. this.$message({
  2333. message: '数据采集成功',
  2334. type: 'success',
  2335. duration: 1500
  2336. })
  2337. } else {
  2338. this.$message({
  2339. message: data.msg,
  2340. type: 'warning',
  2341. duration: 1500
  2342. })
  2343. }
  2344. this.loadFlag = false
  2345. })
  2346. },
  2347. // 获取用户角色
  2348. getUserRoleList () {
  2349. getUserRoleList().then(({data}) => {
  2350. if (data.code === 0) {
  2351. this.roleList = data.rows
  2352. } else {
  2353. this.roleList = []
  2354. }
  2355. })
  2356. },
  2357. // 获取协同人员列表
  2358. getOperatorList () {
  2359. this.operatorData.flag = '1'
  2360. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2361. if (this.roleList.length > 0) {
  2362. let filterList = this.roleList.filter(item => item.roleName === '机修人员')
  2363. if (filterList.length > 0) {
  2364. this.operatorData.roleId = filterList[0].roleId
  2365. } else {
  2366. this.operatorData.roleId = this.roleList[0].roleId
  2367. }
  2368. } else {
  2369. this.operatorData.roleId = ''
  2370. }
  2371. // 先清空缓存选中
  2372. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2373. // 拿到选中的人员编号
  2374. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2375. getOperatorList(this.operatorData).then(({data}) => {
  2376. if (data && data.code === 0) {
  2377. this.operatorList = data.rows
  2378. this.operatorList.forEach(val => {
  2379. // 回显选中
  2380. if (tempDataList.includes(val.adminID)) {
  2381. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2382. }
  2383. })
  2384. this.operatorModelFlag = true
  2385. } else {
  2386. this.$alert(data.msg, '错误', {
  2387. confirmButtonText: '确定'
  2388. })
  2389. }
  2390. })
  2391. },
  2392. // 获取责任人员列表
  2393. getResponsiblePersonList () {
  2394. this.operatorData.flag = '2'
  2395. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2396. if (this.roleList.length > 0) {
  2397. let filterList = this.roleList.filter(item => item.roleName === '系统管理员')
  2398. if (filterList.length > 0) {
  2399. this.operatorData.roleId = filterList[0].roleId
  2400. } else {
  2401. this.operatorData.roleId = this.roleList[0].roleId
  2402. }
  2403. } else {
  2404. this.operatorData.roleId = ''
  2405. }
  2406. // 先清空缓存选中
  2407. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2408. // 拿到选中的人员编号
  2409. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2410. getOperatorList(this.operatorData).then(({data}) => {
  2411. if (data && data.code === 0) {
  2412. this.operatorList = data.rows
  2413. this.operatorList.forEach(val => {
  2414. // 回显选中
  2415. if (tempDataList.includes(val.adminID)) {
  2416. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2417. }
  2418. })
  2419. this.operatorModelFlag = true
  2420. } else {
  2421. this.$alert(data.msg, '错误', {
  2422. confirmButtonText: '确定'
  2423. })
  2424. }
  2425. })
  2426. },
  2427. // 查询机修人员列表
  2428. getOperatorList2 () {
  2429. if (this.operatorData.flag === '1') {
  2430. // 拿到选中的人员编号
  2431. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2432. getOperatorList(this.operatorData).then(({data}) => {
  2433. if (data && data.code === 0) {
  2434. this.operatorList = data.rows
  2435. this.operatorList.forEach(val => {
  2436. // 回显选中的部门
  2437. if (tempDataList.includes(val.adminID)) {
  2438. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2439. }
  2440. })
  2441. } else {
  2442. this.operatorList = []
  2443. }
  2444. })
  2445. } else if (this.operatorData.flag === '2') {
  2446. // 拿到选中的人员编号
  2447. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2448. getOperatorList(this.operatorData).then(({data}) => {
  2449. if (data && data.code === 0) {
  2450. this.operatorList = data.rows
  2451. this.operatorList.forEach(val => {
  2452. // 回显选中的部门
  2453. if (tempDataList.includes(val.adminID)) {
  2454. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2455. }
  2456. })
  2457. } else {
  2458. this.operatorList = []
  2459. }
  2460. })
  2461. } else if (this.operatorData.flag === '3') {
  2462. // 拿到选中的人员编号
  2463. let tempDataList = (this.IQCSelections[this.batchIndex].operator == null ? '' : this.IQCSelections[this.batchIndex].operator).split(';')
  2464. getOperatorList(this.operatorData).then(({data}) => {
  2465. if (data && data.code === 0) {
  2466. this.operatorList = data.rows
  2467. this.operatorList.forEach(val => {
  2468. // 回显选中的部门
  2469. if (tempDataList.includes(val.adminID)) {
  2470. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2471. }
  2472. })
  2473. } else {
  2474. this.operatorList = []
  2475. }
  2476. })
  2477. } else if (this.operatorData.flag === '4') {
  2478. // 拿到选中的人员编号
  2479. let tempDataList = (this.IQCSelections[this.batchIndex].responsiblePerson == null ? '' : this.IQCSelections[this.batchIndex].responsiblePerson).split(';')
  2480. getOperatorList(this.operatorData).then(({data}) => {
  2481. if (data && data.code === 0) {
  2482. this.operatorList = data.rows
  2483. this.operatorList.forEach(val => {
  2484. // 回显选中的部门
  2485. if (tempDataList.includes(val.adminID)) {
  2486. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2487. }
  2488. })
  2489. } else {
  2490. this.operatorList = []
  2491. }
  2492. })
  2493. }
  2494. },
  2495. // 点击行选中复选框
  2496. operatorClickRow (row) {
  2497. this.$refs.operatorTable.toggleRowSelection(row)
  2498. },
  2499. // 多选
  2500. selectionChangeHandle2 (val) {
  2501. this.dataListSelections2 = val
  2502. },
  2503. // 确认多选协同人员
  2504. confirmOperator () {
  2505. if (this.dataListSelections2.length === 0) {
  2506. this.$message.warning('请勾选人员!')
  2507. return
  2508. }
  2509. if (this.operatorData.flag === '1') {
  2510. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2511. if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) {
  2512. this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName
  2513. this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID
  2514. }
  2515. }
  2516. if (this.detailData.operator.charAt(0) === ';') {
  2517. this.detailData.operator = this.detailData.operator.substring(1)
  2518. this.detailData.operatorName = this.detailData.operatorName.substring(1)
  2519. }
  2520. } else if (this.operatorData.flag === '2') {
  2521. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2522. if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) {
  2523. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName
  2524. this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID
  2525. }
  2526. }
  2527. if (this.detailData.responsiblePerson.charAt(0) === ';') {
  2528. this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1)
  2529. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1)
  2530. }
  2531. } else if (this.operatorData.flag === '3') {
  2532. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2533. if (!this.IQCSelections[this.batchIndex].operator.split(';').includes(this.dataListSelections2[i].adminID)) {
  2534. this.IQCSelections[this.batchIndex].operatorName = this.IQCSelections[this.batchIndex].operatorName + ";" + this.dataListSelections2[i].adminName
  2535. this.IQCSelections[this.batchIndex].operator = this.IQCSelections[this.batchIndex].operator + ";" + this.dataListSelections2[i].adminID
  2536. }
  2537. }
  2538. if (this.IQCSelections[this.batchIndex].operator.charAt(0) === ';') {
  2539. this.IQCSelections[this.batchIndex].operator = this.IQCSelections[this.batchIndex].operator.substring(1)
  2540. this.IQCSelections[this.batchIndex].operatorName = this.IQCSelections[this.batchIndex].operatorName.substring(1)
  2541. }
  2542. } else if (this.operatorData.flag === '4') {
  2543. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2544. if (!this.IQCSelections[this.batchIndex].responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) {
  2545. this.IQCSelections[this.batchIndex].responsiblePersonName = this.IQCSelections[this.batchIndex].responsiblePersonName + ";" + this.dataListSelections2[i].adminName
  2546. this.IQCSelections[this.batchIndex].responsiblePerson = this.IQCSelections[this.batchIndex].responsiblePerson + ";" + this.dataListSelections2[i].adminID
  2547. }
  2548. }
  2549. if (this.IQCSelections[this.batchIndex].responsiblePerson.charAt(0) === ';') {
  2550. this.IQCSelections[this.batchIndex].responsiblePerson = this.IQCSelections[this.batchIndex].responsiblePerson.substring(1)
  2551. this.IQCSelections[this.batchIndex].responsiblePersonName = this.IQCSelections[this.batchIndex].responsiblePersonName.substring(1)
  2552. }
  2553. }
  2554. this.operatorData = {
  2555. flag: '',
  2556. site: '',
  2557. bu: '',
  2558. adminID: '',
  2559. adminName: '',
  2560. roleName: '',
  2561. roleId: '',
  2562. }
  2563. this.operatorModelFlag = false
  2564. },
  2565. // // 实测值内容改变事件
  2566. // changeValue (row) {
  2567. // if (row.minValue == null && row.maxValue != null) {
  2568. // if (row.numberValue > row.maxValue) {
  2569. // row.itemResult = 'N'
  2570. // } else {
  2571. // row.itemResult = 'Y'
  2572. // }
  2573. // } else if (row.maxValue == null && row.minValue != null) {
  2574. // if (row.numberValue < row.minValue) {
  2575. // row.itemResult = 'N'
  2576. // } else {
  2577. // row.itemResult = 'Y'
  2578. // }
  2579. // } else if (row.minValue != null && row.maxValue != null) {
  2580. // if (row.numberValue < row.minValue || row.numberValue > row.maxValue) {
  2581. // row.itemResult = 'N'
  2582. // } else {
  2583. // row.itemResult = 'Y'
  2584. // }
  2585. // }
  2586. // },
  2587. // 获取用户的bu
  2588. getSiteAndBuByUserName () {
  2589. let tempData = {
  2590. username: this.$store.state.user.name,
  2591. }
  2592. getSiteAndBuByUserName(tempData).then(({data}) => {
  2593. if (data.code === 0) {
  2594. this.userBuList = data.rows
  2595. }
  2596. })
  2597. },
  2598. // ======= 正则校验 =======
  2599. handleInput (value, type) {
  2600. // 大于等于0,且只能输入4位小数
  2601. let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
  2602. if (val === null || val === undefined || val === '') {
  2603. val = 0
  2604. }
  2605. if (type === 1) {
  2606. this.detailData.unqualifiedQty = val
  2607. } else if (type === 2) {
  2608. this.detailData.passQty = val
  2609. }
  2610. },
  2611. // 子明细导入
  2612. subDetailUpload () {
  2613. let currentData = {
  2614. flag: 'IQC',
  2615. site: this.detailData.site,
  2616. buNo: this.detailData.buNo,
  2617. inspectionNo: this.detailData.inspectionNo
  2618. }
  2619. //打开组件 去做新增业务
  2620. this.$nextTick(() => {
  2621. this.$refs.subDetailUpload.init(currentData)
  2622. })
  2623. },
  2624. // 获取处置措施列表
  2625. disposalMeasuresSearch () {
  2626. let tempData = {
  2627. inspectionTypeNo: '105'
  2628. }
  2629. disposalMeasuresSearch(tempData).then(({data}) => {
  2630. if (data.code === 0) {
  2631. this.disposalMeasuresOptions = data.rows
  2632. }
  2633. })
  2634. },
  2635. // 获取采购类型列表
  2636. orderTypeSearch () {
  2637. orderTypeSearch().then(({data}) => {
  2638. if (data.code === 0) {
  2639. this.orderTypeList = data.rows
  2640. }
  2641. })
  2642. },
  2643. // 单机选中
  2644. IQCClickRow (row) {
  2645. this.currentRow = JSON.parse(JSON.stringify(row))
  2646. },
  2647. // 复选
  2648. selectionIQC (val) {
  2649. this.IQCSelections = val
  2650. },
  2651. rowStyle ({row}) {
  2652. if (this.currentRow.inspectionNo === row.inspectionNo) {
  2653. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  2654. }
  2655. },
  2656. // 单机选中
  2657. IQCDetailClickRow (row) {
  2658. this.currentDetailRow = JSON.parse(JSON.stringify(row))
  2659. },
  2660. rowDetailStyle ({row}) {
  2661. if (this.currentDetailRow.itemNo === row.itemNo) {
  2662. return { 'background-color': '#50DCDC', cursor: 'pointer' };
  2663. }
  2664. },
  2665. // 刷新派设备文档的列表
  2666. getFileContentData (row) {
  2667. this.fileData = {
  2668. site: row.site,
  2669. buNo: row.buNo,
  2670. inspectionNo: row.inspectionNo,
  2671. partNo: row.partNo,
  2672. inspectionTypeNo: '105'
  2673. }
  2674. getFileContentList2(this.fileData).then(({data}) => {
  2675. //区分请求成功和失败的状况
  2676. if (data && data.code === 200) {
  2677. this.fileContentList = data.rows
  2678. } else {
  2679. this.fileContentList = []
  2680. }
  2681. })
  2682. this.fileFlag = true
  2683. },
  2684. // 新增文件的modal
  2685. addUploadFileModal () {
  2686. let currentData = {
  2687. titleCon: 'IQC文件上传',
  2688. site: this.detailData.site,
  2689. buNo: this.detailData.buNo,
  2690. createBy: this.$store.state.user.name,
  2691. inspectionNo: this.detailData.inspectionNo,
  2692. remark: '',
  2693. folder: 'qcIQC',
  2694. }
  2695. //打开组件 去做新增业务
  2696. this.$nextTick(() => {
  2697. this.$refs.qcFAIUploadFile.init(currentData)
  2698. })
  2699. },
  2700. // 上传项目图片
  2701. uploadImageModal (row) {
  2702. let currentData = {
  2703. site: this.detailData.site,
  2704. buNo: this.detailData.buNo,
  2705. createBy: this.$store.state.user.name,
  2706. inspectionNo: this.detailData.inspectionNo,
  2707. itemNo: row.itemNo,
  2708. folder: 'IQCItemImageFile'
  2709. }
  2710. //打开组件 去做新增业务
  2711. this.$nextTick(() => {
  2712. this.$refs.comQcItemImageUploadFile.init(currentData)
  2713. })
  2714. },
  2715. // 文件下载
  2716. downloadFile (row) {
  2717. downLoadObjectFile(row)
  2718. .then(({data}) => {
  2719. // 不限制文件下载类型
  2720. const blob = new Blob([data], {type: "application/octet-stream"})
  2721. // 下载文件名称
  2722. const fileName = row.fileName
  2723. // a标签下载
  2724. const linkNode = document.createElement('a')
  2725. // a标签的download属性规定下载文件的名称
  2726. linkNode.download = fileName
  2727. linkNode.style.display = 'none'
  2728. // 生成一个Blob URL
  2729. linkNode.href = URL.createObjectURL(blob)
  2730. document.body.appendChild(linkNode)
  2731. // 模拟在按钮上的一次鼠标单击
  2732. linkNode.click()
  2733. // 释放URL 对象
  2734. URL.revokeObjectURL(linkNode.href)
  2735. document.body.removeChild(linkNode)
  2736. })
  2737. },
  2738. // 预览
  2739. previewFile (row) {
  2740. // 预览文件
  2741. let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
  2742. let type = ''
  2743. if (image.includes(row.fileType.toLowerCase())) {
  2744. type = 'image/' + row.fileType
  2745. }
  2746. let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
  2747. if (video.includes(row.fileType.toLowerCase())) {
  2748. type = 'video/' + row.fileType
  2749. }
  2750. let txt = ['txt']
  2751. if (txt.includes(row.fileType.toLowerCase())) {
  2752. type = 'text/plain'
  2753. }
  2754. let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
  2755. if (office.includes(row.fileType.toLowerCase())) {
  2756. this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
  2757. return
  2758. }
  2759. let pdf = ['pdf']
  2760. if (pdf.includes(row.fileType.toLowerCase())) {
  2761. type = 'application/pdf'
  2762. }
  2763. if (type === ''){
  2764. this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
  2765. return;
  2766. }
  2767. downLoadObjectFile(row).then(({data}) => {
  2768. const blob = new Blob([data], { type: type });
  2769. // 创建URL来生成预览
  2770. const fileURL = URL.createObjectURL(blob);
  2771. if (type.includes('image')) { // 图片
  2772. localStorage.setItem("imgUrl",fileURL)
  2773. window.open(window.location.origin+"/#/image",'_blank')
  2774. } else {
  2775. // 在新标签页中打开文件预览
  2776. const newTab = window.open(fileURL, '_blank')
  2777. }
  2778. })
  2779. },
  2780. // 删除文件
  2781. deleteFile (row) {
  2782. let tempData = {
  2783. site: row.orderRef1,
  2784. inspectionNo: row.orderRef2,
  2785. buNo: row.orderRef4,
  2786. partNo: this.fileData.partNo,
  2787. inspectionTypeNo: '105'
  2788. }
  2789. this.$confirm('确定要删除此文件?', '提示', {
  2790. confirmButtonText: '确定',
  2791. cancelButtonText: '取消',
  2792. type: 'warning'
  2793. }).then(() => {
  2794. deleteObjectFile(row).then(({data}) => {
  2795. if (data && data.code == 0) {
  2796. this.getFileContentData(tempData)
  2797. this.$message({
  2798. message: '操作成功',
  2799. type: 'success',
  2800. duration: 1500,
  2801. onClose: () => {}
  2802. })
  2803. } else {
  2804. this.$alert(data.msg, '错误', {
  2805. confirmButtonText: '确定'
  2806. })
  2807. }
  2808. })
  2809. }).catch(() => {
  2810. })
  2811. },
  2812. // 获取基础数据列表S
  2813. getBaseList (val,type) {
  2814. this.tagNo = val
  2815. this.tagType = type
  2816. this.$nextTick(() => {
  2817. let strVal = ''
  2818. let conSql = ''
  2819. if (val === 1037) {
  2820. strVal = this.modalData.detailCodeNo
  2821. this.$refs.baseList.init(val, strVal)
  2822. }
  2823. if (val === 1040) {
  2824. strVal = this.modalData.inspectorNo
  2825. this.$refs.baseList.init(val, strVal)
  2826. }
  2827. if (val === 508) {
  2828. strVal = this.searchData.warehouseId
  2829. this.$refs.baseList.init(val, strVal)
  2830. }
  2831. if (val === 509 && type === 1) {
  2832. strVal = this.searchData.supplierNo
  2833. this.$refs.baseList.init(val, strVal)
  2834. }
  2835. if (val === 509 && type === 2) {
  2836. strVal = this.detailData.responsiblePerson
  2837. this.$refs.baseList.init(val, strVal)
  2838. }
  2839. if (val === 207) {
  2840. strVal = this.changeData.samplingProgrammeNo
  2841. conSql = " and bu_no = '" + this.changeData.buNo + "'"
  2842. this.$refs.baseList.init(val, strVal, conSql)
  2843. }
  2844. if (val === 208) {
  2845. strVal = this.changeData.samplingLevelNo
  2846. conSql = " and bu_no = '" + this.changeData.buNo + "'"
  2847. this.$refs.baseList.init(val, strVal, conSql)
  2848. }
  2849. })
  2850. },
  2851. // 列表方法的回调
  2852. getBaseData (val) {
  2853. if (this.tagNo === 1037) {
  2854. this.modalData.detailCodeNo = val.code_no
  2855. this.modalData.detailCodeDesc = val.code_desc
  2856. }
  2857. if (this.tagNo === 1040) {
  2858. this.modalData.inspectorNo = val.inspector_no
  2859. this.modalData.inspectorName = val.inspector_name
  2860. }
  2861. if (this.tagNo === 508) {
  2862. this.searchData.warehouseId = val.WareHouseID
  2863. }
  2864. if (this.tagNo === 509 && this.tagType === 1) {
  2865. this.searchData.supplierNo = val.SupplierID
  2866. }
  2867. if (this.tagNo === 509 && this.tagType === 2) {
  2868. this.detailData.responsiblePerson = val.SupplierID
  2869. }
  2870. if (this.tagNo === 207) {
  2871. this.changeData.samplingProgrammeNo = val.sampling_programme_no
  2872. this.changeData.samplingProgrammeDesc = val.sampling_programme_desc
  2873. }
  2874. if (this.tagNo === 208) {
  2875. this.changeData.samplingLevelNo = val.sampling_level_no
  2876. this.changeData.samplingLevelDesc = val.sampling_level_desc
  2877. }
  2878. },
  2879. // 获取主信息数据列表
  2880. getDataList () {
  2881. this.searchData.limit = this.pageSize
  2882. this.searchData.page = this.pageIndex
  2883. qcIQCInspectionSearch(this.searchData).then(({data}) => {
  2884. if (data.code === 0) {
  2885. this.dataList = data.page.list
  2886. this.pageIndex = data.page.currPage
  2887. this.pageSize = data.page.pageSize
  2888. this.totalPage = data.page.totalCount
  2889. }
  2890. })
  2891. },
  2892. // 每页数
  2893. sizeChangeHandle (val) {
  2894. this.pageSize = val
  2895. this.pageIndex = 1
  2896. this.getDataList()
  2897. },
  2898. // 当前页
  2899. currentChangeHandle (val) {
  2900. this.pageIndex = val
  2901. this.getDataList()
  2902. },
  2903. // 多选
  2904. selectionChangeHandle (val) {
  2905. this.dataListSelections = val
  2906. },
  2907. // 查询检验类型
  2908. inspectorSearch () {
  2909. inspectorSearch().then(({data}) => {
  2910. if (data.code === 0) {
  2911. this.options = data.rows
  2912. }
  2913. })
  2914. },
  2915. async Transfer () {
  2916. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  2917. this.$message.warning('请选择检验结论!')
  2918. return
  2919. }
  2920. if (this.detailData.inspectionResult === '不合格' && (this.detailData.disposalMeasures == null || this.detailData.disposalMeasures === '')) {
  2921. this.$message.warning('请选择处置措施!')
  2922. return
  2923. }
  2924. if (this.detailList.length > 0 && this.detailData.inspectionResult === '不合格') {
  2925. const flag = this.detailList.some(item => item.itemResult === 'N')
  2926. if (!flag) {
  2927. this.$message.warning('请选择不合格项目!')
  2928. return
  2929. }
  2930. }
  2931. this.$confirm(`确认保存检验数据?`, '提示', {
  2932. confirmButtonText: '确定',
  2933. cancelButtonText: '取消',
  2934. type: 'warning'
  2935. }).then(() => {
  2936. if (this.detailData.inspectionResult !== '不合格') {
  2937. this.detailData.disposalMeasures = ''
  2938. this.detailData.disposalRemark = ''
  2939. }
  2940. this.saveDetailInformation()
  2941. })
  2942. },
  2943. // 新增明细信息
  2944. saveDetailInformation () {
  2945. this.saveInformationData.site = this.detailData.site
  2946. this.saveInformationData.buNo = this.detailData.buNo
  2947. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  2948. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  2949. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  2950. this.saveInformationData.inspectorNo = this.$store.state.user.name
  2951. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  2952. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  2953. this.saveInformationData.rollCount = this.detailData.rollCount
  2954. this.saveInformationData.samplingQty = this.detailData.samplingQty
  2955. this.saveInformationData.unqualifiedQty = this.detailData.unqualifiedQty
  2956. this.saveInformationData.poOrderNo = this.detailData.poOrderNo
  2957. this.saveInformationData.poItemNo = this.detailData.poItemNo
  2958. this.saveInformationData.partNo = this.detailData.partNo
  2959. this.saveInformationData.partDesc = this.detailData.partDesc
  2960. this.saveInformationData.operator = this.detailData.operator
  2961. this.saveInformationData.responsiblePerson = this.detailData.responsiblePerson
  2962. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  2963. this.saveInformationData.passQty = this.detailData.passQty == null ? 0 : this.detailData.passQty
  2964. this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
  2965. // this.saveInformationData.subDetailList = this.acquisitionList
  2966. saveIQCDetailedRecord(this.saveInformationData).then(({data}) => {
  2967. if (data && data.code === 0) {
  2968. this.getDataList()
  2969. this.detailInformationFlag = false
  2970. this.$message({
  2971. message: '操作成功',
  2972. type: 'success',
  2973. duration: 1500,
  2974. onClose: () => {}
  2975. })
  2976. } else {
  2977. this.$alert(data.msg, '错误', {
  2978. confirmButtonText: '确定'
  2979. })
  2980. }
  2981. })
  2982. },
  2983. // 开始检验
  2984. actionModal (row) {
  2985. this.$confirm(`确认开始检验?`, '提示', {
  2986. confirmButtonText: '确定',
  2987. cancelButtonText: '取消',
  2988. type: 'warning'
  2989. }).then(() => {
  2990. let tempData = {
  2991. site: row.site,
  2992. buNo: row.buNo,
  2993. inspectionNo: row.inspectionNo,
  2994. actionBy: this.$store.state.user.name,
  2995. state: '待检验'
  2996. }
  2997. actionIQCInspection(tempData).then(({data}) => {
  2998. if (data && data.code === 0) {
  2999. this.getDataList()
  3000. this.$message({
  3001. message: '操作成功',
  3002. type: 'success',
  3003. duration: 1500,
  3004. onClose: () => {}
  3005. })
  3006. } else {
  3007. this.$alert(data.msg, '错误', {
  3008. confirmButtonText: '确定'
  3009. })
  3010. }
  3011. })
  3012. })
  3013. },
  3014. // 明细记录信息查询
  3015. detailModal (row) {
  3016. this.detailData.site = row.site
  3017. this.detailData.buNo = row.buNo
  3018. this.detailData.inspectionNo = row.inspectionNo
  3019. this.detailData.partNo = row.partNo
  3020. this.detailData.partDesc = row.partDesc
  3021. this.detailData.rollQty = row.rollQty
  3022. this.detailData.samplingQty = row.samplingQty
  3023. this.detailData.unqualifiedQty = row.unqualifiedQty
  3024. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  3025. this.detailData.submitFlag = row.submitFlag
  3026. this.detailData.disposalMeasures = row.disposalMeasures
  3027. this.detailData.disposalRemark = row.disposalRemark
  3028. this.detailData.inspectionResult = row.inspectionResult
  3029. this.detailData.inspectorNo = row.inspectorNo
  3030. this.detailData.inspectionRemark = row.inspectionRemark
  3031. this.detailData.umId = row.umId
  3032. this.detailData.rollCount = row.rollCount
  3033. this.detailData.poOrderNo = row.poOrderNo
  3034. this.detailData.poItemNo = row.poItemNo
  3035. this.detailData.operator = row.operator
  3036. this.detailData.operatorName = row.operatorName
  3037. this.detailData.responsiblePerson = row.responsiblePerson
  3038. this.detailData.responsiblePersonName = row.responsiblePersonName
  3039. if (row.state === '待检验') {
  3040. this.detailData.passQty = row.samplingQty
  3041. } else {
  3042. this.detailData.passQty = row.passQty
  3043. this.detailData.notPassQty = row.notPassQty
  3044. }
  3045. this.getInspectionFormData()
  3046. this.inspectorSearch()
  3047. // this.acquisitionList = []
  3048. this.detailInformationFlag = true
  3049. },
  3050. detailModal2 (row) {
  3051. this.detailData.site = row.site
  3052. this.detailData.buNo = row.buNo
  3053. this.detailData.inspectionNo = row.inspectionNo
  3054. this.detailData.partNo = row.partNo
  3055. this.detailData.partDesc = row.partDesc
  3056. this.detailData.rollQty = row.rollQty
  3057. this.detailData.samplingQty = row.samplingQty
  3058. this.detailData.unqualifiedQty = row.unqualifiedQty
  3059. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  3060. this.detailData.submitFlag = row.submitFlag
  3061. this.detailData.disposalMeasures = row.disposalMeasures
  3062. this.detailData.disposalRemark = row.disposalRemark
  3063. this.detailData.inspectionResult = row.inspectionResult
  3064. this.detailData.inspectorNo = row.inspectorNo
  3065. this.detailData.inspectionRemark = row.inspectionRemark
  3066. this.detailData.umId = row.umId
  3067. this.detailData.rollCount = row.rollCount
  3068. this.detailData.poOrderNo = row.poOrderNo
  3069. this.detailData.poItemNo = row.poItemNo
  3070. this.detailData.operator = row.operator
  3071. this.detailData.operatorName = row.operatorName
  3072. this.detailData.responsiblePerson = row.responsiblePerson
  3073. this.detailData.responsiblePersonName = row.responsiblePersonName
  3074. this.detailData.passQty = row.passQty
  3075. this.detailData.notPassQty = row.notPassQty
  3076. iqcDetailSearch(this.detailData).then(({data}) => {
  3077. if (data && data.code === 0) {
  3078. this.batchDetailList = data.rows
  3079. this.batchInformationTable = 'batchInfo'
  3080. this.batchInformationFlag = true
  3081. } else {
  3082. this.$message.warning('未查到检验单明细信息!')
  3083. }
  3084. })
  3085. },
  3086. // 检验单明细
  3087. getInspectionFormData () {
  3088. iqcDetailSearch(this.detailData).then(({data}) => {
  3089. if (data && data.code === 0) {
  3090. this.detailList = data.rows
  3091. } else {
  3092. this.detailList = []
  3093. }
  3094. })
  3095. },
  3096. // 子明细记录信息查询
  3097. subDetailModal (row) {
  3098. this.subDetailData = row
  3099. this.pageIndex2 = 1
  3100. selectIQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  3101. this.tableData = data.rows
  3102. })
  3103. this.batchAddData = {
  3104. samplingLocation: '',
  3105. samplingLocationB: '',
  3106. samplingNumber: ''
  3107. }
  3108. this.subDetailFlag = true
  3109. },
  3110. // 删除检验记录
  3111. deleteModal () {
  3112. if (this.IQCSelections.length === 0) {
  3113. this.$message.warning('请勾选要删除的检验单!')
  3114. return
  3115. }
  3116. this.$confirm(`是否删除该 `+ this.IQCSelections.length +` 条检验记录?`, '提示', {
  3117. confirmButtonText: '确定',
  3118. cancelButtonText: '取消',
  3119. type: 'warning'
  3120. }).then(() => {
  3121. let tempData = {
  3122. site: '',
  3123. submitList: this.IQCSelections
  3124. }
  3125. iqcRecordDelete(tempData).then(({data}) => {
  3126. if (data && data.code === 0) {
  3127. this.getDataList()
  3128. this.IQCSelections = []
  3129. this.$message({
  3130. message: '操作成功',
  3131. type: 'success',
  3132. duration: 1500,
  3133. onClose: () => {}
  3134. })
  3135. } else {
  3136. this.$alert(data.msg, '错误', {
  3137. confirmButtonText: '确定'
  3138. })
  3139. }
  3140. })
  3141. }).catch(() => {
  3142. })
  3143. },
  3144. // 任务重载
  3145. overLoadModal () {
  3146. if (this.IQCSelections.length === 0) {
  3147. this.$message.warning('请勾选要重载的检验单!')
  3148. return
  3149. }
  3150. if (this.IQCSelections.every(val => val.state === '待检验' || val.state === '未开始')) {
  3151. this.$confirm(`是否重载该 `+ this.IQCSelections.length +` 条检验单?`, '提示', {
  3152. confirmButtonText: '确定',
  3153. cancelButtonText: '取消',
  3154. type: 'warning'
  3155. }).then(() => {
  3156. let tempData = {
  3157. site: '',
  3158. submitList: this.IQCSelections
  3159. }
  3160. iqcRecordOverLoad(tempData).then(({data}) => {
  3161. if (data && data.code === 0) {
  3162. this.getDataList()
  3163. this.IQCSelections = []
  3164. this.$message({
  3165. message: '操作成功',
  3166. type: 'success',
  3167. duration: 1500,
  3168. onClose: () => {}
  3169. })
  3170. } else {
  3171. this.$alert(data.msg, '错误', {
  3172. confirmButtonText: '确定'
  3173. })
  3174. }
  3175. })
  3176. }).catch(() => {
  3177. })
  3178. } else {
  3179. this.$message.warning('检验单必须为待检验状态!')
  3180. return
  3181. }
  3182. },
  3183. // 审核按钮
  3184. submitResult () {
  3185. let tempData1 = '' // 记录不是待审核状态的单号
  3186. let tempData2 = '' // 记录处置措施未填写的单号
  3187. if (this.IQCSelections.length === 0) {
  3188. this.$message.warning('请勾选要审核的检验单!')
  3189. return
  3190. }
  3191. for (let i = 0; i < this.IQCSelections.length; i++) {
  3192. if (this.IQCSelections[i].state !== '待审核'){
  3193. tempData1 = tempData1 + this.IQCSelections[i].inspectionNo + '、'
  3194. }
  3195. if (this.IQCSelections[i].inspectionResult === '不合格' && (this.IQCSelections[i].disposalMeasures === '' || this.IQCSelections[i].disposalMeasures == null)) {
  3196. tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、'
  3197. }
  3198. }
  3199. if (tempData1 !== '') {
  3200. tempData1 = tempData1.substring(0, tempData1.length - 1)
  3201. this.$message.warning('检验单号 ' + tempData1 + ' 不是待审核状态!')
  3202. return
  3203. }
  3204. if (tempData2 !== '') {
  3205. tempData2 = tempData2.substring(0, tempData2.length - 1)
  3206. this.$message.warning('检验单号 ' + tempData2 + ' 的处置措施未选择!')
  3207. return
  3208. }
  3209. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.IQCSelections.length + ` 条记录`, '提示', {
  3210. confirmButtonText: '确定',
  3211. cancelButtonText: '取消',
  3212. type: 'warning'
  3213. }).then(() => {
  3214. this.submitData.submitList = this.IQCSelections
  3215. saveIQCSubmitResult(this.submitData).then(({data}) => {
  3216. if (data && data.code === 0) {
  3217. this.getDataList()
  3218. this.IQCSelections = []
  3219. this.$message({
  3220. message: '操作成功',
  3221. type: 'success',
  3222. duration: 1500,
  3223. onClose: () => {}
  3224. })
  3225. } else {
  3226. this.$alert(data.msg, '错误', {
  3227. confirmButtonText: '确定'
  3228. })
  3229. }
  3230. })
  3231. }).catch(() => {
  3232. })
  3233. },
  3234. // 子明细每页数
  3235. sizeChangeHandle2 (val) {
  3236. this.pageSize2 = val
  3237. },
  3238. // 子明细当前页
  3239. currentChangeHandle2 (val) {
  3240. this.pageIndex2 = val
  3241. },
  3242. // 子明细方法
  3243. // 表格的新增
  3244. rowClassName ({ row, rowIndex }) {
  3245. row.xh = rowIndex + 1
  3246. row.rowI = this.tableData.indexOf(row) + 1
  3247. },
  3248. // 单选框选中数据
  3249. handleDetailSelectionChange(selection) {
  3250. this.checkedDetail = selection
  3251. },
  3252. // 点击新增更多
  3253. handleAddBtn (td) {
  3254. checkIQCIsSubmit(td).then(({data}) => {
  3255. if (data.flag !== 1) {
  3256. let obj = {}
  3257. obj.subDetailValue = ""
  3258. obj.samplingLocation = ""
  3259. this.tableData.push(obj)
  3260. } else {
  3261. this.$alert("记录已提交!", '错误', {
  3262. confirmButtonText: '确定'
  3263. })
  3264. }
  3265. })
  3266. },
  3267. // 批量新增操作
  3268. batchHandleAdd (td) {
  3269. checkIQCIsSubmit(td).then(({data}) => {
  3270. if (data.flag !== 1) {
  3271. this.batchHandleAddModalFlag = true
  3272. } else {
  3273. this.$alert("记录已提交!", '错误', {
  3274. confirmButtonText: '确定'
  3275. })
  3276. }
  3277. })
  3278. },
  3279. // 批量新增行
  3280. batchHandleAddModal () {
  3281. for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
  3282. let obj = {}
  3283. obj.samplingLocation = this.batchAddData.samplingLocation
  3284. obj.samplingLocationB = this.batchAddData.samplingLocationB
  3285. obj.subDetailValue = ""
  3286. this.tableData.push(obj)
  3287. }
  3288. this.batchHandleAddModalFlag = false
  3289. },
  3290. // 回车事件
  3291. nextFocus1 (index) {
  3292. let a1 = `${index + 1}` + `a`
  3293. this.$nextTick(() => {
  3294. this.$refs[a1].focus()
  3295. })
  3296. },
  3297. nextFocus2 (index) {
  3298. let a2 = `${index + 1}` + `b`
  3299. this.$nextTick(() => {
  3300. this.$refs[a2].focus()
  3301. })
  3302. },
  3303. nextFocus3 (index) {
  3304. let a3 = `${index + 1}` + `c`
  3305. this.$nextTick(() => {
  3306. this.$refs[a3].focus()
  3307. })
  3308. },
  3309. focusNextInput (index, type) {
  3310. let aaa = ''
  3311. if (this.detailList.length - 1 === index) {
  3312. aaa = `${type}0`
  3313. } else {
  3314. aaa = `${type}${index + 1}`
  3315. }
  3316. this.$nextTick(() => {
  3317. this.$refs[aaa].focus()
  3318. })
  3319. },
  3320. //删除
  3321. handleDeleteBtn (td) {
  3322. checkIQCIsSubmit(td).then(({data}) => {
  3323. if (data.flag !== 1) {
  3324. if (this.checkedDetail.length === 0) {
  3325. this.$alert("请先选择要删除的数据", "提示", {
  3326. confirmButtonText: "确定",
  3327. })
  3328. } else {
  3329. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  3330. confirmButtonText: "确定",
  3331. cancelButtonText: "取消",
  3332. type: "warning",
  3333. callback: (action) => {
  3334. if (action === "confirm") {
  3335. let val = this.checkedDetail
  3336. val.forEach((val, index) => {
  3337. this.tableData.splice(this.tableData.indexOf(val), 1)
  3338. if (this.templateTableData.length === 0) {
  3339. this.pageIndex2--
  3340. }
  3341. })
  3342. this.$message({
  3343. message: "删除成功!",
  3344. type: "success",
  3345. })
  3346. return
  3347. } else {
  3348. this.$message({
  3349. message: "已取消删除操作",
  3350. type: "warning",
  3351. })
  3352. return
  3353. }
  3354. },
  3355. })
  3356. }
  3357. } else {
  3358. this.$alert("记录已提交!", '错误', {
  3359. confirmButtonText: '确定'
  3360. })
  3361. }
  3362. })
  3363. },
  3364. // 新增子明细记录
  3365. saveSubDetailResult () {
  3366. for (let i = 0; i < this.tableData.length; i++) {
  3367. if(this.tableData[i].subDetailValue === '' || this.tableData[i].subDetailValue == null){
  3368. this.$message.warning('序号' + (i+1) +'未填写实测值!')
  3369. return
  3370. }
  3371. }
  3372. this.subDetailData.subDetailValues = this.tableData
  3373. saveIQCSubDetailed(this.subDetailData).then(({data}) => {
  3374. if (data && data.code === 0) {
  3375. if (data.count > 0) {
  3376. this.subDetailData.itemResult = 'N'
  3377. this.subDetailData.unqualifiedQuantity = data.count
  3378. }
  3379. if (this.subDetailData.subDetailValues.length > 0) {
  3380. this.subDetailData.subDetailRecordNum = 1
  3381. } else {
  3382. this.subDetailData.subDetailRecordNum = -1
  3383. this.subDetailData.unqualifiedQuantity = 0
  3384. this.subDetailData.itemResult = 'Y'
  3385. }
  3386. this.subDetailFlag = false
  3387. this.tableData = []
  3388. this.$message({
  3389. message: '操作成功',
  3390. type: 'success',
  3391. duration: 1500,
  3392. onClose: () => {}
  3393. })
  3394. } else {
  3395. this.$alert(data.msg, '错误', {
  3396. confirmButtonText: '确定'
  3397. })
  3398. }
  3399. })
  3400. },
  3401. // 更改检验方式
  3402. changeInspectionModal (row) {
  3403. this.changeData = {
  3404. site: row.site,
  3405. buNo: row.buNo,
  3406. inspectionNo: row.inspectionNo,
  3407. rollCount: row.rollCount,
  3408. inspectCode: '',
  3409. qtySample: '',
  3410. percentSample: '',
  3411. samplingProgrammeNo: '',
  3412. samplingProgrammeDesc: '',
  3413. samplingLevelNo: '',
  3414. samplingLevelDesc: '',
  3415. receiptNo: row.receiptNo,
  3416. receiptItemNo: row.receiptItemNo,
  3417. inspectionTypeNo: '105'
  3418. }
  3419. this.changeModalFlag = true
  3420. },
  3421. // 保存修改
  3422. changeInspectionWay () {
  3423. if (this.changeData.inspectCode === '' || this.changeData.inspectCode == null) {
  3424. this.$message.warning('请选择检验方式!')
  3425. return
  3426. }
  3427. if (this.changeData.inspectCode === '数量抽检' && (this.changeData.qtySample == null || this.changeData.qtySample === '' || this.changeData.qtySample === 0)) {
  3428. this.$message.warning('请填写抽检数量!')
  3429. return
  3430. }
  3431. if (this.changeData.inspectCode === '比例抽检' && (this.changeData.percentSample == null || this.changeData.percentSample === '' || this.changeData.percentSample === 0)) {
  3432. this.$message.warning('请填写抽检比例!')
  3433. return
  3434. }
  3435. if (this.changeData.inspectCode === '不固定抽检' && (this.changeData.samplingProgrammeNo == null || this.changeData.samplingProgrammeNo === '')) {
  3436. this.$message.warning('请选择抽样方案!')
  3437. return
  3438. }
  3439. if (this.changeData.inspectCode === '不固定抽检' && (this.changeData.samplingLevelNo === null || this.changeData.samplingLevelNo === '')) {
  3440. this.$message.warning('请选择检验水平!')
  3441. return
  3442. }
  3443. if (this.changeData.inspectCode === '数量抽检' && this.changeData.qtySample > this.changeData.rollCount) {
  3444. this.$message.warning('抽检数量不能大于送检数量,当前检验单送检数量为[]!')
  3445. return
  3446. }
  3447. changeInspectionWay(this.changeData).then(({data}) => {
  3448. if (data && data.code === 0) {
  3449. this.getDataList()
  3450. this.changeModalFlag = false
  3451. this.$message({
  3452. message: '操作成功',
  3453. type: 'success',
  3454. duration: 1500,
  3455. onClose: () => {}
  3456. })
  3457. } else {
  3458. this.$alert(data.msg, '错误', {
  3459. confirmButtonText: '确定'
  3460. })
  3461. }
  3462. })
  3463. },
  3464. // 校验用户是否收藏
  3465. favoriteIsOk () {
  3466. let userFavorite = {
  3467. userId: this.$store.state.user.id,
  3468. languageCode: this.$i18n.locale
  3469. }
  3470. userFavoriteList(userFavorite).then(({data}) => {
  3471. for (let i = 0; i < data.list.length; i++) {
  3472. if (this.$route.meta.menuId === data.list[i].menuId) {
  3473. this.favorite = true
  3474. }
  3475. }
  3476. })
  3477. },
  3478. // 收藏 OR 取消收藏
  3479. favoriteFunction () {
  3480. let userFavorite = {
  3481. userId: this.$store.state.user.id,
  3482. functionId: this.$route.meta.menuId,
  3483. }
  3484. if (this.favorite) {
  3485. removeUserFavorite(userFavorite).then(({data}) => {
  3486. this.$message.success(data.msg)
  3487. this.favorite = false
  3488. })
  3489. } else {
  3490. // 收藏
  3491. saveUserFavorite(userFavorite).then(({data}) => {
  3492. this.$message.success(data.msg)
  3493. this.favorite = true
  3494. })
  3495. }
  3496. },
  3497. //导出excel
  3498. async createExportData () {
  3499. this.searchData.limit = -1
  3500. this.searchData.page = 1
  3501. await qcIQCInspectionSearch(this.searchData).then(({data}) => {
  3502. this.exportList = data.page.list
  3503. })
  3504. return this.exportList
  3505. },
  3506. startDownload() {},
  3507. finishDownload() {},
  3508. fields () {
  3509. let json = "{"
  3510. this.columnList1.forEach((item, index) => {
  3511. if (index == this.columnList1.length - 1) {
  3512. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  3513. } else {
  3514. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  3515. }
  3516. })
  3517. json += "}"
  3518. let s = eval("(" + json + ")")
  3519. return s
  3520. },
  3521. // 动态列开始 获取 用户保存的 格式列
  3522. async getTableUserColumn (tableId, columnId) {
  3523. let queryTableUser = {
  3524. userId: this.$store.state.user.name,
  3525. functionId: this.$route.meta.menuId,
  3526. tableId: tableId,
  3527. status: true,
  3528. languageCode: this.$i18n.locale
  3529. }
  3530. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3531. if (data.rows.length > 0) {
  3532. //this.columnList1 = []
  3533. switch (columnId) {
  3534. case 1:
  3535. this.columnList1 = data.rows
  3536. break;
  3537. case 2:
  3538. this.detailColumnList = data.rows
  3539. break;
  3540. // case 3:
  3541. // this.columnList2 = data.rows
  3542. // break;
  3543. // case 4:
  3544. // this.columnList3 = data.rows
  3545. // break;
  3546. }
  3547. } else {
  3548. this.getColumnList(tableId, columnId)
  3549. }
  3550. })
  3551. },
  3552. // 获取 tableDefault 列
  3553. async getColumnList (tableId, columnId) {
  3554. let queryTable = {
  3555. functionId: this.$route.meta.menuId,
  3556. tableId: tableId,
  3557. languageCode: this.$i18n.locale
  3558. }
  3559. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3560. if (!data.rows.length == 0) {
  3561. switch (columnId) {
  3562. case 1:
  3563. this.columnList1 = data.rows
  3564. break;
  3565. case 2:
  3566. this.detailColumnList = data.rows
  3567. break;
  3568. // case 3:
  3569. // this.columnList2 = data.rows
  3570. // break;
  3571. // case 4:
  3572. // this.columnList3 = data.rows
  3573. // break;
  3574. }
  3575. } else {
  3576. // this.showDefault = true.
  3577. }
  3578. })
  3579. },
  3580. /**
  3581. * 明细导入后将返回值回传给父组件
  3582. * @param val
  3583. */
  3584. changeMyString (val) {
  3585. for (let i = 0; i < this.detailList.length; i++) {
  3586. if (val[this.detailList[i].itemNo] !== undefined) {
  3587. this.detailList[i].unqualifiedQuantity = val[this.detailList[i].itemNo]
  3588. if (val[this.detailList[i].itemNo] != null) {
  3589. this.detailList[i].subDetailRecordNum = 1
  3590. }
  3591. if (val[this.detailList[i].itemNo] > 0) {
  3592. this.detailList[i].itemResult = 'N'
  3593. }
  3594. }
  3595. }
  3596. },
  3597. //获取按钮的权限数据
  3598. getButtonAuthData () {
  3599. let searchFlag = this.isAuth(this.menuId+":search")
  3600. let checkFlag = this.isAuth(this.menuId+":check")
  3601. let overLoadFlag = this.isAuth(this.menuId+":overLoad")
  3602. let deleteFlag = this.isAuth(this.menuId+":delete")
  3603. let detailFlag = this.isAuth(this.menuId+":detail")
  3604. let fileFlag = this.isAuth(this.menuId+":file")
  3605. let changeFlag = this.isAuth(this.menuId+":change")
  3606. //处理页面的权限数据
  3607. this.authSearch = !searchFlag
  3608. this.authCheck = !checkFlag
  3609. this.authOverLoad = !overLoadFlag
  3610. this.authDelete = !deleteFlag
  3611. this.authDetail = !detailFlag
  3612. this.authFile = !fileFlag
  3613. this.authChange = !changeFlag
  3614. },
  3615. }
  3616. }
  3617. </script>
  3618. <style scoped>
  3619. /deep/ .redElSelect .el-input--suffix .el-input__inner{
  3620. color: red;
  3621. font-weight: bold;
  3622. }
  3623. /deep/ .greenElSelect .el-input--suffix .el-input__inner{
  3624. color: rgb(103,194,58);
  3625. font-weight: bold;
  3626. }
  3627. .numInput /deep/ .el-input__inner{
  3628. text-align: right;
  3629. }
  3630. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  3631. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  3632. -webkit-appearance: none;
  3633. }
  3634. /deep/ .inlineNumber input[type="number"]{
  3635. -moz-appearance: textfield;
  3636. padding-right: 5px !important;
  3637. }
  3638. .el-table /deep/ .cell{
  3639. height: auto;
  3640. line-height: 1.5;
  3641. }
  3642. /deep/ .el-tabs--border-card>.el-tabs__content{
  3643. padding: 5px !important;
  3644. }
  3645. </style>