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

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