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.

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