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.

3029 lines
109 KiB

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