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.

1953 lines
70 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 收藏 -->
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  9. <!-- 条件查询 -->
  10. <el-form :inline="true" label-position="top" :model="searchData" >
  11. <el-form-item :label="'检验单号'">
  12. <el-input v-model="searchData.inspectionNo" clearable style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'状态'">
  15. <el-select v-model="searchData.state" style="width: 100px">
  16. <el-option label="全部" value=""></el-option>
  17. <el-option label="待检验" value="待检验"></el-option>
  18. <el-option label="待审核" value="待审核"></el-option>
  19. <el-option label="已完成" value="已完成"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item :label="'检验结论'">
  23. <el-select v-model="searchData.inspectionResult" style="width: 100px">
  24. <el-option label="全部" value=""></el-option>
  25. <el-option label="合格" value="合格"></el-option>
  26. <el-option label="不合格" value="不合格"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item :label="'物料编码'">
  30. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="'物料名称'">
  33. <el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
  34. </el-form-item>
  35. <el-form-item :label="'供应商'">
  36. <el-input v-model="searchData.supplierDesc" clearable style="width: 120px"></el-input>
  37. </el-form-item>
  38. <el-form-item :label="'处置措施'">
  39. <el-select v-model="searchData.disposalMeasures" style="width: 120px">
  40. <el-option label="全部" value=""></el-option>
  41. <el-option label="缺少备件" value="缺少备件"></el-option>
  42. <el-option label="等待售后" value="等待售后"></el-option>
  43. <el-option label="远程协助" value="远程协助"></el-option>
  44. <el-option label="换班换人" value="换班换人"></el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item :label="'质检员'">
  48. <el-input v-model="searchData.inspectorName" clearable style="width: 120px"></el-input>
  49. </el-form-item>
  50. <el-form-item :label="'检验时间'">
  51. <el-date-picker style="width: 150px" v-model="searchData.startDate" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="开始日期"></el-date-picker>
  52. -
  53. <el-date-picker style="width: 150px" v-model="searchData.endDate" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="结束日期"></el-date-picker>
  54. </el-form-item>
  55. <el-form-item :label="' '">
  56. <el-button type="primary" @click="getDataList()">查询</el-button>
  57. <el-button type="primary" @click="submitResult()">审核</el-button>
  58. <el-button type="primary" @click="deleteModal()">删除</el-button>
  59. <download-excel
  60. :fields="fields()"
  61. :data="exportData"
  62. type="xls"
  63. :name="exportName"
  64. :header="exportHeader"
  65. :footer="exportFooter"
  66. :fetch="createExportData"
  67. :before-generate="startDownload"
  68. :before-finish="finishDownload"
  69. worksheet="导出信息"
  70. class="el-button el-button--primary el-button--medium">
  71. {{ "导出" }}
  72. </download-excel>
  73. </el-form-item>
  74. </el-form>
  75. <!-- 检验记录展示列表 -->
  76. <el-table
  77. :height="height"
  78. :data="dataList"
  79. border
  80. ref="IQCTable"
  81. @row-click="IQCClickRow"
  82. @selection-change="selectionIQC"
  83. v-loading="dataListLoading"
  84. style="width: 100%;">
  85. <el-table-column
  86. type="selection"
  87. header-align="center"
  88. align="center"
  89. :selectable="selectFlag"
  90. width="50">
  91. </el-table-column>
  92. <el-table-column
  93. prop="state"
  94. header-align="center"
  95. align="center"
  96. label="状态">
  97. <template slot-scope="scope">
  98. <div :style="{fontWeight:'bold', color: scope.row.state === '待检验' ? 'red' : scope.row.state === '待审核' ? '#ffa500e0' : scope.row.state === '已完成' ? '#3ac252' : ''}">
  99. {{ scope.row.state }}
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. v-for="(item,index) in columnList1" :key="index"
  105. :sortable="item.columnSortable"
  106. :prop="item.columnProp"
  107. :header-align="item.headerAlign"
  108. :show-overflow-tooltip="item.showOverflowTooltip"
  109. :align="item.align"
  110. :fixed="item.fixed===''?false:item.fixed"
  111. :min-width="item.columnWidth"
  112. :label="item.columnLabel">
  113. <template slot-scope="scope">
  114. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  115. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. fixed="right"
  120. header-align="center"
  121. align="center"
  122. width="200"
  123. label="操作">
  124. <template slot-scope="scope">
  125. <a type="text" size="small" @click="detailModal(scope.row)">检验单</a>
  126. <a type="text" size="small" @click="getFileContentData(scope.row)">工作文件</a>
  127. <!-- <a type="text" size="small" @click="submitResult(scope.row)">审核</a>-->
  128. <!-- <a type="text" size="small" @click="deleteModal(scope.row)">删除</a>-->
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <!-- 分页-->
  133. <el-pagination
  134. @size-change="sizeChangeHandle"
  135. @current-change="currentChangeHandle"
  136. :current-page="pageIndex"
  137. :page-sizes="[20, 50, 100, 200, 500]"
  138. :page-size="pageSize"
  139. :total="totalPage"
  140. layout="total, sizes, prev, pager, next, jumper">
  141. </el-pagination>
  142. <!-- 检验单详情页 -->
  143. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1200px">
  144. <el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
  145. <el-form-item :label="'物料编码'">
  146. <el-input v-model="detailData.partNo" disabled style="width: 100px"></el-input>
  147. </el-form-item>
  148. <el-form-item :label="'物料名称'">
  149. <el-input v-model="detailData.partDesc" disabled style="width: 200px"></el-input>
  150. </el-form-item>
  151. <el-form-item :label="'计量单位'">
  152. <el-input v-model="detailData.umId" disabled style="width: 200px"></el-input>
  153. </el-form-item>
  154. <el-form-item :label="'到货数量'">
  155. <el-input class="numInput" v-model="detailData.rollQty" type="number" disabled style="width: 80px"></el-input>
  156. </el-form-item>
  157. <el-form-item :label="'送检数量'">
  158. <el-input class="numInput" v-model="detailData.rollCount" type="number" disabled style="width: 80px"></el-input>
  159. </el-form-item>
  160. <el-form-item :label="'抽样数量'">
  161. <el-input class="numInput" v-model="detailData.samplingQty" type="number" disabled style="width: 80px"></el-input>
  162. </el-form-item>
  163. </el-form>
  164. <el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
  165. <el-form-item :label="'不合格项目数量'">
  166. <el-input class="numInput" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
  167. <el-input class="numInput" @input="handleInput(detailData.unqualifiedQty,1)" v-if="detailData.submitFlag != 'Y'" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
  168. </el-form-item>
  169. <el-form-item :label="'处置措施'">
  170. <el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
  171. <el-option
  172. v-for = "i in disposalMeasuresOptions"
  173. :key = "i.id"
  174. :label = "i.disposalMeasures"
  175. :value = "i.disposalMeasures">
  176. </el-option>
  177. </el-select>
  178. <el-select v-if="detailData.submitFlag != 'Y'" clearable v-model="detailData.disposalMeasures" style="width: 100px">
  179. <el-option
  180. v-for = "i in disposalMeasuresOptions"
  181. :key = "i.id"
  182. :label = "i.disposalMeasures"
  183. :value = "i.disposalMeasures">
  184. </el-option>
  185. </el-select>
  186. </el-form-item>
  187. <el-form-item :label="'处置说明'">
  188. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
  189. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalRemark" style="width: 200px"></el-input>
  190. </el-form-item>
  191. <el-form-item :label="'检验结论'">
  192. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  193. <el-option label="合格" value="合格"></el-option>
  194. <el-option label="不合格" value="不合格"></el-option>
  195. </el-select>
  196. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionResult" style="width: 100px" placeholder="请选择">
  197. <el-option label="合格" value="合格"></el-option>
  198. <el-option label="不合格" value="不合格"></el-option>
  199. </el-select>
  200. </el-form-item>
  201. <el-form-item label="检验员">
  202. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  203. <el-option
  204. v-for = "i in options"
  205. :key = "i.inspectorNo"
  206. :label = "i.inspectorName"
  207. :value = "i.inspectorNo">
  208. </el-option>
  209. </el-select>
  210. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  211. <el-option
  212. v-for = "i in options"
  213. :key = "i.inspectorNo"
  214. :label = "i.inspectorName"
  215. :value = "i.inspectorNo">
  216. </el-option>
  217. </el-select>
  218. </el-form-item>
  219. <el-form-item :label="'质检备注'">
  220. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 280px"></el-input>
  221. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionRemark" style="width: 280px"></el-input>
  222. </el-form-item>
  223. <el-form-item :label="' '">
  224. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  225. <el-button type="primary" icon="el-icon-upload" @click="subDetailUpload()">明细导入</el-button>
  226. </el-form-item>
  227. <el-form-item :label="' '"></el-form-item>
  228. </el-form>
  229. <!-- 展示列表 -->
  230. <div class="rq ">
  231. <el-table
  232. :height="500"
  233. :data="detailList"
  234. border
  235. v-loading="dataListLoading"
  236. style="width: 100%;">
  237. <el-table-column
  238. prop=""
  239. header-align="center"
  240. align="center"
  241. min-width="60"
  242. label="操作">
  243. <template slot-scope="scope">
  244. <el-button class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  245. </template>
  246. </el-table-column>
  247. <el-table-column
  248. v-for="(item,index) in detailColumnList" :key="index"
  249. :sortable="item.columnSortable"
  250. :prop="item.columnProp"
  251. :header-align="item.headerAlign"
  252. :show-overflow-tooltip="item.showOverflowTooltip"
  253. :align="item.align"
  254. :fixed="item.fixed===''?false:item.fixed"
  255. :min-width="item.columnWidth"
  256. :label="item.columnLabel">
  257. <template slot-scope="scope">
  258. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  259. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column
  263. prop=""
  264. header-align="center"
  265. align="right"
  266. min-width="80"
  267. label="实测值">
  268. <template slot-scope="scope">
  269. <el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  270. <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;padding: 0px " allow-create>;width:98%"></el-input>
  271. </template>
  272. </el-table-column>
  273. <el-table-column
  274. prop=""
  275. header-align="center"
  276. align="center"
  277. min-width="80"
  278. label="检验明细">
  279. <template slot-scope="scope">
  280. <el-button v-if="scope.row.subDetailRecordNum <= 0" type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  281. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. prop=""
  286. header-align="center"
  287. align="right"
  288. min-width="80"
  289. label="不合格数量">
  290. <template slot-scope="scope">
  291. <el-input class="numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  292. <el-input class="numInput" :ref="`unqualifiedQuantity${scope.$index}`" v-if="detailData.submitFlag != 'Y'" v-model="scope.row.unqualifiedQuantity" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. prop=""
  297. header-align="center"
  298. align="right"
  299. min-width="75"
  300. label="项目检验结论">
  301. <template slot-scope="scope">
  302. <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" >
  303. <el-option label="合格" value="Y" style="color: green"></el-option>
  304. <el-option label="不合格" value="N" style="color: red"></el-option>
  305. </el-select>
  306. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag != 'Y'" v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  307. <el-option label="合格" value="Y" style="color: green"></el-option>
  308. <el-option label="不合格" value="N" style="color: red"></el-option>
  309. </el-select>
  310. </template>
  311. </el-table-column>
  312. </el-table>
  313. </div>
  314. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  315. <el-button type="primary" @click="Transfer()">保存</el-button>
  316. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  317. </el-footer>
  318. </el-dialog>
  319. <!-- 文件清单 -->
  320. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  321. <el-table
  322. :height="350"
  323. :data="fileContentList"
  324. border
  325. v-loading="dataListLoading"
  326. style="width: 100%; ">
  327. <el-table-column
  328. v-for="(item,index) in fileColumnList" :key="index"
  329. :sortable="item.columnSortable"
  330. :prop="item.columnProp"
  331. :header-align="item.headerAlign"
  332. :show-overflow-tooltip="item.showOverflowTooltip"
  333. :align="item.align"
  334. :fixed="item.fixed===''?false:item.fixed"
  335. :min-width="item.columnWidth"
  336. :label="item.columnLabel">
  337. <template slot-scope="scope">
  338. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  339. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  340. </template>
  341. </el-table-column>
  342. <el-table-column
  343. fixed="right"
  344. header-align="center"
  345. align="center"
  346. width="100"
  347. label="操作">
  348. <template slot-scope="scope">
  349. <a @click="downloadFile(scope.row)">下载</a>
  350. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  351. </template>
  352. </el-table-column>
  353. </el-table>
  354. </el-dialog>
  355. <!-- 子明细信息 -->
  356. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="572px">
  357. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  358. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  359. <el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
  360. <div class="rq ">
  361. <el-table
  362. :height="400"
  363. :data="tableData"
  364. border
  365. :row-class-name="rowClassName"
  366. @selection-change="handleDetailSelectionChange"
  367. style="width: 100%;">
  368. <el-table-column type="selection" align="center" width="50"></el-table-column>
  369. <el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
  370. <el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150">
  371. <template slot-scope="{row}">
  372. <el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
  373. <el-input :ref="`${row.xh-1}` + `a`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
  374. </template>
  375. </el-table-column>
  376. <el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150">
  377. <template slot-scope="{row}">
  378. <el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
  379. <el-input :ref="`${row.xh-1}` + `b`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
  380. </template>
  381. </el-table-column>
  382. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="200">
  383. <template slot-scope="{row}">
  384. <el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  385. <el-input :ref="`${row.xh-1}` + `c`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值"></el-input>
  386. </template>
  387. </el-table-column>
  388. </el-table>
  389. </div>
  390. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  391. <el-button v-if="detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult()">保存</el-button>
  392. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  393. </el-footer>
  394. </el-dialog>
  395. <!-- 批量新增子明细操作-->
  396. <el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
  397. <el-form :inline="true" label-position="top">
  398. <el-form-item :label="'默认抽样位置A'">
  399. <el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
  400. </el-form-item>
  401. <el-form-item :label="'默认抽样位置B'">
  402. <el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
  403. </el-form-item>
  404. <el-form-item :label="'抽样数量'">
  405. <el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
  406. </el-form-item>
  407. </el-form>
  408. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  409. <el-button type="primary" @click="batchHandleAddModal()">保存</el-button>
  410. <el-button type="primary" @click="batchHandleAddModalFlag = false">关闭</el-button>
  411. </el-footer>
  412. </el-dialog>
  413. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  414. <!-- 上传文件的modal -->
  415. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="getDataList()" v-drag></qcFAIUploadFile>
  416. <!-- 上传文件的modal -->
  417. <comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData()" v-drag></comQcItemImageUploadFile>
  418. <!-- 子明细导入 -->
  419. <subDetailUpload @changeEvent="changeMyString" ref="subDetailUpload" @refreshPageTables="getInspectionFormData()" v-drag></subDetailUpload>
  420. </div>
  421. </template>
  422. <script>
  423. import {
  424. qcIQCInspectionSearch, // IQC检验记录查询
  425. iqcDetailSearch, // iqc检验记录查询
  426. inspectorSearch, // 检验员查询
  427. selectIQCSubDetailedRecord, // 查询子明细记录
  428. checkIQCSubDetailValue, // 检查子明细中的实测值是否在规定范围
  429. saveIQCDetailedRecord, // 新增明细信息
  430. checkIQCIsSubmit, // 检查是否已提交
  431. saveIQCSubDetailed, // 新增子明细信息
  432. saveIQCSubmitResult, // 审核
  433. iqcRecordDelete, // 删除检验记录
  434. disposalMeasuresSearch // 获取处置措施列表
  435. } from "@/api/qc/qc.js"
  436. import {
  437. getTableDefaultListLanguage,
  438. getTableUserListLanguage,
  439. } from "@/api/table.js"
  440. import Chooselist from '@/views/modules/common/Chooselist_eam'
  441. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  442. import {deleteObjectFile} from '@/api/eam/eam.js'
  443. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  444. import qcFAIUploadFile from "./qc_FAI_upload_file"
  445. import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
  446. import subDetailUpload from "./sub_detail_upload"
  447. export default {
  448. components: {
  449. Chooselist,
  450. qcFAIUploadFile,
  451. comQcItemImageUploadFile,
  452. subDetailUpload
  453. },
  454. watch: {
  455. detailList: {
  456. deep: true,
  457. handler: function (newV, oldV) {
  458. let num = 0
  459. for (let i = 0; i < this.detailList.length; i++) {
  460. if (this.detailList[i].itemResult === 'N') {
  461. num++
  462. }
  463. }
  464. this.detailData.unqualifiedQty = num
  465. }
  466. },
  467. },
  468. data () {
  469. return {
  470. // 是否收藏
  471. favorite: false,
  472. // 导出 start
  473. exportData: [],
  474. exportName: "IQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  475. exportHeader: ["IQC检验录入"],
  476. exportFooter: [],
  477. exportList:[],
  478. // 导出 end
  479. submitData:{
  480. site: this.$store.state.user.site,
  481. inspectionNo: '',
  482. isQualified: '',
  483. isQualifiedChinese: '',
  484. submitList: [],
  485. },
  486. tagNo:'',
  487. searchData: {
  488. site: this.$store.state.user.site,
  489. inspectionNo: '',
  490. inspectionTypeNo:'105',
  491. isQualified: '',
  492. startDate: '',
  493. endDate: '',
  494. partNo:'',
  495. partDesc:'',
  496. state: '待检验',
  497. inspectionResult: '',
  498. supplierDesc: '',
  499. disposalMeasures: '',
  500. inspectorName: '',
  501. page: 1,
  502. limit: 10,
  503. },
  504. pageIndex: 1,
  505. pageSize: 50,
  506. totalPage: 0,
  507. height: 200,
  508. dataList: [],
  509. dataListLoading: false,
  510. dataListSelections: [],
  511. submitFlag: false,
  512. modalData: {
  513. flag:'',
  514. functionType:'',
  515. site: this.$store.state.user.site,
  516. inspectionNo:'',
  517. workOrderNumber: '',
  518. workOrderQuantity: '',
  519. reelNumber: '',
  520. partNo: '',
  521. rollingQuantity: '',
  522. sampleQuantity: '',
  523. detailCodeNo:'',
  524. detailCodeDesc:'',
  525. inspectionTypeNo:'105',
  526. inspectionTypeName:'IQC',
  527. inspectorNo:'',
  528. inspectorName:'',
  529. isQualified:'',
  530. isQualifiedChinese:''
  531. },
  532. // 展示列集
  533. columnList1: [
  534. {
  535. userId: this.$store.state.user.name,
  536. functionId: 301006,
  537. serialNumber: '301006Table1InspectionNo',
  538. tableId: "301006Table1",
  539. tableName: "IQC检验记录表",
  540. columnProp: 'inspectionNo',
  541. headerAlign: "center",
  542. align: "center",
  543. columnLabel: '检验单号',
  544. columnHidden: false,
  545. columnImage: false,
  546. columnSortable: false,
  547. sortLv: 0,
  548. status: true,
  549. fixed: '',
  550. columnWidth: 120,
  551. },
  552. {
  553. userId: this.$store.state.user.name,
  554. functionId: 301006,
  555. serialNumber: '301006Table1InspectionResult',
  556. tableId: "301006Table1",
  557. tableName: "IQC检验记录表",
  558. columnProp: 'inspectionResult',
  559. headerAlign: "center",
  560. align: "center",
  561. columnLabel: '检验结论',
  562. columnHidden: false,
  563. columnImage: false,
  564. columnSortable: false,
  565. sortLv: 0,
  566. status: true,
  567. fixed: '',
  568. columnWidth: 80,
  569. },
  570. {
  571. userId: this.$store.state.user.name,
  572. functionId: 301006,
  573. serialNumber: '301006Table1TaskDate',
  574. tableId: "301006Table1",
  575. tableName: "IQC检验记录表",
  576. columnProp: 'taskDate',
  577. headerAlign: "center",
  578. align: "center",
  579. columnLabel: '任务生成日期',
  580. columnHidden: false,
  581. columnImage: false,
  582. columnSortable: false,
  583. sortLv: 0,
  584. status: true,
  585. fixed: '',
  586. columnWidth: 120,
  587. },
  588. {
  589. userId: this.$store.state.user.name,
  590. functionId: 301006,
  591. serialNumber: '301006Table1InspectionCycle',
  592. tableId: "301006Table1",
  593. tableName: "IQC检验记录表",
  594. columnProp: 'inspectionCycle',
  595. headerAlign: "center",
  596. align: "center",
  597. columnLabel: '检验周期(h)',
  598. columnHidden: false,
  599. columnImage: false,
  600. columnSortable: false,
  601. sortLv: 0,
  602. status: true,
  603. fixed: '',
  604. columnWidth: 80,
  605. },
  606. {
  607. userId: this.$store.state.user.name,
  608. functionId: 301006,
  609. serialNumber: '301006Table1RollNo',
  610. tableId: "301006Table1",
  611. tableName: "IQC检验记录表",
  612. columnProp: 'rollNo',
  613. headerAlign: "center",
  614. align: "center",
  615. columnLabel: '标签条码',
  616. columnHidden: false,
  617. columnImage: false,
  618. columnSortable: false,
  619. sortLv: 0,
  620. status: true,
  621. fixed: '',
  622. columnWidth: 120,
  623. },
  624. {
  625. userId: this.$store.state.user.name,
  626. functionId: 301006,
  627. serialNumber: '301006Table1PartNo',
  628. tableId: "301006Table1",
  629. tableName: "IQC检验记录表",
  630. columnProp: 'partNo',
  631. headerAlign: "center",
  632. align: "center",
  633. columnLabel: '物料编码',
  634. columnHidden: false,
  635. columnImage: false,
  636. columnSortable: false,
  637. sortLv: 0,
  638. status: true,
  639. fixed: '',
  640. columnWidth: 100,
  641. },
  642. {
  643. userId: this.$store.state.user.name,
  644. functionId: 301006,
  645. serialNumber: '301006Table1PartDesc',
  646. tableId: "301006Table1",
  647. tableName: "IQC检验记录表",
  648. columnProp: 'partDesc',
  649. headerAlign: "center",
  650. align: "center",
  651. columnLabel: '物料名称',
  652. columnHidden: false,
  653. columnImage: false,
  654. columnSortable: false,
  655. sortLv: 0,
  656. status: true,
  657. fixed: '',
  658. columnWidth: 150,
  659. },
  660. {
  661. userId: this.$store.state.user.name,
  662. functionId: 301006,
  663. serialNumber: '301006Table1Umid',
  664. tableId: "301006Table1",
  665. tableName: "IQC检验记录表",
  666. columnProp: 'umId',
  667. headerAlign: "center",
  668. align: "center",
  669. columnLabel: '计量单位',
  670. columnHidden: false,
  671. columnImage: false,
  672. columnSortable: false,
  673. sortLv: 0,
  674. status: true,
  675. fixed: '',
  676. columnWidth: 80,
  677. },
  678. {
  679. userId: this.$store.state.user.name,
  680. functionId: 301006,
  681. serialNumber: '301006Table1RollQty',
  682. tableId: "301006Table1",
  683. tableName: "IQC检验记录表",
  684. columnProp: 'rollQty',
  685. headerAlign: "center",
  686. align: "right",
  687. columnLabel: '到货数量',
  688. columnHidden: false,
  689. columnImage: false,
  690. columnSortable: false,
  691. sortLv: 0,
  692. status: true,
  693. fixed: '',
  694. columnWidth: 80,
  695. },
  696. {
  697. userId: this.$store.state.user.name,
  698. functionId: 301006,
  699. serialNumber: '301006Table1RollCount',
  700. tableId: "301006Table1",
  701. tableName: "IQC检验记录表",
  702. columnProp: 'rollCount',
  703. headerAlign: "center",
  704. align: "right",
  705. columnLabel: '送检数量',
  706. columnHidden: false,
  707. columnImage: false,
  708. columnSortable: false,
  709. sortLv: 0,
  710. status: true,
  711. fixed: '',
  712. columnWidth: 80,
  713. },
  714. {
  715. userId: this.$store.state.user.name,
  716. functionId: 301006,
  717. serialNumber: '301006Table1SamplingQty',
  718. tableId: "301006Table1",
  719. tableName: "IQC检验记录表",
  720. columnProp: 'samplingQty',
  721. headerAlign: "center",
  722. align: "right",
  723. columnLabel: '抽样数量',
  724. columnHidden: false,
  725. columnImage: false,
  726. columnSortable: false,
  727. sortLv: 0,
  728. status: true,
  729. fixed: '',
  730. columnWidth: 80,
  731. },
  732. {
  733. userId: this.$store.state.user.name,
  734. functionId: 301006,
  735. serialNumber: '301006Table1PoOrderNo',
  736. tableId: "301006Table1",
  737. tableName: "IQC检验记录表",
  738. columnProp: 'poOrderNo',
  739. headerAlign: "center",
  740. align: "center",
  741. columnLabel: '单据号',
  742. columnHidden: false,
  743. columnImage: false,
  744. columnSortable: false,
  745. sortLv: 0,
  746. status: true,
  747. fixed: '',
  748. columnWidth: 130,
  749. },
  750. {
  751. userId: this.$store.state.user.name,
  752. functionId: 301006,
  753. serialNumber: '301006Table1PoItemNo',
  754. tableId: "301006Table1",
  755. tableName: "IQC检验记录表",
  756. columnProp: 'poItemNo',
  757. headerAlign: "center",
  758. align: "right",
  759. columnLabel: '单据行号',
  760. columnHidden: false,
  761. columnImage: false,
  762. columnSortable: false,
  763. sortLv: 0,
  764. status: true,
  765. fixed: '',
  766. columnWidth: 80,
  767. },
  768. {
  769. userId: this.$store.state.user.name,
  770. functionId: 301006,
  771. serialNumber: '301006Table1SupplierDesc',
  772. tableId: "301006Table1",
  773. tableName: "IQC检验记录表",
  774. columnProp: 'supplierDesc',
  775. headerAlign: "center",
  776. align: "center",
  777. columnLabel: '供应商',
  778. columnHidden: false,
  779. columnImage: false,
  780. columnSortable: false,
  781. sortLv: 0,
  782. status: true,
  783. fixed: '',
  784. columnWidth: 150,
  785. },
  786. {
  787. userId: this.$store.state.user.name,
  788. functionId: 301006,
  789. serialNumber: '301006Table1InspectionRemark',
  790. tableId: "301006Table1",
  791. tableName: "IQC检验记录表",
  792. columnProp: 'inspectionRemark',
  793. headerAlign: "center",
  794. align: "center",
  795. columnLabel: '质检备注',
  796. columnHidden: false,
  797. columnImage: false,
  798. columnSortable: false,
  799. sortLv: 0,
  800. status: true,
  801. fixed: '',
  802. columnWidth: 150,
  803. },
  804. {
  805. userId: this.$store.state.user.name,
  806. functionId: 301006,
  807. serialNumber: '301006Table1DisposalMeasures',
  808. tableId: "301006Table1",
  809. tableName: "IQC检验记录表",
  810. columnProp: 'disposalMeasures',
  811. headerAlign: "center",
  812. align: "center",
  813. columnLabel: '处置措施',
  814. columnHidden: false,
  815. columnImage: false,
  816. columnSortable: false,
  817. sortLv: 0,
  818. status: true,
  819. fixed: '',
  820. columnWidth: 120,
  821. },
  822. {
  823. userId: this.$store.state.user.name,
  824. functionId: 301006,
  825. serialNumber: '301006Table1DisposalRemark',
  826. tableId: "301006Table1",
  827. tableName: "IQC检验记录表",
  828. columnProp: 'disposalRemark',
  829. headerAlign: "center",
  830. align: "center",
  831. columnLabel: '处置说明',
  832. columnHidden: false,
  833. columnImage: false,
  834. columnSortable: false,
  835. sortLv: 0,
  836. status: true,
  837. fixed: '',
  838. columnWidth: 150,
  839. },
  840. {
  841. userId: this.$store.state.user.name,
  842. functionId: 301006,
  843. serialNumber: '301006Table1InspectorDate',
  844. tableId: "301006Table1",
  845. tableName: "IQC检验记录表",
  846. columnProp: 'inspectorDate',
  847. headerAlign: "center",
  848. align: "center",
  849. columnLabel: '检验时间',
  850. columnHidden: false,
  851. columnImage: false,
  852. columnSortable: false,
  853. sortLv: 0,
  854. status: true,
  855. fixed: '',
  856. columnWidth: 130,
  857. },
  858. {
  859. userId: this.$store.state.user.name,
  860. functionId: 301006,
  861. serialNumber: '301006Table1InspectorName',
  862. tableId: "301006Table1",
  863. tableName: "IQC检验记录表",
  864. columnProp: 'inspectorName',
  865. headerAlign: "center",
  866. align: "center",
  867. columnLabel: '质检员',
  868. columnHidden: false,
  869. columnImage: false,
  870. columnSortable: false,
  871. sortLv: 0,
  872. status: true,
  873. fixed: '',
  874. columnWidth: 120,
  875. },
  876. ],
  877. detailColumnList: [
  878. {
  879. userId: this.$store.state.user.name,
  880. functionId: 301006,
  881. serialNumber: '301006Table2ItemDesc',
  882. tableId: "301006Table2",
  883. tableName: "检验单明细表",
  884. columnProp: 'itemDesc',
  885. headerAlign: "center",
  886. align: "center",
  887. columnLabel: '检验项目',
  888. columnHidden: false,
  889. columnImage: false,
  890. columnSortable: false,
  891. sortLv: 0,
  892. status: true,
  893. fixed: '',
  894. columnWidth: 120,
  895. },
  896. {
  897. userId: this.$store.state.user.name,
  898. functionId: 301006,
  899. serialNumber: '301006Table2SamplingLevelDesc',
  900. tableId: "301006Table2",
  901. tableName: "检验单明细表",
  902. columnProp: 'samplingLevelDesc',
  903. headerAlign: "center",
  904. align: "center",
  905. columnLabel: '检验水平',
  906. columnHidden: false,
  907. columnImage: false,
  908. columnSortable: false,
  909. sortLv: 0,
  910. status: true,
  911. fixed: '',
  912. columnWidth: 120,
  913. },
  914. {
  915. userId: this.$store.state.user.name,
  916. functionId: 301006,
  917. serialNumber: '301006Table2SamplingProgrammeDesc',
  918. tableId: "301006Table2",
  919. tableName: "检验单明细表",
  920. columnProp: 'samplingProgrammeDesc',
  921. headerAlign: "center",
  922. align: "center",
  923. columnLabel: '检验方案',
  924. columnHidden: false,
  925. columnImage: false,
  926. columnSortable: false,
  927. sortLv: 0,
  928. status: true,
  929. fixed: '',
  930. columnWidth: 120,
  931. },
  932. {
  933. userId: this.$store.state.user.name,
  934. functionId: 301006,
  935. serialNumber: '301006Table2ObjectDesc',
  936. tableId: "301006Table2",
  937. tableName: "检验单明细表",
  938. columnProp: 'objectDesc',
  939. headerAlign: "center",
  940. align: "center",
  941. columnLabel: '检测仪器',
  942. columnHidden: false,
  943. columnImage: false,
  944. columnSortable: false,
  945. sortLv: 0,
  946. status: true,
  947. fixed: '',
  948. columnWidth: 120,
  949. },
  950. {
  951. userId: this.$store.state.user.name,
  952. functionId: 301006,
  953. serialNumber: '301006Table2Aql',
  954. tableId: "301006Table2",
  955. tableName: "检验单明细表",
  956. columnProp: 'aql',
  957. headerAlign: "center",
  958. align: "center",
  959. columnLabel: 'AQL',
  960. columnHidden: false,
  961. columnImage: false,
  962. columnSortable: false,
  963. sortLv: 0,
  964. status: true,
  965. fixed: '',
  966. columnWidth: 80,
  967. },
  968. {
  969. userId: this.$store.state.user.name,
  970. functionId: 301006,
  971. serialNumber: '301006Table2Ac',
  972. tableId: "301006Table2",
  973. tableName: "检验单明细表",
  974. columnProp: 'ac',
  975. headerAlign: "center",
  976. align: "center",
  977. columnLabel: 'AC',
  978. columnHidden: false,
  979. columnImage: false,
  980. columnSortable: false,
  981. sortLv: 0,
  982. status: true,
  983. fixed: '',
  984. columnWidth: 80,
  985. },
  986. {
  987. userId: this.$store.state.user.name,
  988. functionId: 301006,
  989. serialNumber: '301006Table2Re',
  990. tableId: "301006Table2",
  991. tableName: "检验单明细表",
  992. columnProp: 're',
  993. headerAlign: "center",
  994. align: "center",
  995. columnLabel: 'RE',
  996. columnHidden: false,
  997. columnImage: false,
  998. columnSortable: false,
  999. sortLv: 0,
  1000. status: true,
  1001. fixed: '',
  1002. columnWidth: 80,
  1003. },
  1004. {
  1005. userId: this.$store.state.user.name,
  1006. functionId: 301006,
  1007. serialNumber: '301006Table2DefaultValue',
  1008. tableId: "301006Table2",
  1009. tableName: "检验单明细表",
  1010. columnProp: 'defaultValue',
  1011. headerAlign: "center",
  1012. align: "center",
  1013. columnLabel: '标准值',
  1014. columnHidden: false,
  1015. columnImage: false,
  1016. columnSortable: false,
  1017. sortLv: 0,
  1018. status: true,
  1019. fixed: '',
  1020. columnWidth: 100,
  1021. },
  1022. {
  1023. userId: this.$store.state.user.name,
  1024. functionId: 301006,
  1025. serialNumber: '301006Table2MaxValue',
  1026. tableId: "301006Table2",
  1027. tableName: "检验单明细表",
  1028. columnProp: 'maxValue',
  1029. headerAlign: "center",
  1030. align: "center",
  1031. columnLabel: '最大值',
  1032. columnHidden: false,
  1033. columnImage: false,
  1034. columnSortable: false,
  1035. sortLv: 0,
  1036. status: true,
  1037. fixed: '',
  1038. columnWidth: 100,
  1039. },
  1040. {
  1041. userId: this.$store.state.user.name,
  1042. functionId: 301006,
  1043. serialNumber: '301006Table2MinValue',
  1044. tableId: "301006Table2",
  1045. tableName: "检验单明细表",
  1046. columnProp: 'minValue',
  1047. headerAlign: "center",
  1048. align: "center",
  1049. columnLabel: '最小值',
  1050. columnHidden: false,
  1051. columnImage: false,
  1052. columnSortable: false,
  1053. sortLv: 0,
  1054. status: true,
  1055. fixed: '',
  1056. columnWidth: 100,
  1057. },
  1058. {
  1059. userId: this.$store.state.user.name,
  1060. functionId: 301006,
  1061. serialNumber: '301006Table2ValueType',
  1062. tableId: "301006Table2",
  1063. tableName: "检验单明细表",
  1064. columnProp: 'valueType',
  1065. headerAlign: "center",
  1066. align: "center",
  1067. columnLabel: '检测值类型',
  1068. columnHidden: false,
  1069. columnImage: false,
  1070. columnSortable: false,
  1071. sortLv: 0,
  1072. status: true,
  1073. fixed: '',
  1074. columnWidth: 80,
  1075. },
  1076. ],
  1077. fileColumnList: [
  1078. {
  1079. columnProp: 'fileName',
  1080. headerAlign: "center",
  1081. align: "center",
  1082. columnLabel: '文件名称',
  1083. columnHidden: false,
  1084. columnImage: false,
  1085. columnSortable: false,
  1086. sortLv: 0,
  1087. status: true,
  1088. fixed: '',
  1089. },
  1090. {
  1091. columnProp: 'createdBy',
  1092. headerAlign: "center",
  1093. align: 'center',
  1094. columnLabel: '上传人',
  1095. columnHidden: false,
  1096. columnImage: false,
  1097. columnSortable: true,
  1098. sortLv: 0,
  1099. status: true,
  1100. fixed: false
  1101. },
  1102. {
  1103. columnProp: 'createDate',
  1104. headerAlign: "center",
  1105. align: 'center',
  1106. columnLabel: '上传时间',
  1107. columnHidden: false,
  1108. columnImage: false,
  1109. columnSortable: true,
  1110. sortLv: 0,
  1111. status: true,
  1112. fixed: false
  1113. },
  1114. {
  1115. columnProp: 'orderRef3',
  1116. headerAlign: "center",
  1117. align: 'center',
  1118. columnLabel: '备注',
  1119. columnHidden: false,
  1120. columnImage: false,
  1121. columnSortable: true,
  1122. sortLv: 0,
  1123. status: true,
  1124. fixed: false
  1125. },
  1126. ],
  1127. detailData:{
  1128. site: this.$store.state.user.site,
  1129. inspectionNo: '',
  1130. partNo: '',
  1131. partDesc: '',
  1132. rollQty: '',
  1133. samplingQty: '',
  1134. unqualifiedQty: 0,
  1135. unqualifiedQuantity: '',
  1136. disposalMeasures: '',
  1137. disposalRemark: '',
  1138. inspectionResult: '',
  1139. inspectorNo: '',
  1140. inspectionRemark: '',
  1141. submitFlag: '',
  1142. supplierNo: '',
  1143. umId: '',
  1144. rollCount: ''
  1145. },
  1146. detailInformationFlag: false,
  1147. detailList:[],
  1148. saveInformationData:{
  1149. site: this.$store.state.user.site,
  1150. inspectionNo:'',
  1151. disposalMeasures: '',
  1152. disposalRemark: '',
  1153. inspectorNo: '',
  1154. inspectionRemark: '',
  1155. itemList:[],
  1156. unqualifiedQty: ''
  1157. },
  1158. // 子明细数据对象
  1159. tableData: [],
  1160. checkedDetail: [],
  1161. subDetailFlag: false,
  1162. subDetailData: {
  1163. site: this.$store.state.user.site,
  1164. inspectionNo: '',
  1165. itemNo: '',
  1166. itemDesc: '',
  1167. defaultValue: '',
  1168. maxValue: '',
  1169. minValue: '',
  1170. valueTypeDb: '',
  1171. subDetailValues:[]
  1172. },
  1173. options: [],
  1174. fileFlag: false,
  1175. fileContentList: [],
  1176. IQCSelections: [],
  1177. batchHandleAddModalFlag: false,
  1178. batchAddData: {
  1179. samplingLocation: '',
  1180. samplingLocationB: '',
  1181. samplingNumber: ''
  1182. },
  1183. disposalMeasuresOptions: []
  1184. }
  1185. },
  1186. mounted () {
  1187. this.$nextTick(() => {
  1188. this.height = window.innerHeight - 210
  1189. })
  1190. },
  1191. created () {
  1192. this.getDataList()
  1193. this.favoriteIsOk()
  1194. this.disposalMeasuresSearch()
  1195. // 动态列
  1196. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1197. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  1198. },
  1199. methods: {
  1200. // ======= 正则校验 =======
  1201. handleInput (value, type) {
  1202. // 大于等于0,且只能输入4位小数
  1203. let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
  1204. if (val == null || val == undefined || val == '') {
  1205. val = 0
  1206. }
  1207. if (type === 1) {
  1208. this.detailData.unqualifiedQty = val
  1209. }
  1210. },
  1211. // 子明细导入
  1212. subDetailUpload () {
  1213. let currentData = {
  1214. flag: 'IQC',
  1215. site: this.$store.state.user.site,
  1216. inspectionNo: this.detailData.inspectionNo
  1217. }
  1218. //打开组件 去做新增业务
  1219. this.$nextTick(() => {
  1220. this.$refs.subDetailUpload.init(currentData)
  1221. })
  1222. },
  1223. // 获取处置措施列表
  1224. disposalMeasuresSearch(){
  1225. let tempData = {
  1226. inspectionTypeNo: '105'
  1227. }
  1228. disposalMeasuresSearch(tempData).then(({data}) => {
  1229. if (data.code === 0) {
  1230. this.disposalMeasuresOptions = data.rows
  1231. }
  1232. })
  1233. },
  1234. selectFlag(){
  1235. return true;
  1236. },
  1237. // 单机选中
  1238. IQCClickRow(row){
  1239. this.$refs.IQCTable.toggleRowSelection(row);
  1240. },
  1241. // 复选
  1242. selectionIQC(val){
  1243. this.IQCSelections = val
  1244. },
  1245. //刷新派设备文档的列表
  1246. getFileContentData(row) {
  1247. let currentData = {
  1248. orderRef1: row.site,
  1249. orderRef2: row.inspectionNo
  1250. };
  1251. getFileContentList(currentData).then(({data}) => {
  1252. //区分请求成功和失败的状况
  1253. if (data && data.code === 200) {
  1254. this.fileContentList = data.rows;
  1255. } else {
  1256. this.fileContentList = [];
  1257. }
  1258. })
  1259. this.fileFlag = true;
  1260. },
  1261. // 新增文件的modal
  1262. addUploadFileModal () {
  1263. let currentData = {
  1264. titleCon: 'IQC文件上传',
  1265. site: this.$store.state.user.site,
  1266. createBy: this.$store.state.user.name,
  1267. inspectionNo: this.detailData.inspectionNo,
  1268. remark: '',
  1269. folder: 'qcIQC',
  1270. };
  1271. //打开组件 去做新增业务
  1272. this.$nextTick(() => {
  1273. this.$refs.qcFAIUploadFile.init(currentData);
  1274. })
  1275. },
  1276. // 上传项目图片
  1277. uploadImageModal (row) {
  1278. let currentData = {
  1279. site: this.$store.state.user.site,
  1280. createBy: this.$store.state.user.name,
  1281. inspectionNo: this.detailData.inspectionNo,
  1282. itemNo: row.itemNo,
  1283. folder: 'IQCItemImageFile'
  1284. }
  1285. //打开组件 去做新增业务
  1286. this.$nextTick(() => {
  1287. this.$refs.comQcItemImageUploadFile.init(currentData)
  1288. })
  1289. },
  1290. // 文件下载
  1291. downloadFile(row){
  1292. downLoadObjectFile(row)
  1293. .then(({data}) => {
  1294. // 不限制文件下载类型
  1295. const blob = new Blob([data], {type: "application/octet-stream"})
  1296. // 下载文件名称
  1297. const fileName = row.fileName
  1298. // a标签下载
  1299. const linkNode = document.createElement('a')
  1300. // a标签的download属性规定下载文件的名称
  1301. linkNode.download = fileName
  1302. linkNode.style.display = 'none'
  1303. // 生成一个Blob URL
  1304. linkNode.href = URL.createObjectURL(blob)
  1305. document.body.appendChild(linkNode)
  1306. // 模拟在按钮上的一次鼠标单击
  1307. linkNode.click()
  1308. // 释放URL 对象
  1309. URL.revokeObjectURL(linkNode.href)
  1310. document.body.removeChild(linkNode)
  1311. })
  1312. },
  1313. // 删除文件
  1314. deleteFile(row){
  1315. let tempData = {
  1316. site: row.orderRef1,
  1317. inspectionNo: row.orderRef2
  1318. }
  1319. this.$confirm('确定要删除此文件?', '提示', {
  1320. confirmButtonText: '确定',
  1321. cancelButtonText: '取消',
  1322. type: 'warning'
  1323. }).then(() => {
  1324. deleteObjectFile(row).then(({data}) => {
  1325. if (data && data.code == 0) {
  1326. this.getFileContentData(tempData)
  1327. this.$message({
  1328. message: '操作成功',
  1329. type: 'success',
  1330. duration: 1500,
  1331. onClose: () => {
  1332. }
  1333. })
  1334. } else {
  1335. this.$alert(data.msg, '错误', {
  1336. confirmButtonText: '确定'
  1337. })
  1338. }
  1339. })
  1340. }).catch(() => {
  1341. })
  1342. },
  1343. // 获取基础数据列表S
  1344. getBaseList (val,type) {
  1345. this.tagNo = val
  1346. this.$nextTick(() => {
  1347. let strVal = ''
  1348. if (val === 1037) {
  1349. strVal = this.modalData.detailCodeNo
  1350. this.$refs.baseList.init(val, strVal)
  1351. }
  1352. if (val === 1040) {
  1353. strVal = this.modalData.inspectorNo
  1354. this.$refs.baseList.init(val, strVal)
  1355. }
  1356. })
  1357. },
  1358. /* 列表方法的回调 */
  1359. getBaseData (val) {
  1360. if (this.tagNo === 1037) {
  1361. this.modalData.detailCodeNo = val.code_no
  1362. this.modalData.detailCodeDesc = val.code_desc
  1363. }
  1364. if (this.tagNo === 1040) {
  1365. this.modalData.inspectorNo = val.inspector_no
  1366. this.modalData.inspectorName = val.inspector_name
  1367. }
  1368. },
  1369. // 获取主信息数据列表
  1370. getDataList () {
  1371. this.searchData.limit = this.pageSize
  1372. this.searchData.page = this.pageIndex
  1373. qcIQCInspectionSearch(this.searchData).then(({data}) => {
  1374. if (data.code === 0) {
  1375. this.dataList = data.page.list
  1376. this.pageIndex = data.page.currPage
  1377. this.pageSize = data.page.pageSize
  1378. this.totalPage = data.page.totalCount
  1379. }
  1380. this.dataListLoading = false
  1381. })
  1382. },
  1383. // 每页数
  1384. sizeChangeHandle (val) {
  1385. this.pageSize = val
  1386. this.pageIndex = 1
  1387. this.getDataList()
  1388. },
  1389. // 当前页
  1390. currentChangeHandle (val) {
  1391. this.pageIndex = val
  1392. this.getDataList()
  1393. },
  1394. // 多选
  1395. selectionChangeHandle (val) {
  1396. this.dataListSelections = val
  1397. },
  1398. // 查询检验类型
  1399. inspectorSearch(){
  1400. inspectorSearch().then(({data}) => {
  1401. if (data.code === 0) {
  1402. this.options = data.rows
  1403. }
  1404. })
  1405. },
  1406. async Transfer(){
  1407. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  1408. this.$message.warning('请选择检验结论!')
  1409. return
  1410. }
  1411. // let num = 0 // 记录结论为不合格的项目数
  1412. // for (let i = 0; i < this.detailList.length; i++) {
  1413. // if(this.detailList[i].valueTypeDb === 'N') { // 如果检验值类型为数字
  1414. // await checkIQCSubDetailValue(this.detailList[i]).then(({data}) => {
  1415. // if (data.flag === 2 && this.detailList[i].itemResult === 'Y') { // 如果项目实测值超出范围且项目结论为合格
  1416. // this.detailList[i].itemResult = 'N'
  1417. // num = num + 1
  1418. // }
  1419. // })
  1420. // }
  1421. // if(this.detailList[i].itemResult === '' || this.detailList[i].itemResult == null){ // 默认结论为合格
  1422. // this.detailList[i].itemResult = 'Y'
  1423. // }
  1424. // }
  1425. // if (this.detailData.inspectionResult === '合格' && num > 0){
  1426. // this.$confirm('存在不合格项目,是否将检验记录保存为合格', '提示', {
  1427. // confirmButtonText: '确定',
  1428. // cancelButtonText: '取消',
  1429. // type: 'warning'
  1430. // }).then(() => {
  1431. // this.saveDetailInformation()
  1432. // })
  1433. // }else {
  1434. // this.saveDetailInformation()
  1435. // }
  1436. this.saveDetailInformation()
  1437. },
  1438. // 新增明细信息
  1439. saveDetailInformation(){
  1440. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  1441. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  1442. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  1443. this.saveInformationData.inspectorNo = this.$store.state.user.name
  1444. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  1445. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  1446. this.saveInformationData.unqualifiedQty = this.detailData.unqualifiedQty
  1447. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  1448. saveIQCDetailedRecord(this.saveInformationData).then(({data}) => {
  1449. if (data && data.code === 0) {
  1450. this.getDataList()
  1451. this.detailInformationFlag = false
  1452. this.$message({
  1453. message: '操作成功',
  1454. type: 'success',
  1455. duration: 1500,
  1456. onClose: () => {}
  1457. })
  1458. } else {
  1459. this.$alert(data.msg, '错误', {
  1460. confirmButtonText: '确定'
  1461. })
  1462. }
  1463. })
  1464. },
  1465. // 明细记录信息查询
  1466. detailModal(row){
  1467. this.detailData.site = this.$store.state.user.site
  1468. this.detailData.inspectionNo = row.inspectionNo
  1469. this.detailData.partNo = row.partNo
  1470. this.detailData.partDesc = row.partDesc
  1471. this.detailData.rollQty = row.rollQty
  1472. this.detailData.samplingQty = row.samplingQty
  1473. this.detailData.unqualifiedQty = row.unqualifiedQty
  1474. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  1475. this.detailData.submitFlag = row.submitFlag
  1476. this.detailData.disposalMeasures = row.disposalMeasures
  1477. this.detailData.disposalRemark = row.disposalRemark
  1478. this.detailData.inspectionResult = row.inspectionResult
  1479. this.detailData.inspectorNo = row.inspectorNo
  1480. this.detailData.inspectionRemark = row.inspectionRemark
  1481. this.detailData.umId = row.umId
  1482. this.detailData.rollCount = row.rollCount
  1483. this.getInspectionFormData()
  1484. this.inspectorSearch()
  1485. this.detailInformationFlag = true
  1486. },
  1487. // 检验单明细
  1488. getInspectionFormData(){
  1489. iqcDetailSearch(this.detailData).then(({data}) => {
  1490. if (data && data.code === 0) {
  1491. this.detailList = data.rows
  1492. } else {
  1493. this.detailList = []
  1494. }
  1495. })
  1496. },
  1497. // 子明细记录信息查询
  1498. subDetailModal(row){
  1499. // this.subDetailData.inspectionNo = row.inspectionNo;
  1500. // this.subDetailData.itemNo = row.itemNo;
  1501. // this.subDetailData.itemDesc = row.itemDesc;
  1502. // this.subDetailData.defaultValue = row.defaultValue;
  1503. // this.subDetailData.maxValue = row.maxValue;
  1504. // this.subDetailData.minValue = row.minValue;
  1505. this.subDetailData = row
  1506. selectIQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  1507. this.tableData = data.rows
  1508. })
  1509. this.batchAddData = {
  1510. samplingLocation: '',
  1511. samplingLocationB: '',
  1512. samplingNumber: ''
  1513. }
  1514. this.subDetailFlag = true
  1515. },
  1516. // 删除检验记录
  1517. deleteModal () {
  1518. if(this.IQCSelections.length === 0){
  1519. this.$message.warning('请勾选要删除的检验单!')
  1520. return
  1521. }
  1522. this.$confirm(`是否删除该 `+ this.IQCSelections.length +` 条检验记录?`, '提示', {
  1523. confirmButtonText: '确定',
  1524. cancelButtonText: '取消',
  1525. type: 'warning'
  1526. }).then(() => {
  1527. let tempData = {
  1528. site: this.$store.state.user.site,
  1529. submitList: this.IQCSelections
  1530. }
  1531. iqcRecordDelete(tempData).then(({data}) => {
  1532. if (data && data.code === 0) {
  1533. this.getDataList()
  1534. this.IQCSelections = []
  1535. this.$message({
  1536. message: '操作成功',
  1537. type: 'success',
  1538. duration: 1500,
  1539. onClose: () => {
  1540. }
  1541. })
  1542. } else {
  1543. this.$alert(data.msg, '错误', {
  1544. confirmButtonText: '确定'
  1545. })
  1546. }
  1547. })
  1548. }).catch(() => {
  1549. })
  1550. },
  1551. // 审核按钮
  1552. submitResult(){
  1553. let tempData1 = '' // 记录不是待审核状态的单号
  1554. let tempData2 = '' // 记录处置措施未填写的单号
  1555. if(this.IQCSelections.length === 0){
  1556. this.$message.warning('请勾选要审核的检验单!')
  1557. return
  1558. }
  1559. for (let i = 0; i < this.IQCSelections.length; i++) {
  1560. if (this.IQCSelections[i].state != '待审核'){
  1561. tempData1 = tempData1 + this.IQCSelections[i].inspectionNo + '、'
  1562. }
  1563. if (this.IQCSelections[i].inspectionResult === '不合格' && (this.IQCSelections[i].disposalMeasures === '' || this.IQCSelections[i].disposalMeasures == null)){
  1564. tempData2 = tempData2 + this.IQCSelections[i].inspectionNo + '、'
  1565. }
  1566. }
  1567. if (tempData1 != ''){
  1568. tempData1 = tempData1.substring(0, tempData1.length - 1)
  1569. this.$message.warning('检验单号 ' + tempData1 + ' 不是待审核状态!')
  1570. return
  1571. }
  1572. if (tempData2 != ''){
  1573. tempData2 = tempData2.substring(0, tempData2.length - 1)
  1574. this.$message.warning('检验单号 ' + tempData2 + ' 的处置措施未选择!')
  1575. return
  1576. }
  1577. // this.submitData.site = row.site
  1578. // this.submitData.inspectionNo = row.inspectionNo
  1579. // this.submitData.inspectionResult = row.inspectionResult
  1580. // if (row.inspectionResult == '不合格' && (row.disposalMeasures == '' || row.disposalMeasures == null)){
  1581. // this.$alert('处置措施未选择!', '错误', {
  1582. // confirmButtonText: '确定'
  1583. // })
  1584. // return false
  1585. // }
  1586. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.IQCSelections.length + ` 条记录`, '提示', {
  1587. confirmButtonText: '确定',
  1588. cancelButtonText: '取消',
  1589. type: 'warning'
  1590. }).then(() => {
  1591. this.submitData.submitList = this.IQCSelections
  1592. saveIQCSubmitResult(this.submitData).then(({data}) => {
  1593. if (data && data.code === 0) {
  1594. this.getDataList()
  1595. this.IQCSelections = []
  1596. this.$message({
  1597. message: '操作成功',
  1598. type: 'success',
  1599. duration: 1500,
  1600. onClose: () => {}
  1601. })
  1602. } else {
  1603. this.$alert(data.msg, '错误', {
  1604. confirmButtonText: '确定'
  1605. })
  1606. }
  1607. })
  1608. }).catch(() => {
  1609. })
  1610. },
  1611. // 子明细方法
  1612. // 表格的新增
  1613. rowClassName({ row, rowIndex }) {
  1614. row.xh = rowIndex + 1;
  1615. },
  1616. // 单选框选中数据
  1617. handleDetailSelectionChange(selection) {
  1618. this.checkedDetail = selection;
  1619. },
  1620. // 点击新增更多
  1621. handleAddBtn (td) {
  1622. checkIQCIsSubmit(td).then(({data}) => {
  1623. if (data.flag != 1) {
  1624. let obj = {};
  1625. obj.subDetailValue = "";
  1626. obj.samplingLocation = "";
  1627. this.tableData.push(obj);
  1628. } else {
  1629. this.$alert("记录已提交!", '错误', {
  1630. confirmButtonText: '确定'
  1631. })
  1632. }
  1633. })
  1634. },
  1635. // 批量新增操作
  1636. batchHandleAdd (td) {
  1637. checkIQCIsSubmit(td).then(({data}) => {
  1638. if (data.flag != 1) {
  1639. this.batchHandleAddModalFlag = true
  1640. } else {
  1641. this.$alert("记录已提交!", '错误', {
  1642. confirmButtonText: '确定'
  1643. })
  1644. }
  1645. })
  1646. },
  1647. // 批量新增行
  1648. batchHandleAddModal () {
  1649. for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
  1650. let obj = {}
  1651. obj.samplingLocation = this.batchAddData.samplingLocation
  1652. obj.samplingLocationB = this.batchAddData.samplingLocationB
  1653. obj.subDetailValue = ""
  1654. this.tableData.push(obj)
  1655. }
  1656. this.batchHandleAddModalFlag = false
  1657. },
  1658. // 回车事件
  1659. nextFocus1 (index) {
  1660. let a1 = `${index + 1}` + `a`
  1661. this.$nextTick(() => {
  1662. this.$refs[a1].focus()
  1663. })
  1664. },
  1665. nextFocus2 (index) {
  1666. let a2 = `${index + 1}` + `b`
  1667. this.$nextTick(() => {
  1668. this.$refs[a2].focus()
  1669. })
  1670. },
  1671. nextFocus3 (index) {
  1672. let a3 = `${index + 1}` + `c`
  1673. this.$nextTick(() => {
  1674. this.$refs[a3].focus()
  1675. })
  1676. },
  1677. focusNextInput(index, type) {
  1678. let aaa = ''
  1679. if (this.detailList.length - 1 === index) {
  1680. aaa = `${type}0`
  1681. } else {
  1682. aaa = `${type}${index + 1}`
  1683. }
  1684. this.$nextTick(() => {
  1685. this.$refs[aaa].focus()
  1686. })
  1687. },
  1688. //删除
  1689. handleDeleteBtn(td) {
  1690. checkIQCIsSubmit(td).then(({data}) => {
  1691. if (data.flag != 1) {
  1692. if (this.checkedDetail.length === 0) {
  1693. this.$alert("请先选择要删除的数据", "提示", {
  1694. confirmButtonText: "确定",
  1695. })
  1696. } else {
  1697. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  1698. confirmButtonText: "确定",
  1699. cancelButtonText: "取消",
  1700. type: "warning",
  1701. callback: (action) => {
  1702. if (action === "confirm") {
  1703. let val = this.checkedDetail;
  1704. val.forEach((val, index) => {
  1705. this.tableData.forEach((v, i) => {
  1706. if (val.xh === v.xh) {
  1707. this.tableData.splice(i, 1);
  1708. }
  1709. });
  1710. });
  1711. this.$message({
  1712. message: "删除成功!",
  1713. type: "success",
  1714. });
  1715. return;
  1716. } else {
  1717. this.$message({
  1718. message: "已取消删除操作",
  1719. type: "warning",
  1720. });
  1721. return;
  1722. }
  1723. },
  1724. });
  1725. }
  1726. } else {
  1727. this.$alert("记录已提交!", '错误', {
  1728. confirmButtonText: '确定'
  1729. })
  1730. }
  1731. })
  1732. },
  1733. // 新增子明细记录
  1734. saveSubDetailResult(){
  1735. for (let i = 0; i < this.tableData.length; i++) {
  1736. if(this.tableData[i].subDetailValue === '' || this.tableData[i].subDetailValue == null){
  1737. this.$message.warning('序号' + (i+1) +'未填写实测值!')
  1738. return
  1739. }
  1740. }
  1741. this.subDetailData.subDetailValues = this.tableData
  1742. saveIQCSubDetailed(this.subDetailData).then(({data}) => {
  1743. if (data && data.code === 0) {
  1744. if (data.count > 0) {
  1745. this.subDetailData.itemResult = 'N'
  1746. this.subDetailData.unqualifiedQuantity = data.count
  1747. }
  1748. if (this.subDetailData.subDetailValues.length > 0) {
  1749. this.subDetailData.subDetailRecordNum = 1
  1750. } else {
  1751. this.subDetailData.subDetailRecordNum = -1
  1752. this.subDetailData.unqualifiedQuantity = 0
  1753. this.subDetailData.itemResult = 'Y'
  1754. }
  1755. this.subDetailFlag = false
  1756. this.tableData = []
  1757. this.$message({
  1758. message: '操作成功',
  1759. type: 'success',
  1760. duration: 1500,
  1761. onClose: () => {}
  1762. })
  1763. } else {
  1764. this.$alert(data.msg, '错误', {
  1765. confirmButtonText: '确定'
  1766. })
  1767. }
  1768. })
  1769. },
  1770. // 校验用户是否收藏
  1771. favoriteIsOk() {
  1772. let userFavorite = {
  1773. userId: this.$store.state.user.id,
  1774. languageCode: this.$i18n.locale
  1775. }
  1776. userFavoriteList(userFavorite).then(({data}) => {
  1777. for (let i = 0; i < data.list.length; i++) {
  1778. if(this.$route.meta.menuId == data.list[i].menuId){
  1779. this.favorite = true
  1780. }
  1781. }
  1782. })
  1783. },
  1784. // 收藏 OR 取消收藏
  1785. favoriteFunction() {
  1786. let userFavorite = {
  1787. userId: this.$store.state.user.id,
  1788. functionId: this.$route.meta.menuId,
  1789. }
  1790. if (this.favorite) {
  1791. removeUserFavorite(userFavorite).then(({data}) => {
  1792. this.$message.success(data.msg)
  1793. this.favorite = false
  1794. })
  1795. } else {
  1796. // 收藏
  1797. saveUserFavorite(userFavorite).then(({data}) => {
  1798. this.$message.success(data.msg)
  1799. this.favorite = true
  1800. })
  1801. }
  1802. },
  1803. //导出excel
  1804. async createExportData() {
  1805. this.searchData.limit = -1
  1806. this.searchData.page = 1
  1807. await qcIQCInspectionSearch(this.searchData).then(({data}) => {
  1808. this.exportList= data.page.list;
  1809. })
  1810. return this.exportList;
  1811. },
  1812. startDownload() {},
  1813. finishDownload() {},
  1814. fields() {
  1815. let json = "{"
  1816. this.columnList1.forEach((item, index) => {
  1817. if (index == this.columnList1.length - 1) {
  1818. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1819. } else {
  1820. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1821. }
  1822. })
  1823. json += "}"
  1824. let s = eval("(" + json + ")")
  1825. return s
  1826. },
  1827. // 动态列开始 获取 用户保存的 格式列
  1828. async getTableUserColumn(tableId, columnId) {
  1829. let queryTableUser = {
  1830. userId: this.$store.state.user.name,
  1831. functionId: this.$route.meta.menuId,
  1832. tableId: tableId,
  1833. status: true,
  1834. languageCode: this.$i18n.locale
  1835. }
  1836. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1837. if (data.rows.length > 0) {
  1838. //this.columnList1 = []
  1839. switch (columnId) {
  1840. case 1:
  1841. this.columnList1 = data.rows
  1842. break;
  1843. case 2:
  1844. this.detailColumnList = data.rows
  1845. break;
  1846. // case 3:
  1847. // this.columnList2 = data.rows
  1848. // break;
  1849. // case 4:
  1850. // this.columnList3 = data.rows
  1851. // break;
  1852. }
  1853. } else {
  1854. this.getColumnList(tableId, columnId)
  1855. }
  1856. })
  1857. },
  1858. // 获取 tableDefault 列
  1859. async getColumnList(tableId, columnId) {
  1860. this.queryTable.tableId = tableId
  1861. let queryTable= {
  1862. functionId: this.$route.meta.menuId,
  1863. tableId: tableId,
  1864. languageCode: this.$i18n.locale
  1865. }
  1866. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1867. if (!data.rows.length == 0) {
  1868. switch (columnId) {
  1869. case 1:
  1870. this.columnList1 = data.rows
  1871. break;
  1872. case 2:
  1873. this.detailColumnList = data.rows
  1874. break;
  1875. // case 3:
  1876. // this.columnList2 = data.rows
  1877. // break;
  1878. // case 4:
  1879. // this.columnList3 = data.rows
  1880. // break;
  1881. }
  1882. } else {
  1883. // this.showDefault = true.
  1884. }
  1885. })
  1886. },
  1887. /**
  1888. * 明细导入后将返回值回传给父组件
  1889. * @param val
  1890. */
  1891. changeMyString (val) {
  1892. for (let i = 0; i < this.detailList.length; i++) {
  1893. if (val[this.detailList[i].itemNo] !== undefined) {
  1894. this.detailList[i].unqualifiedQuantity = val[this.detailList[i].itemNo]
  1895. if (val[this.detailList[i].itemNo] != null) {
  1896. this.detailList[i].subDetailRecordNum = 1
  1897. }
  1898. if (val[this.detailList[i].itemNo] > 0) {
  1899. this.detailList[i].itemResult = 'N'
  1900. }
  1901. }
  1902. }
  1903. },
  1904. }
  1905. }
  1906. </script>
  1907. <style scoped>
  1908. /deep/ .redElSelect .el-input--suffix .el-input__inner{
  1909. color: red;
  1910. font-weight: bold;
  1911. }
  1912. /deep/ .greenElSelect .el-input--suffix .el-input__inner{
  1913. color: rgb(103,194,58);
  1914. font-weight: bold;
  1915. }
  1916. .numInput /deep/ .el-input__inner{
  1917. text-align: right;
  1918. }
  1919. </style>