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

3067 lines
110 KiB

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