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.

1400 lines
48 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
  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" style="width: 100px"></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.orderNo" style="width: 120px"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="'工序'">
  33. <el-input v-model="searchData.operationDesc" style="width: 120px"></el-input>
  34. </el-form-item>
  35. <el-form-item :label="'检验时间:'">
  36. <el-date-picker style="width: 150px" v-model="searchData.startDate" type="datetime"
  37. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="开始日期">
  38. </el-date-picker>
  39. -
  40. <el-date-picker style="width: 150px" v-model="searchData.endDate" type="datetime"
  41. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="结束日期">
  42. </el-date-picker>
  43. </el-form-item>
  44. <el-form-item :label="' '">
  45. <el-button @click="doEmpty()">清空</el-button>
  46. <el-button type="primary" @click="getDataList()">查询</el-button>
  47. <el-button type="primary" @click="submitResult()">审核</el-button>
  48. <el-button type="primary" @click="deleteModal()">删除</el-button>
  49. <download-excel
  50. :fields="fields()"
  51. :data="exportData"
  52. type="xls"
  53. :name="exportName"
  54. :header="exportHeader"
  55. :footer="exportFooter"
  56. :fetch="createExportData"
  57. :before-generate="startDownload"
  58. :before-finish="finishDownload"
  59. worksheet="导出信息"
  60. class="el-button el-button--primary el-button--medium">
  61. {{ "导出" }}
  62. </download-excel>
  63. </el-form-item>
  64. </el-form>
  65. <!-- 检验记录展示列表 -->
  66. <el-table
  67. :height="height"
  68. :data="dataList"
  69. border
  70. ref="FAITable"
  71. @row-click="FAIClickRow"
  72. @selection-change="selectionFAI"
  73. v-loading="dataListLoading"
  74. style="width: 100%;">
  75. <el-table-column
  76. type="selection"
  77. header-align="center"
  78. align="center"
  79. :selectable="selectFlag"
  80. width="50">
  81. </el-table-column>
  82. <el-table-column
  83. prop="state"
  84. header-align="center"
  85. align="center"
  86. label="状态">
  87. <template slot-scope="scope">
  88. <div :style="{fontWeight:'bold', color: scope.row.state === '待检验' ? 'red' : scope.row.state === '待审核' ? '#ffa500e0' : scope.row.state === '已完成' ? '#3ac252' : ''}">
  89. {{scope.row.state}}
  90. </div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column
  94. v-for="(item,index) in columnList" :key="index"
  95. :sortable="item.columnSortable"
  96. :prop="item.columnProp"
  97. :header-align="item.headerAlign"
  98. :show-overflow-tooltip="item.showOverflowTooltip"
  99. :align="item.align"
  100. :fixed="item.fixed==''?false:item.fixed"
  101. :min-width="item.columnWidth"
  102. :label="item.columnLabel">
  103. <template slot-scope="scope">
  104. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  105. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column
  109. fixed="right"
  110. header-align="center"
  111. align="center"
  112. width="200"
  113. label="操作">
  114. <template slot-scope="scope">
  115. <a type="text" size="small" @click="detailModal(scope.row)">检验单</a>
  116. <a type="text" size="small" @click="getFileContentData(scope.row)">工作文件</a>
  117. <!-- <a type="text" size="small" @click="submitResult(scope.row)">审核</a>-->
  118. <!-- <a type="text" size="small" @click="deleteModal(scope.row)">删除</a>-->
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <!-- 分页-->
  123. <el-pagination
  124. @size-change="sizeChangeHandle"
  125. @current-change="currentChangeHandle"
  126. :current-page="pageIndex"
  127. :page-sizes="[20, 50, 100, 1000]"
  128. :page-size="pageSize"
  129. :total="totalPage"
  130. layout="total, sizes, prev, pager, next, jumper">
  131. </el-pagination>
  132. <!-- 检验单详情页 -->
  133. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1200px">
  134. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  135. <el-form-item :label="'物料编码'">
  136. <el-input v-model="detailData.partNo" disabled style="width: 100px"></el-input>
  137. </el-form-item>
  138. <el-form-item :label="'物料名称'">
  139. <el-input v-model="detailData.partDesc" disabled style="width: 200px"></el-input>
  140. </el-form-item>
  141. <el-form-item :label="'送检数量'">
  142. <el-input v-model="detailData.rollQty" disabled style="width: 80px"></el-input>
  143. </el-form-item>
  144. <el-form-item :label="'抽样数量'">
  145. <el-input v-model="detailData.samplingQty" disabled style="width: 80px"></el-input>
  146. </el-form-item>
  147. </el-form>
  148. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  149. <el-form-item :label="'不合格项目数量'">
  150. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
  151. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
  152. </el-form-item>
  153. <el-form-item :label="'处置措施'">
  154. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalMeasures" disabled style="width: 100px">
  155. <el-option label="请选择" value=""></el-option>
  156. <el-option label="特采" value="特采"></el-option>
  157. <el-option label="拒收" value="拒收"></el-option>
  158. </el-select>
  159. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalMeasures" style="width: 100px">
  160. <el-option label="请选择" value=""></el-option>
  161. <el-option label="特采" value="特采"></el-option>
  162. <el-option label="拒收" value="拒收"></el-option>
  163. </el-select>
  164. </el-form-item>
  165. <el-form-item :label="'处置说明'">
  166. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
  167. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalRemark" style="width: 200px"></el-input>
  168. </el-form-item>
  169. <el-form-item :label="'检验结论'">
  170. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  171. <el-option label="合格" value="合格"></el-option>
  172. <el-option label="不合格" value="不合格"></el-option>
  173. </el-select>
  174. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionResult" style="width: 100px" placeholder="请选择">
  175. <el-option label="合格" value="合格"></el-option>
  176. <el-option label="不合格" value="不合格"></el-option>
  177. </el-select>
  178. </el-form-item>
  179. <el-form-item label="检验员">
  180. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  181. <el-option
  182. v-for = "i in options"
  183. :key = "i.inspectorNo"
  184. :label = "i.inspectorName"
  185. :value = "i.inspectorNo">
  186. </el-option>
  187. </el-select>
  188. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectorNo" placeholder="请选择" style="width: 100px">
  189. <el-option
  190. v-for = "i in options"
  191. :key = "i.inspectorNo"
  192. :label = "i.inspectorName"
  193. :value = "i.inspectorNo">
  194. </el-option>
  195. </el-select>
  196. </el-form-item>
  197. <el-form-item :label="'质检备注'">
  198. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 200px"></el-input>
  199. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionRemark" style="width: 200px"></el-input>
  200. </el-form-item>
  201. <el-form-item :label="' '">
  202. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  203. </el-form-item>
  204. <el-form-item :label="' '"></el-form-item>
  205. </el-form>
  206. <!-- 展示列表 -->
  207. <div class="rq ">
  208. <el-table
  209. :height="500"
  210. :data="detailList"
  211. border
  212. v-loading="dataListLoading"
  213. style="width: 100%;">
  214. <el-table-column
  215. v-for="(item,index) in detailColumnList" :key="index"
  216. :sortable="item.columnSortable"
  217. :prop="item.columnProp"
  218. :header-align="item.headerAlign"
  219. :show-overflow-tooltip="item.showOverflowTooltip"
  220. :align="item.align"
  221. :fixed="item.fixed==''?false:item.fixed"
  222. :min-width="item.columnWidth"
  223. :label="item.columnLabel">
  224. <template slot-scope="scope">
  225. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  226. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. prop=""
  231. header-align="center"
  232. align="center"
  233. min-width="80"
  234. label="子明细">
  235. <template slot-scope="scope">
  236. <el-button type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  237. </template>
  238. </el-table-column>
  239. <el-table-column
  240. prop=""
  241. header-align="center"
  242. align="right"
  243. min-width="80"
  244. label="不合格数量">
  245. <template slot-scope="scope">
  246. <el-input v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  247. <el-input v-if="detailData.submitFlag != 'Y'" v-model="scope.row.unqualifiedQuantity" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  248. </template>
  249. </el-table-column>
  250. <el-table-column
  251. prop=""
  252. header-align="center"
  253. align="right"
  254. min-width="75"
  255. label="项目检验结论">
  256. <template slot-scope="scope">
  257. <el-select v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
  258. <el-option label="合格" value="Y" style="color: green"></el-option>
  259. <el-option label="不合格" value="N" style="color: red"></el-option>
  260. </el-select>
  261. <el-select v-if="detailData.submitFlag != 'Y'" v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  262. <el-option label="合格" value="Y" style="color: green"></el-option>
  263. <el-option label="不合格" value="N" style="color: red"></el-option>
  264. </el-select>
  265. </template>
  266. </el-table-column>
  267. </el-table>
  268. </div>
  269. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  270. <el-button type="primary" @click="Transfer()">保存</el-button>
  271. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  272. </el-footer>
  273. </el-dialog>
  274. <!-- 子明细信息 -->
  275. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="471px">
  276. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  277. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  278. <div class="rq ">
  279. <el-table
  280. :height="300"
  281. :data="tableData"
  282. border
  283. :row-class-name="rowClassName"
  284. @selection-change="handleDetailSelectionChange"
  285. style="width: 100%;">
  286. <el-table-column type="selection" align="center" width="50"></el-table-column>
  287. <el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
  288. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="抽样位置" width="150">
  289. <template slot-scope="{row}">
  290. <el-input v-if="tableData[row.xh-1].isSubmit==='Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置"></el-input>
  291. <el-input v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocation" placeholder="请输入抽样位置"></el-input>
  292. </template>
  293. </el-table-column>
  294. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="200">
  295. <template slot-scope="{row}">
  296. <el-input v-if="tableData[row.xh-1].isSubmit==='Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  297. <el-input v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].subDetailValue" placeholder="请输入实测值"></el-input>
  298. </template>
  299. </el-table-column>
  300. </el-table>
  301. </div>
  302. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  303. <el-button type="primary" @click="saveSubDetailResult()">保存</el-button>
  304. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  305. </el-footer>
  306. </el-dialog>
  307. <!-- 文件清单 -->
  308. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  309. <el-table
  310. :height="350"
  311. :data="fileContentList"
  312. border
  313. v-loading="dataListLoading"
  314. style="width: 100%; ">
  315. <el-table-column
  316. v-for="(item,index) in fileColumnList" :key="index"
  317. :sortable="item.columnSortable"
  318. :prop="item.columnProp"
  319. :header-align="item.headerAlign"
  320. :show-overflow-tooltip="item.showOverflowTooltip"
  321. :align="item.align"
  322. :fixed="item.fixed==''?false:item.fixed"
  323. :min-width="item.columnWidth"
  324. :label="item.columnLabel">
  325. <template slot-scope="scope">
  326. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  327. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  328. </template>
  329. </el-table-column>
  330. <el-table-column
  331. fixed="right"
  332. header-align="center"
  333. align="center"
  334. width="100"
  335. label="操作">
  336. <template slot-scope="scope">
  337. <a @click="downloadFile(scope.row)" >下载</a>
  338. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  339. </template>
  340. </el-table-column>
  341. </el-table>
  342. </el-dialog>
  343. <!-- 上传文件的modal -->
  344. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="getDataList()" v-drag></qcFAIUploadFile>
  345. </div>
  346. </template>
  347. <script>
  348. import {
  349. qcFAIInspectionSearch, // 查询FAI的检验记录
  350. faiDetailSearch, // 查询FAI的检验明细
  351. inspectorSearch, // 查询检验员
  352. faiRecordDelete, // 删除检验记录
  353. saveFAIDetailedRecord, // 新增明细信息
  354. saveFAISubmitResult, // 审核
  355. saveFAISubDetailed, // 新增子明细信息
  356. selectFAISubDetailedRecord, // 子明细记录信息查询
  357. checkFAIIsSubmit, // 检查是否已提交
  358. checkFAISubDetailValue // 检查子明细中的实测值是否在规定范围
  359. } from "@/api/qc/qc.js";
  360. import Chooselist from '@/views/modules/common/Chooselist_eam';
  361. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js';
  362. import {deleteObjectFile} from '@/api/eam/eam.js';
  363. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  364. import qcFAIUploadFile from "./qc_FAI_upload_file";
  365. import axios from 'axios'
  366. import Vue from 'vue'
  367. /*上传文件的組件*/
  368. export default {
  369. components: {
  370. Chooselist,
  371. qcFAIUploadFile
  372. },
  373. watch: {
  374. },
  375. data () {
  376. return {
  377. inspectionNo: '',
  378. fileFlag: false,
  379. fileContentList: [],
  380. // 是否收藏
  381. favorite: false,
  382. // 导出 start
  383. exportData: [],
  384. exportName: "FAI检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  385. exportHeader: ["FAI检验录入"],
  386. exportFooter: [],
  387. exportList:[],
  388. // 导出 end
  389. checkCompletedData:{
  390. inspectionNo: ''
  391. },
  392. submitData:{
  393. site: this.$store.state.user.site,
  394. inspectionNo: '',
  395. submit_flag: '',
  396. inspectionResult: '',
  397. submitList: [],
  398. },
  399. tagNo:'',
  400. searchData: {
  401. site: this.$store.state.user.site,
  402. inspectionNo: '',
  403. state: '',
  404. inspectionResult: '',
  405. orderNo: '',
  406. operationDesc: '',
  407. startDate: '',
  408. endDate: '',
  409. page: 1,
  410. limit: 10,
  411. },
  412. pageIndex: 1,
  413. pageSize: 20,
  414. totalPage: 0,
  415. height: 200,
  416. dataList: [],
  417. dataListLoading: false,
  418. dataListSelections: [],
  419. modalData: {
  420. flag:'',
  421. site: this.$store.state.user.site,
  422. inspectionNo:'',
  423. partNo: '',
  424. partDesc: '',
  425. inspectionTypeNo:'102',
  426. inspectionTypeName:'FAI',
  427. inspectorNo:'',
  428. inspectorName:'',
  429. submit_flag:'',
  430. },
  431. // 展示列集
  432. columnList: [
  433. {
  434. columnProp: 'inspectionNo',
  435. headerAlign: "center",
  436. align: "center",
  437. columnLabel: '检验单号',
  438. columnHidden: false,
  439. columnImage: false,
  440. columnSortable: false,
  441. sortLv: 0,
  442. status: true,
  443. fixed: '',
  444. },
  445. {
  446. columnProp: 'inspectionResult',
  447. headerAlign: "center",
  448. align: "center",
  449. columnLabel: '检验结论',
  450. columnHidden: false,
  451. columnImage: false,
  452. columnSortable: false,
  453. sortLv: 0,
  454. status: true,
  455. fixed: '',
  456. },
  457. {
  458. columnProp: 'disposalMeasures',
  459. headerAlign: "center",
  460. align: "center",
  461. columnLabel: '处置措施',
  462. columnHidden: false,
  463. columnImage: false,
  464. columnSortable: false,
  465. sortLv: 0,
  466. status: true,
  467. fixed: '',
  468. },
  469. {
  470. columnProp: 'taskDate',
  471. headerAlign: "center",
  472. align: "center",
  473. columnLabel: '任务生成日期',
  474. columnHidden: false,
  475. columnImage: false,
  476. columnSortable: false,
  477. sortLv: 0,
  478. status: true,
  479. fixed: '',
  480. },
  481. {
  482. columnProp: 'inspectionCycle',
  483. headerAlign: "center",
  484. align: "center",
  485. columnLabel: '检验周期(h)',
  486. columnHidden: false,
  487. columnImage: false,
  488. columnSortable: false,
  489. sortLv: 0,
  490. status: true,
  491. fixed: '',
  492. },
  493. {
  494. columnProp: 'orderNo',
  495. headerAlign: "center",
  496. align: "center",
  497. columnLabel: '工单号',
  498. columnHidden: false,
  499. columnImage: false,
  500. columnSortable: false,
  501. sortLv: 0,
  502. status: true,
  503. fixed: '',
  504. },
  505. {
  506. columnProp: 'operationDesc',
  507. headerAlign: "center",
  508. align: "center",
  509. columnLabel: '工序',
  510. columnHidden: false,
  511. columnImage: false,
  512. columnSortable: false,
  513. sortLv: 0,
  514. status: true,
  515. fixed: '',
  516. },
  517. {
  518. columnProp: 'resourceDesc',
  519. headerAlign: "center",
  520. align: "center",
  521. columnLabel: '机台',
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: '',
  528. },
  529. {
  530. columnProp: 'partNo',
  531. headerAlign: "center",
  532. align: "center",
  533. columnLabel: '物料编码',
  534. columnHidden: false,
  535. columnImage: false,
  536. columnSortable: false,
  537. sortLv: 0,
  538. status: true,
  539. fixed: '',
  540. },
  541. {
  542. columnProp: 'partDesc',
  543. headerAlign: "center",
  544. align: "center",
  545. columnLabel: '物料名称',
  546. columnHidden: false,
  547. columnImage: false,
  548. columnSortable: false,
  549. sortLv: 0,
  550. status: true,
  551. fixed: '',
  552. },
  553. {
  554. columnProp: 'rollQty',
  555. headerAlign: "center",
  556. align: "right",
  557. columnLabel: '送检数量',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. },
  565. {
  566. columnProp: 'samplingQty',
  567. headerAlign: "center",
  568. align: "right",
  569. columnLabel: '抽样数量',
  570. columnHidden: false,
  571. columnImage: false,
  572. columnSortable: false,
  573. sortLv: 0,
  574. status: true,
  575. fixed: '',
  576. },
  577. {
  578. columnProp: 'inspectionRemark',
  579. headerAlign: "center",
  580. align: "center",
  581. columnLabel: '质检备注',
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: '',
  588. },
  589. {
  590. columnProp: 'disposalRemark',
  591. headerAlign: "center",
  592. align: "center",
  593. columnLabel: '处置说明',
  594. columnHidden: false,
  595. columnImage: false,
  596. columnSortable: false,
  597. sortLv: 0,
  598. status: true,
  599. fixed: '',
  600. },
  601. {
  602. columnProp: 'inspectorDate',
  603. headerAlign: "center",
  604. align: "center",
  605. columnLabel: '检验时间',
  606. columnHidden: false,
  607. columnImage: false,
  608. columnSortable: false,
  609. sortLv: 0,
  610. status: true,
  611. fixed: '',
  612. },
  613. {
  614. columnProp: 'inspectorNo',
  615. headerAlign: "center",
  616. align: "center",
  617. columnLabel: '质检员',
  618. columnHidden: false,
  619. columnImage: false,
  620. columnSortable: false,
  621. sortLv: 0,
  622. status: true,
  623. fixed: '',
  624. },
  625. ],
  626. //项目清单
  627. detailData:{
  628. site: this.$store.state.user.site,
  629. inspectionNo:'',
  630. partNo:'',
  631. partDesc:'',
  632. rollQty:'',
  633. samplingQty: '',
  634. unqualifiedQty: 0,
  635. unqualifiedQuantity:'',
  636. disposalMeasures:'',
  637. disposalRemark: '',
  638. inspectionResult: '',
  639. inspectorNo: '',
  640. inspectionRemark: '',
  641. submitFlag: '',
  642. },
  643. detailInformationFlag:false,
  644. detailList:[],
  645. saveInformationData:{
  646. site: this.$store.state.user.site,
  647. inspectionNo:'',
  648. disposalMeasures: '',
  649. disposalRemark: '',
  650. inspectorNo: '',
  651. inspectionRemark: '',
  652. itemList:[],
  653. },
  654. detailColumnList: [
  655. {
  656. columnProp: 'itemDesc',
  657. headerAlign: "center",
  658. align: "center",
  659. columnLabel: '检验项目',
  660. columnHidden: false,
  661. columnImage: false,
  662. columnSortable: false,
  663. sortLv: 0,
  664. status: true,
  665. fixed: '',
  666. },
  667. {
  668. columnProp: 'samplingLevelDesc',
  669. headerAlign: "center",
  670. align: "center",
  671. columnLabel: '检验水平',
  672. columnHidden: false,
  673. columnImage: false,
  674. columnSortable: false,
  675. sortLv: 0,
  676. status: true,
  677. fixed: '',
  678. },
  679. {
  680. columnProp: 'samplingProgrammeDesc',
  681. headerAlign: "center",
  682. align: "center",
  683. columnLabel: '检验方案',
  684. columnHidden: false,
  685. columnImage: false,
  686. columnSortable: false,
  687. sortLv: 0,
  688. status: true,
  689. fixed: '',
  690. },
  691. {
  692. columnProp: 'objectDesc',
  693. headerAlign: "center",
  694. align: "center",
  695. columnLabel: '检测仪器',
  696. columnHidden: false,
  697. columnImage: false,
  698. columnSortable: false,
  699. sortLv: 0,
  700. status: true,
  701. fixed: '',
  702. },
  703. {
  704. columnProp: 'aql',
  705. headerAlign: "center",
  706. align: "center",
  707. columnLabel: 'AQL',
  708. columnHidden: false,
  709. columnImage: false,
  710. columnSortable: false,
  711. sortLv: 0,
  712. status: true,
  713. fixed: '',
  714. },
  715. {
  716. columnProp: 'ac',
  717. headerAlign: "center",
  718. align: "center",
  719. columnLabel: 'AC',
  720. columnHidden: false,
  721. columnImage: false,
  722. columnSortable: false,
  723. sortLv: 0,
  724. status: true,
  725. fixed: '',
  726. },
  727. {
  728. columnProp: 're',
  729. headerAlign: "center",
  730. align: "center",
  731. columnLabel: 'RE',
  732. columnHidden: false,
  733. columnImage: false,
  734. columnSortable: false,
  735. sortLv: 0,
  736. status: true,
  737. fixed: '',
  738. },
  739. {
  740. columnProp: 'defaultValue',
  741. headerAlign: "center",
  742. align: "center",
  743. columnLabel: '标准值',
  744. columnHidden: false,
  745. columnImage: false,
  746. columnSortable: false,
  747. sortLv: 0,
  748. status: true,
  749. fixed: '',
  750. },
  751. {
  752. columnProp: 'maxValue',
  753. headerAlign: "center",
  754. align: "center",
  755. columnLabel: '上限值',
  756. columnHidden: false,
  757. columnImage: false,
  758. columnSortable: false,
  759. sortLv: 0,
  760. status: true,
  761. fixed: '',
  762. },
  763. {
  764. columnProp: 'minValue',
  765. headerAlign: "center",
  766. align: "center",
  767. columnLabel: '下限值',
  768. columnHidden: false,
  769. columnImage: false,
  770. columnSortable: false,
  771. sortLv: 0,
  772. status: true,
  773. fixed: '',
  774. },
  775. {
  776. columnProp: 'valueType',
  777. headerAlign: "center",
  778. align: "center",
  779. columnLabel: '检测值类型',
  780. columnHidden: false,
  781. columnImage: false,
  782. columnSortable: false,
  783. sortLv: 0,
  784. status: true,
  785. fixed: '',
  786. },
  787. ],
  788. fileColumnList: [
  789. {
  790. columnProp: 'fileName',
  791. headerAlign: "center",
  792. align: "center",
  793. columnLabel: '文件名称',
  794. columnHidden: false,
  795. columnImage: false,
  796. columnSortable: false,
  797. sortLv: 0,
  798. status: true,
  799. fixed: '',
  800. },
  801. {
  802. columnProp: 'createdBy',
  803. headerAlign: "center",
  804. align: 'center',
  805. columnLabel: '上传人',
  806. columnHidden: false,
  807. columnImage: false,
  808. columnSortable: true,
  809. sortLv: 0,
  810. status: true,
  811. fixed: false
  812. },
  813. {
  814. columnProp: 'createDate',
  815. headerAlign: "center",
  816. align: 'center',
  817. columnLabel: '上传时间',
  818. columnHidden: false,
  819. columnImage: false,
  820. columnSortable: true,
  821. sortLv: 0,
  822. status: true,
  823. fixed: false
  824. },
  825. {
  826. columnProp: 'orderRef3',
  827. headerAlign: "center",
  828. align: 'center',
  829. columnLabel: '备注',
  830. columnHidden: false,
  831. columnImage: false,
  832. columnSortable: true,
  833. sortLv: 0,
  834. status: true,
  835. fixed: false
  836. },
  837. ],
  838. // 子明细数据对象
  839. tableData: [],
  840. checkedDetail: [],
  841. subDetailFlag: false,
  842. subDetailData: {
  843. site: this.$store.state.user.site,
  844. inspectionNo: '',
  845. itemNo: '',
  846. itemDesc: '',
  847. defaultValue: '',
  848. maxValue: '',
  849. minValue: '',
  850. subDetailValues:[]
  851. },
  852. options: [],
  853. FAISelections: [],
  854. }
  855. },
  856. mounted () {
  857. this.$nextTick(() => {
  858. this.height = window.innerHeight - 210
  859. })
  860. },
  861. created () {
  862. this.getDataList()
  863. this.favoriteIsOk()
  864. },
  865. methods: {
  866. selectFlag(){
  867. return true;
  868. },
  869. // 单机选中
  870. FAIClickRow(row){
  871. this.$refs.FAITable.toggleRowSelection(row);
  872. },
  873. // 复选
  874. selectionFAI(val){
  875. this.FAISelections = val
  876. },
  877. //刷新派设备文档的列表
  878. getFileContentData(row) {
  879. let currentData = {
  880. orderRef2: row.inspectionNo
  881. };
  882. getFileContentList(currentData).then(({data}) => {
  883. //区分请求成功和失败的状况
  884. if (data && data.code == 200) {
  885. this.fileContentList = data.rows;
  886. } else {
  887. this.fileContentList = [];
  888. }
  889. })
  890. this.fileFlag = true;
  891. },
  892. /*新增文件的modal*/
  893. addUploadFileModal(){
  894. let currentData = {
  895. site: this.$store.state.user.site,
  896. createBy: this.$store.state.user.name,
  897. inspectionNo: this.detailData.inspectionNo,
  898. remark: '',
  899. folder: 'qcFAI',
  900. };
  901. //打开组件 去做新增业务
  902. this.$nextTick(() => {
  903. this.$refs.qcFAIUploadFile.init(currentData);
  904. })
  905. },
  906. downloadFile(row){
  907. downLoadObjectFile(row)
  908. .then(({data}) => {
  909. // 不限制文件下载类型
  910. const blob = new Blob([data], {type: "application/octet-stream"})
  911. // 下载文件名称
  912. const fileName = row.fileName
  913. // a标签下载
  914. const linkNode = document.createElement('a')
  915. // a标签的download属性规定下载文件的名称
  916. linkNode.download = fileName
  917. linkNode.style.display = 'none'
  918. // 生成一个Blob URL
  919. linkNode.href = URL.createObjectURL(blob)
  920. document.body.appendChild(linkNode)
  921. // 模拟在按钮上的一次鼠标单击
  922. linkNode.click()
  923. // 释放URL 对象
  924. URL.revokeObjectURL(linkNode.href)
  925. document.body.removeChild(linkNode)
  926. })
  927. },
  928. // 删除文件
  929. deleteFile(row){
  930. this.$confirm('确定要删除此文件?', '提示', {
  931. confirmButtonText: '确定',
  932. cancelButtonText: '取消',
  933. type: 'warning'
  934. }).then(() => {
  935. deleteObjectFile(row).then(({data}) => {
  936. if (data && data.code === 0) {
  937. this.getFileContentData(row);
  938. this.$message({
  939. message: '操作成功',
  940. type: 'success',
  941. duration: 1500,
  942. onClose: () => {
  943. }
  944. })
  945. } else {
  946. this.$alert(data.msg, '错误', {
  947. confirmButtonText: '确定'
  948. })
  949. }
  950. })
  951. }).catch(() => {
  952. })
  953. },
  954. // 查询检验类型
  955. inspectorSearch(){
  956. inspectorSearch().then(({data}) => {
  957. if (data.code === 0) {
  958. this.options = data.rows
  959. }
  960. })
  961. },
  962. // 清空搜索栏
  963. doEmpty(){
  964. this.searchData = {
  965. site: this.$store.state.user.site,
  966. inspectionNo: '',
  967. state: '',
  968. inspectionResult: '',
  969. orderNo: '',
  970. operationDesc: '',
  971. startDate: '',
  972. endDate: '',
  973. page: 1,
  974. limit: 10,
  975. }
  976. },
  977. // 获取主信息数据列表
  978. getDataList () {
  979. this.searchData.limit = this.pageSize
  980. this.searchData.page = this.pageIndex
  981. qcFAIInspectionSearch(this.searchData).then(({data}) => {
  982. if (data.code === 0) {
  983. this.dataList = data.page.list
  984. this.pageIndex = data.page.currPage
  985. this.pageSize = data.page.pageSize
  986. this.totalPage = data.page.totalCount
  987. }
  988. this.dataListLoading = false
  989. })
  990. },
  991. // 每页数
  992. sizeChangeHandle (val) {
  993. this.pageSize = val
  994. this.pageIndex = 1
  995. this.getDataList()
  996. },
  997. // 当前页
  998. currentChangeHandle (val) {
  999. this.pageIndex = val
  1000. this.getDataList()
  1001. },
  1002. // 多选
  1003. selectionChangeHandle (val) {
  1004. this.dataListSelections = val
  1005. },
  1006. // 删除检验记录
  1007. deleteModal () {
  1008. if(this.FAISelections.length === 0){
  1009. this.$alert('请勾选要删除的检验单!', '提示', {
  1010. confirmButtonText: '确定'
  1011. })
  1012. return false
  1013. }
  1014. this.$confirm(`是否删除该 `+ this.FAISelections.length +` 条检验记录?`, '提示', {
  1015. confirmButtonText: '确定',
  1016. cancelButtonText: '取消',
  1017. type: 'warning'
  1018. }).then(() => {
  1019. let tempData = {
  1020. site: this.$store.state.user.site,
  1021. submitList: this.FAISelections
  1022. }
  1023. faiRecordDelete(tempData).then(({data}) => {
  1024. if (data && data.code === 0) {
  1025. this.getDataList()
  1026. this.FAISelections = []
  1027. this.$message({
  1028. message: '操作成功',
  1029. type: 'success',
  1030. duration: 1500,
  1031. onClose: () => {
  1032. }
  1033. })
  1034. } else {
  1035. this.$alert(data.msg, '错误', {
  1036. confirmButtonText: '确定'
  1037. })
  1038. }
  1039. })
  1040. }).catch(() => {
  1041. })
  1042. },
  1043. Transfer(){
  1044. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  1045. this.$alert('请选择检验结论!', '错误', {
  1046. confirmButtonText: '确定'
  1047. })
  1048. return false
  1049. }
  1050. if (this.detailData.inspectorNo === '' || this.detailData.inspectorNo == null) {
  1051. this.$alert('请选择检验员!', '错误', {
  1052. confirmButtonText: '确定'
  1053. })
  1054. return false
  1055. }
  1056. // if (this.detailData.inspectionResult == 'Y' && (this.detailData.disposalMeasures == '特采' || this.detailData.disposalMeasures == '拒收')) {
  1057. // this.$alert('合格不予处置措施,请查看!', '错误', {
  1058. // confirmButtonText: '确定'
  1059. // })
  1060. // return false
  1061. // }
  1062. for (let i = 0; i < this.detailList.length; i++) {
  1063. if(this.detailList[i].itemResult === '' || this.detailList[i].itemResult == null){
  1064. // this.$alert(this.detailList[i].itemDesc+'是否合格未确认!', '错误', {
  1065. // confirmButtonText: '确定'
  1066. // })
  1067. // return false
  1068. this.detailList[i].itemResult = 'Y'
  1069. }
  1070. if(this.detailList[i].valueTypeDb === 'N') {
  1071. checkFAISubDetailValue(this.detailList[i]).then(({data}) => {
  1072. if (data.flag == 2 && this.detailList[i].itemResult === 'Y') {
  1073. this.$confirm(this.detailList[i].itemDesc + ' 中实测值不在合格范围!是否保存为合格?', '提示', {
  1074. confirmButtonText: '确定',
  1075. cancelButtonText: '取消',
  1076. type: 'warning'
  1077. }).then(() => {
  1078. this.saveDetailInformation()
  1079. }).then(() => {
  1080. return false
  1081. })
  1082. }else {
  1083. this.saveDetailInformation()
  1084. }
  1085. })
  1086. }
  1087. }
  1088. this.$message({message: '操作成功', type: 'success', duration: 1500, onClose: () => {}})
  1089. },
  1090. // 新增明细信息
  1091. saveDetailInformation(){
  1092. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  1093. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  1094. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  1095. this.saveInformationData.inspectorNo = this.detailData.inspectorNo
  1096. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  1097. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  1098. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  1099. saveFAIDetailedRecord(this.saveInformationData).then(({data}) => {
  1100. if (data && data.code == '0') {
  1101. this.getDataList()
  1102. this.detailInformationFlag = false
  1103. } else {
  1104. this.$alert(data.msg, '错误', {
  1105. confirmButtonText: '确定'
  1106. })
  1107. }
  1108. })
  1109. },
  1110. // 明细记录信息查询
  1111. detailModal(row){
  1112. this.detailData.site = this.$store.state.user.site,
  1113. this.detailData.inspectionNo = row.inspectionNo
  1114. this.detailData.partNo = row.partNo
  1115. this.detailData.partDesc = row.partDesc
  1116. this.detailData.rollQty = row.rollQty
  1117. this.detailData.samplingQty = row.samplingQty
  1118. this.detailData.unqualifiedQty = row.unqualifiedQty
  1119. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  1120. this.detailData.submitFlag = row.submitFlag
  1121. this.detailData.disposalMeasures = row.disposalMeasures
  1122. this.detailData.disposalRemark = row.disposalRemark
  1123. this.detailData.inspectionResult = row.inspectionResult
  1124. this.detailData.inspectorNo = row.inspectorNo
  1125. this.detailData.inspectionRemark = row.inspectionRemark
  1126. faiDetailSearch(this.detailData).then(({data}) => {
  1127. this.detailList = data.rows
  1128. })
  1129. this.inspectorSearch();
  1130. this.detailInformationFlag = true;
  1131. },
  1132. // 子明细记录信息查询
  1133. subDetailModal(row){
  1134. this.subDetailData.inspectionNo = row.inspectionNo;
  1135. this.subDetailData.itemNo = row.itemNo;
  1136. this.subDetailData.itemDesc = row.itemDesc;
  1137. this.subDetailData.defaultValue = row.defaultValue;
  1138. this.subDetailData.maxValue = row.maxValue;
  1139. this.subDetailData.minValue = row.minValue;
  1140. selectFAISubDetailedRecord(this.subDetailData).then(({data}) => {
  1141. this.tableData = data.rows
  1142. })
  1143. this.subDetailFlag = true;
  1144. },
  1145. // 审核按钮
  1146. submitResult(){
  1147. let tempData1 = '' // 记录不是待审核状态的单号
  1148. let tempData2 = '' // 记录处置措施未填写的单号
  1149. if(this.FAISelections.length == 0){
  1150. this.$alert('请勾选要审核的检验单!', '提示', {
  1151. confirmButtonText: '确定'
  1152. })
  1153. return false
  1154. }
  1155. for (let i = 0; i < this.FAISelections.length; i++) {
  1156. if (this.FAISelections[i].state != '待审核'){
  1157. tempData1 = tempData1 + this.FAISelections[i].inspectionNo + '、'
  1158. }
  1159. if (this.FAISelections[i].inspectionResult == '不合格' && (this.FAISelections[i].disposalMeasures == '' || this.FAISelections[i].disposalMeasures == null)){
  1160. tempData2 = tempData2 + this.FAISelections[i].inspectionNo + '、'
  1161. }
  1162. }
  1163. if (tempData1 != ''){
  1164. tempData1 = tempData1.substring(0, tempData1.length - 1)
  1165. this.$alert('检验单号 ' + tempData1 + ' 不是待审核状态!', '提示', {
  1166. confirmButtonText: '确定'
  1167. })
  1168. return false
  1169. }
  1170. if (tempData2 != ''){
  1171. tempData2 = tempData2.substring(0, tempData2.length - 1)
  1172. this.$alert('检验单号 ' + tempData2 + ' 的处置措施未选择!', '提示', {
  1173. confirmButtonText: '确定'
  1174. })
  1175. return false
  1176. }
  1177. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.FAISelections.length + ` 条记录`, '提示', {
  1178. confirmButtonText: '确定',
  1179. cancelButtonText: '取消',
  1180. type: 'warning'
  1181. }).then(() => {
  1182. this.submitData.submitList = this.FAISelections
  1183. saveFAISubmitResult(this.submitData).then(({data}) => {
  1184. if (data && data.code ==0) {
  1185. this.getDataList()
  1186. this.FAISelections = []
  1187. this.$message({
  1188. message: '操作成功',
  1189. type: 'success',
  1190. duration: 1500,
  1191. onClose: () => {
  1192. }
  1193. })
  1194. } else {
  1195. this.$alert(data.msg, '错误', {
  1196. confirmButtonText: '确定'
  1197. })
  1198. }
  1199. })
  1200. }).catch(() => {
  1201. })
  1202. },
  1203. // 子明细方法
  1204. //表格的新增
  1205. rowClassName({ row, rowIndex }) {
  1206. row.xh = rowIndex + 1;
  1207. },
  1208. //单选框选中数据
  1209. handleDetailSelectionChange(selection) {
  1210. this.checkedDetail = selection;
  1211. },
  1212. //点击新增更多
  1213. handleAddBtn(td) {
  1214. checkFAIIsSubmit(td).then(({data}) => {
  1215. if (data.flag != 1) {
  1216. let obj = {};
  1217. obj.subDetailValue = "";
  1218. obj.samplingLocation = "";
  1219. this.tableData.push(obj);
  1220. console.log(this.tableData)
  1221. } else {
  1222. this.$alert("记录已提交!", '错误', {
  1223. confirmButtonText: '确定'
  1224. })
  1225. }
  1226. })
  1227. },
  1228. //删除
  1229. handleDeleteBtn(td) {
  1230. checkFAIIsSubmit(td).then(({data}) => {
  1231. if (data.flag != 1) {
  1232. if (this.checkedDetail.length == 0) {
  1233. this.$alert("请先选择要删除的数据", "提示", {
  1234. confirmButtonText: "确定",
  1235. });
  1236. } else {
  1237. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  1238. confirmButtonText: "确定",
  1239. cancelButtonText: "取消",
  1240. type: "warning",
  1241. callback: (action) => {
  1242. if (action === "confirm") {
  1243. let val = this.checkedDetail;
  1244. val.forEach((val, index) => {
  1245. this.tableData.forEach((v, i) => {
  1246. if (val.xh === v.xh) {
  1247. this.tableData.splice(i, 1);
  1248. }
  1249. });
  1250. });
  1251. this.$message({
  1252. message: "删除成功,记得保存修改喔!",
  1253. type: "success",
  1254. });
  1255. //this.$refs.tb.clearSelection();
  1256. return;
  1257. } else {
  1258. this.$message({
  1259. message: "已取消删除操作",
  1260. type: "warning",
  1261. });
  1262. return;
  1263. }
  1264. },
  1265. });
  1266. }
  1267. } else {
  1268. this.$alert("记录已提交!", '错误', {
  1269. confirmButtonText: '确定'
  1270. })
  1271. }
  1272. })
  1273. },
  1274. // 新增子明细记录
  1275. saveSubDetailResult(){
  1276. for (let i = 0; i < this.tableData.length; i++) {
  1277. if(this.tableData[i].subDetailValue == '' || this.tableData[i].subDetailValue == null){
  1278. this.$alert('序号' + (i+1) +'未填写实测值!', '错误', {
  1279. confirmButtonText: '确定'
  1280. })
  1281. return false
  1282. }
  1283. }
  1284. this.subDetailData.subDetailValues = this.tableData
  1285. saveFAISubDetailed(this.subDetailData).then(({data}) => {
  1286. if (data && data.code === 0) {
  1287. this.getDataList()
  1288. this.subDetailFlag = false
  1289. this.tableData = []
  1290. this.$message({
  1291. message: '操作成功',
  1292. type: 'success',
  1293. duration: 1500,
  1294. onClose: () => {
  1295. }
  1296. })
  1297. } else {
  1298. this.$alert(data.msg, '错误', {
  1299. confirmButtonText: '确定'
  1300. })
  1301. }
  1302. })
  1303. },
  1304. // 校验用户是否收藏
  1305. favoriteIsOk() {
  1306. let userFavorite = {
  1307. userId: this.$store.state.user.id,
  1308. languageCode: this.$i18n.locale
  1309. }
  1310. console.log(this.$route.meta.menuId)
  1311. userFavoriteList(userFavorite).then(({data}) => {
  1312. for (let i = 0; i < data.list.length; i++) {
  1313. // let flag=false;
  1314. if(this.$route.meta.menuId==data.list[i].menuId){
  1315. this.favorite = true
  1316. // flag=true;
  1317. }
  1318. }
  1319. })
  1320. },
  1321. // 收藏 OR 取消收藏
  1322. favoriteFunction() {
  1323. let userFavorite = {
  1324. userId: this.$store.state.user.id,
  1325. functionId: this.$route.meta.menuId,
  1326. }
  1327. if (this.favorite) {
  1328. // 取消收藏
  1329. // this.$confirm(`确定取消收藏`, '提示', {
  1330. // confirmButtonText: '确定',
  1331. // cancelButtonText: '取消',
  1332. // type: 'warning'
  1333. // }).then(() => {
  1334. removeUserFavorite(userFavorite).then(({data}) => {
  1335. this.$message.success(data.msg)
  1336. this.favorite = false
  1337. })
  1338. // })
  1339. } else {
  1340. // 收藏
  1341. saveUserFavorite(userFavorite).then(({data}) => {
  1342. this.$message.success(data.msg)
  1343. this.favorite = true
  1344. })
  1345. }
  1346. },
  1347. //导出excel
  1348. async createExportData() {
  1349. this.searchData.limit = -1
  1350. this.searchData.page = 1
  1351. await qcFAIInspectionSearch(this.searchData).then(({data}) => {
  1352. this.exportList= data.page.list;
  1353. })
  1354. return this.exportList;
  1355. },
  1356. startDownload() {
  1357. // this.exportData = this.dataList
  1358. },
  1359. finishDownload() {
  1360. },
  1361. fields() {
  1362. let json = "{"
  1363. this.columnList.forEach((item, index) => {
  1364. if (index == this.columnList.length - 1) {
  1365. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1366. } else {
  1367. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1368. }
  1369. })
  1370. json += "}"
  1371. let s = eval("(" + json + ")")
  1372. return s
  1373. },
  1374. // 导出 end
  1375. }
  1376. }
  1377. </script>
  1378. <style scoped>
  1379. </style>