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

3096 lines
111 KiB

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