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.

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