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.

2706 lines
95 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
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 columnList1" :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 label="标签号">
  136. <!-- <el-autocomplete v-if="this.modalData.specialTaskFlag === 'Y'" disabled style="width: 456px" size="mini" v-model="modalData.rollNo" clearable-->
  137. <!-- :fetch-suggestions="querySearchAsync" @select="handleSelect"-->
  138. <!-- placeholder="请输入标签号">-->
  139. <!-- </el-autocomplete>-->
  140. <!-- <el-autocomplete v-if="this.modalData.specialTaskFlag !== 'Y'" style="width: 456px" size="mini" v-model="modalData.rollNo" clearable-->
  141. <!-- :fetch-suggestions="querySearchAsync" @select="handleSelect"-->
  142. <!-- placeholder="请输入标签号">-->
  143. <!-- </el-autocomplete>-->
  144. <el-input v-if="this.modalData.specialTaskFlag === 'Y'" disabled v-model="modalData.rollNo" style="width: 456px"></el-input>
  145. <el-input v-if="this.modalData.specialTaskFlag !== 'Y'" v-model="modalData.rollNo" @keyup.native.enter="rollNoEnter" clearable style="width: 456px"></el-input>
  146. </el-form-item>
  147. </el-form>
  148. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  149. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && (this.modalData.rollNo == '' || this.modalData.rollNo == null)" prop="orderNo" :rules="rules.seqNoType">
  150. <span slot="label" @click="getBaseList(1052)"><a herf="#">派工单号</a></span>
  151. <el-input v-model="modalData.seqNo" style="width: 221px"></el-input>
  152. </el-form-item>
  153. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && this.modalData.rollNo != '' && this.modalData.rollNo != null" prop="orderNo" :rules="rules.seqNoType">
  154. <span slot="label">派工单号</span>
  155. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  156. </el-form-item>
  157. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" prop="orderNo" :rules="rules.seqNoType">
  158. <span slot="label">派工单号</span>
  159. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  160. </el-form-item>
  161. <el-form-item label="工单号" prop="orderNo" :rules="rules.orderNoType">
  162. <el-input v-model="modalData.orderNo" style="width: 221px" disabled></el-input>
  163. </el-form-item>
  164. </el-form>
  165. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  166. <el-form-item label="工序" prop="operationDesc" :rules="rules.operationDescType">
  167. <el-select v-model="modalData.operationDesc" placeholder="请选择" style="width: 221px">
  168. <el-option
  169. v-for = "i in operationList"
  170. :key = "i.operationNo"
  171. :label = "i.operationDesc"
  172. :value = "i.operationDesc">
  173. </el-option>
  174. </el-select>
  175. </el-form-item>
  176. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y'" label="机台" prop="resourceId" :rules="rules.resourceIdType">
  177. <!-- <el-select v-model="modalData.resourceDesc" placeholder="请选择" style="width: 221px">-->
  178. <!-- <el-option-->
  179. <!-- v-for = "i in resourceList"-->
  180. <!-- :key = "i.resourceId"-->
  181. <!-- :label = "i.resourceDesc"-->
  182. <!-- :value = "i.resourceId">-->
  183. <!-- </el-option>-->
  184. <!-- </el-select>-->
  185. <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>
  186. </el-form-item>
  187. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'">
  188. <span slot="label" @click="getBaseList(205)"><a herf="#">机台</a></span>
  189. <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>
  190. </el-form-item>
  191. </el-form>
  192. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  193. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y'" label="物料编码" prop="partNo" :rules="rules.partNoType">
  194. <el-input v-model="modalData.partNo" readonly style="width: 221px"></el-input>
  195. </el-form-item>
  196. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" :model="modalData">
  197. <span slot="label" @click="queryPartList()"><a herf="#">物料编码</a></span>
  198. <el-input v-model="modalData.partNo" style="width: 221px"></el-input>
  199. </el-form-item>
  200. <el-form-item label="物料名称">
  201. <el-input v-model="modalData.partDesc" readonly style="width: 221px"></el-input>
  202. </el-form-item>
  203. </el-form>
  204. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  205. <el-form-item label="物料类别">
  206. <el-input v-model="modalData.spec" readonly style="width: 221px"></el-input>
  207. </el-form-item>
  208. <el-form-item label="SKU">
  209. <el-input v-model="modalData.sku" readonly style="width: 221px"></el-input>
  210. </el-form-item>
  211. </el-form>
  212. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  213. <el-form-item>
  214. <span v-if="this.controlData.baseData === '控制'" slot="label" @click="queryTemplateList()"><a>检验模板</a></span>
  215. <span v-if="this.controlData.baseData === '未控制'" slot="label">检验模板</span>
  216. <el-input v-model="modalData.templateName" disabled style="width: 221px"></el-input>
  217. </el-form-item>
  218. <el-form-item label="送检数量:" prop="rollQty" :rules="rules.rollQtyType">
  219. <el-input v-model="modalData.rollQty" type="number" style="width: 103px"></el-input>
  220. </el-form-item>
  221. <el-form-item label="单位" prop="umId" :rules="rules.umIdType">
  222. <el-select v-model="modalData.umId" placeholder="请选择" style="width: 103px">
  223. <el-option
  224. v-for = "i in umList"
  225. :key = "i.umId"
  226. :label = "i.umName"
  227. :value = "i.umId">
  228. </el-option>
  229. </el-select>
  230. </el-form-item>
  231. </el-form>
  232. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  233. <el-form-item label="老卷号">
  234. <el-input v-model="modalData.batchRollNo" style="width: 221px"></el-input>
  235. </el-form-item>
  236. <el-form-item label="无工单检验">
  237. <input type="checkbox" name="specialTask" v-model="checked" @click="changeSpecialTask()"/>
  238. </el-form-item>
  239. </el-form>
  240. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  241. <el-form-item label="特殊要求">
  242. <el-input type="textarea" v-model="modalData.specialRequirements" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 456px;height: 30px"></el-input>
  243. </el-form-item>
  244. </el-form>
  245. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  246. <el-button type="primary" @click="saveData()">保存</el-button>
  247. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  248. </el-footer>
  249. </el-dialog>
  250. <!-- 检验单详情页 -->
  251. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag :visible.sync="detailInformationFlag" width="1200px">
  252. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  253. <el-form-item :label="'物料编码'">
  254. <el-input v-model="detailData.partNo" readonly style="width: 100px"></el-input>
  255. </el-form-item>
  256. <el-form-item :label="'物料类别'">
  257. <el-input v-model="detailData.spec" readonly style="width: 200px"></el-input>
  258. </el-form-item>
  259. <el-form-item :label="'PN'">
  260. <el-input v-model="detailData.cinvSourceCode" readonly style="width: 100px"></el-input>
  261. </el-form-item>
  262. <el-form-item :label="'SKU'">
  263. <el-input v-model="detailData.sku" readonly style="width: 100px"></el-input>
  264. </el-form-item>
  265. <el-form-item :label="'物料名称'">
  266. <el-input v-model="detailData.partDesc" readonly style="width: 200px"></el-input>
  267. </el-form-item>
  268. <el-form-item :label="'送检数量'">
  269. <el-input v-model="detailData.rollQty" type="number" style="width: 80px"></el-input>
  270. </el-form-item>
  271. <el-form-item :label="'抽样数量'">
  272. <el-input v-model="detailData.samplingQty" type="number" style="width: 80px"></el-input>
  273. </el-form-item>
  274. <el-form-item :label="'单位'">
  275. <el-input v-model="detailData.umName" readonly style="width: 80px"></el-input>
  276. </el-form-item>
  277. </el-form>
  278. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList()">
  279. <el-form-item :label="'不合格项目数量'">
  280. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
  281. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
  282. </el-form-item>
  283. <el-form-item :label="'处置措施'">
  284. <el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
  285. <el-option
  286. v-for = "i in disposalMeasuresOptions"
  287. :key = "i.id"
  288. :label = "i.disposalMeasures"
  289. :value = "i.disposalMeasures">
  290. </el-option>
  291. </el-select>
  292. <el-select v-if="detailData.submitFlag != 'Y'" clearable v-model="detailData.disposalMeasures" style="width: 100px">
  293. <el-option
  294. v-for = "i in disposalMeasuresOptions"
  295. :key = "i.id"
  296. :label = "i.disposalMeasures"
  297. :value = "i.disposalMeasures">
  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.disposalRemark" disabled style="width: 200px"></el-input>
  303. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.disposalRemark" style="width: 200px"></el-input>
  304. </el-form-item>
  305. <el-form-item :label="'检验结论'">
  306. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  307. <el-option label="合格" value="合格"></el-option>
  308. <el-option label="不合格" value="不合格"></el-option>
  309. </el-select>
  310. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionResult" style="width: 100px" placeholder="请选择">
  311. <el-option label="合格" value="合格"></el-option>
  312. <el-option label="不合格" value="不合格"></el-option>
  313. </el-select>
  314. </el-form-item>
  315. <el-form-item label="检验员">
  316. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  317. <el-option
  318. v-for = "i in options"
  319. :key = "i.inspectorNo"
  320. :label = "i.inspectorName"
  321. :value = "i.inspectorNo">
  322. </el-option>
  323. </el-select>
  324. <el-select v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  325. <el-option
  326. v-for = "i in options"
  327. :key = "i.inspectorNo"
  328. :label = "i.inspectorName"
  329. :value = "i.inspectorNo">
  330. </el-option>
  331. </el-select>
  332. </el-form-item>
  333. <el-form-item :label="'质检备注'">
  334. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 300px"></el-input>
  335. <el-input v-if="detailData.submitFlag != 'Y'" v-model="detailData.inspectionRemark" style="width: 300px"></el-input>
  336. </el-form-item>
  337. <el-form-item :label="' '">
  338. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  339. </el-form-item>
  340. <el-form-item :label="' '"></el-form-item>
  341. </el-form>
  342. <!-- 展示列表 -->
  343. <div class="rq ">
  344. <el-table
  345. :height="500"
  346. :data="detailList"
  347. border
  348. v-loading="dataListLoading"
  349. style="width: 100%;">
  350. <el-table-column
  351. prop=""
  352. header-align="center"
  353. align="center"
  354. min-width="40"
  355. label="操作">
  356. <template slot-scope="scope">
  357. <el-button class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  358. </template>
  359. </el-table-column>
  360. <el-table-column
  361. v-for="(item,index) in detailColumnList" :key="index"
  362. :sortable="item.columnSortable"
  363. :prop="item.columnProp"
  364. :header-align="item.headerAlign"
  365. :show-overflow-tooltip="item.showOverflowTooltip"
  366. :align="item.align"
  367. :fixed="item.fixed==''?false:item.fixed"
  368. :min-width="item.columnWidth"
  369. :label="item.columnLabel">
  370. <template slot-scope="scope">
  371. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  372. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  373. </template>
  374. </el-table-column>
  375. <el-table-column
  376. prop=""
  377. header-align="center"
  378. align="center"
  379. min-width="80"
  380. label="子明细">
  381. <template slot-scope="scope">
  382. <el-button v-if="scope.row.subDetailRecordNum <= 0" type="primary" @click="subDetailModal(scope.row) ">点击输入</el-button>
  383. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row) ">点击输入</el-button>
  384. </template>
  385. </el-table-column>
  386. <el-table-column
  387. prop=""
  388. header-align="center"
  389. align="right"
  390. min-width="80"
  391. label="抽样数量">
  392. <template slot-scope="scope">
  393. <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>
  394. <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>
  395. </template>
  396. </el-table-column>
  397. <el-table-column
  398. prop=""
  399. header-align="center"
  400. align="right"
  401. min-width="80"
  402. label="不合格数量">
  403. <template slot-scope="scope">
  404. <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>
  405. <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>
  406. </template>
  407. </el-table-column>
  408. <el-table-column
  409. prop=""
  410. header-align="center"
  411. align="right"
  412. min-width="75"
  413. label="项目检验结论">
  414. <template slot-scope="scope">
  415. <el-select v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px" >
  416. <el-option label="合格" value="Y" style="color: green"></el-option>
  417. <el-option label="不合格" value="N" style="color: red"></el-option>
  418. </el-select>
  419. <el-select v-if="detailData.submitFlag != 'Y'" v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  420. <el-option label="合格" value="Y" style="color: green"></el-option>
  421. <el-option label="不合格" value="N" style="color: red"></el-option>
  422. </el-select>
  423. </template>
  424. </el-table-column>
  425. </el-table>
  426. </div>
  427. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  428. <el-button type="primary" @click="Transfer()">保存</el-button>
  429. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  430. </el-footer>
  431. </el-dialog>
  432. <!-- 子明细信息 -->
  433. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="572px">
  434. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  435. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  436. <el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
  437. <div class="rq ">
  438. <el-table
  439. :height="400"
  440. :data="tableData"
  441. border
  442. :row-class-name="rowClassName"
  443. @selection-change="handleDetailSelectionChange"
  444. style="width: 100%;">
  445. <el-table-column type="selection" align="center" width="50"></el-table-column>
  446. <el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
  447. <el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150">
  448. <template slot-scope="{row}">
  449. <el-input v-if="tableData[row.xh-1].isSubmit==='Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
  450. <el-input :ref="`${row.xh-1}` + `a`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
  451. </template>
  452. </el-table-column>
  453. <el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150">
  454. <template slot-scope="{row}">
  455. <el-input v-if="tableData[row.xh-1].isSubmit==='Y'" v-model="tableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
  456. <el-input :ref="`${row.xh-1}` + `b`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
  457. </template>
  458. </el-table-column>
  459. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="200">
  460. <template slot-scope="{row}">
  461. <el-input v-if="tableData[row.xh-1].isSubmit==='Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  462. <el-input :ref="`${row.xh-1}` + `c`" v-if="tableData[row.xh-1].isSubmit!='Y'" v-model="tableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值"></el-input>
  463. </template>
  464. </el-table-column>
  465. </el-table>
  466. </div>
  467. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  468. <el-button type="primary" @click="saveSubDetailResult()">保存</el-button>
  469. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  470. </el-footer>
  471. </el-dialog>
  472. <!-- 批量新增子明细操作-->
  473. <el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
  474. <el-form :inline="true" label-position="top">
  475. <el-form-item :label="'默认抽样位置A'">
  476. <el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
  477. </el-form-item>
  478. <el-form-item :label="'默认抽样位置B'">
  479. <el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
  480. </el-form-item>
  481. <el-form-item :label="'抽样数量'">
  482. <el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
  483. </el-form-item>
  484. </el-form>
  485. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  486. <el-button type="primary" @click="batchHandleAddModal()">保存</el-button>
  487. <el-button type="primary" @click="batchHandleAddModalFlag=false">关闭</el-button>
  488. </el-footer>
  489. </el-dialog>
  490. <!-- 检验模板 -->
  491. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="templateModelFlag" width="520px">
  492. <div class="rq">
  493. <el-form :inline="true" label-position="top" :model="templateData">
  494. <el-form-item :label="'模板编码'">
  495. <el-input v-model="templateData.templateId" clearable style="width: 120px"></el-input>
  496. </el-form-item>
  497. <el-form-item :label="'模板名称'">
  498. <el-input v-model="templateData.templateName" clearable style="width: 120px"></el-input>
  499. </el-form-item>
  500. <el-form-item :label="'检验类型'">
  501. <el-select v-model="templateData.inspectionTypeNo" style="width: 100px">
  502. <el-option
  503. v-for = "i in typeOptions"
  504. :key = "i.inspectionTypeNo"
  505. :label = "i.inspectionTypeName"
  506. :value = "i.inspectionTypeNo">
  507. </el-option>
  508. </el-select>
  509. </el-form-item>
  510. <el-form-item :label="' '">
  511. <el-button type="primary" @click="queryTemplateList()">查询</el-button>
  512. </el-form-item>
  513. </el-form>
  514. <el-table
  515. :height="300"
  516. :data="templateList"
  517. @row-dblclick="getRowData"
  518. border
  519. v-loading="dataListLoading"
  520. style="width: 100%;">
  521. <el-table-column
  522. v-for="(item,index) in templateDetailList" :key="index"
  523. :sortable="item.columnSortable"
  524. :prop="item.columnProp"
  525. :header-align="item.headerAlign"
  526. :show-overflow-tooltip="item.showOverflowTooltip"
  527. :align="item.align"
  528. :fixed="item.fixed==''?false:item.fixed"
  529. :min-width="item.columnWidth"
  530. :label="item.columnLabel">
  531. <template slot-scope="scope">
  532. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  533. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  534. </template>
  535. </el-table-column>
  536. </el-table>
  537. </div>
  538. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  539. <el-button type="primary" @click="templateModelFlag=false">关闭</el-button>
  540. </el-footer>
  541. </el-dialog>
  542. <!-- 物料 -->
  543. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="520px">
  544. <div class="rq">
  545. <el-form :inline="true" label-position="top" :model="partData">
  546. <el-form-item :label="'物料编码'">
  547. <el-input v-model="partData.partNo" clearable style="width: 120px"></el-input>
  548. </el-form-item>
  549. <el-form-item :label="'物料名称'">
  550. <el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
  551. </el-form-item>
  552. <el-form-item :label="'SKU'">
  553. <el-input v-model="partData.sku" clearable style="width: 120px"></el-input>
  554. </el-form-item>
  555. <el-form-item :label="' '">
  556. <el-button type="primary" @click="queryPartList()">查询</el-button>
  557. </el-form-item>
  558. </el-form>
  559. <el-table
  560. :height="300"
  561. :data="partList"
  562. @row-dblclick="getRowData2"
  563. border
  564. v-loading="dataListLoading"
  565. style="width: 100%;">
  566. <el-table-column
  567. v-for="(item,index) in partDetailList" :key="index"
  568. :sortable="item.columnSortable"
  569. :prop="item.columnProp"
  570. :header-align="item.headerAlign"
  571. :show-overflow-tooltip="item.showOverflowTooltip"
  572. :align="item.align"
  573. :fixed="item.fixed==''?false:item.fixed"
  574. :min-width="item.columnWidth"
  575. :label="item.columnLabel">
  576. <template slot-scope="scope">
  577. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  578. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  579. </template>
  580. </el-table-column>
  581. </el-table>
  582. </div>
  583. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  584. <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
  585. </el-footer>
  586. </el-dialog>
  587. <!-- 文件清单 -->
  588. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  589. <el-table
  590. :height="350"
  591. :data="fileContentList"
  592. border
  593. v-loading="dataListLoading"
  594. style="width: 100%; ">
  595. <el-table-column
  596. v-for="(item,index) in fileColumnList" :key="index"
  597. :sortable="item.columnSortable"
  598. :prop="item.columnProp"
  599. :header-align="item.headerAlign"
  600. :show-overflow-tooltip="item.showOverflowTooltip"
  601. :align="item.align"
  602. :fixed="item.fixed==''?false:item.fixed"
  603. :min-width="item.columnWidth"
  604. :label="item.columnLabel">
  605. <template slot-scope="scope">
  606. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  607. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  608. </template>
  609. </el-table-column>
  610. <el-table-column
  611. fixed="right"
  612. header-align="center"
  613. align="center"
  614. width="100"
  615. label="操作">
  616. <template slot-scope="scope">
  617. <a @click="downloadFile(scope.row)">下载</a>
  618. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  619. </template>
  620. </el-table-column>
  621. </el-table>
  622. </el-dialog>
  623. <!-- chooseList模态框 -->
  624. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  625. <!-- 上传文件的modal -->
  626. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="getDataList()" v-drag></qcFAIUploadFile>
  627. <!-- 上传文件的modal -->
  628. <comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData()" v-drag></comQcItemImageUploadFile>
  629. </div>
  630. </template>
  631. <script>
  632. import {
  633. qcFAIInspectionSearch, // 查询FAI的检验记录
  634. faiDetailSearch, // 查询FAI的检验明细
  635. inspectorSearch, // 查询检验员
  636. faiRecordDelete, // 删除检验记录
  637. saveFAIDetailedRecord, // 新增明细信息
  638. saveFAISubmitResult, // 审核
  639. saveFAISubDetailed, // 新增子明细信息
  640. selectFAISubDetailedRecord, // 子明细记录信息查询
  641. checkFAIIsSubmit, // 检查是否已提交
  642. getResourceList, // 查询机台列表
  643. getOperationList, // 查询工序列表
  644. getPartList, // 查询物料列表
  645. saveFAIInspection, // 新增FAI检验
  646. queryController, // 检查动控
  647. queryTemplateList, // 获取检验模板列表
  648. getPartInformation, // 获取物料信息
  649. getSpecialOperationList, // 获取特殊工序列表
  650. inspectionTypeSearch, // 搜索所有检验类型
  651. disposalMeasuresSearch, // 获取处置措施列表
  652. getRollNo, // 模糊查询标签号
  653. rollNoEnter, // 标签号回车事件
  654. queryPartList, // 查询物料集合
  655. umSearch // 查询单位列表
  656. } from "@/api/qc/qc.js";
  657. import {
  658. getTableDefaultListLanguage,
  659. getTableUserListLanguage,
  660. } from "@/api/table.js"
  661. import Chooselist from '@/views/modules/common/Chooselist_eam';
  662. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js';
  663. import {deleteObjectFile} from '@/api/eam/eam.js';
  664. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  665. import qcFAIUploadFile from "./qc_FAI_upload_file";
  666. import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file";
  667. /*上传文件的組件*/
  668. export default {
  669. components: {
  670. Chooselist,
  671. qcFAIUploadFile,
  672. comQcItemImageUploadFile
  673. },
  674. data () {
  675. return {
  676. inspectionNo: '',
  677. fileFlag: false,
  678. fileContentList: [],
  679. // 是否收藏
  680. favorite: false,
  681. // 导出 start
  682. exportData: [],
  683. exportName: "FAI检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  684. exportHeader: ["FAI检验录入"],
  685. exportFooter: [],
  686. exportList:[],
  687. // 导出 end
  688. checkCompletedData:{
  689. inspectionNo: ''
  690. },
  691. submitData:{
  692. site: this.$store.state.user.site,
  693. inspectionNo: '',
  694. submit_flag: '',
  695. inspectionResult: '',
  696. submitList: [],
  697. },
  698. tagNo:'',
  699. searchData: {
  700. site: this.$store.state.user.site,
  701. inspectionNo: '',
  702. state: '',
  703. inspectionResult: '',
  704. orderNo: '',
  705. operationDesc: '',
  706. startDate: '',
  707. endDate: '',
  708. page: 1,
  709. limit: 10,
  710. },
  711. pageIndex: 1,
  712. pageSize: 50,
  713. totalPage: 0,
  714. height: 200,
  715. dataList: [],
  716. dataListLoading: false,
  717. dataListSelections: [],
  718. modalData: {
  719. flag: '',
  720. site: this.$store.state.user.site,
  721. inspectionNo: '',
  722. partNo: '',
  723. partDesc: '',
  724. inspectionTypeNo: '106',
  725. inspectionTypeName: '',
  726. inspectorNo: '',
  727. inspectorName: '',
  728. submit_flag: '',
  729. seqNo: '',
  730. batchRollNo: '',
  731. spec: '',
  732. sku: '',
  733. specialRequirements: '',
  734. templateId: '',
  735. templateName: '',
  736. specialTaskFlag: '',
  737. workCenterNo: '',
  738. rollNo: '',
  739. umId: '',
  740. umName: ''
  741. },
  742. // 展示列集
  743. columnList1: [
  744. {
  745. userId: this.$store.state.user.name,
  746. functionId: 301007,
  747. serialNumber: '301007Table1InspectionNo',
  748. tableId: "301007Table1",
  749. tableName: "FAI检验记录表",
  750. columnProp: 'inspectionNo',
  751. headerAlign: "center",
  752. align: "center",
  753. columnLabel: '检验单号',
  754. columnHidden: false,
  755. columnImage: false,
  756. columnSortable: false,
  757. sortLv: 0,
  758. status: true,
  759. fixed: '',
  760. columnWidth: 120,
  761. },
  762. {
  763. userId: this.$store.state.user.name,
  764. functionId: 301007,
  765. serialNumber: '301007Table1BatchRollNo',
  766. tableId: "301007Table1",
  767. tableName: "FQC检验记录表",
  768. columnProp: 'batchRollNo',
  769. headerAlign: "center",
  770. align: "center",
  771. columnLabel: '老卷号',
  772. columnHidden: false,
  773. columnImage: false,
  774. columnSortable: false,
  775. sortLv: 0,
  776. status: true,
  777. fixed: '',
  778. columnWidth: 100,
  779. },
  780. {
  781. userId: this.$store.state.user.name,
  782. functionId: 301007,
  783. serialNumber: '301007Table1RollNo',
  784. tableId: "301007Table1",
  785. tableName: "FQC检验记录表",
  786. columnProp: 'rollNo',
  787. headerAlign: "center",
  788. align: "center",
  789. columnLabel: '标签条码',
  790. columnHidden: false,
  791. columnImage: false,
  792. columnSortable: false,
  793. sortLv: 0,
  794. status: true,
  795. fixed: '',
  796. columnWidth: 100,
  797. },
  798. {
  799. userId: this.$store.state.user.name,
  800. functionId: 301007,
  801. serialNumber: '301007Table1InspectionResult',
  802. tableId: "301007Table1",
  803. tableName: "FQC检验记录表",
  804. columnProp: 'inspectionResult',
  805. headerAlign: "center",
  806. align: "center",
  807. columnLabel: '检验结论',
  808. columnHidden: false,
  809. columnImage: false,
  810. columnSortable: false,
  811. sortLv: 0,
  812. status: true,
  813. fixed: '',
  814. columnWidth: 80,
  815. },
  816. {
  817. userId: this.$store.state.user.name,
  818. functionId: 301007,
  819. serialNumber: '301007Table1DisposalMeasures',
  820. tableId: "301007Table1",
  821. tableName: "FQC检验记录表",
  822. columnProp: 'disposalMeasures',
  823. headerAlign: "center",
  824. align: "center",
  825. columnLabel: '处置措施',
  826. columnHidden: false,
  827. columnImage: false,
  828. columnSortable: false,
  829. sortLv: 0,
  830. status: true,
  831. fixed: '',
  832. columnWidth: 100,
  833. },
  834. {
  835. userId: this.$store.state.user.name,
  836. functionId: 301007,
  837. serialNumber: '301007Table1TaskDate',
  838. tableId: "301007Table1",
  839. tableName: "FQC检验记录表",
  840. columnProp: 'taskDate',
  841. headerAlign: "center",
  842. align: "center",
  843. columnLabel: '任务生成日期',
  844. columnHidden: false,
  845. columnImage: false,
  846. columnSortable: false,
  847. sortLv: 0,
  848. status: true,
  849. fixed: '',
  850. columnWidth: 120,
  851. },
  852. {
  853. userId: this.$store.state.user.name,
  854. functionId: 301007,
  855. serialNumber: '301007Table1InspectionCycle',
  856. tableId: "301007Table1",
  857. tableName: "FQC检验记录表",
  858. columnProp: 'inspectionCycle',
  859. headerAlign: "center",
  860. align: "right",
  861. columnLabel: '检验周期(h)',
  862. columnHidden: false,
  863. columnImage: false,
  864. columnSortable: false,
  865. sortLv: 0,
  866. status: true,
  867. fixed: '',
  868. columnWidth: 80,
  869. },
  870. {
  871. userId: this.$store.state.user.name,
  872. functionId: 301007,
  873. serialNumber: '301007Table1OrderNo',
  874. tableId: "301007Table1",
  875. tableName: "FQC检验记录表",
  876. columnProp: 'orderNo',
  877. headerAlign: "center",
  878. align: "center",
  879. columnLabel: '工单号',
  880. columnHidden: false,
  881. columnImage: false,
  882. columnSortable: false,
  883. sortLv: 0,
  884. status: true,
  885. fixed: '',
  886. columnWidth: 120,
  887. },
  888. {
  889. userId: this.$store.state.user.name,
  890. functionId: 301007,
  891. serialNumber: '301007Table1SeqNo',
  892. tableId: "301007Table1",
  893. tableName: "FQC检验记录表",
  894. columnProp: 'seqNo',
  895. headerAlign: "center",
  896. align: "center",
  897. columnLabel: '派工单号',
  898. columnHidden: false,
  899. columnImage: false,
  900. columnSortable: false,
  901. sortLv: 0,
  902. status: true,
  903. fixed: '',
  904. columnWidth: 150,
  905. },
  906. {
  907. userId: this.$store.state.user.name,
  908. functionId: 301007,
  909. serialNumber: '301007Table1OperationDesc',
  910. tableId: "301007Table1",
  911. tableName: "FQC检验记录表",
  912. columnProp: 'operationDesc',
  913. headerAlign: "center",
  914. align: "center",
  915. columnLabel: '工序',
  916. columnHidden: false,
  917. columnImage: false,
  918. columnSortable: false,
  919. sortLv: 0,
  920. status: true,
  921. fixed: '',
  922. columnWidth: 100,
  923. },
  924. {
  925. userId: this.$store.state.user.name,
  926. functionId: 301007,
  927. serialNumber: '301007Table1ResourceDesc',
  928. tableId: "301007Table1",
  929. tableName: "FQC检验记录表",
  930. columnProp: 'resourceDesc',
  931. headerAlign: "center",
  932. align: "center",
  933. columnLabel: '机台',
  934. columnHidden: false,
  935. columnImage: false,
  936. columnSortable: false,
  937. sortLv: 0,
  938. status: true,
  939. fixed: '',
  940. columnWidth: 100,
  941. },
  942. {
  943. userId: this.$store.state.user.name,
  944. functionId: 301007,
  945. serialNumber: '301007Table1PartNo',
  946. tableId: "301007Table1",
  947. tableName: "FQC检验记录表",
  948. columnProp: 'partNo',
  949. headerAlign: "center",
  950. align: "center",
  951. columnLabel: '物料编码',
  952. columnHidden: false,
  953. columnImage: false,
  954. columnSortable: false,
  955. sortLv: 0,
  956. status: true,
  957. fixed: '',
  958. columnWidth: 100,
  959. },
  960. {
  961. userId: this.$store.state.user.name,
  962. functionId: 301007,
  963. serialNumber: '301007Table1Spec',
  964. tableId: "301007Table1",
  965. tableName: "FQC检验记录表",
  966. columnProp: 'spec',
  967. headerAlign: "center",
  968. align: "center",
  969. columnLabel: '物料类别',
  970. columnHidden: false,
  971. columnImage: false,
  972. columnSortable: false,
  973. sortLv: 0,
  974. status: true,
  975. fixed: '',
  976. columnWidth: 150,
  977. },
  978. {
  979. userId: this.$store.state.user.name,
  980. functionId: 301007,
  981. serialNumber: '301007Table1CinvSourceCode',
  982. tableId: "301007Table1",
  983. tableName: "FQC检验记录表",
  984. columnProp: 'cinvSourceCode',
  985. headerAlign: "center",
  986. align: "center",
  987. columnLabel: 'PN',
  988. columnHidden: false,
  989. columnImage: false,
  990. columnSortable: false,
  991. sortLv: 0,
  992. status: true,
  993. fixed: '',
  994. columnWidth: 100,
  995. },
  996. {
  997. userId: this.$store.state.user.name,
  998. functionId: 301007,
  999. serialNumber: '301007Table1Sku',
  1000. tableId: "301007Table1",
  1001. tableName: "FQC检验记录表",
  1002. columnProp: 'sku',
  1003. headerAlign: "center",
  1004. align: "center",
  1005. columnLabel: 'SKU',
  1006. columnHidden: false,
  1007. columnImage: false,
  1008. columnSortable: false,
  1009. sortLv: 0,
  1010. status: true,
  1011. fixed: '',
  1012. columnWidth: 100,
  1013. },
  1014. {
  1015. userId: this.$store.state.user.name,
  1016. functionId: 301007,
  1017. serialNumber: '301007Table1PartDesc',
  1018. tableId: "301007Table1",
  1019. tableName: "FQC检验记录表",
  1020. columnProp: 'partDesc',
  1021. headerAlign: "center",
  1022. align: "center",
  1023. columnLabel: '物料名称',
  1024. columnHidden: false,
  1025. columnImage: false,
  1026. columnSortable: false,
  1027. sortLv: 0,
  1028. status: true,
  1029. fixed: '',
  1030. columnWidth: 150,
  1031. },
  1032. {
  1033. userId: this.$store.state.user.name,
  1034. functionId: 301007,
  1035. serialNumber: '301007Table1RollQty',
  1036. tableId: "301007Table1",
  1037. tableName: "FQC检验记录表",
  1038. columnProp: 'rollQty',
  1039. headerAlign: "center",
  1040. align: "right",
  1041. columnLabel: '送检数量',
  1042. columnHidden: false,
  1043. columnImage: false,
  1044. columnSortable: false,
  1045. sortLv: 0,
  1046. status: true,
  1047. fixed: '',
  1048. columnWidth: 80,
  1049. },
  1050. {
  1051. userId: this.$store.state.user.name,
  1052. functionId: 301007,
  1053. serialNumber: '301007Table1SamplingQty',
  1054. tableId: "301007Table1",
  1055. tableName: "FQC检验记录表",
  1056. columnProp: 'samplingQty',
  1057. headerAlign: "center",
  1058. align: "right",
  1059. columnLabel: '抽样数量',
  1060. columnHidden: false,
  1061. columnImage: false,
  1062. columnSortable: false,
  1063. sortLv: 0,
  1064. status: true,
  1065. fixed: '',
  1066. columnWidth: 80,
  1067. },
  1068. {
  1069. userId: this.$store.state.user.name,
  1070. functionId: 301007,
  1071. serialNumber: '301007Table1UmName',
  1072. tableId: "301007Table1",
  1073. tableName: "FQC检验记录表",
  1074. columnProp: 'umName',
  1075. headerAlign: "center",
  1076. align: "center",
  1077. columnLabel: '单位',
  1078. columnHidden: false,
  1079. columnImage: false,
  1080. columnSortable: false,
  1081. sortLv: 0,
  1082. status: true,
  1083. fixed: '',
  1084. columnWidth: 80,
  1085. },
  1086. {
  1087. userId: this.$store.state.user.name,
  1088. functionId: 301007,
  1089. serialNumber: '301007Table1InspectionRemark',
  1090. tableId: "301007Table1",
  1091. tableName: "FQC检验记录表",
  1092. columnProp: 'inspectionRemark',
  1093. headerAlign: "center",
  1094. align: "center",
  1095. columnLabel: '质检备注',
  1096. columnHidden: false,
  1097. columnImage: false,
  1098. columnSortable: false,
  1099. sortLv: 0,
  1100. status: true,
  1101. fixed: '',
  1102. columnWidth: 120,
  1103. },
  1104. {
  1105. userId: this.$store.state.user.name,
  1106. functionId: 301007,
  1107. serialNumber: '301007Table1DisposalRemark',
  1108. tableId: "301007Table1",
  1109. tableName: "FQC检验记录表",
  1110. columnProp: 'disposalRemark',
  1111. headerAlign: "center",
  1112. align: "center",
  1113. columnLabel: '处置说明',
  1114. columnHidden: false,
  1115. columnImage: false,
  1116. columnSortable: false,
  1117. sortLv: 0,
  1118. status: true,
  1119. fixed: '',
  1120. columnWidth: 120,
  1121. },
  1122. {
  1123. userId: this.$store.state.user.name,
  1124. functionId: 301007,
  1125. serialNumber: '301007Table1InspectorDate',
  1126. tableId: "301007Table1",
  1127. tableName: "FQC检验记录表",
  1128. columnProp: 'inspectorDate',
  1129. headerAlign: "center",
  1130. align: "center",
  1131. columnLabel: '检验时间',
  1132. columnHidden: false,
  1133. columnImage: false,
  1134. columnSortable: false,
  1135. sortLv: 0,
  1136. status: true,
  1137. fixed: '',
  1138. columnWidth: 120,
  1139. },
  1140. {
  1141. userId: this.$store.state.user.name,
  1142. functionId: 301007,
  1143. serialNumber: '301007Table1InspectorName',
  1144. tableId: "301007Table1",
  1145. tableName: "FQC检验记录表",
  1146. columnProp: 'inspectorName',
  1147. headerAlign: "center",
  1148. align: "center",
  1149. columnLabel: '质检员',
  1150. columnHidden: false,
  1151. columnImage: false,
  1152. columnSortable: false,
  1153. sortLv: 0,
  1154. status: true,
  1155. fixed: '',
  1156. columnWidth: 100,
  1157. },
  1158. {
  1159. userId: this.$store.state.user.name,
  1160. functionId: 301007,
  1161. serialNumber: '301007Table1SpecialRequirements',
  1162. tableId: "301007Table1",
  1163. tableName: "FQC检验记录表",
  1164. columnProp: 'specialRequirements',
  1165. headerAlign: "center",
  1166. align: "center",
  1167. columnLabel: '特殊要求',
  1168. columnHidden: false,
  1169. columnImage: false,
  1170. columnSortable: false,
  1171. sortLv: 0,
  1172. status: true,
  1173. fixed: '',
  1174. columnWidth: 120,
  1175. },
  1176. ],
  1177. //项目清单
  1178. detailData:{
  1179. site: this.$store.state.user.site,
  1180. inspectionNo:'',
  1181. partNo:'',
  1182. partDesc:'',
  1183. rollQty:'',
  1184. samplingQty: '',
  1185. unqualifiedQty: 0,
  1186. unqualifiedQuantity:'',
  1187. disposalMeasures:'',
  1188. disposalRemark: '',
  1189. inspectionResult: '',
  1190. inspectorNo: '',
  1191. inspectorName: '',
  1192. inspectionRemark: '',
  1193. submitFlag: '',
  1194. cinvSourceCode: '',
  1195. sku: '',
  1196. spec: '',
  1197. umId: '',
  1198. umName: ''
  1199. },
  1200. detailInformationFlag:false,
  1201. detailList:[],
  1202. saveInformationData:{
  1203. site: this.$store.state.user.site,
  1204. inspectionNo:'',
  1205. disposalMeasures: '',
  1206. disposalRemark: '',
  1207. inspectorNo: '',
  1208. inspectionRemark: '',
  1209. samplingQty: '',
  1210. rollQty: '',
  1211. itemList:[],
  1212. },
  1213. detailColumnList: [
  1214. {
  1215. columnProp: 'itemDesc',
  1216. headerAlign: "center",
  1217. align: "center",
  1218. columnLabel: '检验项目',
  1219. columnHidden: false,
  1220. columnImage: false,
  1221. columnSortable: false,
  1222. sortLv: 0,
  1223. status: true,
  1224. fixed: '',
  1225. },
  1226. {
  1227. columnProp: 'samplingLevelDesc',
  1228. headerAlign: "center",
  1229. align: "center",
  1230. columnLabel: '检验水平',
  1231. columnHidden: false,
  1232. columnImage: false,
  1233. columnSortable: false,
  1234. sortLv: 0,
  1235. status: true,
  1236. fixed: '',
  1237. },
  1238. {
  1239. columnProp: 'samplingProgrammeDesc',
  1240. headerAlign: "center",
  1241. align: "center",
  1242. columnLabel: '检验方案',
  1243. columnHidden: false,
  1244. columnImage: false,
  1245. columnSortable: false,
  1246. sortLv: 0,
  1247. status: true,
  1248. fixed: '',
  1249. },
  1250. {
  1251. columnProp: 'objectDesc',
  1252. headerAlign: "center",
  1253. align: "center",
  1254. columnLabel: '检测仪器',
  1255. columnHidden: false,
  1256. columnImage: false,
  1257. columnSortable: false,
  1258. sortLv: 0,
  1259. status: true,
  1260. fixed: '',
  1261. },
  1262. {
  1263. columnProp: 'aql',
  1264. headerAlign: "center",
  1265. align: "center",
  1266. columnLabel: 'AQL',
  1267. columnHidden: false,
  1268. columnImage: false,
  1269. columnSortable: false,
  1270. sortLv: 0,
  1271. status: true,
  1272. fixed: '',
  1273. },
  1274. {
  1275. columnProp: 'ac',
  1276. headerAlign: "center",
  1277. align: "center",
  1278. columnLabel: 'AC',
  1279. columnHidden: false,
  1280. columnImage: false,
  1281. columnSortable: false,
  1282. sortLv: 0,
  1283. status: true,
  1284. fixed: '',
  1285. },
  1286. {
  1287. columnProp: 're',
  1288. headerAlign: "center",
  1289. align: "center",
  1290. columnLabel: 'RE',
  1291. columnHidden: false,
  1292. columnImage: false,
  1293. columnSortable: false,
  1294. sortLv: 0,
  1295. status: true,
  1296. fixed: '',
  1297. },
  1298. {
  1299. columnProp: 'defaultValue',
  1300. headerAlign: "center",
  1301. align: "center",
  1302. columnLabel: '标准值',
  1303. columnHidden: false,
  1304. columnImage: false,
  1305. columnSortable: false,
  1306. sortLv: 0,
  1307. status: true,
  1308. fixed: '',
  1309. },
  1310. {
  1311. columnProp: 'maxValue',
  1312. headerAlign: "center",
  1313. align: "center",
  1314. columnLabel: '上限值',
  1315. columnHidden: false,
  1316. columnImage: false,
  1317. columnSortable: false,
  1318. sortLv: 0,
  1319. status: true,
  1320. fixed: '',
  1321. },
  1322. {
  1323. columnProp: 'minValue',
  1324. headerAlign: "center",
  1325. align: "center",
  1326. columnLabel: '下限值',
  1327. columnHidden: false,
  1328. columnImage: false,
  1329. columnSortable: false,
  1330. sortLv: 0,
  1331. status: true,
  1332. fixed: '',
  1333. },
  1334. {
  1335. columnProp: 'valueType',
  1336. headerAlign: "center",
  1337. align: "center",
  1338. columnLabel: '检测值类型',
  1339. columnHidden: false,
  1340. columnImage: false,
  1341. columnSortable: false,
  1342. sortLv: 0,
  1343. status: true,
  1344. fixed: '',
  1345. },
  1346. ],
  1347. fileColumnList: [
  1348. {
  1349. columnProp: 'fileName',
  1350. headerAlign: "center",
  1351. align: "center",
  1352. columnLabel: '文件名称',
  1353. columnHidden: false,
  1354. columnImage: false,
  1355. columnSortable: false,
  1356. sortLv: 0,
  1357. status: true,
  1358. fixed: '',
  1359. },
  1360. {
  1361. columnProp: 'createdBy',
  1362. headerAlign: "center",
  1363. align: 'center',
  1364. columnLabel: '上传人',
  1365. columnHidden: false,
  1366. columnImage: false,
  1367. columnSortable: true,
  1368. sortLv: 0,
  1369. status: true,
  1370. fixed: false
  1371. },
  1372. {
  1373. columnProp: 'createDate',
  1374. headerAlign: "center",
  1375. align: 'center',
  1376. columnLabel: '上传时间',
  1377. columnHidden: false,
  1378. columnImage: false,
  1379. columnSortable: true,
  1380. sortLv: 0,
  1381. status: true,
  1382. fixed: false
  1383. },
  1384. {
  1385. columnProp: 'orderRef3',
  1386. headerAlign: "center",
  1387. align: 'center',
  1388. columnLabel: '备注',
  1389. columnHidden: false,
  1390. columnImage: false,
  1391. columnSortable: true,
  1392. sortLv: 0,
  1393. status: true,
  1394. fixed: false
  1395. },
  1396. ],
  1397. // 子明细数据对象
  1398. tableData: [],
  1399. checkedDetail: [],
  1400. subDetailFlag: false,
  1401. subDetailData: {
  1402. site: this.$store.state.user.site,
  1403. inspectionNo: '',
  1404. itemNo: '',
  1405. itemDesc: '',
  1406. defaultValue: '',
  1407. maxValue: '',
  1408. minValue: '',
  1409. subDetailValues:[]
  1410. },
  1411. options: [],
  1412. FAISelections: [],
  1413. modalFlag: false,
  1414. rules:{
  1415. orderNoType:[
  1416. {
  1417. required: true,
  1418. message: ' ',
  1419. trigger: 'change'
  1420. }
  1421. ],
  1422. operationDescType:[
  1423. {
  1424. required: true,
  1425. message: ' ',
  1426. trigger: 'change'
  1427. }
  1428. ],
  1429. resourceIdType:[
  1430. {
  1431. required: true,
  1432. message: ' ',
  1433. trigger: 'change'
  1434. }
  1435. ],
  1436. rollQtyType:[
  1437. {
  1438. required: true,
  1439. message: ' ',
  1440. trigger: 'change'
  1441. }
  1442. ],
  1443. seqNoType: [
  1444. {
  1445. required: true,
  1446. message: ' ',
  1447. trigger: 'change'
  1448. }
  1449. ],
  1450. partNoType: [
  1451. {
  1452. required: true,
  1453. message: ' ',
  1454. trigger: 'change'
  1455. }
  1456. ],
  1457. umIdType: [
  1458. {
  1459. required: true,
  1460. message: ' ',
  1461. trigger: 'change'
  1462. }
  1463. ]
  1464. },
  1465. resourceList: [],
  1466. operationList: [],
  1467. partList: [],
  1468. batchHandleAddModalFlag: false,
  1469. batchAddData: {
  1470. samplingLocation: '',
  1471. samplingLocationB: '',
  1472. samplingNumber: ''
  1473. },
  1474. controlData: {},
  1475. templateData: {
  1476. site: this.$store.state.user.site,
  1477. templateId: '',
  1478. templateName: '',
  1479. inspectionTypeNo: '',
  1480. inspectionTypeName: ''
  1481. },
  1482. templateList: [],
  1483. templateModelFlag: false,
  1484. templateDetailList: [
  1485. {
  1486. columnProp: 'templateId',
  1487. headerAlign: "center",
  1488. align: "center",
  1489. columnLabel: '模板编码',
  1490. columnHidden: false,
  1491. columnImage: false,
  1492. columnSortable: false,
  1493. sortLv: 0,
  1494. status: true,
  1495. fixed: '',
  1496. },
  1497. {
  1498. columnProp: 'templateName',
  1499. headerAlign: "center",
  1500. align: "center",
  1501. columnLabel: '模板名称',
  1502. columnHidden: false,
  1503. columnImage: false,
  1504. columnSortable: false,
  1505. sortLv: 0,
  1506. status: true,
  1507. fixed: '',
  1508. },
  1509. {
  1510. columnProp: 'inspectionTypeName',
  1511. headerAlign: "center",
  1512. align: "center",
  1513. columnLabel: '检验类型',
  1514. columnHidden: false,
  1515. columnImage: false,
  1516. columnSortable: false,
  1517. sortLv: 0,
  1518. status: true,
  1519. fixed: '',
  1520. },
  1521. ],
  1522. checked: false,
  1523. typeOptions: [],
  1524. disposalMeasuresOptions: [],
  1525. timeout: null,
  1526. partData: {
  1527. site: this.$store.state.user.site,
  1528. partNo: '',
  1529. partDesc: '',
  1530. sku: ''
  1531. },
  1532. partDetailList: [
  1533. {
  1534. columnProp: 'partNo',
  1535. headerAlign: "center",
  1536. align: "center",
  1537. columnLabel: '物料编码',
  1538. columnHidden: false,
  1539. columnImage: false,
  1540. columnSortable: false,
  1541. sortLv: 0,
  1542. status: true,
  1543. fixed: '',
  1544. },
  1545. {
  1546. columnProp: 'partDesc',
  1547. headerAlign: "center",
  1548. align: "center",
  1549. columnLabel: '物料名称',
  1550. columnHidden: false,
  1551. columnImage: false,
  1552. columnSortable: false,
  1553. sortLv: 0,
  1554. status: true,
  1555. fixed: '',
  1556. },
  1557. {
  1558. columnProp: 'sku',
  1559. headerAlign: "center",
  1560. align: "center",
  1561. columnLabel: 'SKU',
  1562. columnHidden: false,
  1563. columnImage: false,
  1564. columnSortable: false,
  1565. sortLv: 0,
  1566. status: true,
  1567. fixed: '',
  1568. },
  1569. ],
  1570. partModelFlag: false,
  1571. umList: []
  1572. }
  1573. },
  1574. mounted () {
  1575. this.$nextTick(() => {
  1576. this.height = window.innerHeight - 210
  1577. })
  1578. },
  1579. created () {
  1580. // 数据列表
  1581. this.getDataList()
  1582. // 收藏
  1583. this.favoriteIsOk()
  1584. // 检验类型
  1585. this.inspectionTypeSearch()
  1586. // 处置措施列表
  1587. this.disposalMeasuresSearch()
  1588. // 单位
  1589. this.umSearch()
  1590. // 查看 质量任务生成规则控制 动控是否开启
  1591. this.queryController()
  1592. // 动态列
  1593. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1594. },
  1595. methods: {
  1596. // 查询单位
  1597. umSearch(){
  1598. let tempData = {
  1599. site: this.$store.state.user.site,
  1600. active: 'Y'
  1601. }
  1602. umSearch(tempData).then(({data}) => {
  1603. if (data.code === 0) {
  1604. this.umList = data.rows
  1605. }
  1606. })
  1607. },
  1608. // 标签号回车事件
  1609. rollNoEnter () {
  1610. let tempData = {
  1611. site: this.$store.state.user.site,
  1612. rollNo: this.modalData.rollNo
  1613. }
  1614. rollNoEnter(tempData).then(({data}) => {
  1615. if (data && data.code === 0) {
  1616. this.operationList = data.rows
  1617. this.modalData.seqNo = data.rows[0].seqNo
  1618. this.modalData.orderNo = data.rows[0].orderNo
  1619. this.modalData.operationDesc = data.rows[0].operationDesc
  1620. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1621. this.modalData.resourceId = data.rows[0].resourceId
  1622. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1623. this.modalData.partNo = data.rows[0].partNo
  1624. this.modalData.partDesc = data.rows[0].partDesc
  1625. this.modalData.spec = data.rows[0].spec
  1626. this.modalData.sku = data.rows[0].sku
  1627. } else {
  1628. this.$alert(data.msg, '错误', {
  1629. confirmButtonText: '确定'
  1630. })
  1631. }
  1632. })
  1633. },
  1634. querySearchAsync (queryString, cb) {
  1635. clearTimeout(this.timeout)
  1636. let results = []
  1637. if (queryString == '') {
  1638. cb(results)
  1639. } else {
  1640. // 掉接口需要的参数
  1641. let find = {
  1642. rollNo: queryString, //上面输入框绑定的数据
  1643. site: this.$store.state.user.site,
  1644. }
  1645. // 这里去调后端的接口.根据自己接口的情况进行赋值
  1646. getRollNo(find).then(({data}) => {
  1647. if (data.code === 0) {
  1648. let result = data.rows
  1649. // 循环放到一个远程搜索需要的数组
  1650. for (let i = 0; i < result.length; i++) {
  1651. const element = result[i]
  1652. results.push({
  1653. value: element.rollNo,
  1654. seqNo: element.seqNo,
  1655. orderNo: element.orderNo
  1656. })
  1657. }
  1658. cb(results)
  1659. } else {
  1660. results = []
  1661. cb(results)
  1662. }
  1663. })
  1664. }
  1665. },
  1666. //点击出现搜索后点击的每一项
  1667. handleSelect (item) {
  1668. this.modalData.rollNo = item.value
  1669. this.modalData.seqNo = item.seqNo
  1670. this.modalData.orderNo = item.orderNo
  1671. this.getOperationList()
  1672. //this.getPartList()
  1673. },
  1674. // 获取处置措施列表
  1675. disposalMeasuresSearch(){
  1676. let tempData = {
  1677. inspectionTypeNo: '106'
  1678. }
  1679. disposalMeasuresSearch(tempData).then(({data}) => {
  1680. if (data.code === 0) {
  1681. this.disposalMeasuresOptions = data.rows
  1682. }
  1683. })
  1684. },
  1685. // 查询检验类型
  1686. inspectionTypeSearch(){
  1687. let tempData = {
  1688. site: this.$store.state.user.site
  1689. }
  1690. inspectionTypeSearch(tempData).then(({data}) => {
  1691. if (data.code === 0) {
  1692. this.typeOptions = data.rows
  1693. }
  1694. })
  1695. },
  1696. // 获取基础数据列表S
  1697. getBaseList (val,type) {
  1698. this.tagNo = val
  1699. this.$nextTick(() => {
  1700. let strVal = ''
  1701. if (val === 1052) {
  1702. strVal = this.modalData.seqNo
  1703. this.$refs.baseList.init(val, strVal)
  1704. }
  1705. if (val === 205) {
  1706. strVal = this.modalData.resourceDesc
  1707. this.$refs.baseList.init(val, strVal)
  1708. }
  1709. // if (val === 206) {
  1710. // strVal = this.modalData.partNo
  1711. // this.$refs.baseList.init(val, strVal)
  1712. // }
  1713. })
  1714. },
  1715. /* 列表方法的回调 */
  1716. getBaseData (val) {
  1717. if (this.tagNo === 1052) {
  1718. this.modalData.seqNo = val.seqno
  1719. this.modalData.orderNo = val.orderno
  1720. this.modalData.operationDesc = ''
  1721. this.modalData.resourceId = ''
  1722. this.getOperationList()
  1723. //this.getPartList()
  1724. }
  1725. if (this.tagNo === 205) {
  1726. this.modalData.resourceId = val.resource_id
  1727. this.modalData.resourceDesc = val.resource_desc
  1728. }
  1729. // if (this.tagNo === 206) {
  1730. // this.modalData.partNo = val.part_no
  1731. // this.modalData.partDesc = val.part_desc
  1732. // // 获取物料的其他信息
  1733. // this.getPartInformation()
  1734. // }
  1735. },
  1736. // // 获取物料其它信息
  1737. // getPartInformation () {
  1738. // getPartInformation(this.modalData).then(({data}) => {
  1739. // if (data && data.code === 0) {
  1740. // this.modalData.spec = data.rows[0].spec
  1741. // this.modalData.sku = data.rows[0].sku
  1742. // } else {
  1743. // this.$alert(data.msg, '错误', {
  1744. // confirmButtonText: '确定'
  1745. // })
  1746. // }
  1747. // })
  1748. // },
  1749. // 获取机台列表
  1750. getResourceList(){
  1751. // 判断是否为特殊任务,特殊任务的机台不随工序改变
  1752. if (this.modalData.specialTaskFlag === 'Y') {
  1753. return
  1754. } else {
  1755. getResourceList(this.modalData).then(({data}) => {
  1756. if (data && data.code === 0) {
  1757. //this.resourceList = data.rows
  1758. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1759. this.modalData.resourceId = data.rows[0].resourceId
  1760. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1761. } else {
  1762. this.$alert(data.msg, '错误', {
  1763. confirmButtonText: '确定'
  1764. })
  1765. }
  1766. })
  1767. }
  1768. },
  1769. // 获取工序列表
  1770. getOperationList(){
  1771. getOperationList(this.modalData).then(({data}) => {
  1772. if (data && data.code === 0) {
  1773. this.operationList = data.rows
  1774. this.modalData.operationDesc = data.rows[0].operationDesc
  1775. //this.getResourceList()
  1776. this.modalData.workCenterNo = data.rows[0].workCenterNo
  1777. this.modalData.resourceId = data.rows[0].resourceId
  1778. this.modalData.resourceDesc = data.rows[0].resourceDesc
  1779. this.modalData.partNo = data.rows[0].partNo
  1780. this.modalData.partDesc = data.rows[0].partDesc
  1781. this.modalData.spec = data.rows[0].spec
  1782. this.modalData.sku = data.rows[0].sku
  1783. } else {
  1784. this.$alert(data.msg, '错误', {
  1785. confirmButtonText: '确定'
  1786. })
  1787. }
  1788. })
  1789. },
  1790. // 获取物料列表
  1791. getPartList(){
  1792. getPartList(this.modalData).then(({data}) => {
  1793. if (data && data.code === 0) {
  1794. this.partList = data.rows
  1795. this.modalData.partNo = this.partList[0].partNo
  1796. this.modalData.partDesc = this.partList[0].partDesc
  1797. this.modalData.spec = this.partList[0].spec
  1798. this.modalData.sku = this.partList[0].sku
  1799. } else {
  1800. this.$alert(data.msg, '错误', {
  1801. confirmButtonText: '确定'
  1802. })
  1803. }
  1804. })
  1805. },
  1806. // 是否新增特殊任务
  1807. changeSpecialTask () {
  1808. // 先重置数据
  1809. this.modalData = {
  1810. flag: '1',
  1811. site: this.$store.state.user.site,
  1812. inspectionNo:'',
  1813. partNo: '',
  1814. partDesc: '',
  1815. inspectionTypeNo:'',
  1816. inspectionTypeName:'',
  1817. inspectorNo:'',
  1818. inspectorName:'',
  1819. submit_flag:'',
  1820. orderNo: '',
  1821. operationDesc: '',
  1822. operationNo: '',
  1823. resourceId: '',
  1824. resourceDesc: '',
  1825. rollQty: '',
  1826. seqNo: '',
  1827. batchRollNo: '',
  1828. spec: '',
  1829. sku: '',
  1830. specialRequirements: '',
  1831. templateId: '',
  1832. templateName: '',
  1833. specialTaskFlag: '',
  1834. workCenterNo: '',
  1835. rollNo: '',
  1836. umId: this.umList[0].umId,
  1837. umName: this.umList[0].umName
  1838. }
  1839. // 获取选中框
  1840. let obj = document.getElementsByName('specialTask')
  1841. // 判断是否打勾
  1842. if (obj[0].checked) {
  1843. let tempData = {
  1844. site: this.$store.state.user.site
  1845. }
  1846. this.modalData.specialTaskFlag = 'Y'
  1847. // 获取特殊工序列表
  1848. getSpecialOperationList(tempData).then(({data}) => {
  1849. if (data && data.code === 0) {
  1850. this.operationList = data.rows
  1851. } else {
  1852. this.$alert(data.msg, '错误', {
  1853. confirmButtonText: '确定'
  1854. })
  1855. }
  1856. })
  1857. // 派工单和工单号赋值
  1858. this.modalData.seqNo = '000#1TSGD'
  1859. this.modalData.orderNo = '000#1'
  1860. } else {
  1861. this.modalData.specialTaskFlag = ''
  1862. }
  1863. },
  1864. // 新增FAI巡检记录
  1865. saveData(){
  1866. if (this.modalData.seqNo === '' || this.modalData.seqNo == null) {
  1867. this.$message.warning('请选择派工单!')
  1868. return
  1869. }
  1870. if (this.modalData.orderNo === '' || this.modalData.orderNo == null) {
  1871. this.$message.warning('请选择工单!')
  1872. return
  1873. }
  1874. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.partNo === '' || this.modalData.partNo == null)) {
  1875. this.$message.warning('请选择物料!')
  1876. return
  1877. }
  1878. if (this.modalData.operationDesc === '' || this.modalData.operationDesc == null) {
  1879. this.$message.warning('请选择工序!')
  1880. return
  1881. }
  1882. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.resourceId === '' || this.modalData.resourceId == null)) {
  1883. this.$message.warning('请选择机台!')
  1884. return
  1885. }
  1886. if (this.modalData.rollQty === '' || this.modalData.rollQty == null) {
  1887. this.$message.warning('请填写送检数量!')
  1888. return
  1889. }
  1890. if (this.modalData.umId === '' || this.modalData.umId == null) {
  1891. this.$message.warning('请选择单位!')
  1892. return
  1893. }
  1894. if (this.controlData.baseData === '控制' && (this.modalData.templateId == null || this.modalData.templateId === '')) {
  1895. this.$message.warning('请选择检验模板!')
  1896. return
  1897. }
  1898. if(this.modalData.flag === '1'){
  1899. saveFAIInspection(this.modalData).then(({data}) => {
  1900. if (data && data.code === 0) {
  1901. this.getDataList()
  1902. this.operationList = []
  1903. this.resourceList = []
  1904. this.partList = []
  1905. this.modalFlag = false
  1906. this.$message({
  1907. message: '操作成功',
  1908. type: 'success',
  1909. duration: 1500,
  1910. onClose: () => {
  1911. }
  1912. })
  1913. } else {
  1914. this.$alert(data.msg, '错误', {
  1915. confirmButtonText: '确定'
  1916. })
  1917. }
  1918. })
  1919. }
  1920. },
  1921. // 检查动控是否开启
  1922. queryController () {
  1923. let tempData = {
  1924. controlNo: '10004',
  1925. site: this.$store.state.user.site,
  1926. }
  1927. queryController(tempData).then(({data}) => {
  1928. if (data && data.code === 0) {
  1929. this.controlData = data.rows
  1930. } else {
  1931. this.$alert(data.msg, '错误', {
  1932. confirmButtonText: '确定'
  1933. })
  1934. }
  1935. })
  1936. },
  1937. // 新增
  1938. addModal(){
  1939. this.modalData = {
  1940. flag: '1',
  1941. site: this.$store.state.user.site,
  1942. inspectionNo: '',
  1943. partNo: '',
  1944. partDesc: '',
  1945. inspectionTypeNo: '106',
  1946. inspectionTypeName: '',
  1947. inspectorNo: '',
  1948. inspectorName: '',
  1949. submit_flag: '',
  1950. orderNo: '',
  1951. operationDesc: '',
  1952. operationNo: '',
  1953. resourceId: '',
  1954. resourceDesc: '',
  1955. rollQty: '',
  1956. seqNo: '',
  1957. batchRollNo: '',
  1958. spec: '',
  1959. sku: '',
  1960. specialRequirements: '',
  1961. templateId: '',
  1962. templateName: '',
  1963. specialTaskFlag: '',
  1964. workCenterNo: '',
  1965. rollNo: '',
  1966. umId: this.umList[0].umId,
  1967. umName: this.umList[0].umName
  1968. }
  1969. this.operationList = []
  1970. this.resourceList = []
  1971. this.partList = []
  1972. this.modalDisableFlag = false
  1973. this.modalFlag = true
  1974. this.checked = false
  1975. },
  1976. // 获取检验模板列表
  1977. queryTemplateList () {
  1978. // 查询所有检验模板
  1979. queryTemplateList(this.templateData).then(({data}) => {
  1980. if (data && data.code === 0) {
  1981. this.templateList = data.rows
  1982. this.templateModelFlag = true
  1983. }else {
  1984. this.$alert(data.msg, '错误', {
  1985. confirmButtonText: '确定'
  1986. })
  1987. }
  1988. })
  1989. },
  1990. // 获取物料列表
  1991. queryPartList () {
  1992. // 查询所有物料
  1993. queryPartList(this.partData).then(({data}) => {
  1994. if (data && data.code === 0) {
  1995. this.partList = data.rows
  1996. this.partModelFlag = true
  1997. }else {
  1998. this.$alert(data.msg, '错误', {
  1999. confirmButtonText: '确定'
  2000. })
  2001. }
  2002. })
  2003. },
  2004. // 选中检验模板
  2005. getRowData (row) {
  2006. this.modalData.templateId = row.templateId
  2007. this.modalData.templateName = row.templateName
  2008. this.templateModelFlag = false
  2009. },
  2010. // 选中物料
  2011. getRowData2 (row) {
  2012. this.modalData.partNo = row.partNo
  2013. this.modalData.partDesc = row.partDesc
  2014. this.modalData.sku = row.sku
  2015. this.modalData.spec = row.spec
  2016. this.partModelFlag = false
  2017. },
  2018. selectFlag(){
  2019. return true;
  2020. },
  2021. // 单机选中
  2022. FAIClickRow(row){
  2023. this.$refs.FAITable.toggleRowSelection(row);
  2024. },
  2025. // 复选
  2026. selectionFAI(val){
  2027. this.FAISelections = val
  2028. },
  2029. //刷新派设备文档的列表
  2030. getFileContentData(row) {
  2031. let currentData = {
  2032. orderRef1: row.site,
  2033. orderRef2: row.inspectionNo
  2034. };
  2035. getFileContentList(currentData).then(({data}) => {
  2036. //区分请求成功和失败的状况
  2037. if (data && data.code == 200) {
  2038. this.fileContentList = data.rows;
  2039. } else {
  2040. this.fileContentList = [];
  2041. }
  2042. })
  2043. this.fileFlag = true;
  2044. },
  2045. /*新增文件的modal*/
  2046. addUploadFileModal(){
  2047. let currentData = {
  2048. titleCon: 'FAI文件上传',
  2049. site: this.$store.state.user.site,
  2050. createBy: this.$store.state.user.name,
  2051. inspectionNo: this.detailData.inspectionNo,
  2052. remark: '',
  2053. folder: 'qcFAI',
  2054. };
  2055. //打开组件 去做新增业务
  2056. this.$nextTick(() => {
  2057. this.$refs.qcFAIUploadFile.init(currentData);
  2058. })
  2059. },
  2060. // 上传项目图片
  2061. uploadImageModal (row) {
  2062. let currentData = {
  2063. site: this.$store.state.user.site,
  2064. createBy: this.$store.state.user.name,
  2065. inspectionNo: this.detailData.inspectionNo,
  2066. itemNo: row.itemNo,
  2067. folder: 'FAIItemImageFile'
  2068. }
  2069. //打开组件 去做新增业务
  2070. this.$nextTick(() => {
  2071. this.$refs.comQcItemImageUploadFile.init(currentData)
  2072. })
  2073. },
  2074. downloadFile(row){
  2075. downLoadObjectFile(row)
  2076. .then(({data}) => {
  2077. // 不限制文件下载类型
  2078. const blob = new Blob([data], {type: "application/octet-stream"})
  2079. // 下载文件名称
  2080. const fileName = row.fileName
  2081. // a标签下载
  2082. const linkNode = document.createElement('a')
  2083. // a标签的download属性规定下载文件的名称
  2084. linkNode.download = fileName
  2085. linkNode.style.display = 'none'
  2086. // 生成一个Blob URL
  2087. linkNode.href = URL.createObjectURL(blob)
  2088. document.body.appendChild(linkNode)
  2089. // 模拟在按钮上的一次鼠标单击
  2090. linkNode.click()
  2091. // 释放URL 对象
  2092. URL.revokeObjectURL(linkNode.href)
  2093. document.body.removeChild(linkNode)
  2094. })
  2095. },
  2096. // 删除文件
  2097. deleteFile(row){
  2098. let tempData = {
  2099. site: row.orderRef1,
  2100. inspectionNo: row.orderRef2
  2101. }
  2102. this.$confirm('确定要删除此文件?', '提示', {
  2103. confirmButtonText: '确定',
  2104. cancelButtonText: '取消',
  2105. type: 'warning'
  2106. }).then(() => {
  2107. deleteObjectFile(row).then(({data}) => {
  2108. if (data && data.code === 0) {
  2109. this.getFileContentData(tempData);
  2110. this.$message({
  2111. message: '操作成功',
  2112. type: 'success',
  2113. duration: 1500,
  2114. onClose: () => {
  2115. }
  2116. })
  2117. } else {
  2118. this.$alert(data.msg, '错误', {
  2119. confirmButtonText: '确定'
  2120. })
  2121. }
  2122. })
  2123. }).catch(() => {
  2124. })
  2125. },
  2126. // 查询检验类型
  2127. inspectorSearch(){
  2128. inspectorSearch().then(({data}) => {
  2129. if (data.code === 0) {
  2130. this.options = data.rows
  2131. }
  2132. })
  2133. },
  2134. // 获取主信息数据列表
  2135. getDataList () {
  2136. this.searchData.limit = this.pageSize
  2137. this.searchData.page = this.pageIndex
  2138. qcFAIInspectionSearch(this.searchData).then(({data}) => {
  2139. if (data.code === 0) {
  2140. this.dataList = data.page.list
  2141. this.pageIndex = data.page.currPage
  2142. this.pageSize = data.page.pageSize
  2143. this.totalPage = data.page.totalCount
  2144. }
  2145. this.dataListLoading = false
  2146. })
  2147. },
  2148. // 每页数
  2149. sizeChangeHandle (val) {
  2150. this.pageSize = val
  2151. this.pageIndex = 1
  2152. this.getDataList()
  2153. },
  2154. // 当前页
  2155. currentChangeHandle (val) {
  2156. this.pageIndex = val
  2157. this.getDataList()
  2158. },
  2159. // 多选
  2160. selectionChangeHandle (val) {
  2161. this.dataListSelections = val
  2162. },
  2163. // 删除检验记录
  2164. deleteModal () {
  2165. if(this.FAISelections.length === 0){
  2166. this.$alert('请勾选要删除的检验单!', '提示', {
  2167. confirmButtonText: '确定'
  2168. })
  2169. return false
  2170. }
  2171. this.$confirm(`是否删除该 `+ this.FAISelections.length +` 条检验记录?`, '提示', {
  2172. confirmButtonText: '确定',
  2173. cancelButtonText: '取消',
  2174. type: 'warning'
  2175. }).then(() => {
  2176. let tempData = {
  2177. site: this.$store.state.user.site,
  2178. submitList: this.FAISelections
  2179. }
  2180. faiRecordDelete(tempData).then(({data}) => {
  2181. if (data && data.code === 0) {
  2182. this.getDataList()
  2183. this.FAISelections = []
  2184. this.$message({
  2185. message: '操作成功',
  2186. type: 'success',
  2187. duration: 1500,
  2188. onClose: () => {
  2189. }
  2190. })
  2191. } else {
  2192. this.$alert(data.msg, '错误', {
  2193. confirmButtonText: '确定'
  2194. })
  2195. }
  2196. })
  2197. }).catch(() => {
  2198. })
  2199. },
  2200. Transfer(){
  2201. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  2202. this.$message.warning('请选择检验结论!')
  2203. return
  2204. }
  2205. // if (this.detailData.inspectorNo === '' || this.detailData.inspectorNo == null) {
  2206. // this.$message.warning('请选择检验员!')
  2207. // return
  2208. // }
  2209. for (let i = 0; i < this.detailList.length; i++) {
  2210. if(this.detailList[i].itemResult === '' || this.detailList[i].itemResult == null){
  2211. this.detailList[i].itemResult = 'Y'
  2212. }
  2213. // if(this.detailList[i].valueTypeDb === 'N') {
  2214. // checkFAISubDetailValue(this.detailList[i]).then(({data}) => {
  2215. // if (data.flag == 2 && this.detailList[i].itemResult === 'Y') {
  2216. // this.$confirm(this.detailList[i].itemDesc + ' 中实测值不在合格范围!是否保存为合格?', '提示', {
  2217. // confirmButtonText: '确定',
  2218. // cancelButtonText: '取消',
  2219. // type: 'warning'
  2220. // }).then(() => {
  2221. // this.saveDetailInformation()
  2222. // }).then(() => {
  2223. // return false
  2224. // })
  2225. // }else {
  2226. // this.saveDetailInformation()
  2227. // }
  2228. // })
  2229. // }
  2230. }
  2231. this.saveDetailInformation()
  2232. this.$message({message: '操作成功', type: 'success', duration: 1500, onClose: () => {}})
  2233. },
  2234. // 新增明细信息
  2235. saveDetailInformation(){
  2236. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  2237. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  2238. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  2239. this.saveInformationData.inspectorNo = this.$store.state.user.name
  2240. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  2241. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  2242. this.saveInformationData.rollQty = this.detailData.rollQty
  2243. this.saveInformationData.samplingQty = this.detailData.samplingQty
  2244. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  2245. saveFAIDetailedRecord(this.saveInformationData).then(({data}) => {
  2246. if (data && data.code === 0) {
  2247. this.getDataList()
  2248. this.detailInformationFlag = false
  2249. } else {
  2250. this.$alert(data.msg, '错误', {
  2251. confirmButtonText: '确定'
  2252. })
  2253. }
  2254. })
  2255. },
  2256. // 明细记录信息查询
  2257. detailModal(row){
  2258. this.detailData.site = this.$store.state.user.site
  2259. this.detailData.inspectionNo = row.inspectionNo
  2260. this.detailData.partNo = row.partNo
  2261. this.detailData.partDesc = row.partDesc
  2262. this.detailData.rollQty = row.rollQty
  2263. this.detailData.samplingQty = row.samplingQty
  2264. this.detailData.unqualifiedQty = row.unqualifiedQty
  2265. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  2266. this.detailData.submitFlag = row.submitFlag
  2267. this.detailData.disposalMeasures = row.disposalMeasures
  2268. this.detailData.disposalRemark = row.disposalRemark
  2269. this.detailData.inspectionResult = row.inspectionResult
  2270. this.detailData.inspectorNo = row.inspectorNo
  2271. this.detailData.inspectorName = row.inspectorName
  2272. this.detailData.inspectionRemark = row.inspectionRemark
  2273. this.detailData.cinvSourceCode = row.cinvSourceCode
  2274. this.detailData.sku = row.sku
  2275. this.detailData.spec = row.spec
  2276. this.detailData.umId = row.umId
  2277. this.detailData.umName = row.umName
  2278. this.getInspectionFormData()
  2279. this.inspectorSearch()
  2280. this.detailInformationFlag = true
  2281. },
  2282. // 检验单明细
  2283. getInspectionFormData(){
  2284. faiDetailSearch(this.detailData).then(({data}) => {
  2285. if (data && data.code === 0) {
  2286. this.detailList = data.rows
  2287. } else {
  2288. this.detailList = []
  2289. }
  2290. })
  2291. },
  2292. // 子明细记录信息查询
  2293. subDetailModal(row){
  2294. this.subDetailData.inspectionNo = row.inspectionNo;
  2295. this.subDetailData.itemNo = row.itemNo;
  2296. this.subDetailData.itemDesc = row.itemDesc;
  2297. this.subDetailData.defaultValue = row.defaultValue;
  2298. this.subDetailData.maxValue = row.maxValue;
  2299. this.subDetailData.minValue = row.minValue;
  2300. selectFAISubDetailedRecord(this.subDetailData).then(({data}) => {
  2301. this.tableData = data.rows
  2302. })
  2303. this.batchAddData = {
  2304. samplingLocation: '',
  2305. samplingLocationB: '',
  2306. samplingNumber: ''
  2307. }
  2308. this.subDetailFlag = true;
  2309. },
  2310. // 审核按钮
  2311. submitResult(){
  2312. let tempData1 = '' // 记录不是待审核状态的单号
  2313. let tempData2 = '' // 记录处置措施未填写的单号
  2314. if(this.FAISelections.length == 0){
  2315. this.$alert('请勾选要审核的检验单!', '提示', {
  2316. confirmButtonText: '确定'
  2317. })
  2318. return false
  2319. }
  2320. for (let i = 0; i < this.FAISelections.length; i++) {
  2321. if (this.FAISelections[i].state != '待审核'){
  2322. tempData1 = tempData1 + this.FAISelections[i].inspectionNo + '、'
  2323. }
  2324. if (this.FAISelections[i].inspectionResult == '不合格' && (this.FAISelections[i].disposalMeasures == '' || this.FAISelections[i].disposalMeasures == null)){
  2325. tempData2 = tempData2 + this.FAISelections[i].inspectionNo + '、'
  2326. }
  2327. }
  2328. if (tempData1 != ''){
  2329. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2330. this.$alert('检验单号 ' + tempData1 + ' 不是待审核状态!', '提示', {
  2331. confirmButtonText: '确定'
  2332. })
  2333. return false
  2334. }
  2335. if (tempData2 != ''){
  2336. tempData2 = tempData2.substring(0, tempData2.length - 1)
  2337. this.$alert('检验单号 ' + tempData2 + ' 的处置措施未选择!', '提示', {
  2338. confirmButtonText: '确定'
  2339. })
  2340. return false
  2341. }
  2342. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.FAISelections.length + ` 条记录`, '提示', {
  2343. confirmButtonText: '确定',
  2344. cancelButtonText: '取消',
  2345. type: 'warning'
  2346. }).then(() => {
  2347. this.submitData.submitList = this.FAISelections
  2348. saveFAISubmitResult(this.submitData).then(({data}) => {
  2349. if (data && data.code === 0) {
  2350. this.getDataList()
  2351. this.FAISelections = []
  2352. this.$message({
  2353. message: '操作成功',
  2354. type: 'success',
  2355. duration: 1500,
  2356. onClose: () => {
  2357. }
  2358. })
  2359. } else {
  2360. this.$alert(data.msg, '错误', {
  2361. confirmButtonText: '确定'
  2362. })
  2363. }
  2364. })
  2365. }).catch(() => {
  2366. })
  2367. },
  2368. // 子明细方法
  2369. //表格的新增
  2370. rowClassName({ row, rowIndex }) {
  2371. row.xh = rowIndex + 1
  2372. },
  2373. //单选框选中数据
  2374. handleDetailSelectionChange(selection) {
  2375. this.checkedDetail = selection
  2376. },
  2377. //点击新增更多
  2378. handleAddBtn(td) {
  2379. checkFAIIsSubmit(td).then(({data}) => {
  2380. if (data.flag != 1) {
  2381. let obj = {};
  2382. obj.subDetailValue = ""
  2383. obj.samplingLocation = ""
  2384. this.tableData.push(obj)
  2385. } else {
  2386. this.$alert("记录已提交!", '错误', {
  2387. confirmButtonText: '确定'
  2388. })
  2389. }
  2390. })
  2391. },
  2392. // 批量新增操作
  2393. batchHandleAdd (td) {
  2394. checkFAIIsSubmit(td).then(({data}) => {
  2395. if (data.flag != 1) {
  2396. this.batchHandleAddModalFlag = true
  2397. } else {
  2398. this.$alert("记录已提交!", '错误', {
  2399. confirmButtonText: '确定'
  2400. })
  2401. }
  2402. })
  2403. },
  2404. // 批量新增行
  2405. batchHandleAddModal () {
  2406. for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
  2407. let obj = {}
  2408. obj.samplingLocation = this.batchAddData.samplingLocation
  2409. obj.samplingLocationB = this.batchAddData.samplingLocationB
  2410. obj.subDetailValue = ""
  2411. this.tableData.push(obj)
  2412. }
  2413. this.batchHandleAddModalFlag = false
  2414. },
  2415. // 回车事件
  2416. nextFocus1 (index) {
  2417. let a1 = `${index + 1}` + `a`
  2418. this.$nextTick(() => {
  2419. this.$refs[a1].focus()
  2420. })
  2421. },
  2422. nextFocus2 (index) {
  2423. let a2 = `${index + 1}` + `b`
  2424. this.$nextTick(() => {
  2425. this.$refs[a2].focus()
  2426. })
  2427. },
  2428. nextFocus3 (index) {
  2429. let a3 = `${index + 1}` + `c`
  2430. this.$nextTick(() => {
  2431. this.$refs[a3].focus()
  2432. })
  2433. },
  2434. //删除
  2435. handleDeleteBtn(td) {
  2436. checkFAIIsSubmit(td).then(({data}) => {
  2437. if (data.flag != 1) {
  2438. if (this.checkedDetail.length == 0) {
  2439. this.$alert("请先选择要删除的数据", "提示", {
  2440. confirmButtonText: "确定",
  2441. })
  2442. } else {
  2443. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  2444. confirmButtonText: "确定",
  2445. cancelButtonText: "取消",
  2446. type: "warning",
  2447. callback: (action) => {
  2448. if (action === "confirm") {
  2449. let val = this.checkedDetail
  2450. val.forEach((val, index) => {
  2451. this.tableData.forEach((v, i) => {
  2452. if (val.xh === v.xh) {
  2453. this.tableData.splice(i, 1)
  2454. }
  2455. })
  2456. })
  2457. this.$message({
  2458. message: "删除成功!",
  2459. type: "success",
  2460. })
  2461. return
  2462. } else {
  2463. this.$message({
  2464. message: "已取消删除操作",
  2465. type: "warning",
  2466. })
  2467. return
  2468. }
  2469. },
  2470. })
  2471. }
  2472. } else {
  2473. this.$alert("记录已提交!", '错误', {
  2474. confirmButtonText: '确定'
  2475. })
  2476. }
  2477. })
  2478. },
  2479. // 新增子明细记录
  2480. saveSubDetailResult(){
  2481. for (let i = 0; i < this.tableData.length; i++) {
  2482. if(this.tableData[i].subDetailValue == '' || this.tableData[i].subDetailValue == null){
  2483. this.$message.warning('序号' + (i+1) +'未填写实测值!')
  2484. return
  2485. }
  2486. }
  2487. this.subDetailData.subDetailValues = this.tableData
  2488. saveFAISubDetailed(this.subDetailData).then(({data}) => {
  2489. if (data && data.code === 0) {
  2490. faiDetailSearch(this.detailData).then(({data}) => {
  2491. this.detailList = data.rows
  2492. })
  2493. this.subDetailFlag = false
  2494. this.tableData = []
  2495. this.$message({
  2496. message: '操作成功',
  2497. type: 'success',
  2498. duration: 1500,
  2499. onClose: () => {}
  2500. })
  2501. } else {
  2502. this.$alert(data.msg, '错误', {
  2503. confirmButtonText: '确定'
  2504. })
  2505. }
  2506. })
  2507. },
  2508. // 校验用户是否收藏
  2509. favoriteIsOk() {
  2510. let userFavorite = {
  2511. userId: this.$store.state.user.id,
  2512. languageCode: this.$i18n.locale
  2513. }
  2514. userFavoriteList(userFavorite).then(({data}) => {
  2515. for (let i = 0; i < data.list.length; i++) {
  2516. if(this.$route.meta.menuId==data.list[i].menuId){
  2517. this.favorite = true
  2518. }
  2519. }
  2520. })
  2521. },
  2522. // 收藏 OR 取消收藏
  2523. favoriteFunction() {
  2524. let userFavorite = {
  2525. userId: this.$store.state.user.id,
  2526. functionId: this.$route.meta.menuId,
  2527. }
  2528. if (this.favorite) {
  2529. removeUserFavorite(userFavorite).then(({data}) => {
  2530. this.$message.success(data.msg)
  2531. this.favorite = false
  2532. })
  2533. } else {
  2534. // 收藏
  2535. saveUserFavorite(userFavorite).then(({data}) => {
  2536. this.$message.success(data.msg)
  2537. this.favorite = true
  2538. })
  2539. }
  2540. },
  2541. //导出excel
  2542. async createExportData() {
  2543. this.searchData.limit = -1
  2544. this.searchData.page = 1
  2545. await qcFAIInspectionSearch(this.searchData).then(({data}) => {
  2546. this.exportList= data.page.list;
  2547. })
  2548. return this.exportList;
  2549. },
  2550. startDownload() {},
  2551. finishDownload() {},
  2552. fields() {
  2553. let json = "{"
  2554. this.columnList1.forEach((item, index) => {
  2555. if (index == this.columnList1.length - 1) {
  2556. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  2557. } else {
  2558. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  2559. }
  2560. })
  2561. json += "}"
  2562. let s = eval("(" + json + ")")
  2563. return s
  2564. },
  2565. // 动态列开始 获取 用户保存的 格式列
  2566. async getTableUserColumn(tableId, columnId) {
  2567. let queryTableUser = {
  2568. userId: this.$store.state.user.name,
  2569. functionId: this.$route.meta.menuId,
  2570. tableId: tableId,
  2571. status: true,
  2572. languageCode: this.$i18n.locale
  2573. }
  2574. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2575. if (data.rows.length > 0) {
  2576. //this.columnList1 = []
  2577. switch (columnId) {
  2578. case 1:
  2579. this.columnList1 = data.rows
  2580. break;
  2581. // case 2:
  2582. // this.columnList1 = data.rows
  2583. // break;
  2584. // case 3:
  2585. // this.columnList2 = data.rows
  2586. // break;
  2587. // case 4:
  2588. // this.columnList3 = data.rows
  2589. // break;
  2590. }
  2591. } else {
  2592. this.getColumnList(tableId, columnId)
  2593. }
  2594. })
  2595. },
  2596. // 获取 tableDefault 列
  2597. async getColumnList(tableId, columnId) {
  2598. this.queryTable.tableId = tableId
  2599. let queryTable= {
  2600. functionId: this.$route.meta.menuId,
  2601. tableId: tableId,
  2602. languageCode: this.$i18n.locale
  2603. }
  2604. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2605. if (!data.rows.length == 0) {
  2606. switch (columnId) {
  2607. case 1:
  2608. this.columnList1 = data.rows
  2609. break;
  2610. // case 2:
  2611. // this.columnList1 = data.rows
  2612. // break;
  2613. // case 3:
  2614. // this.columnList2 = data.rows
  2615. // break;
  2616. // case 4:
  2617. // this.columnList3 = data.rows
  2618. // break;
  2619. }
  2620. } else {
  2621. // this.showDefault = true.
  2622. }
  2623. })
  2624. },
  2625. //动态列结束
  2626. }
  2627. }
  2628. </script>
  2629. <style scoped>
  2630. </style>