祥兆质量前端
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.

4194 lines
148 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 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" @keyup.enter.native="getDataList">
  11. <el-form-item :label="'BU'">
  12. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 75px">
  13. <el-option
  14. v-for = "i in userBuList"
  15. :key = "i.buNo"
  16. :label = "i.buDesc"
  17. :value = "i.buDesc">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'检验单号'">
  22. <el-input v-model="searchData.inspectionNo" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'物料编码'">
  25. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'物料名称'">
  28. <el-input v-model="searchData.partDesc" clearable style="width: 285px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'检验类型'">
  31. <el-select v-model="searchData.inspectionTypeNo" clearable style="width: 100px">
  32. <el-option label="IPQC首检" value="101"></el-option>
  33. <el-option label="IPQC自检" value="102"></el-option>
  34. <el-option label="IPQC巡检" value="103"></el-option>
  35. <el-option label="IPQC末件检" value="104"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-form>
  39. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  40. <el-form-item :label="'检验结论'">
  41. <el-select v-model="searchData.inspectionResult" clearable style="width: 80px">
  42. <el-option label="合格" value="合格"></el-option>
  43. <el-option label="不合格" value="不合格"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item :label="'处置措施'">
  47. <el-select v-model="searchData.disposalMeasures" clearable style="width: 90px">
  48. <el-option
  49. v-for = "i in disposalMeasuresOptions"
  50. :key = "i.id"
  51. :label = "i.disposalMeasures"
  52. :value = "i.disposalMeasures">
  53. </el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item :label="'工单号'">
  57. <el-input v-model="searchData.orderNo" clearable style="width: 137px"></el-input>
  58. </el-form-item>
  59. <el-form-item :label="'派工单号'">
  60. <el-input v-model="searchData.seqNo" clearable style="width: 173px"></el-input>
  61. </el-form-item>
  62. <el-form-item :label="'工序'">
  63. <el-input v-model="searchData.operationDesc" clearable style="width: 108px"></el-input>
  64. </el-form-item>
  65. <el-form-item :label="'状态'">
  66. <el-select v-model="searchData.states" multiple style="width: 340px">
  67. <el-option label="未开始" value="未开始"></el-option>
  68. <el-option label="待检验" value="待检验"></el-option>
  69. <el-option label="待审核" value="待审核"></el-option>
  70. <el-option label="已完成" value="已完成"></el-option>
  71. </el-select>
  72. </el-form-item>
  73. </el-form>
  74. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  75. <el-form-item :label="'送检人员'">
  76. <el-input v-model="searchData.createBy" clearable style="width: 125px"></el-input>
  77. </el-form-item>
  78. <el-form-item :label="'送检日期'">
  79. <el-date-picker style="width: 130px" v-model="searchData.startDate2" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="开始日期"></el-date-picker>
  80. -
  81. <el-date-picker style="width: 130px" v-model="searchData.endDate2" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="结束日期"></el-date-picker>
  82. </el-form-item>
  83. <el-form-item :label="'检验日期:'">
  84. <el-date-picker style="width: 130px" v-model="searchData.startDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="开始日期"></el-date-picker>
  85. -
  86. <el-date-picker style="width: 130px" v-model="searchData.endDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="结束日期"></el-date-picker>
  87. </el-form-item>
  88. <el-form-item :label="' '">
  89. <el-button v-if="!authSearch" type="primary" @click="getDataList">查询</el-button>
  90. <el-button v-if="!authSave" type="primary" @click="addModal">新增</el-button>
  91. <el-button v-if="!authCheck" type="primary" @click="submitResult">审核</el-button>
  92. <el-button v-if="!authDelete" type="primary" @click="deleteModal">删除</el-button>
  93. <download-excel
  94. :fields="fields()"
  95. :data="exportData"
  96. type="xls"
  97. :name="exportName"
  98. :header="exportHeader"
  99. :footer="exportFooter"
  100. :fetch="createExportData"
  101. :before-generate="startDownload"
  102. :before-finish="finishDownload"
  103. worksheet="导出信息"
  104. class="el-button el-button--primary el-button--medium">
  105. {{ "导出" }}
  106. </download-excel>
  107. </el-form-item>
  108. </el-form>
  109. <!-- 检验记录展示列表 -->
  110. <el-table
  111. :height="height"
  112. :data="dataList"
  113. border
  114. ref="IPQCTable"
  115. show-summary
  116. :summary-method="getSummaries"
  117. :row-style="rowStyle"
  118. @row-click="IPQCClickRow"
  119. @selection-change="selectionIPQC"
  120. style="width: 100%;">
  121. <el-table-column
  122. type="selection"
  123. header-align="center"
  124. align="center"
  125. :selectable="selectFlag"
  126. width="50">
  127. </el-table-column>
  128. <el-table-column
  129. prop="state"
  130. header-align="center"
  131. align="center"
  132. label="状态">
  133. <template slot-scope="scope">
  134. <div :style="{fontWeight:'bold', color: scope.row.state =='待检验' ? 'red' : scope.row.state =='待审核' ? '#ffa500e0' : scope.row.state =='已完成' ? '#3ac252' : ''}">
  135. <i v-if="scope.row.importantFlag === 'Y'" class="el-icon-s-flag" style="color: red"></i> {{ scope.row.state }}
  136. </div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column
  140. v-for="(item,index) in columnList1" :key="index"
  141. :sortable="item.columnSortable"
  142. :prop="item.columnProp"
  143. :header-align="item.headerAlign"
  144. :show-overflow-tooltip="item.showOverflowTooltip"
  145. :align="item.align"
  146. :fixed="item.fixed==''?false:item.fixed"
  147. :min-width="item.columnWidth"
  148. :label="item.columnLabel">
  149. <template slot-scope="scope">
  150. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  151. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column
  155. fixed="right"
  156. header-align="center"
  157. align="center"
  158. width="100"
  159. label="操作">
  160. <template slot-scope="scope">
  161. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state === '未开始'" @click="actionModal(scope.row)">开始检验</el-link>
  162. <el-link style="cursor: pointer" v-if="!authDetail && scope.row.state !== '未开始'" @click="detailModal(scope.row)">检验单</el-link>
  163. <el-dropdown trigger="click">
  164. <el-link style="cursor: pointer;font-size: 12px">更多</el-link>
  165. <el-dropdown-menu slot="dropdown">
  166. <el-dropdown-item v-if="!authFile" @click.native="getFileContentData(scope.row)">工作文件</el-dropdown-item>
  167. </el-dropdown-menu>
  168. </el-dropdown>
  169. </template>
  170. </el-table-column>
  171. </el-table>
  172. <!-- 分页-->
  173. <el-pagination
  174. @size-change="sizeChangeHandle"
  175. @current-change="currentChangeHandle"
  176. :current-page="pageIndex"
  177. :page-sizes="[20, 50, 100, 200, 500]"
  178. :page-size="pageSize"
  179. :total="totalPage"
  180. layout="total, sizes, prev, pager, next, jumper">
  181. </el-pagination>
  182. <!-- 新增巡检记录 -->
  183. <el-dialog title="新增检验记录" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px">
  184. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  185. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  186. <el-select v-model="modalData.bu" placeholder="请选择" @change="buChange" style="width: 221px">
  187. <el-option
  188. v-for = "i in userBuList"
  189. :key = "i.buNo"
  190. :label = "i.buNo"
  191. :value = "i.buNo">
  192. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  193. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  194. {{ i.buDesc }}
  195. </span>
  196. </el-option>
  197. </el-select>
  198. </el-form-item>
  199. <el-form-item label="箱号">
  200. <el-input v-if="this.modalData.specialTaskFlag === 'Y'" disabled v-model="modalData.boxNo" style="width: 221px"></el-input>
  201. <el-input v-else v-model="modalData.boxNo" @keyup.native.enter="boxNoEnter" clearable style="width: 221px"></el-input>
  202. </el-form-item>
  203. <!-- <el-form-item label="标签号">-->
  204. <!-- <el-input v-if="this.modalData.specialTaskFlag === 'Y'" disabled v-model="modalData.rollNo" style="width: 221px"></el-input>-->
  205. <!-- <el-input v-else v-model="modalData.rollNo" @keyup.native.enter="rollNoEnter" clearable style="width: 221px"></el-input>-->
  206. <!-- </el-form-item>-->
  207. </el-form>
  208. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  209. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && (this.modalData.rollNo === '' || this.modalData.rollNo == null)" prop="orderNo" :rules="rules.seqNoType">
  210. <span style="cursor: pointer" slot="label" @click="getBaseList(1052)"><a herf="#">派工单号</a></span>
  211. <el-input v-model="modalData.seqNo" style="width: 221px"></el-input>
  212. </el-form-item>
  213. <el-form-item v-if="this.modalData.specialTaskFlag !== 'Y' && this.modalData.rollNo != null && this.modalData.rollNo !== ''" prop="orderNo" :rules="rules.seqNoType">
  214. <span slot="label">派工单号</span>
  215. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  216. </el-form-item>
  217. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" prop="orderNo" :rules="rules.seqNoType">
  218. <span slot="label">派工单号</span>
  219. <el-input v-model="modalData.seqNo" disabled style="width: 221px"></el-input>
  220. </el-form-item>
  221. <el-form-item label="工单号" prop="orderNo" :rules="rules.orderNoType">
  222. <el-input v-model="modalData.orderNo" style="width: 221px" disabled></el-input>
  223. </el-form-item>
  224. </el-form>
  225. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  226. <el-form-item label="工序" prop="operationDesc" :rules="rules.operationDescType">
  227. <el-select v-model="modalData.operationDesc" placeholder="请选择" style="width: 221px">
  228. <el-option
  229. v-for = "i in operationList"
  230. :key = "i.operationNo"
  231. :label = "i.operationDesc"
  232. :value = "i.operationDesc">
  233. </el-option>
  234. </el-select>
  235. </el-form-item>
  236. <el-form-item>
  237. <span style="cursor: pointer" slot="label" @click="getBaseList(505)"><a herf="#">机台</a></span>
  238. <el-input v-model="modalData.resourceDesc" readonly style="width: 221px"></el-input>
  239. </el-form-item>
  240. <!-- <el-form-item v-else label="机台" prop="resourceId" :rules="rules.resourceIdType">-->
  241. <!-- <el-input v-model="modalData.resourceDesc" style="width: 221px"></el-input>-->
  242. <!-- </el-form-item>-->
  243. </el-form>
  244. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  245. <el-form-item v-if="this.modalData.specialTaskFlag === 'Y'" :model="modalData">
  246. <span style="cursor: pointer" slot="label" @click="queryPartList"><a herf="#">物料编码</a></span>
  247. <el-input v-model="modalData.partNo" style="width: 221px"></el-input>
  248. </el-form-item>
  249. <el-form-item v-else label="物料编码" prop="partNo" :rules="rules.partNoType">
  250. <el-input v-model="modalData.partNo" readonly style="width: 221px"></el-input>
  251. </el-form-item>
  252. <el-form-item label="物料类别">
  253. <el-input v-model="modalData.spec" readonly style="width: 221px"></el-input>
  254. </el-form-item>
  255. </el-form>
  256. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  257. <el-form-item label="物料名称">
  258. <el-input v-model="modalData.partDesc" readonly style="width: 456px"></el-input>
  259. </el-form-item>
  260. </el-form>
  261. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  262. <el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
  263. <el-select v-model="modalData.inspectionTypeNo" style="width: 104px">
  264. <el-option label="首件检" value="首件检"></el-option>
  265. <el-option label="自检" value="自检"></el-option>
  266. <el-option label="巡检" value="巡检"></el-option>
  267. <el-option label="末件检" value="末件检"></el-option>
  268. </el-select>
  269. </el-form-item>
  270. <el-form-item label="送检数量" prop="rollQty" :rules="rules.rollQtyType">
  271. <el-input v-model="modalData.rollQty" type="number" style="width: 104px"></el-input>
  272. </el-form-item>
  273. <el-form-item label="单位" prop="umId" :rules="rules.umIdType">
  274. <el-select v-model="modalData.umId" placeholder="请选择" style="width: 104px">
  275. <el-option
  276. v-for = "i in umList"
  277. :key = "i.umId"
  278. :label = "i.umName"
  279. :value = "i.umId">
  280. </el-option>
  281. </el-select>
  282. </el-form-item>
  283. <el-form-item label=" ">
  284. <el-checkbox v-model="modalData.importantFlag" true-label="Y">重点检验</el-checkbox>
  285. </el-form-item>
  286. </el-form>
  287. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  288. <el-form-item prop="templateId" :rules="rules.templateId">
  289. <span style="cursor: pointer" v-if="this.controlData.baseData === '控制'" slot="label" @click="queryTemplateList"><a>检验模板</a></span>
  290. <span v-else slot="label">检验模板</span>
  291. <el-input v-model="modalData.templateName" readonly style="width: 221px"></el-input>
  292. </el-form-item>
  293. <el-form-item label="送检总数">
  294. <el-input v-model="modalData.sjzs" disabled style="width: 104px"></el-input>
  295. </el-form-item>
  296. <el-form-item label=" ">
  297. <input type="checkbox" id="specialTask" name="specialTask" v-model="checked" @click="changeSpecialTask"/> <label for="specialTask">无工单检验</label>
  298. </el-form-item>
  299. </el-form>
  300. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  301. <el-form-item label="特殊要求">
  302. <el-input type="textarea" v-model="modalData.specialRequirements" :rows="3" resize='none' show-word-limit style="width: 456px;height: 30px"></el-input>
  303. </el-form-item>
  304. </el-form>
  305. <el-footer style="height:40px;margin-top: 55px;text-align:center">
  306. <el-button :loading="saveLoading" type="primary" @click="saveData">保存</el-button>
  307. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  308. </el-footer>
  309. </el-dialog>
  310. <!-- 检验单详情页 -->
  311. <el-dialog title="检验明细清单" :close-on-click-modal="false" v-drag top="5vh" :visible.sync="detailInformationFlag" width="1200px">
  312. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList">
  313. <el-form-item :label="'物料编码'">
  314. <el-input v-model="detailData.partNo" readonly style="width: 100px"></el-input>
  315. </el-form-item>
  316. <el-form-item :label="'物料类别'">
  317. <el-input v-model="detailData.spec" readonly style="width: 200px"></el-input>
  318. </el-form-item>
  319. <el-form-item :label="'物料名称'">
  320. <el-input v-model="detailData.partDesc" readonly style="width: 200px"></el-input>
  321. </el-form-item>
  322. <el-form-item :label="'送检数量'">
  323. <el-input class="inlineNumber numInput" v-model="detailData.rollQty" type="number" style="width: 80px"></el-input>
  324. </el-form-item>
  325. <el-form-item :label="'抽样数量'">
  326. <el-input class="inlineNumber numInput" v-model="detailData.samplingQty" type="number" style="width: 80px"></el-input>
  327. </el-form-item>
  328. <el-form-item :label="'单位'">
  329. <el-input v-model="detailData.umName" readonly style="width: 80px"></el-input>
  330. </el-form-item>
  331. <el-form-item :label="'不合格项目数量'">
  332. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="detailData.unqualifiedQty" disabled type="number" style="width: 80px"></el-input>
  333. <el-input class="inlineNumber numInput" v-else @input="handleInput(detailData.unqualifiedQty,1)" v-model="detailData.unqualifiedQty" type="number" style="width: 80px"></el-input>
  334. </el-form-item>
  335. <el-form-item :label="'合格数量'">
  336. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="detailData.passQty" disabled type="number" style="width: 80px"></el-input>
  337. <el-input class="inlineNumber numInput" v-else @input="handleInput(detailData.passQty,2)" v-model="detailData.passQty" type="number" style="width: 80px"></el-input>
  338. </el-form-item>
  339. <el-form-item :label="'不合格数量'">
  340. <el-input class="inlineNumber numInput" v-model="detailData.notPassQty" type="number" disabled style="width: 80px"></el-input>
  341. </el-form-item>
  342. </el-form>
  343. <el-form :inline="true" label-position="top" @keyup.enter.native = "getDataList">
  344. <el-form-item :label="'检验结论'">
  345. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionResult" disabled style="width: 100px" placeholder="请选择">
  346. <el-option label="合格" value="合格"></el-option>
  347. <el-option label="不合格" value="不合格"></el-option>
  348. </el-select>
  349. <el-select v-else v-model="detailData.inspectionResult" @change="resultChange" style="width: 100px" placeholder="请选择">
  350. <el-option label="合格" value="合格"></el-option>
  351. <el-option label="不合格" value="不合格"></el-option>
  352. </el-select>
  353. </el-form-item>
  354. <el-form-item :label="'质检备注'">
  355. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectionRemark" disabled style="width: 303px"></el-input>
  356. <el-input v-else v-model="detailData.inspectionRemark" style="width: 303px"></el-input>
  357. </el-form-item>
  358. <el-form-item label="检验员">
  359. <el-select v-if="detailData.submitFlag === 'Y'" v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  360. <el-option
  361. v-for = "i in options"
  362. :key = "i.inspectorNo"
  363. :label = "i.inspectorName"
  364. :value = "i.inspectorNo">
  365. </el-option>
  366. </el-select>
  367. <el-select v-else v-model="detailData.inspectorNo" disabled placeholder="请选择" style="width: 100px">
  368. <el-option
  369. v-for = "i in options"
  370. :key = "i.inspectorNo"
  371. :label = "i.inspectorName"
  372. :value = "i.inspectorNo">
  373. </el-option>
  374. </el-select>
  375. </el-form-item>
  376. <el-form-item>
  377. <span v-if="detailData.submitFlag === 'Y'" slot="label">协同人员</span>
  378. <span v-else style="cursor: pointer" slot="label" @click="getOperatorList"><a>协同人员</a></span>
  379. <el-input v-model="detailData.operatorName" readonly style="width: 173px"></el-input>
  380. </el-form-item>
  381. <el-form-item>
  382. <span v-if="detailData.submitFlag === 'Y'" slot="label">责任人(供应商)</span>
  383. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(509)" ><a>责任人(供应商)</a></span>
  384. <el-input v-model="detailData.responsiblePerson" :readonly="detailData.submitFlag === 'Y'" style="width: 224px"></el-input>
  385. <!-- <span v-if="detailData.submitFlag === 'Y'" slot="label">责任人</span>-->
  386. <!-- <span v-else style="cursor: pointer" slot="label" @click="getResponsiblePersonList"><a>责任人</a></span>-->
  387. <!-- <el-input v-model="detailData.responsiblePersonName" readonly style="width: 173px"></el-input>-->
  388. </el-form-item>
  389. <el-form-item :label="' '">
  390. <el-button type="primary" @click="getFileContentData(detailData)">工作文件</el-button>
  391. <!-- <el-button type="primary" @click="addUploadFileModal">上传文件</el-button>-->
  392. <el-button type="primary" icon="el-icon-upload" @click="subDetailUpload">明细导入</el-button>
  393. </el-form-item>
  394. </el-form>
  395. <el-form v-show="detailData.inspectionResult === '不合格'" :inline="true" label-position="top">
  396. <el-form-item :label="'处置措施'">
  397. <el-select v-if="detailData.submitFlag === 'Y'" clearable v-model="detailData.disposalMeasures" disabled style="width: 100px">
  398. <el-option
  399. v-for = "i in disposalMeasuresOptions"
  400. :key = "i.id"
  401. :label = "i.disposalMeasures"
  402. :value = "i.disposalMeasures">
  403. </el-option>
  404. </el-select>
  405. <el-select v-else clearable v-model="detailData.disposalMeasures" style="width: 100px">
  406. <el-option
  407. v-for = "i in disposalMeasuresOptions"
  408. :key = "i.id"
  409. :label = "i.disposalMeasures"
  410. :value = "i.disposalMeasures">
  411. </el-option>
  412. </el-select>
  413. </el-form-item>
  414. <el-form-item :label="'处置说明'">
  415. <el-input v-if="detailData.submitFlag === 'Y'" v-model="detailData.disposalRemark" disabled style="width: 200px"></el-input>
  416. <el-input v-else v-model="detailData.disposalRemark" style="width: 280px"></el-input>
  417. </el-form-item>
  418. </el-form>
  419. <!-- 展示列表 -->
  420. <div class="rq ">
  421. <el-table
  422. :height="400"
  423. :data="detailList"
  424. border
  425. :row-style="rowDetailStyle"
  426. @row-click="IPQCDetailClickRow"
  427. style="width: 100%;">
  428. <el-table-column
  429. prop=""
  430. header-align="center"
  431. align="center"
  432. min-width="60"
  433. label="操作">
  434. <template slot-scope="scope">
  435. <el-button v-if="scope.row.detailImageNum > 0" type="success" class="el-icon-picture" @click="uploadImageModal(scope.row)"></el-button>
  436. <el-button v-else class="el-icon-picture" type="primary" @click="uploadImageModal(scope.row)"></el-button>
  437. </template>
  438. </el-table-column>
  439. <el-table-column
  440. v-for="(item,index) in detailColumnList" :key="index"
  441. :sortable="item.columnSortable"
  442. :prop="item.columnProp"
  443. :header-align="item.headerAlign"
  444. :show-overflow-tooltip="item.showOverflowTooltip"
  445. :align="item.align"
  446. :fixed="item.fixed==''?false:item.fixed"
  447. :min-width="item.columnWidth"
  448. :label="item.columnLabel">
  449. <template slot-scope="scope">
  450. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  451. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  452. </template>
  453. </el-table-column>
  454. <el-table-column
  455. prop=""
  456. header-align="center"
  457. align="right"
  458. min-width="80"
  459. label="实测值">
  460. <template slot-scope="scope">
  461. <el-input :ref="`textValue${scope.$index}`" v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numberValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" type="number" style="height: 11px; width: 98%"></el-input>
  462. <el-input :ref="`textValue${scope.$index}`" v-else v-model="scope.row.textValue" @keyup.enter.native="focusNextInput(scope.$index, 'textValue')" style="height: 11px; width: 98%"></el-input>
  463. </template>
  464. </el-table-column>
  465. <el-table-column
  466. prop=""
  467. header-align="center"
  468. align="center"
  469. min-width="80"
  470. label="检验明细">
  471. <template slot-scope="scope">
  472. <el-button v-if="scope.row.subDetailRecordNum > 0" type="success" @click="subDetailModal(scope.row)">点击输入</el-button>
  473. <el-button v-else type="primary" @click="subDetailModal(scope.row)">点击输入</el-button>
  474. </template>
  475. </el-table-column>
  476. <el-table-column
  477. prop=""
  478. header-align="center"
  479. align="right"
  480. min-width="80"
  481. label="抽样数量">
  482. <template slot-scope="scope">
  483. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.samplingQty" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  484. <el-input class="inlineNumber numInput" v-else :ref="`samplingQty${scope.$index}`" v-model="scope.row.samplingQty" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'samplingQty')" style="height: 11px; width: 98%"></el-input>
  485. </template>
  486. </el-table-column>
  487. <el-table-column
  488. prop=""
  489. header-align="center"
  490. align="right"
  491. min-width="80"
  492. label="不合格数量">
  493. <template slot-scope="scope">
  494. <el-input class="inlineNumber numInput" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.unqualifiedQuantity" disabled type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"></el-input>
  495. <el-input class="inlineNumber numInput" v-else :ref="`unqualifiedQuantity${scope.$index}`" v-model="scope.row.unqualifiedQuantity" type="number" @keyup.enter.native="focusNextInput(scope.$index, 'unqualifiedQuantity')" style="height: 11px; width: 98%"></el-input>
  496. </template>
  497. </el-table-column>
  498. <el-table-column
  499. prop=""
  500. header-align="center"
  501. align="right"
  502. min-width="90"
  503. label="项目检验结论">
  504. <template slot-scope="scope">
  505. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-if="detailData.submitFlag === 'Y'" v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px">
  506. <el-option label="合格" value="Y" style="color: green"></el-option>
  507. <el-option label="不合格" value="N" style="color: red"></el-option>
  508. </el-select>
  509. <el-select :class="{redElSelect:scope.row.itemResult === 'N', greenElSelect:scope.row.itemResult === 'Y'}" v-else v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  510. <el-option label="合格" value="Y" style="color: green"></el-option>
  511. <el-option label="不合格" value="N" style="color: red"></el-option>
  512. </el-select>
  513. </template>
  514. </el-table-column>
  515. </el-table>
  516. </div>
  517. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  518. <el-button type="primary" @click="Transfer">保存</el-button>
  519. <el-button type="primary" @click="detailInformationFlag=false">关闭</el-button>
  520. </el-footer>
  521. </el-dialog>
  522. <!-- 子明细信息 -->
  523. <el-dialog title="子明细信息" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="572px">
  524. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn(subDetailData)">添加</el-button>
  525. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn(subDetailData)">删除</el-button>
  526. <el-button type="primary" icon="el-icon-more" size="mini" @click="batchHandleAdd(subDetailData)">批量新增</el-button>
  527. <div class="rq ">
  528. <el-table
  529. :height="400"
  530. :data="templateTableData"
  531. border
  532. :row-class-name="rowClassName"
  533. @selection-change="handleDetailSelectionChange"
  534. style="width: 100%;">
  535. <el-table-column type="selection" align="center" width="50"></el-table-column>
  536. <el-table-column label="序号" align="center" prop="rowI" width="50"></el-table-column>
  537. <el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150">
  538. <template slot-scope="{row}">
  539. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input>
  540. <el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input>
  541. </template>
  542. </el-table-column>
  543. <el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150">
  544. <template slot-scope="{row}">
  545. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input>
  546. <el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input>
  547. </template>
  548. </el-table-column>
  549. <el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值" width="150">
  550. <template slot-scope="{row}">
  551. <el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值"></el-input>
  552. <el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值"></el-input>
  553. </template>
  554. </el-table-column>
  555. </el-table>
  556. <!-- 分页-->
  557. <el-pagination
  558. @size-change="sizeChangeHandle2"
  559. @current-change="currentChangeHandle2"
  560. :current-page="pageIndex2"
  561. :page-sizes="[20, 50, 100, 200, 500]"
  562. :page-size="pageSize2"
  563. :total="tableData.length"
  564. layout="total, sizes, prev, pager, next, jumper">
  565. </el-pagination>
  566. </div>
  567. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  568. <el-button v-if="detailData.submitFlag !== 'Y'" type="primary" @click="saveSubDetailResult">保存</el-button>
  569. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  570. </el-footer>
  571. </el-dialog>
  572. <!-- 派工单号 -->
  573. <el-dialog title="派工单号" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="seqDetailFlag" width="952px" height="273px">
  574. <el-form :inline="true" label-position="top" :model="seqDetailData" style="margin-left: 7px;margin-top: -5px;">
  575. <el-form-item label="工单号">
  576. <el-input v-model="seqDetailData.orderNo" clearable style="width: 150px"></el-input>
  577. </el-form-item>
  578. <el-form-item label="派工单号">
  579. <el-input v-model="seqDetailData.seqNo" clearable style="width: 150px"></el-input>
  580. </el-form-item>
  581. <el-form-item label="状态">
  582. <el-select v-model="seqDetailData.status" style="width: 100px" placeholder="请选择">
  583. <el-option label="全部" value=""></el-option>
  584. <el-option label="已发料" value="已发料"></el-option>
  585. <el-option label="已关闭" value="已关闭"></el-option>
  586. <el-option label="已计划" value="已计划"></el-option>
  587. <el-option label="已开工" value="已开工"></el-option>
  588. <el-option label="已入库" value="已入库"></el-option>
  589. <el-option label="已下达" value="已下达"></el-option>
  590. </el-select>
  591. </el-form-item>
  592. <el-form-item label=" ">
  593. <el-checkbox v-model="seqDetailData.cancelFlag" true-label="Y">包含已取消工单</el-checkbox>
  594. </el-form-item>
  595. </el-form>
  596. <el-form :inline="true" label-position="top" :model="seqDetailData" style="margin-left: 7px;margin-top: -5px;">
  597. <el-form-item label="物料编码">
  598. <el-input v-model="seqDetailData.partNo" clearable style="width: 150px"></el-input>
  599. </el-form-item>
  600. <el-form-item label="物料名称">
  601. <el-input v-model="seqDetailData.partDesc" clearable style="width: 315px"></el-input>
  602. </el-form-item>
  603. <el-form-item label="工序">
  604. <el-input v-model="seqDetailData.operationDesc" clearable style="width: 150px"></el-input>
  605. </el-form-item>
  606. <el-form-item>
  607. <el-button type="primary" @click="searchSeqInfo" style="margin-top: 24px">查询</el-button>
  608. </el-form-item>
  609. </el-form>
  610. <el-table
  611. :height="400"
  612. :data="seqInfoList"
  613. @row-dblclick="getRowData1"
  614. border
  615. style="width: 100%;">
  616. <el-table-column
  617. v-for="(item,index) in seqDetailColumnList" :key="index"
  618. :sortable="item.columnSortable"
  619. :prop="item.columnProp"
  620. :header-align="item.headerAlign"
  621. :show-overflow-tooltip="item.showOverflowTooltip"
  622. :align="item.align"
  623. :fixed="item.fixed==''?false:item.fixed"
  624. :min-width="item.columnWidth"
  625. :label="item.columnLabel">
  626. </el-table-column>
  627. </el-table>
  628. <!-- 分页插件 -->
  629. <el-pagination
  630. @size-change="sizeChangeHandle3"
  631. @current-change="currentChangeHandle3"
  632. :current-page="pageIndex3"
  633. :page-sizes="[20, 50, 100, 200, 500]"
  634. :page-size="pageSize3"
  635. :total="totalPage3"
  636. layout="total, sizes, prev, pager, next, jumper">
  637. </el-pagination>
  638. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  639. <el-button type="primary" @click="seqDetailFlag = false">关闭</el-button>
  640. </el-footer>
  641. </el-dialog>
  642. <!-- 批量新增子明细操作-->
  643. <el-dialog title="批量新增" :close-on-click-modal="false" v-drag :visible.sync="batchHandleAddModalFlag" width="510px">
  644. <el-form :inline="true" label-position="top">
  645. <el-form-item :label="'默认抽样位置A'">
  646. <el-input v-model="batchAddData.samplingLocation" style="width: 150px"></el-input>
  647. </el-form-item>
  648. <el-form-item :label="'默认抽样位置B'">
  649. <el-input v-model="batchAddData.samplingLocationB" style="width: 150px"></el-input>
  650. </el-form-item>
  651. <el-form-item :label="'抽样数量'">
  652. <el-input type="number" v-model="batchAddData.samplingNumber" style="width: 150px"></el-input>
  653. </el-form-item>
  654. </el-form>
  655. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  656. <el-button type="primary" @click="batchHandleAddModal">保存</el-button>
  657. <el-button type="primary" @click="batchHandleAddModalFlag=false">关闭</el-button>
  658. </el-footer>
  659. </el-dialog>
  660. <!-- 检验模板 -->
  661. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="templateModelFlag" width="520px">
  662. <div class="rq">
  663. <el-form :inline="true" label-position="top" :model="templateData">
  664. <el-form-item :label="'模板编码'">
  665. <el-input v-model="templateData.templateId" clearable style="width: 120px"></el-input>
  666. </el-form-item>
  667. <el-form-item :label="'模板名称'">
  668. <el-input v-model="templateData.templateName" clearable style="width: 120px"></el-input>
  669. </el-form-item>
  670. <!-- <el-form-item :label="'检验类型'">-->
  671. <!-- <el-select v-model="templateData.inspectionTypeNo" style="width: 100px">-->
  672. <!-- <el-option-->
  673. <!-- v-for = "i in typeOptions"-->
  674. <!-- :key = "i.inspectionTypeNo"-->
  675. <!-- :label = "i.inspectionTypeName"-->
  676. <!-- :value = "i.inspectionTypeNo">-->
  677. <!-- </el-option>-->
  678. <!-- </el-select>-->
  679. <!-- </el-form-item>-->
  680. <el-form-item :label="' '">
  681. <el-button type="primary" @click="queryTemplateList">查询</el-button>
  682. </el-form-item>
  683. </el-form>
  684. <el-table
  685. :height="300"
  686. :data="templateList"
  687. @row-dblclick="getRowData"
  688. border
  689. style="width: 100%;">
  690. <el-table-column
  691. v-for="(item,index) in templateDetailList" :key="index"
  692. :sortable="item.columnSortable"
  693. :prop="item.columnProp"
  694. :header-align="item.headerAlign"
  695. :show-overflow-tooltip="item.showOverflowTooltip"
  696. :align="item.align"
  697. :fixed="item.fixed==''?false:item.fixed"
  698. :min-width="item.columnWidth"
  699. :label="item.columnLabel">
  700. <template slot-scope="scope">
  701. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  702. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  703. </template>
  704. </el-table-column>
  705. </el-table>
  706. </div>
  707. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  708. <el-button type="primary" @click="templateModelFlag=false">关闭</el-button>
  709. </el-footer>
  710. </el-dialog>
  711. <!-- 物料 -->
  712. <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="520px">
  713. <div class="rq">
  714. <el-form :inline="true" label-position="top" :model="partData">
  715. <el-form-item :label="'物料编码'">
  716. <el-input v-model="partData.partNo" clearable style="width: 115px"></el-input>
  717. </el-form-item>
  718. <el-form-item :label="'物料名称'">
  719. <el-input v-model="partData.partDesc" clearable style="width: 115px"></el-input>
  720. </el-form-item>
  721. <el-form-item :label="' '">
  722. <el-button type="primary" @click="queryPartList">查询</el-button>
  723. </el-form-item>
  724. </el-form>
  725. <el-table
  726. :height="300"
  727. :data="partList"
  728. @row-dblclick="getRowData2"
  729. border
  730. style="width: 100%;">
  731. <el-table-column
  732. v-for="(item,index) in partDetailList" :key="index"
  733. :sortable="item.columnSortable"
  734. :prop="item.columnProp"
  735. :header-align="item.headerAlign"
  736. :show-overflow-tooltip="item.showOverflowTooltip"
  737. :align="item.align"
  738. :fixed="item.fixed==''?false:item.fixed"
  739. :min-width="item.columnWidth"
  740. :label="item.columnLabel">
  741. <template slot-scope="scope">
  742. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  743. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  744. </template>
  745. </el-table-column>
  746. </el-table>
  747. </div>
  748. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  749. <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
  750. </el-footer>
  751. </el-dialog>
  752. <!-- 文件清单 -->
  753. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="fileFlag" width="800px">
  754. <el-form :inline="true" label-position="top">
  755. <el-form-item v-if="detailInformationFlag">
  756. <el-button type="primary" @click="addUploadFileModal">上传文件</el-button>
  757. </el-form-item>
  758. </el-form>
  759. <el-table
  760. :height="350"
  761. :data="fileContentList"
  762. border
  763. style="width: 100%; ">
  764. <el-table-column
  765. v-for="(item,index) in fileColumnList" :key="index"
  766. :sortable="item.columnSortable"
  767. :prop="item.columnProp"
  768. :header-align="item.headerAlign"
  769. :show-overflow-tooltip="item.showOverflowTooltip"
  770. :align="item.align"
  771. :fixed="item.fixed==''?false:item.fixed"
  772. :min-width="item.columnWidth"
  773. :label="item.columnLabel">
  774. <template slot-scope="scope">
  775. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  776. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  777. </template>
  778. </el-table-column>
  779. <el-table-column
  780. fixed="right"
  781. header-align="center"
  782. align="center"
  783. width="100"
  784. label="操作">
  785. <template slot-scope="scope">
  786. <el-link style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link>
  787. <el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link>
  788. <el-link v-if="scope.row.fileType2 !== 'sop'" style="cursor: pointer" @click="deleteFile(scope.row)">删除</el-link>
  789. </template>
  790. </el-table-column>
  791. </el-table>
  792. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  793. <el-button type="primary" @click="fileFlag=false">关闭</el-button>
  794. </el-footer>
  795. </el-dialog>
  796. <!-- 机修人员清单 -->
  797. <el-dialog title="人员清单" :close-on-click-modal="false" v-drag :visible.sync="operatorModelFlag" width="820px">
  798. <div class="rq">
  799. <el-form :inline="true" label-position="top" :model="operatorData">
  800. <el-form-item :label="'所属角色'">
  801. <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px">
  802. <el-option
  803. v-for = "i in roleList"
  804. :key = "i.roleId"
  805. :label = "i.roleName"
  806. :value = "i.roleId">
  807. </el-option>
  808. </el-select>
  809. </el-form-item>
  810. <el-form-item :label="'用户编码'">
  811. <el-input v-model="operatorData.adminID" clearable style="width: 120px"></el-input>
  812. </el-form-item>
  813. <el-form-item :label="'用户姓名'">
  814. <el-input v-model="operatorData.adminName" clearable style="width: 120px"></el-input>
  815. </el-form-item>
  816. <el-form-item :label="' '">
  817. <el-button type="primary" @click="getOperatorList2">查询</el-button>
  818. </el-form-item>
  819. </el-form>
  820. <el-table
  821. :height="300"
  822. :data="operatorList"
  823. ref="operatorTable"
  824. @row-click="operatorClickRow"
  825. @selection-change="selectionChangeHandle2"
  826. border
  827. style="width: 100%;">
  828. <el-table-column
  829. type="selection"
  830. header-align="center"
  831. align="center"
  832. width="50">
  833. </el-table-column>
  834. <el-table-column
  835. v-for="(item,index) in operatorDetailList" :key="index"
  836. :sortable="item.columnSortable"
  837. :prop="item.columnProp"
  838. :header-align="item.headerAlign"
  839. :show-overflow-tooltip="item.showOverflowTooltip"
  840. :align="item.align"
  841. :fixed="item.fixed==''?false:item.fixed"
  842. :min-width="item.columnWidth"
  843. :label="item.columnLabel">
  844. <template slot-scope="scope">
  845. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  846. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  847. </template>
  848. </el-table-column>
  849. </el-table>
  850. </div>
  851. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  852. <el-button type="primary" @click="confirmOperator">确认</el-button>
  853. <el-button type="primary" @click="operatorModelFlag = false">关闭</el-button>
  854. </el-footer>
  855. </el-dialog>
  856. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  857. <!-- 上传文件的modal -->
  858. <qcFAIUploadFile ref="qcFAIUploadFile" @refreshPageTables="()=>{this.getFileContentData(this.detailData)}" v-drag></qcFAIUploadFile>
  859. <!-- 上传文件的modal -->
  860. <comQcItemImageUploadFile ref="comQcItemImageUploadFile" @refreshPageTables2="getInspectionFormData" v-drag></comQcItemImageUploadFile>
  861. <!-- 子明细导入 -->
  862. <subDetailUpload @changeEvent="changeMyString" ref="subDetailUpload" @refreshPageTables="getInspectionFormData" v-drag></subDetailUpload>
  863. </div>
  864. </template>
  865. <script>
  866. import {
  867. qcIPQCInspectionSearch, // 查询IPQC的检验记录
  868. ipqcDetailSearch, // 查询IPQC的检验明细
  869. inspectorSearch, // 查询检验员
  870. ipqcRecordDelete, // 删除检验记录
  871. saveIPQCDetailedRecord, // 新增明细信息
  872. saveIPQCSubmitResult, // 审核
  873. saveIPQCSubDetailed, // 新增子明细信息
  874. selectIPQCSubDetailedRecord, // 子明细记录信息查询
  875. checkIPQCIsSubmit, // 检查是否已提交
  876. getOperationList, // 查询工序列表
  877. getResourceList, // 查询机台列表
  878. getPartList, // 查询物料列表
  879. saveOsInspection, // 新增检验记录
  880. queryController, // 检查动控
  881. queryTemplateList, // 获取检验模板列表
  882. getSpecialOperationList, // 获取特殊工序列表
  883. inspectionTypeSearch, // 搜索所有检验类型
  884. disposalMeasuresSearch, // 获取处置措施列表
  885. getRollNo, // 模糊查询标签号
  886. rollNoEnter, // 标签号回车事件
  887. queryPartList, // 查询物料集合
  888. umSearch, // 查询单位列表
  889. getSiteAndBuByUserName,
  890. searchSeqInfo, // 派工单号查询
  891. actionIPQCInspection, // 开始检验
  892. dataAcquisition, // 数据采集
  893. boxNoEnter, // 箱号回车事件
  894. } from "@/api/qc/qc.js"
  895. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  896. import Chooselist from '@/views/modules/common/Chooselist_eam'
  897. import {getFileContentList2, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  898. import {
  899. deleteObjectFile,
  900. getUserRoleList, // 获取用户角色列表
  901. getOperatorList
  902. } from '@/api/eam/eam.js'
  903. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  904. import qcFAIUploadFile from "./qc_FAI_upload_file"
  905. import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
  906. import subDetailUpload from "./sub_detail_upload";
  907. /*上传文件的組件*/
  908. export default {
  909. components: {
  910. Chooselist,
  911. qcFAIUploadFile,
  912. comQcItemImageUploadFile,
  913. subDetailUpload,
  914. },
  915. computed: {
  916. templateTableData () {
  917. let start = (this.pageIndex2 - 1) * this.pageSize2
  918. let end = start + this.pageSize2
  919. if (end > this.tableData.length){
  920. end = this.tableData.length
  921. }
  922. return this.tableData.slice(start,end)
  923. }
  924. },
  925. watch: {
  926. "detailData.samplingQty" (newValue,oldValue) {
  927. this.detailData.passQty = newValue
  928. this.detailList = this.detailList.map((item)=>{
  929. item.samplingQty = newValue
  930. return item
  931. })
  932. },
  933. detailData: {
  934. deep: true,
  935. handler: function (newV, oldV) {
  936. this.detailData.notPassQty = this.detailData.samplingQty - this.detailData.passQty
  937. }
  938. },
  939. detailList: {
  940. deep: true,
  941. handler: function (newV, oldV) {
  942. let num = 0
  943. for (let i = 0; i < this.detailList.length; i++) {
  944. if (this.detailList[i].itemResult === 'N') {
  945. num++
  946. }
  947. }
  948. this.detailData.unqualifiedQty = num
  949. }
  950. },
  951. $route (newVal, oldVal) {
  952. console.log(111)
  953. if (newVal.path !== oldVal.path) {
  954. console.log(222)
  955. if (!this.authSearch) {
  956. console.log(333)
  957. if (this.$route.params.inspectionNo) {
  958. console.log(444)
  959. this.searchData.inspectionNo = this.$route.params.inspectionNo
  960. this.getDataList2()
  961. }
  962. }
  963. }
  964. }
  965. },
  966. data () {
  967. return {
  968. loadFlag: false,
  969. inspectionNo: '',
  970. fileFlag: false,
  971. fileContentList: [],
  972. // 是否收藏
  973. favorite: false,
  974. // 导出 start
  975. exportData: [],
  976. exportName: "IPQC检验录入" + this.dayjs().format('YYYYMMDDHHmmss'),
  977. exportHeader: ["IPQC检验录入"],
  978. exportFooter: [],
  979. exportList: [],
  980. // 导出 end
  981. checkCompletedData:{
  982. inspectionNo: ''
  983. },
  984. submitData:{
  985. site: '',
  986. inspectionNo: '',
  987. inspectionResult: '',
  988. submitList: [],
  989. },
  990. tagNo:'',
  991. searchData: {
  992. site: '',
  993. userName: this.$store.state.user.name,
  994. inspectionNo: '',
  995. state: '',
  996. inspectionResult: '',
  997. orderNo: '',
  998. operationDesc: '',
  999. buDesc: '',
  1000. startDate: '',
  1001. endDate: '',
  1002. startDate2: '',
  1003. endDate2: '',
  1004. inspectionTypeNo: '',
  1005. partNo: '',
  1006. partDesc: '',
  1007. disposalMeasures: '',
  1008. page: 1,
  1009. limit: 10,
  1010. seqNo: '',
  1011. states: ['未开始','待检验'],
  1012. createBy: ''
  1013. },
  1014. pageIndex: 1,
  1015. pageSize: 50,
  1016. totalPage: 0,
  1017. pageIndex2: 1,
  1018. pageSize2: 20,
  1019. totalPage2: 0,
  1020. pageIndex3: 1,
  1021. pageSize3: 20,
  1022. totalPage3: 0,
  1023. height: 200,
  1024. dataList: [],
  1025. dataListSelections: [],
  1026. modalData: {
  1027. flag:'',
  1028. site: '',
  1029. bu: '',
  1030. inspectionNo:'',
  1031. partNo: '',
  1032. partDesc: '',
  1033. inspectionTypeNo:'',
  1034. inspectionTypeName:'',
  1035. inspectorNo:'',
  1036. inspectorName:'',
  1037. orderNo: '',
  1038. operationDesc: '',
  1039. operationNo: '',
  1040. resourceId: '',
  1041. resourceDesc: '',
  1042. rollQty: '',
  1043. seqNo: '',
  1044. spec: '',
  1045. qtyrequired: '',
  1046. lotsize:'',
  1047. specialRequirements: '',
  1048. templateId: '',
  1049. templateName: '',
  1050. specialTaskFlag: '',
  1051. workCenterNo: '',
  1052. rollNo: '',
  1053. umId: '',
  1054. umName: '',
  1055. sjzs: '',
  1056. boxNo: '',
  1057. createBy: '',
  1058. importantFlag: ''
  1059. },
  1060. // 展示列集
  1061. columnList1: [
  1062. {
  1063. userId: this.$store.state.user.name,
  1064. functionId: 301014,
  1065. serialNumber: '301014Table1BuDesc',
  1066. tableId: "301014Table1",
  1067. tableName: "IPQC检验记录表",
  1068. columnProp: 'buDesc',
  1069. headerAlign: "center",
  1070. align: "center",
  1071. columnLabel: 'BU',
  1072. columnHidden: false,
  1073. columnImage: false,
  1074. columnSortable: false,
  1075. sortLv: 0,
  1076. status: true,
  1077. fixed: '',
  1078. columnWidth: 100,
  1079. },
  1080. {
  1081. userId: this.$store.state.user.name,
  1082. functionId: 301014,
  1083. serialNumber: '301014Table1InspectionNo',
  1084. tableId: "301014Table1",
  1085. tableName: "IPQC检验记录表",
  1086. columnProp: 'inspectionNo',
  1087. headerAlign: "center",
  1088. align: "center",
  1089. columnLabel: '检验单号',
  1090. columnHidden: false,
  1091. columnImage: false,
  1092. columnSortable: false,
  1093. sortLv: 0,
  1094. status: true,
  1095. fixed: '',
  1096. columnWidth: 120,
  1097. },
  1098. {
  1099. userId: this.$store.state.user.name,
  1100. functionId: 301014,
  1101. serialNumber: '301014Table1RollNo',
  1102. tableId: "301014Table1",
  1103. tableName: "IPQC检验记录表",
  1104. columnProp: 'rollNo',
  1105. headerAlign: "center",
  1106. align: "center",
  1107. columnLabel: '标签条码',
  1108. columnHidden: false,
  1109. columnImage: false,
  1110. columnSortable: false,
  1111. sortLv: 0,
  1112. status: true,
  1113. fixed: '',
  1114. columnWidth: 120,
  1115. },
  1116. {
  1117. userId: this.$store.state.user.name,
  1118. functionId: 301014,
  1119. serialNumber: '301014Table1InspectionResult',
  1120. tableId: "301014Table1",
  1121. tableName: "IPQC检验记录表",
  1122. columnProp: 'inspectionResult',
  1123. headerAlign: "center",
  1124. align: "center",
  1125. columnLabel: '检验结论',
  1126. columnHidden: false,
  1127. columnImage: false,
  1128. columnSortable: false,
  1129. sortLv: 0,
  1130. status: true,
  1131. fixed: '',
  1132. columnWidth: 100,
  1133. },
  1134. {
  1135. userId: this.$store.state.user.name,
  1136. functionId: 301014,
  1137. serialNumber: '301014Table1DisposalMeasures',
  1138. tableId: "301014Table1",
  1139. tableName: "IPQC检验记录表",
  1140. columnProp: 'disposalMeasures',
  1141. headerAlign: "center",
  1142. align: "center",
  1143. columnLabel: '处置措施',
  1144. columnHidden: false,
  1145. columnImage: false,
  1146. columnSortable: false,
  1147. sortLv: 0,
  1148. status: true,
  1149. fixed: '',
  1150. columnWidth: 120,
  1151. },
  1152. {
  1153. userId: this.$store.state.user.name,
  1154. functionId: 301014,
  1155. serialNumber: '301014Table1InspectionTypeNo',
  1156. tableId: "301014Table1",
  1157. tableName: "IPQC检验记录表",
  1158. columnProp: 'inspectionTypeNo',
  1159. headerAlign: "center",
  1160. align: "center",
  1161. columnLabel: '检验类型',
  1162. columnHidden: false,
  1163. columnImage: false,
  1164. columnSortable: false,
  1165. sortLv: 0,
  1166. status: true,
  1167. fixed: '',
  1168. columnWidth: 100,
  1169. },
  1170. {
  1171. userId: this.$store.state.user.name,
  1172. functionId: 301014,
  1173. serialNumber: '301014Table1TaskDate',
  1174. tableId: "301014Table1",
  1175. tableName: "IPQC检验记录表",
  1176. columnProp: 'taskDate',
  1177. headerAlign: "center",
  1178. align: "center",
  1179. columnLabel: '送检日期',
  1180. columnHidden: false,
  1181. columnImage: false,
  1182. columnSortable: false,
  1183. sortLv: 0,
  1184. status: true,
  1185. fixed: '',
  1186. columnWidth: 170,
  1187. },
  1188. {
  1189. userId: this.$store.state.user.name,
  1190. functionId: 301014,
  1191. serialNumber: '301014Table1CreateBy',
  1192. tableId: "301014Table1",
  1193. tableName: "IPQC检验记录表",
  1194. columnProp: 'createBy',
  1195. headerAlign: "center",
  1196. align: "left",
  1197. columnLabel: '送检人员',
  1198. columnHidden: false,
  1199. columnImage: false,
  1200. columnSortable: false,
  1201. sortLv: 0,
  1202. status: true,
  1203. fixed: '',
  1204. columnWidth: 100,
  1205. },
  1206. {
  1207. userId: this.$store.state.user.name,
  1208. functionId: 301014,
  1209. serialNumber: '301014Table1InspectionCycle',
  1210. tableId: "301014Table1",
  1211. tableName: "IPQC检验记录表",
  1212. columnProp: 'inspectionCycle',
  1213. headerAlign: "center",
  1214. align: "right",
  1215. columnLabel: '检验周期(h)',
  1216. columnHidden: false,
  1217. columnImage: false,
  1218. columnSortable: false,
  1219. sortLv: 0,
  1220. status: true,
  1221. fixed: '',
  1222. columnWidth: 100,
  1223. },
  1224. {
  1225. userId: this.$store.state.user.name,
  1226. functionId: 301014,
  1227. serialNumber: '301014Table1OrderNo',
  1228. tableId: "301014Table1",
  1229. tableName: "IPQC检验记录表",
  1230. columnProp: 'orderNo',
  1231. headerAlign: "center",
  1232. align: "left",
  1233. columnLabel: '工单号',
  1234. columnHidden: false,
  1235. columnImage: false,
  1236. columnSortable: false,
  1237. sortLv: 0,
  1238. status: true,
  1239. fixed: '',
  1240. columnWidth: 120,
  1241. },
  1242. {
  1243. userId: this.$store.state.user.name,
  1244. functionId: 301014,
  1245. serialNumber: '301014Table1SeqNo',
  1246. tableId: "301014Table1",
  1247. tableName: "IPQC检验记录表",
  1248. columnProp: 'seqNo',
  1249. headerAlign: "center",
  1250. align: "left",
  1251. columnLabel: '派工单号',
  1252. columnHidden: false,
  1253. columnImage: false,
  1254. columnSortable: false,
  1255. sortLv: 0,
  1256. status: true,
  1257. fixed: '',
  1258. columnWidth: 150,
  1259. },
  1260. {
  1261. userId: this.$store.state.user.name,
  1262. functionId: 301014,
  1263. serialNumber: '301014Table1DepartmentID',
  1264. tableId: "301014Table1",
  1265. tableName: "IPQC检验记录表",
  1266. columnProp: 'departmentID',
  1267. headerAlign: "center",
  1268. align: "left",
  1269. columnLabel: '车间编码',
  1270. columnHidden: false,
  1271. columnImage: false,
  1272. columnSortable: false,
  1273. sortLv: 0,
  1274. status: true,
  1275. fixed: '',
  1276. columnWidth: 100,
  1277. },
  1278. {
  1279. userId: this.$store.state.user.name,
  1280. functionId: 301014,
  1281. serialNumber: '301014Table1DepartmentName',
  1282. tableId: "301014Table1",
  1283. tableName: "IPQC检验记录表",
  1284. columnProp: 'departmentName',
  1285. headerAlign: "center",
  1286. align: "left",
  1287. columnLabel: '车间名称',
  1288. columnHidden: false,
  1289. columnImage: false,
  1290. columnSortable: false,
  1291. sortLv: 0,
  1292. status: true,
  1293. fixed: '',
  1294. columnWidth: 150,
  1295. },
  1296. {
  1297. userId: this.$store.state.user.name,
  1298. functionId: 301014,
  1299. serialNumber: '301014Table1WorkCenterNo',
  1300. tableId: "301014Table1",
  1301. tableName: "IPQC检验记录表",
  1302. fixed: '',
  1303. columnProp: 'workCenterNo',
  1304. headerAlign: "center",
  1305. align: "left",
  1306. columnLabel: '加工中心编码',
  1307. columnHidden: false,
  1308. columnImage: false,
  1309. columnSortable: false,
  1310. sortLv: 0,
  1311. status: true,
  1312. columnWidth: 100,
  1313. },
  1314. {
  1315. userId: this.$store.state.user.name,
  1316. functionId: 301014,
  1317. serialNumber: '301014Table1WorkCenterDesc',
  1318. tableId: "301014Table1",
  1319. tableName: "IPQC检验记录表",
  1320. fixed: '',
  1321. columnProp: 'workCenterDesc',
  1322. headerAlign: "center",
  1323. align: "left",
  1324. columnLabel: '加工中心名称',
  1325. columnHidden: false,
  1326. columnImage: false,
  1327. columnSortable: false,
  1328. sortLv: 0,
  1329. status: true,
  1330. columnWidth: 150,
  1331. },
  1332. {
  1333. userId: this.$store.state.user.name,
  1334. functionId: 301014,
  1335. serialNumber: '301014Table1OperationDesc',
  1336. tableId: "301014Table1",
  1337. tableName: "IPQC检验记录表",
  1338. columnProp: 'operationDesc',
  1339. headerAlign: "center",
  1340. align: "left",
  1341. columnLabel: '工序',
  1342. columnHidden: false,
  1343. columnImage: false,
  1344. columnSortable: false,
  1345. sortLv: 0,
  1346. status: true,
  1347. fixed: '',
  1348. columnWidth: 100,
  1349. },
  1350. {
  1351. userId: this.$store.state.user.name,
  1352. functionId: 301014,
  1353. serialNumber: '301014Table1ResourceDesc',
  1354. tableId: "301014Table1",
  1355. tableName: "IPQC检验记录表",
  1356. columnProp: 'resourceDesc',
  1357. headerAlign: "center",
  1358. align: "left",
  1359. columnLabel: '机台',
  1360. columnHidden: false,
  1361. columnImage: false,
  1362. columnSortable: false,
  1363. sortLv: 0,
  1364. status: true,
  1365. fixed: '',
  1366. columnWidth: 100,
  1367. },
  1368. {
  1369. userId: this.$store.state.user.name,
  1370. functionId: 301014,
  1371. serialNumber: '301014Table1PartNo',
  1372. tableId: "301014Table1",
  1373. tableName: "IPQC检验记录表",
  1374. columnProp: 'partNo',
  1375. headerAlign: "center",
  1376. align: "center",
  1377. columnLabel: '物料编码',
  1378. columnHidden: false,
  1379. columnImage: false,
  1380. columnSortable: false,
  1381. sortLv: 0,
  1382. status: true,
  1383. fixed: '',
  1384. columnWidth: 120,
  1385. },
  1386. {
  1387. userId: this.$store.state.user.name,
  1388. functionId: 301014,
  1389. serialNumber: '301014Table1PartDesc',
  1390. tableId: "301014Table1",
  1391. tableName: "IPQC检验记录表",
  1392. columnProp: 'partDesc',
  1393. headerAlign: "center",
  1394. align: "left",
  1395. columnLabel: '物料名称',
  1396. columnHidden: false,
  1397. columnImage: false,
  1398. columnSortable: false,
  1399. sortLv: 0,
  1400. status: true,
  1401. fixed: '',
  1402. columnWidth: 200,
  1403. },
  1404. {
  1405. userId: this.$store.state.user.name,
  1406. functionId: 301014,
  1407. serialNumber: '301014Table1Spec',
  1408. tableId: "301014Table1",
  1409. tableName: "IPQC检验记录表",
  1410. columnProp: 'spec',
  1411. headerAlign: "center",
  1412. align: "left",
  1413. columnLabel: '规格型号',
  1414. columnHidden: false,
  1415. columnImage: false,
  1416. columnSortable: false,
  1417. sortLv: 0,
  1418. status: true,
  1419. fixed: '',
  1420. columnWidth: 150,
  1421. },
  1422. {
  1423. userId: this.$store.state.user.name,
  1424. functionId: 301014,
  1425. serialNumber: '301014Table1RollQty',
  1426. tableId: "301014Table1",
  1427. tableName: "IPQC检验记录表",
  1428. columnProp: 'rollQty',
  1429. headerAlign: "center",
  1430. align: "right",
  1431. columnLabel: '送检数量',
  1432. columnHidden: false,
  1433. columnImage: false,
  1434. columnSortable: false,
  1435. sortLv: 0,
  1436. status: true,
  1437. fixed: '',
  1438. columnWidth: 100,
  1439. },
  1440. {
  1441. userId: this.$store.state.user.name,
  1442. functionId: 301014,
  1443. serialNumber: '301014Table1SamplingQty',
  1444. tableId: "301014Table1",
  1445. tableName: "IPQC检验记录表",
  1446. columnProp: 'samplingQty',
  1447. headerAlign: "center",
  1448. align: "right",
  1449. columnLabel: '抽样数量',
  1450. columnHidden: false,
  1451. columnImage: false,
  1452. columnSortable: false,
  1453. sortLv: 0,
  1454. status: true,
  1455. fixed: '',
  1456. columnWidth: 100,
  1457. },
  1458. {
  1459. userId: this.$store.state.user.name,
  1460. functionId: 301014,
  1461. serialNumber: '301014Table1UmName',
  1462. tableId: "301014Table1",
  1463. tableName: "IPQC检验记录表",
  1464. columnProp: 'umName',
  1465. headerAlign: "center",
  1466. align: "left",
  1467. columnLabel: '单位',
  1468. columnHidden: false,
  1469. columnImage: false,
  1470. columnSortable: false,
  1471. sortLv: 0,
  1472. status: true,
  1473. fixed: '',
  1474. columnWidth: 100,
  1475. },
  1476. {
  1477. userId: this.$store.state.user.name,
  1478. functionId: 301014,
  1479. serialNumber: '301014Table1InspectionRemark',
  1480. tableId: "301014Table1",
  1481. tableName: "IPQC检验记录表",
  1482. columnProp: 'inspectionRemark',
  1483. headerAlign: "center",
  1484. align: "left",
  1485. columnLabel: '质检备注',
  1486. columnHidden: false,
  1487. columnImage: false,
  1488. columnSortable: false,
  1489. sortLv: 0,
  1490. status: true,
  1491. fixed: '',
  1492. columnWidth: 200,
  1493. },
  1494. {
  1495. userId: this.$store.state.user.name,
  1496. functionId: 301014,
  1497. serialNumber: '301014Table1DisposalRemark',
  1498. tableId: "301014Table1",
  1499. tableName: "IPQC检验记录表",
  1500. columnProp: 'disposalRemark',
  1501. headerAlign: "center",
  1502. align: "left",
  1503. columnLabel: '处置说明',
  1504. columnHidden: false,
  1505. columnImage: false,
  1506. columnSortable: false,
  1507. sortLv: 0,
  1508. status: true,
  1509. fixed: '',
  1510. columnWidth: 200,
  1511. },
  1512. {
  1513. userId: this.$store.state.user.name,
  1514. functionId: 301014,
  1515. serialNumber: '301014Table1ActionDate',
  1516. tableId: "301014Table1",
  1517. tableName: "IPQC检验记录表",
  1518. columnProp: 'actionDate',
  1519. headerAlign: "center",
  1520. align: "center",
  1521. columnLabel: '开始检验时间',
  1522. columnHidden: false,
  1523. columnImage: false,
  1524. columnSortable: false,
  1525. sortLv: 0,
  1526. status: true,
  1527. fixed: '',
  1528. columnWidth: 170,
  1529. },
  1530. {
  1531. userId: this.$store.state.user.name,
  1532. functionId: 301014,
  1533. serialNumber: '301014Table1InspectorDate',
  1534. tableId: "301014Table1",
  1535. tableName: "IPQC检验记录表",
  1536. columnProp: 'inspectorDate',
  1537. headerAlign: "center",
  1538. align: "center",
  1539. columnLabel: '检验时间',
  1540. columnHidden: false,
  1541. columnImage: false,
  1542. columnSortable: false,
  1543. sortLv: 0,
  1544. status: true,
  1545. fixed: '',
  1546. columnWidth: 170,
  1547. },
  1548. {
  1549. userId: this.$store.state.user.name,
  1550. functionId: 301014,
  1551. serialNumber: '301014Table1InspectorName',
  1552. tableId: "301014Table1",
  1553. tableName: "IPQC检验记录表",
  1554. columnProp: 'inspectorName',
  1555. headerAlign: "center",
  1556. align: "center",
  1557. columnLabel: '质检员',
  1558. columnHidden: false,
  1559. columnImage: false,
  1560. columnSortable: false,
  1561. sortLv: 0,
  1562. status: true,
  1563. fixed: '',
  1564. columnWidth: 100,
  1565. },
  1566. {
  1567. userId: this.$store.state.user.name,
  1568. functionId: 301014,
  1569. serialNumber: '301014Table1SpecialRequirements',
  1570. tableId: "301014Table1",
  1571. tableName: "IPQC检验记录表",
  1572. columnProp: 'specialRequirements',
  1573. headerAlign: "center",
  1574. align: "left",
  1575. columnLabel: '特殊要求',
  1576. columnHidden: false,
  1577. columnImage: false,
  1578. columnSortable: false,
  1579. sortLv: 0,
  1580. status: true,
  1581. fixed: '',
  1582. columnWidth: 200,
  1583. },
  1584. ],
  1585. //项目清单
  1586. detailData: {
  1587. site: '',
  1588. buNo: '',
  1589. inspectionNo:'',
  1590. partNo:'',
  1591. partDesc:'',
  1592. rollQty:'',
  1593. samplingQty: '',
  1594. unqualifiedQty: 0,
  1595. unqualifiedQuantity:'',
  1596. disposalMeasures:'',
  1597. disposalRemark: '',
  1598. inspectionResult: '',
  1599. inspectorNo: '',
  1600. inspectorName: '',
  1601. inspectionRemark: '',
  1602. submitFlag: '',
  1603. spec: '',
  1604. umId: '',
  1605. umName: '',
  1606. operator: '',
  1607. operatorName: '',
  1608. responsiblePerson: '',
  1609. responsiblePersonName: '',
  1610. passQty: '',
  1611. notPassQty: ''
  1612. },
  1613. detailInformationFlag: false,
  1614. detailList: [],
  1615. saveInformationData: {
  1616. site: '',
  1617. buNo: '',
  1618. inspectionNo:'',
  1619. disposalMeasures: '',
  1620. disposalRemark: '',
  1621. inspectorNo: '',
  1622. inspectionRemark: '',
  1623. samplingQty: '',
  1624. rollQty: '',
  1625. itemList:[],
  1626. unqualifiedQty: '',
  1627. partNo: '',
  1628. partDesc: '',
  1629. operator: '',
  1630. operatorName: '',
  1631. responsiblePerson: '',
  1632. responsiblePersonName: '',
  1633. subDetailList: [],
  1634. passQty: '',
  1635. notPassQty: ''
  1636. },
  1637. detailColumnList: [
  1638. {
  1639. userId: this.$store.state.user.name,
  1640. functionId: 301014,
  1641. serialNumber: '301014Table2ItemNo',
  1642. tableId: "301014Table2",
  1643. tableName: "检验单明细表",
  1644. columnProp: 'itemNo',
  1645. headerAlign: "center",
  1646. align: "center",
  1647. columnLabel: '检验项目编码',
  1648. columnHidden: false,
  1649. columnImage: false,
  1650. columnSortable: false,
  1651. sortLv: 0,
  1652. status: true,
  1653. fixed: '',
  1654. columnWidth: 120,
  1655. },
  1656. {
  1657. userId: this.$store.state.user.name,
  1658. functionId: 301014,
  1659. serialNumber: '301014Table2ItemDesc',
  1660. tableId: "301014Table2",
  1661. tableName: "检验单明细表",
  1662. columnProp: 'itemDesc',
  1663. headerAlign: "center",
  1664. align: "left",
  1665. columnLabel: '检验项目',
  1666. columnHidden: false,
  1667. columnImage: false,
  1668. columnSortable: false,
  1669. sortLv: 0,
  1670. status: true,
  1671. fixed: '',
  1672. columnWidth: 150,
  1673. },
  1674. {
  1675. userId: this.$store.state.user.name,
  1676. functionId: 301014,
  1677. serialNumber: '301014Table2SamplingLevelDesc',
  1678. tableId: "301014Table2",
  1679. tableName: "检验单明细表",
  1680. columnProp: 'samplingLevelDesc',
  1681. headerAlign: "center",
  1682. align: "left",
  1683. columnLabel: '检验水平',
  1684. columnHidden: false,
  1685. columnImage: false,
  1686. columnSortable: false,
  1687. sortLv: 0,
  1688. status: true,
  1689. fixed: '',
  1690. columnWidth: 150,
  1691. },
  1692. {
  1693. userId: this.$store.state.user.name,
  1694. functionId: 301014,
  1695. serialNumber: '301014Table2SamplingProgrammeDesc',
  1696. tableId: "301014Table2",
  1697. tableName: "检验单明细表",
  1698. columnProp: 'samplingProgrammeDesc',
  1699. headerAlign: "center",
  1700. align: "left",
  1701. columnLabel: '检验方案',
  1702. columnHidden: false,
  1703. columnImage: false,
  1704. columnSortable: false,
  1705. sortLv: 0,
  1706. status: true,
  1707. fixed: '',
  1708. columnWidth: 150,
  1709. },
  1710. {
  1711. userId: this.$store.state.user.name,
  1712. functionId: 301014,
  1713. serialNumber: '301014Table2MethodName',
  1714. tableId: "301014Table2",
  1715. tableName: "检验单明细表",
  1716. columnProp: 'methodName',
  1717. headerAlign: "center",
  1718. align: "left",
  1719. columnLabel: '检验方法',
  1720. columnHidden: false,
  1721. columnImage: false,
  1722. columnSortable: false,
  1723. sortLv: 0,
  1724. status: true,
  1725. fixed: '',
  1726. columnWidth: 150,
  1727. },
  1728. {
  1729. userId: this.$store.state.user.name,
  1730. functionId: 301014,
  1731. serialNumber: '301014Table2MethodRemark',
  1732. tableId: "301014Table2",
  1733. tableName: "检验单明细表",
  1734. columnProp: 'methodRemark',
  1735. headerAlign: "center",
  1736. align: "left",
  1737. columnLabel: '检验方法说明',
  1738. columnHidden: false,
  1739. columnImage: false,
  1740. columnSortable: false,
  1741. sortLv: 0,
  1742. status: true,
  1743. fixed: '',
  1744. columnWidth: 200,
  1745. },
  1746. {
  1747. userId: this.$store.state.user.name,
  1748. functionId: 301014,
  1749. serialNumber: '301014Table2ObjectDesc',
  1750. tableId: "301014Table2",
  1751. tableName: "检验单明细表",
  1752. columnProp: 'objectDesc',
  1753. headerAlign: "center",
  1754. align: "left",
  1755. columnLabel: '检测仪器',
  1756. columnHidden: false,
  1757. columnImage: false,
  1758. columnSortable: false,
  1759. sortLv: 0,
  1760. status: true,
  1761. fixed: '',
  1762. columnWidth: 150,
  1763. },
  1764. {
  1765. userId: this.$store.state.user.name,
  1766. functionId: 301014,
  1767. serialNumber: '301014Table2Aql',
  1768. tableId: "301014Table2",
  1769. tableName: "检验单明细表",
  1770. columnProp: 'aql',
  1771. headerAlign: "center",
  1772. align: "right",
  1773. columnLabel: 'AQL',
  1774. columnHidden: false,
  1775. columnImage: false,
  1776. columnSortable: false,
  1777. sortLv: 0,
  1778. status: true,
  1779. fixed: '',
  1780. columnWidth: 100,
  1781. },
  1782. {
  1783. userId: this.$store.state.user.name,
  1784. functionId: 301014,
  1785. serialNumber: '301014Table2Ac',
  1786. tableId: "301014Table2",
  1787. tableName: "检验单明细表",
  1788. columnProp: 'ac',
  1789. headerAlign: "center",
  1790. align: "right",
  1791. columnLabel: 'AC',
  1792. columnHidden: false,
  1793. columnImage: false,
  1794. columnSortable: false,
  1795. sortLv: 0,
  1796. status: true,
  1797. fixed: '',
  1798. columnWidth: 100,
  1799. },
  1800. {
  1801. userId: this.$store.state.user.name,
  1802. functionId: 301014,
  1803. serialNumber: '301014Table2Re',
  1804. tableId: "301014Table2",
  1805. tableName: "检验单明细表",
  1806. columnProp: 're',
  1807. headerAlign: "center",
  1808. align: "right",
  1809. columnLabel: 'RE',
  1810. columnHidden: false,
  1811. columnImage: false,
  1812. columnSortable: false,
  1813. sortLv: 0,
  1814. status: true,
  1815. fixed: '',
  1816. columnWidth: 100,
  1817. },
  1818. {
  1819. userId: this.$store.state.user.name,
  1820. functionId: 301014,
  1821. serialNumber: '301014Table2DefaultValue',
  1822. tableId: "301014Table2",
  1823. tableName: "检验单明细表",
  1824. columnProp: 'defaultValue',
  1825. headerAlign: "center",
  1826. align: "right",
  1827. columnLabel: '标准值',
  1828. columnHidden: false,
  1829. columnImage: false,
  1830. columnSortable: false,
  1831. sortLv: 0,
  1832. status: true,
  1833. fixed: '',
  1834. columnWidth: 100,
  1835. },
  1836. {
  1837. userId: this.$store.state.user.name,
  1838. functionId: 301014,
  1839. serialNumber: '301014Table2MaxValue',
  1840. tableId: "301014Table2",
  1841. tableName: "检验单明细表",
  1842. columnProp: 'maxValue',
  1843. headerAlign: "center",
  1844. align: "right",
  1845. columnLabel: '上限值',
  1846. columnHidden: false,
  1847. columnImage: false,
  1848. columnSortable: false,
  1849. sortLv: 0,
  1850. status: true,
  1851. fixed: '',
  1852. columnWidth: 100,
  1853. },
  1854. {
  1855. userId: this.$store.state.user.name,
  1856. functionId: 301014,
  1857. serialNumber: '301014Table2MinValue',
  1858. tableId: "301014Table2",
  1859. tableName: "检验单明细表",
  1860. columnProp: 'minValue',
  1861. headerAlign: "center",
  1862. align: "right",
  1863. columnLabel: '下限值',
  1864. columnHidden: false,
  1865. columnImage: false,
  1866. columnSortable: false,
  1867. sortLv: 0,
  1868. status: true,
  1869. fixed: '',
  1870. columnWidth: 100,
  1871. },
  1872. {
  1873. userId: this.$store.state.user.name,
  1874. functionId: 301014,
  1875. serialNumber: '301014Table2ValueType',
  1876. tableId: "301014Table2",
  1877. tableName: "检验单明细表",
  1878. columnProp: 'valueType',
  1879. headerAlign: "center",
  1880. align: "center",
  1881. columnLabel: '检测值类型',
  1882. columnHidden: false,
  1883. columnImage: false,
  1884. columnSortable: false,
  1885. sortLv: 0,
  1886. status: true,
  1887. fixed: '',
  1888. columnWidth: 100,
  1889. },
  1890. ],
  1891. fileColumnList: [
  1892. {
  1893. columnProp: 'fileName',
  1894. headerAlign: "center",
  1895. align: "center",
  1896. columnLabel: '文件名称',
  1897. columnHidden: false,
  1898. columnImage: false,
  1899. columnSortable: false,
  1900. sortLv: 0,
  1901. status: true,
  1902. fixed: '',
  1903. },
  1904. {
  1905. columnProp: 'createdBy',
  1906. headerAlign: "center",
  1907. align: 'center',
  1908. columnLabel: '上传人',
  1909. columnHidden: false,
  1910. columnImage: false,
  1911. columnSortable: true,
  1912. sortLv: 0,
  1913. status: true,
  1914. fixed: false
  1915. },
  1916. {
  1917. columnProp: 'createDate',
  1918. headerAlign: "center",
  1919. align: 'center',
  1920. columnLabel: '上传时间',
  1921. columnHidden: false,
  1922. columnImage: false,
  1923. columnSortable: true,
  1924. sortLv: 0,
  1925. status: true,
  1926. fixed: false
  1927. },
  1928. {
  1929. columnProp: 'orderRef3',
  1930. headerAlign: "center",
  1931. align: 'center',
  1932. columnLabel: '备注',
  1933. columnHidden: false,
  1934. columnImage: false,
  1935. columnSortable: true,
  1936. sortLv: 0,
  1937. status: true,
  1938. fixed: false
  1939. },
  1940. ],
  1941. // 派工单号
  1942. seqInfoList: [],
  1943. seqDetailFlag: false,
  1944. seqDetailData: {
  1945. orderNo: '',
  1946. seqNo: '',
  1947. partNo: '',
  1948. partDesc: '',
  1949. operationDesc: '',
  1950. qtyrequired: '',
  1951. lotsize: '',
  1952. status: '',
  1953. cancelFlag: '',
  1954. page: 1,
  1955. limit: 10
  1956. },
  1957. seqDetailColumnList: [
  1958. {
  1959. userId: this.$store.state.user.name,
  1960. functionId: 301014,
  1961. serialNumber: '301014Table3OrderNo',
  1962. tableId: "301014Table3",
  1963. tableName: "派工单号表",
  1964. fixed: '',
  1965. columnProp: 'orderNo',
  1966. headerAlign: "center",
  1967. align: "left",
  1968. columnLabel: '工单号',
  1969. columnHidden: false,
  1970. columnImage: false,
  1971. columnSortable: false,
  1972. sortLv: 0,
  1973. status: true,
  1974. columnWidth: 150,
  1975. },
  1976. {
  1977. userId: this.$store.state.user.name,
  1978. functionId: 301014,
  1979. serialNumber: '301014Table3SeqNo',
  1980. tableId: "301014Table3",
  1981. tableName: "派工单号表",
  1982. fixed: '',
  1983. columnProp: 'seqNo',
  1984. headerAlign: "center",
  1985. align: "left",
  1986. columnLabel: '派工单号',
  1987. columnHidden: false,
  1988. columnImage: false,
  1989. columnSortable: false,
  1990. sortLv: 0,
  1991. status: true,
  1992. columnWidth: 170,
  1993. },
  1994. {
  1995. userId: this.$store.state.user.name,
  1996. functionId: 301014,
  1997. serialNumber: '301014Table3PartNo',
  1998. tableId: "301014Table3",
  1999. tableName: "派工单号表",
  2000. fixed: '',
  2001. columnProp: 'partNo',
  2002. headerAlign: "center",
  2003. align: "left",
  2004. columnLabel: '物料编码',
  2005. columnHidden: false,
  2006. columnImage: false,
  2007. columnSortable: false,
  2008. sortLv: 0,
  2009. status: true,
  2010. columnWidth: 150,
  2011. },
  2012. {
  2013. userId: this.$store.state.user.name,
  2014. functionId: 301014,
  2015. serialNumber: '301014Table3PartDesc',
  2016. tableId: "301014Table3",
  2017. tableName: "派工单号表",
  2018. fixed: '',
  2019. columnProp: 'partDesc',
  2020. headerAlign: "center",
  2021. align: "left",
  2022. columnLabel: '物料名称',
  2023. columnHidden: false,
  2024. columnImage: false,
  2025. columnSortable: false,
  2026. sortLv: 0,
  2027. status: true,
  2028. columnWidth: 300,
  2029. },
  2030. {
  2031. userId: this.$store.state.user.name,
  2032. functionId: 301014,
  2033. serialNumber: '301014Table3Lotsize',
  2034. tableId: "301014Table3",
  2035. tableName: "派工单号表",
  2036. fixed: '',
  2037. columnProp: 'lotsize',
  2038. headerAlign: "center",
  2039. align: "right",
  2040. columnLabel: '工单数量',
  2041. columnHidden: false,
  2042. columnImage: false,
  2043. columnSortable: false,
  2044. sortLv: 0,
  2045. status: true,
  2046. columnWidth: 100,
  2047. },
  2048. {
  2049. userId: this.$store.state.user.name,
  2050. functionId: 301014,
  2051. serialNumber: '301014Table3Qtyrequired',
  2052. tableId: "301014Table3",
  2053. tableName: "派工单号表",
  2054. fixed: '',
  2055. columnProp: 'qtyrequired',
  2056. headerAlign: "center",
  2057. align: "right",
  2058. columnLabel: '派工数量',
  2059. columnHidden: false,
  2060. columnImage: false,
  2061. columnSortable: false,
  2062. sortLv: 0,
  2063. status: true,
  2064. columnWidth: 100,
  2065. },
  2066. {
  2067. userId: this.$store.state.user.name,
  2068. functionId: 301014,
  2069. serialNumber: '301014Table3OperationDesc',
  2070. tableId: "301014Table3",
  2071. tableName: "派工单号表",
  2072. fixed: '',
  2073. columnProp: 'operationDesc',
  2074. headerAlign: "center",
  2075. align: "center",
  2076. columnLabel: '工序',
  2077. columnHidden: false,
  2078. columnImage: false,
  2079. columnSortable: false,
  2080. sortLv: 0,
  2081. status: true,
  2082. columnWidth: 100,
  2083. }
  2084. ],
  2085. // 子明细数据对象
  2086. tableData: [],
  2087. checkedDetail: [],
  2088. subDetailFlag: false,
  2089. subDetailData: {
  2090. site: '',
  2091. buNo: '',
  2092. inspectionNo: '',
  2093. itemNo: '',
  2094. itemDesc: '',
  2095. defaultValue: '',
  2096. maxValue: '',
  2097. minValue: '',
  2098. valueTypeDb: '',
  2099. subDetailValues:[]
  2100. },
  2101. options: [],
  2102. modalDisableFlag: false,
  2103. modalFlag: false,
  2104. operationList: [],
  2105. resourceList: [],
  2106. partList: [],
  2107. IPQCSelections: [],
  2108. rules: {
  2109. seqNoType: [
  2110. {
  2111. required: true,
  2112. message: ' ',
  2113. trigger: 'change'
  2114. }
  2115. ],
  2116. orderNoType: [
  2117. {
  2118. required: true,
  2119. message: ' ',
  2120. trigger: 'change'
  2121. }
  2122. ],
  2123. operationDescType: [
  2124. {
  2125. required: true,
  2126. message: ' ',
  2127. trigger: 'change'
  2128. }
  2129. ],
  2130. resourceIdType: [
  2131. {
  2132. required: true,
  2133. message: ' ',
  2134. trigger: 'change'
  2135. }
  2136. ],
  2137. rollQtyType: [
  2138. {
  2139. required: true,
  2140. message: ' ',
  2141. trigger: 'change'
  2142. }
  2143. ],
  2144. inspectionTypeNoType: [
  2145. {
  2146. required: true,
  2147. message: ' ',
  2148. trigger: 'change'
  2149. }
  2150. ],
  2151. partNoType: [
  2152. {
  2153. required: true,
  2154. message: ' ',
  2155. trigger: 'change'
  2156. }
  2157. ],
  2158. umIdType: [
  2159. {
  2160. required: true,
  2161. message: ' ',
  2162. trigger: 'change'
  2163. }
  2164. ],
  2165. templateId: [
  2166. {
  2167. required: true,
  2168. message: ' ',
  2169. trigger: 'change'
  2170. }
  2171. ],
  2172. bu:[
  2173. {
  2174. required: true,
  2175. message: ' ',
  2176. trigger: 'change'
  2177. }
  2178. ]
  2179. },
  2180. batchHandleAddModalFlag: false,
  2181. batchAddData: {
  2182. samplingLocation: '',
  2183. samplingLocationB: '',
  2184. samplingNumber: ''
  2185. },
  2186. controlData: {},
  2187. templateData: {
  2188. site: '',
  2189. bu: '',
  2190. templateId: '',
  2191. templateName: '',
  2192. inspectionTypeNo: '',
  2193. inspectionTypeName: ''
  2194. },
  2195. partData: {
  2196. site: '',
  2197. bu: '',
  2198. partNo: '',
  2199. partDesc: '',
  2200. },
  2201. templateList: [],
  2202. templateModelFlag: false,
  2203. templateDetailList: [
  2204. {
  2205. columnProp: 'templateId',
  2206. headerAlign: "center",
  2207. align: "center",
  2208. columnLabel: '模板编码',
  2209. columnHidden: false,
  2210. columnImage: false,
  2211. columnSortable: false,
  2212. sortLv: 0,
  2213. status: true,
  2214. fixed: '',
  2215. },
  2216. {
  2217. columnProp: 'templateName',
  2218. headerAlign: "center",
  2219. align: "center",
  2220. columnLabel: '模板名称',
  2221. columnHidden: false,
  2222. columnImage: false,
  2223. columnSortable: false,
  2224. sortLv: 0,
  2225. status: true,
  2226. fixed: '',
  2227. },
  2228. {
  2229. columnProp: 'inspectionTypeName',
  2230. headerAlign: "center",
  2231. align: "center",
  2232. columnLabel: '检验类型',
  2233. columnHidden: false,
  2234. columnImage: false,
  2235. columnSortable: false,
  2236. sortLv: 0,
  2237. status: true,
  2238. fixed: '',
  2239. },
  2240. ],
  2241. partDetailList: [
  2242. {
  2243. columnProp: 'partNo',
  2244. headerAlign: "center",
  2245. align: "left",
  2246. columnLabel: '物料编码',
  2247. columnHidden: false,
  2248. columnImage: false,
  2249. columnSortable: false,
  2250. sortLv: 0,
  2251. status: true,
  2252. fixed: '',
  2253. columnWidth: 120,
  2254. },
  2255. {
  2256. columnProp: 'partDesc',
  2257. headerAlign: "center",
  2258. align: "left",
  2259. columnLabel: '物料名称',
  2260. columnHidden: false,
  2261. columnImage: false,
  2262. columnSortable: false,
  2263. sortLv: 0,
  2264. status: true,
  2265. fixed: '',
  2266. columnWidth: 300,
  2267. },
  2268. ],
  2269. checked: false,
  2270. typeOptions: [],
  2271. disposalMeasuresOptions: [],
  2272. timeout: null,
  2273. partModelFlag: false,
  2274. umList: [],
  2275. userBuList: [],
  2276. authSearch: false,
  2277. authSave: false,
  2278. authCheck: false,
  2279. authDelete: false,
  2280. authDetail: false,
  2281. authFile: false,
  2282. menuId: this.$route.meta.menuId,
  2283. roleList: [],
  2284. operatorList: [],
  2285. operatorData: {
  2286. flag: '',
  2287. site: '',
  2288. bu: '',
  2289. adminID: '',
  2290. adminName: '',
  2291. roleName: '',
  2292. roleId: '',
  2293. },
  2294. operatorModelFlag: false,
  2295. dataListSelections2: [],
  2296. operatorDetailList: [
  2297. {
  2298. columnProp: 'adminID',
  2299. headerAlign: "center",
  2300. align: "center",
  2301. columnLabel: '用户账号',
  2302. columnHidden: false,
  2303. columnImage: false,
  2304. columnSortable: false,
  2305. sortLv: 0,
  2306. status: true,
  2307. fixed: '',
  2308. },
  2309. {
  2310. columnProp: 'adminName',
  2311. headerAlign: "center",
  2312. align: "center",
  2313. columnLabel: '用户名称',
  2314. columnHidden: false,
  2315. columnImage: false,
  2316. columnSortable: false,
  2317. sortLv: 0,
  2318. status: true,
  2319. fixed: '',
  2320. },
  2321. {
  2322. columnProp: 'email',
  2323. headerAlign: "center",
  2324. align: "center",
  2325. columnLabel: '邮箱',
  2326. columnHidden: false,
  2327. columnImage: false,
  2328. columnSortable: false,
  2329. sortLv: 0,
  2330. status: true,
  2331. fixed: '',
  2332. },
  2333. {
  2334. columnProp: 'phone',
  2335. headerAlign: "center",
  2336. align: "center",
  2337. columnLabel: '手机号',
  2338. columnHidden: false,
  2339. columnImage: false,
  2340. columnSortable: false,
  2341. sortLv: 0,
  2342. status: true,
  2343. fixed: '',
  2344. },
  2345. ],
  2346. acquisitionList: [],
  2347. fileData: {
  2348. site: '',
  2349. buNo: '',
  2350. inspectionNo: '',
  2351. partNo: '',
  2352. inspectionTypeNo: ''
  2353. },
  2354. currentRow: {},
  2355. currentDetailRow: {},
  2356. saveLoading: false,
  2357. }
  2358. },
  2359. mounted () {
  2360. this.$nextTick(() => {
  2361. this.height = window.innerHeight - 250
  2362. })
  2363. },
  2364. updated() {
  2365. this.$nextTick(()=>{
  2366. this.$refs.IPQCTable.doLayout()
  2367. })
  2368. },
  2369. created () {
  2370. // 按钮控制
  2371. this.getButtonAuthData()
  2372. // 获取用户的 site 和 bu
  2373. this.getSiteAndBuByUserName()
  2374. // 收藏
  2375. this.favoriteIsOk()
  2376. // 检验类型
  2377. this.inspectionTypeSearch()
  2378. // 处置措施
  2379. this.disposalMeasuresSearch()
  2380. // 单位
  2381. this.umSearch()
  2382. // 查看 质量任务生成规则控制 动控是否开启
  2383. this.queryController()
  2384. // 动态列
  2385. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2386. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  2387. this.getTableUserColumn(this.$route.meta.menuId+'table3',3)
  2388. if (!this.authSearch) {
  2389. // 获取数据列表
  2390. this.getDataList()
  2391. }
  2392. // 获取用户角色
  2393. this.getUserRoleList()
  2394. if (this.$route.params.inspectionNo) {
  2395. this.searchData.inspectionNo = this.$route.params.inspectionNo
  2396. this.getDataList2()
  2397. }
  2398. },
  2399. activated () {
  2400. },
  2401. methods: {
  2402. // 列表数据总结
  2403. getSummaries (param) {
  2404. const { columns, data } = param
  2405. const sums = []
  2406. columns.forEach((column, index) => {
  2407. if (index === 0) {
  2408. sums[index] = '总计'
  2409. return
  2410. }
  2411. if (column.property !== 'rollQty') {
  2412. sums[index] = ''
  2413. return
  2414. }
  2415. const values = data.map(item => Number(item[column.property]))
  2416. if (!values.every(value => isNaN(value))) {
  2417. sums[index] = values.reduce((prev, curr) => {
  2418. const value = Number(curr)
  2419. if (!isNaN(value)) {
  2420. return prev + curr
  2421. } else {
  2422. return prev
  2423. }
  2424. }, 0)
  2425. } else {
  2426. sums[index] = ''
  2427. }
  2428. })
  2429. return sums
  2430. },
  2431. // 检验结论改变事件
  2432. resultChange () {
  2433. if (this.detailData.inspectionResult === '不合格') {
  2434. this.detailData.passQty = 0
  2435. }
  2436. },
  2437. // 数据采集
  2438. dataAcquisition () {
  2439. this.loadFlag = true
  2440. let tempDate = {
  2441. site: this.detailData.site,
  2442. buNo: this.detailData.buNo,
  2443. inspectionNo: this.detailData.inspectionNo,
  2444. flag: 'ipqc'
  2445. }
  2446. dataAcquisition(tempDate).then(({data}) => {
  2447. if (data.code === 0) {
  2448. // this.acquisitionList = data.rows
  2449. this.changeMyString(data.rows)
  2450. this.$message({
  2451. message: '数据采集成功',
  2452. type: 'success',
  2453. duration: 1500
  2454. })
  2455. } else {
  2456. this.$message({
  2457. message: data.msg,
  2458. type: 'warning',
  2459. duration: 1500
  2460. })
  2461. }
  2462. this.loadFlag = false
  2463. })
  2464. },
  2465. // 获取用户角色
  2466. getUserRoleList () {
  2467. getUserRoleList().then(({data}) => {
  2468. if (data.code === 0) {
  2469. this.roleList = data.rows
  2470. } else {
  2471. this.roleList = []
  2472. }
  2473. })
  2474. },
  2475. // 获取协同人员列表
  2476. getOperatorList () {
  2477. this.operatorData.flag = '1'
  2478. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2479. if (this.roleList.length > 0) {
  2480. let filterList = this.roleList.filter(item => item.roleName === '机修人员')
  2481. if (filterList.length > 0) {
  2482. this.operatorData.roleId = filterList[0].roleId
  2483. } else {
  2484. this.operatorData.roleId = this.roleList[0].roleId
  2485. }
  2486. } else {
  2487. this.operatorData.roleId = ''
  2488. }
  2489. // 先清空缓存选中
  2490. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2491. // 拿到选中的人员编号
  2492. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2493. getOperatorList(this.operatorData).then(({data}) => {
  2494. if (data && data.code === 0) {
  2495. this.operatorList = data.rows
  2496. this.operatorList.forEach(val => {
  2497. // 回显选中
  2498. if (tempDataList.includes(val.adminID)) {
  2499. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2500. }
  2501. })
  2502. this.operatorModelFlag = true
  2503. } else {
  2504. this.$alert(data.msg, '错误', {
  2505. confirmButtonText: '确定'
  2506. })
  2507. }
  2508. })
  2509. },
  2510. // 获取责任人员列表
  2511. getResponsiblePersonList () {
  2512. this.operatorData.flag = '2'
  2513. this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
  2514. if (this.roleList.length > 0) {
  2515. let filterList = this.roleList.filter(item => item.roleName === '系统管理员')
  2516. if (filterList.length > 0) {
  2517. this.operatorData.roleId = filterList[0].roleId
  2518. } else {
  2519. this.operatorData.roleId = this.roleList[0].roleId
  2520. }
  2521. } else {
  2522. this.operatorData.roleId = ''
  2523. }
  2524. // 先清空缓存选中
  2525. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  2526. // 拿到选中的人员编号
  2527. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2528. getOperatorList(this.operatorData).then(({data}) => {
  2529. if (data && data.code === 0) {
  2530. this.operatorList = data.rows
  2531. this.operatorList.forEach(val => {
  2532. // 回显选中
  2533. if (tempDataList.includes(val.adminID)) {
  2534. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2535. }
  2536. })
  2537. this.operatorModelFlag = true
  2538. } else {
  2539. this.$alert(data.msg, '错误', {
  2540. confirmButtonText: '确定'
  2541. })
  2542. }
  2543. })
  2544. },
  2545. // 查询机修人员列表
  2546. getOperatorList2 () {
  2547. if (this.operatorData.flag === '1') {
  2548. // 拿到选中的人员编号
  2549. let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
  2550. getOperatorList(this.operatorData).then(({data}) => {
  2551. if (data && data.code === 0) {
  2552. this.operatorList = data.rows
  2553. this.operatorList.forEach(val => {
  2554. // 回显选中的部门
  2555. if (tempDataList.includes(val.adminID)) {
  2556. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2557. }
  2558. })
  2559. } else {
  2560. this.operatorList = []
  2561. }
  2562. })
  2563. } else {
  2564. // 拿到选中的人员编号
  2565. let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
  2566. getOperatorList(this.operatorData).then(({data}) => {
  2567. if (data && data.code === 0) {
  2568. this.operatorList = data.rows
  2569. this.operatorList.forEach(val => {
  2570. // 回显选中的部门
  2571. if (tempDataList.includes(val.adminID)) {
  2572. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  2573. }
  2574. })
  2575. } else {
  2576. this.operatorList = []
  2577. }
  2578. })
  2579. }
  2580. },
  2581. // 点击行选中复选框
  2582. operatorClickRow (row) {
  2583. this.$refs.operatorTable.toggleRowSelection(row)
  2584. },
  2585. // 多选
  2586. selectionChangeHandle2 (val) {
  2587. this.dataListSelections2 = val
  2588. },
  2589. // 确认多选协同人员
  2590. confirmOperator () {
  2591. if (this.dataListSelections2.length === 0) {
  2592. this.$message.warning('请勾选人员!')
  2593. return
  2594. }
  2595. if (this.operatorData.flag === '1') {
  2596. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2597. this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName
  2598. this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID
  2599. }
  2600. this.detailData.operator = this.detailData.operator.substring(1)
  2601. this.detailData.operatorName = this.detailData.operatorName.substring(1)
  2602. } else {
  2603. for (let i = 0; i < this.dataListSelections2.length; i++) {
  2604. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName
  2605. this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID
  2606. }
  2607. this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1)
  2608. this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1)
  2609. }
  2610. this.operatorData = {
  2611. flag: '',
  2612. site: '',
  2613. bu: '',
  2614. adminID: '',
  2615. adminName: '',
  2616. roleName: '',
  2617. roleId: '',
  2618. }
  2619. this.operatorModelFlag = false
  2620. },
  2621. // bu内容改变事件
  2622. buChange () {
  2623. if (this.modalData.specialTaskFlag !== 'Y') { // 正常检验
  2624. this.modalData.templateId = ''
  2625. this.modalData.templateName = ''
  2626. } else { // 无工单检验
  2627. this.modalData.partNo = ''
  2628. this.modalData.partDesc = ''
  2629. this.modalData.spec = ''
  2630. this.modalData.templateId = ''
  2631. this.modalData.templateName = ''
  2632. }
  2633. },
  2634. // 获取用户的bu
  2635. getSiteAndBuByUserName () {
  2636. let tempData = {
  2637. username: this.$store.state.user.name,
  2638. }
  2639. getSiteAndBuByUserName(tempData).then(({data}) => {
  2640. if (data.code === 0) {
  2641. this.userBuList = data.rows
  2642. }
  2643. })
  2644. },
  2645. // ======= 正则校验 =======
  2646. handleInput (value, type) {
  2647. // 大于等于0,且只能输入4位小数
  2648. let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
  2649. if (val === null || val === undefined || val === '') {
  2650. val = 0
  2651. }
  2652. if (type === 1) {
  2653. this.detailData.unqualifiedQty = val
  2654. } else if (type === 2) {
  2655. this.detailData.passQty = val
  2656. }
  2657. },
  2658. // 子明细导入
  2659. subDetailUpload () {
  2660. let currentData = {
  2661. flag: 'IPQC',
  2662. site: this.detailData.site,
  2663. buNo: this.detailData.buNo,
  2664. inspectionNo: this.detailData.inspectionNo
  2665. }
  2666. //打开组件 去做新增业务
  2667. this.$nextTick(() => {
  2668. this.$refs.subDetailUpload.init(currentData)
  2669. })
  2670. },
  2671. // 查询单位
  2672. umSearch () {
  2673. let tempData = {
  2674. site: this.$store.state.user.site,
  2675. active: 'Y'
  2676. }
  2677. umSearch(tempData).then(({data}) => {
  2678. if (data.code === 0) {
  2679. this.umList = data.rows
  2680. }
  2681. })
  2682. },
  2683. // 标签号回车事件
  2684. rollNoEnter () {
  2685. let tempData = {
  2686. site: '',
  2687. bu: this.modalData.bu,
  2688. rollNo: this.modalData.rollNo
  2689. }
  2690. rollNoEnter(tempData).then(({data}) => {
  2691. if (data && data.code === 0) {
  2692. this.operationList = data.rows
  2693. this.modalData.seqNo = data.rows[0].seqNo
  2694. this.modalData.orderNo = data.rows[0].orderNo
  2695. this.modalData.operationDesc = data.rows[0].operationDesc
  2696. this.modalData.workCenterNo = data.rows[0].workCenterNo
  2697. this.modalData.resourceId = data.rows[0].resourceId
  2698. this.modalData.resourceDesc = data.rows[0].resourceDesc
  2699. this.modalData.partNo = data.rows[0].partNo
  2700. this.modalData.partDesc = data.rows[0].partDesc
  2701. this.modalData.spec = data.rows[0].spec
  2702. } else {
  2703. this.$alert(data.msg, '错误', {
  2704. confirmButtonText: '确定'
  2705. })
  2706. }
  2707. })
  2708. },
  2709. // 箱号扫描事件
  2710. boxNoEnter () {
  2711. let tempData = {
  2712. site: '',
  2713. bu: this.modalData.bu,
  2714. boxNo: this.modalData.boxNo
  2715. }
  2716. boxNoEnter(tempData).then(({data}) => {
  2717. if (data && data.code === 0) {
  2718. this.operationList = data.rows
  2719. this.modalData.seqNo = data.rows[0].seqNo
  2720. this.modalData.orderNo = data.rows[0].orderNo
  2721. this.modalData.operationDesc = data.rows[0].operationDesc
  2722. this.modalData.workCenterNo = data.rows[0].workCenterNo
  2723. this.modalData.resourceId = data.rows[0].resourceId
  2724. this.modalData.resourceDesc = data.rows[0].resourceDesc
  2725. this.modalData.partNo = data.rows[0].partNo
  2726. this.modalData.partDesc = data.rows[0].partDesc
  2727. this.modalData.spec = data.rows[0].spec
  2728. } else {
  2729. this.$alert(data.msg, '错误', {
  2730. confirmButtonText: '确定'
  2731. })
  2732. }
  2733. })
  2734. },
  2735. // input 模糊搜索
  2736. querySearchAsync (queryString, cb) {
  2737. clearTimeout(this.timeout)
  2738. let results = []
  2739. if (queryString === '') {
  2740. cb(results)
  2741. } else {
  2742. // 掉接口需要的参数
  2743. let find = {
  2744. rollNo: queryString, //上面输入框绑定的数据
  2745. site: this.$store.state.user.site,
  2746. }
  2747. // 这里去调后端的接口.根据自己接口的情况进行赋值
  2748. getRollNo(find).then(({data}) => {
  2749. if (data.code === 0) {
  2750. let result = data.rows
  2751. // 循环放到一个远程搜索需要的数组
  2752. for (let i = 0; i < result.length; i++) {
  2753. const element = result[i]
  2754. results.push({
  2755. value: element.rollNo,
  2756. seqNo: element.seqNo,
  2757. orderNo: element.orderNo
  2758. })
  2759. }
  2760. cb(results)
  2761. } else {
  2762. results = []
  2763. cb(results)
  2764. }
  2765. })
  2766. }
  2767. },
  2768. // 点击出现搜索后点击的每一项
  2769. handleSelect (item) {
  2770. this.modalData.rollNo = item.value
  2771. this.modalData.seqNo = item.seqNo
  2772. this.modalData.orderNo = item.orderNo
  2773. this.getOperationList()
  2774. //this.getPartList()
  2775. },
  2776. // 获取处置措施列表
  2777. disposalMeasuresSearch () {
  2778. let tempData = {
  2779. inspectionTypeNo: '101'
  2780. }
  2781. disposalMeasuresSearch(tempData).then(({data}) => {
  2782. if (data.code === 0) {
  2783. this.disposalMeasuresOptions = data.rows
  2784. }
  2785. })
  2786. },
  2787. // 查询检验类型
  2788. inspectionTypeSearch () {
  2789. let tempData = {
  2790. site: this.$store.state.user.site
  2791. }
  2792. inspectionTypeSearch(tempData).then(({data}) => {
  2793. if (data.code === 0) {
  2794. this.typeOptions = data.rows
  2795. this.typeOptions.forEach(val => {
  2796. if (val.inspectionTypeName.includes('IPQC')) {
  2797. this.templateData.inspectionTypeNo = val.inspectionTypeNo
  2798. this.templateData.inspectionTypeName = val.inspectionTypeName
  2799. }
  2800. })
  2801. }
  2802. })
  2803. },
  2804. selectFlag () {
  2805. return true
  2806. },
  2807. // 单机选中
  2808. IPQCClickRow (row) {
  2809. this.currentRow = JSON.parse(JSON.stringify(row))
  2810. },
  2811. // 复选
  2812. selectionIPQC (val) {
  2813. this.IPQCSelections = val
  2814. },
  2815. rowStyle ({row}) {
  2816. if (this.currentRow.inspectionNo === row.inspectionNo) {
  2817. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  2818. }
  2819. },
  2820. // 单机选中
  2821. IPQCDetailClickRow (row) {
  2822. this.currentDetailRow = JSON.parse(JSON.stringify(row))
  2823. },
  2824. rowDetailStyle ({row}) {
  2825. if (this.currentDetailRow.itemNo === row.itemNo) {
  2826. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  2827. }
  2828. },
  2829. //刷新派设备文档的列表
  2830. getFileContentData (row) {
  2831. this.fileData = {
  2832. site: row.site,
  2833. buNo: row.buNo,
  2834. inspectionNo: row.inspectionNo,
  2835. partNo: row.partNo,
  2836. inspectionTypeNo: '101'
  2837. }
  2838. getFileContentList2(this.fileData).then(({data}) => {
  2839. //区分请求成功和失败的状况
  2840. if (data && data.code === 200) {
  2841. this.fileContentList = data.rows
  2842. } else {
  2843. this.fileContentList = []
  2844. }
  2845. })
  2846. this.fileFlag = true
  2847. },
  2848. /*新增文件的modal*/
  2849. addUploadFileModal () {
  2850. let currentData = {
  2851. titleCon: 'IPQC文件上传',
  2852. site: this.detailData.site,
  2853. buNo: this.detailData.buNo,
  2854. createBy: this.$store.state.user.name,
  2855. inspectionNo: this.detailData.inspectionNo,
  2856. remark: '',
  2857. folder: 'qcIPQC',
  2858. }
  2859. //打开组件 去做新增业务
  2860. this.$nextTick(() => {
  2861. this.$refs.qcFAIUploadFile.init(currentData)
  2862. })
  2863. },
  2864. // 上传项目图片
  2865. uploadImageModal (row) {
  2866. let currentData = {
  2867. site: this.detailData.site,
  2868. buNo: this.detailData.buNo,
  2869. createBy: this.$store.state.user.name,
  2870. inspectionNo: this.detailData.inspectionNo,
  2871. itemNo: row.itemNo,
  2872. folder: 'IPQCItemImageFile'
  2873. }
  2874. //打开组件 去做新增业务
  2875. this.$nextTick(() => {
  2876. this.$refs.comQcItemImageUploadFile.init(currentData)
  2877. })
  2878. },
  2879. downloadFile (row) {
  2880. downLoadObjectFile(row).then(({data}) => {
  2881. // 不限制文件下载类型
  2882. const blob = new Blob([data], {type: "application/octet-stream"})
  2883. // 下载文件名称
  2884. const fileName = row.fileName
  2885. // a标签下载
  2886. const linkNode = document.createElement('a')
  2887. // a标签的download属性规定下载文件的名称
  2888. linkNode.download = fileName
  2889. linkNode.style.display = 'none'
  2890. // 生成一个Blob URL
  2891. linkNode.href = URL.createObjectURL(blob)
  2892. document.body.appendChild(linkNode)
  2893. // 模拟在按钮上的一次鼠标单击
  2894. linkNode.click()
  2895. // 释放URL 对象
  2896. URL.revokeObjectURL(linkNode.href)
  2897. document.body.removeChild(linkNode)
  2898. })
  2899. },
  2900. // 预览
  2901. previewFile (row) {
  2902. // 预览文件
  2903. let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
  2904. let type = ''
  2905. if (image.includes(row.fileType.toLowerCase())) {
  2906. type = 'image/' + row.fileType
  2907. }
  2908. let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
  2909. if (video.includes(row.fileType.toLowerCase())) {
  2910. type = 'video/' + row.fileType
  2911. }
  2912. let txt = ['txt']
  2913. if (txt.includes(row.fileType.toLowerCase())) {
  2914. type = 'text/plain'
  2915. }
  2916. let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
  2917. if (office.includes(row.fileType.toLowerCase())) {
  2918. this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
  2919. return
  2920. }
  2921. let pdf = ['pdf']
  2922. if (pdf.includes(row.fileType.toLowerCase())) {
  2923. type = 'application/pdf'
  2924. }
  2925. if (type === ''){
  2926. this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
  2927. return;
  2928. }
  2929. downLoadObjectFile(row).then(({data}) => {
  2930. const blob = new Blob([data], { type: type });
  2931. // 创建URL来生成预览
  2932. const fileURL = URL.createObjectURL(blob);
  2933. if (type.includes('image')) { // 图片
  2934. localStorage.setItem("imgUrl",fileURL)
  2935. window.open(window.location.origin+"/#/image",'_blank')
  2936. } else {
  2937. // 在新标签页中打开文件预览
  2938. const newTab = window.open(fileURL, '_blank')
  2939. }
  2940. })
  2941. },
  2942. // 删除文件
  2943. deleteFile (row) {
  2944. let tempData = {
  2945. site: row.orderRef1,
  2946. inspectionNo: row.orderRef2,
  2947. buNo: row.orderRef4,
  2948. partNo: this.fileData.partNo,
  2949. inspectionTypeNo: '101'
  2950. }
  2951. this.$confirm('确定要删除此文件?', '提示', {
  2952. confirmButtonText: '确定',
  2953. cancelButtonText: '取消',
  2954. type: 'warning'
  2955. }).then(() => {
  2956. deleteObjectFile(row).then(({data}) => {
  2957. if (data && data.code === 0) {
  2958. this.getFileContentData(tempData)
  2959. this.$message({
  2960. message: '操作成功',
  2961. type: 'success',
  2962. duration: 1500,
  2963. onClose: () => {}
  2964. })
  2965. } else {
  2966. this.$alert(data.msg, '错误', {
  2967. confirmButtonText: '确定'
  2968. })
  2969. }
  2970. })
  2971. }).catch(() => {
  2972. })
  2973. },
  2974. // 查询检验员
  2975. inspectorSearch () {
  2976. inspectorSearch().then(({data}) => {
  2977. if (data.code === 0) {
  2978. this.options = data.rows
  2979. }
  2980. })
  2981. },
  2982. // 获取基础数据列表S
  2983. getBaseList (val,type) {
  2984. this.tagNo = val
  2985. this.$nextTick(() => {
  2986. let strVal = ''
  2987. if (val === 1052) {
  2988. this.searchSeqInfo()
  2989. this.seqDetailFlag = true
  2990. }
  2991. if (val === 505) {
  2992. strVal = this.modalData.resourceDesc
  2993. this.$refs.baseList.init(val, strVal)
  2994. }
  2995. if (val === 509) {
  2996. strVal = this.detailData.responsiblePerson
  2997. this.$refs.baseList.init(val, strVal)
  2998. }
  2999. // if (val === 206) {
  3000. // strVal = this.modalData.partNo
  3001. // this.$refs.baseList.init(val, strVal)
  3002. // }
  3003. })
  3004. },
  3005. /* 列表方法的回调 */
  3006. getBaseData (val) {
  3007. if (this.tagNo === 1052) {
  3008. this.modalData.seqNo = val.seqno
  3009. this.modalData.orderNo = val.orderno
  3010. this.modalData.operationDesc = ''
  3011. this.modalData.resourceId = ''
  3012. this.getOperationList()
  3013. //this.getPartList()
  3014. }
  3015. if (this.tagNo === 505) {
  3016. this.modalData.resourceId = val.ResourceID
  3017. this.modalData.resourceDesc = val.ResourceDesc
  3018. }
  3019. if (this.tagNo === 509) {
  3020. this.detailData.responsiblePerson = val.SupplierID
  3021. }
  3022. // if (this.tagNo === 206) {
  3023. // this.modalData.partNo = val.part_no
  3024. // this.modalData.partDesc = val.part_desc
  3025. // // 获取物料的其他信息
  3026. // this.getPartInformation()
  3027. // }
  3028. },
  3029. // // 获取物料其它信息
  3030. // getPartInformation () {
  3031. // getPartInformation(this.modalData).then(({data}) => {
  3032. // if (data && data.code === 0) {
  3033. // this.modalData.spec = data.rows[0].spec
  3034. // } else {
  3035. // this.$alert(data.msg, '错误', {
  3036. // confirmButtonText: '确定'
  3037. // })
  3038. // }
  3039. // })
  3040. // },
  3041. // 获取工序列表
  3042. getOperationList () {
  3043. getOperationList(this.modalData).then(({data}) => {
  3044. if (data && data.code === 0) {
  3045. this.operationList = data.rows
  3046. this.modalData.operationDesc = data.rows[0].operationDesc
  3047. this.modalData.workCenterNo = data.rows[0].workCenterNo
  3048. this.modalData.resourceId = data.rows[0].resourceId
  3049. this.modalData.resourceDesc = data.rows[0].resourceDesc
  3050. this.modalData.partNo = data.rows[0].partNo
  3051. this.modalData.partDesc = data.rows[0].partDesc
  3052. this.modalData.spec = data.rows[0].spec
  3053. this.modalData.qtyrequired = data.rows[0].qtyrequired
  3054. this.modalData.lotsize = data.rows[0].lotsize
  3055. } else {
  3056. this.$alert(data.msg, '错误', {
  3057. confirmButtonText: '确定'
  3058. })
  3059. }
  3060. })
  3061. },
  3062. // 获取机台列表
  3063. getResourceList () {
  3064. // 判断是否为特殊任务,特殊任务的机台不随工序改变
  3065. if (this.modalData.specialTaskFlag === 'Y') {
  3066. return
  3067. } else {
  3068. getResourceList(this.modalData).then(({data}) => {
  3069. if (data && data.code === 0) {
  3070. //this.resourceList = data.rows
  3071. this.modalData.workCenterNo = data.rows[0].workCenterNo
  3072. this.modalData.resourceId = data.rows[0].resourceId
  3073. this.modalData.resourceDesc = data.rows[0].resourceDesc
  3074. } else {
  3075. this.$alert(data.msg, '错误', {
  3076. confirmButtonText: '确定'
  3077. })
  3078. }
  3079. })
  3080. }
  3081. },
  3082. // 获取物料列表
  3083. getPartList () {
  3084. getPartList(this.modalData).then(({data}) => {
  3085. if (data && data.code === 0) {
  3086. this.partList = data.rows
  3087. this.modalData.partNo = this.partList[0].partNo
  3088. this.modalData.partDesc = this.partList[0].partDesc
  3089. this.modalData.spec = this.partList[0].spec
  3090. } else {
  3091. this.$alert(data.msg, '错误', {
  3092. confirmButtonText: '确定'
  3093. })
  3094. }
  3095. })
  3096. },
  3097. // 检查动控是否开启
  3098. queryController () {
  3099. let tempData = {
  3100. controlNo: '10004',
  3101. site: this.$store.state.user.site,
  3102. }
  3103. queryController(tempData).then(({data}) => {
  3104. if (data && data.code === 0) {
  3105. this.controlData = data.rows
  3106. } else {
  3107. this.$alert(data.msg, '错误', {
  3108. confirmButtonText: '确定'
  3109. })
  3110. }
  3111. })
  3112. },
  3113. addModal () {
  3114. this.modalData = {
  3115. flag: '1',
  3116. site: '',
  3117. bu: this.userBuList[0].buNo,
  3118. inspectionNo:'',
  3119. partNo: '',
  3120. partDesc: '',
  3121. inspectionTypeNo:'',
  3122. inspectionTypeName:'',
  3123. inspectorNo:'',
  3124. inspectorName:'',
  3125. orderNo: '',
  3126. operationDesc: '',
  3127. operationNo: '',
  3128. resourceId: '',
  3129. resourceDesc: '',
  3130. rollQty: '',
  3131. seqNo: '',
  3132. spec: '',
  3133. specialRequirements: '',
  3134. templateId: '',
  3135. templateName: '',
  3136. specialTaskFlag: '',
  3137. workCenterNo: '',
  3138. rollNo: '',
  3139. umId: this.umList[0].umId,
  3140. umName: this.umList[0].umName,
  3141. sjzs: '',
  3142. boxNo: '',
  3143. createBy: this.$store.state.user.name,
  3144. importantFlag: ''
  3145. }
  3146. this.operationList = []
  3147. this.resourceList = []
  3148. this.partList = []
  3149. this.modalDisableFlag = false
  3150. this.modalFlag = true
  3151. this.checked = false
  3152. },
  3153. // 获取检验模板列表
  3154. queryTemplateList () {
  3155. this.templateData.bu = this.modalData.bu
  3156. // 查询所有检验模板
  3157. queryTemplateList(this.templateData).then(({data}) => {
  3158. if (data && data.code === 0) {
  3159. this.templateList = data.rows
  3160. this.templateModelFlag = true
  3161. }else {
  3162. this.$alert(data.msg, '错误', {
  3163. confirmButtonText: '确定'
  3164. })
  3165. }
  3166. })
  3167. },
  3168. // 获取物料列表
  3169. queryPartList () {
  3170. this.partData.bu = this.modalData.bu
  3171. // 查询所有物料
  3172. if (this.partData.partNo === '' && this.partData.partDesc === '') {
  3173. this.partList = []
  3174. this.partModelFlag = true
  3175. } else {
  3176. queryPartList(this.partData).then(({data}) => {
  3177. if (data && data.code === 0) {
  3178. this.partList = data.rows
  3179. this.partModelFlag = true
  3180. }else {
  3181. this.$alert(data.msg, '错误', {
  3182. confirmButtonText: '确定'
  3183. })
  3184. }
  3185. })
  3186. }
  3187. },
  3188. // 选中检验模板
  3189. getRowData (row) {
  3190. this.modalData.templateId = row.templateId
  3191. this.modalData.templateName = row.templateName
  3192. this.templateModelFlag = false
  3193. },
  3194. // 选中派工单号
  3195. getRowData1 (row) {
  3196. this.modalData.partNo = row.partNo
  3197. this.modalData.partDesc = row.partDesc
  3198. this.modalData.orderNo = row.orderNo
  3199. this.modalData.seqNo = row.seqNo
  3200. this.modalData.lotsize = row.lotsize
  3201. this.modalData.operationDesc = row.operationDesc
  3202. this.modalData.qtyrequired = row.qtyrequired
  3203. this.modalData.rollQty = row.qtyrequired
  3204. this.modalData.sjzs = row.sjzs
  3205. this.modalData.umId = row.umId
  3206. this.getOperationList()
  3207. this.seqDetailFlag = false
  3208. },
  3209. // 选中物料
  3210. getRowData2 (row) {
  3211. this.modalData.partNo = row.partNo
  3212. this.modalData.partDesc = row.partDesc
  3213. this.modalData.spec = row.spec
  3214. this.partData = {
  3215. site: '',
  3216. bu: '',
  3217. partNo: '',
  3218. partDesc: '',
  3219. }
  3220. this.partModelFlag = false
  3221. },
  3222. // 是否新增特殊任务
  3223. changeSpecialTask () {
  3224. // 先重置数据
  3225. this.modalData = {
  3226. flag: '1',
  3227. site: '',
  3228. bu: this.userBuList[0].buNo,
  3229. inspectionNo:'',
  3230. partNo: '',
  3231. partDesc: '',
  3232. inspectionTypeNo:'',
  3233. inspectionTypeName:'',
  3234. inspectorNo:'',
  3235. inspectorName:'',
  3236. orderNo: '',
  3237. operationDesc: '',
  3238. operationNo: '',
  3239. resourceId: '',
  3240. resourceDesc: '',
  3241. rollQty: '',
  3242. seqNo: '',
  3243. spec: '',
  3244. specialRequirements: '',
  3245. templateId: '',
  3246. templateName: '',
  3247. specialTaskFlag: '',
  3248. workCenterNo: '',
  3249. rollNo: '',
  3250. umId: this.umList[0].umId,
  3251. umName: this.umList[0].umName,
  3252. boxNo: '',
  3253. createBy: this.$store.state.user.name,
  3254. importantFlag: ''
  3255. }
  3256. // 获取选中框
  3257. let obj = document.getElementsByName('specialTask')
  3258. // 判断是否打勾
  3259. if (obj[0].checked) {
  3260. let tempData = {
  3261. site: '',
  3262. bu: this.modalData.bu
  3263. }
  3264. this.modalData.specialTaskFlag = 'Y'
  3265. // 获取特殊工序列表
  3266. getSpecialOperationList(tempData).then(({data}) => {
  3267. if (data && data.code === 0) {
  3268. this.operationList = data.rows
  3269. } else {
  3270. this.$alert(data.msg, '错误', {
  3271. confirmButtonText: '确定'
  3272. })
  3273. }
  3274. })
  3275. // 派工单和工单号赋值
  3276. this.modalData.seqNo = '000#1TSGD'
  3277. this.modalData.orderNo = '000#1'
  3278. } else {
  3279. this.operationList = []
  3280. this.modalData.specialTaskFlag = ''
  3281. }
  3282. },
  3283. // 新增IPQC巡检记录
  3284. saveData () {
  3285. if (this.modalData.bu === '' || this.modalData.bu == null) {
  3286. this.$message.warning('请选择BU!')
  3287. return
  3288. }
  3289. if (this.modalData.seqNo === '' || this.modalData.seqNo == null) {
  3290. this.$message.warning('请选择派工单!')
  3291. return
  3292. }
  3293. if (this.modalData.orderNo === '' || this.modalData.orderNo == null) {
  3294. this.$message.warning('请选择工单!')
  3295. return
  3296. }
  3297. if (this.modalData.inspectionTypeNo === '' || this.modalData.inspectionTypeNo == null) {
  3298. this.$message.warning('请选择检验类型!')
  3299. return
  3300. }
  3301. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.partNo === '' || this.modalData.partNo == null)) {
  3302. this.$message.warning('请选择物料!')
  3303. return
  3304. }
  3305. if (this.modalData.operationDesc === '' || this.modalData.operationDesc == null) {
  3306. this.$message.warning('请选择工序!')
  3307. return
  3308. }
  3309. if (this.modalData.specialTaskFlag !== 'Y' && (this.modalData.resourceId === '' || this.modalData.resourceId == null)) {
  3310. this.$message.warning('请选择机台!')
  3311. return
  3312. }
  3313. if (this.modalData.rollQty === '' || this.modalData.rollQty == null) {
  3314. this.$message.warning('请填写送检数量!')
  3315. return
  3316. }
  3317. if (this.modalData.umId === '' || this.modalData.umId == null) {
  3318. this.$message.warning('请选择单位!')
  3319. return
  3320. }
  3321. if (this.controlData.baseData === '控制' && (this.modalData.templateId == null || this.modalData.templateId === '')) {
  3322. this.$message.warning('请选择检验模板!')
  3323. return
  3324. }
  3325. this.saveLoading = true
  3326. if(this.modalData.flag === '1'){
  3327. saveOsInspection(this.modalData).then(({data}) => {
  3328. if (data && data.code === 0) {
  3329. this.getDataList()
  3330. this.operationList = []
  3331. this.resourceList = []
  3332. this.partList = []
  3333. this.modalFlag = false
  3334. this.$message({
  3335. message: '操作成功',
  3336. type: 'success',
  3337. duration: 1500,
  3338. onClose: () => {}
  3339. })
  3340. } else {
  3341. this.$alert(data.msg, '错误', {
  3342. confirmButtonText: '确定'
  3343. })
  3344. }
  3345. this.saveLoading = false
  3346. }).catch(()=>{
  3347. this.saveLoading = false
  3348. })
  3349. }
  3350. },
  3351. // 获取主信息数据列表
  3352. getDataList () {
  3353. this.searchData.limit = this.pageSize
  3354. this.searchData.page = this.pageIndex
  3355. qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  3356. if (data.code === 0) {
  3357. this.dataList = data.page.list
  3358. this.pageIndex = data.page.currPage
  3359. this.pageSize = data.page.pageSize
  3360. this.totalPage = data.page.totalCount
  3361. }
  3362. })
  3363. },
  3364. // 获取主信息数据列表
  3365. getDataList2 () {
  3366. this.searchData.limit = this.pageSize
  3367. this.searchData.page = this.pageIndex
  3368. qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  3369. if (data.code === 0) {
  3370. this.dataList = data.page.list
  3371. this.pageIndex = data.page.currPage
  3372. this.pageSize = data.page.pageSize
  3373. this.totalPage = data.page.totalCount
  3374. if (this.dataList.length > 0) {
  3375. // 开始检验
  3376. this.$confirm(`确认开始检验?`, '提示', {
  3377. confirmButtonText: '确定',
  3378. cancelButtonText: '取消',
  3379. type: 'warning'
  3380. }).then(() => {
  3381. let tempData = {
  3382. site: this.dataList[0].site,
  3383. buNo: this.dataList[0].buNo,
  3384. inspectionNo: this.dataList[0].inspectionNo,
  3385. actionBy: this.$store.state.user.name,
  3386. state: '待检验'
  3387. }
  3388. actionIPQCInspection(tempData).then(({data}) => {
  3389. if (data && data.code === 0) {
  3390. qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  3391. if (data.code === 0) {
  3392. this.dataList = data.page.list
  3393. this.pageIndex = data.page.currPage
  3394. this.pageSize = data.page.pageSize
  3395. this.totalPage = data.page.totalCount
  3396. if (this.dataList.length > 0) {
  3397. // 打开检验单
  3398. this.detailModal(this.dataList[0])
  3399. this.$router.push()
  3400. }
  3401. }
  3402. })
  3403. }
  3404. })
  3405. })
  3406. }
  3407. }
  3408. })
  3409. },
  3410. // 每页数
  3411. sizeChangeHandle (val) {
  3412. this.pageSize = val
  3413. this.pageIndex = 1
  3414. this.getDataList()
  3415. },
  3416. // 当前页
  3417. currentChangeHandle (val) {
  3418. this.pageIndex = val
  3419. this.getDataList()
  3420. },
  3421. sizeChangeHandle3 (val) {
  3422. this.pageSize3 = val
  3423. this.pageIndex3 = 1
  3424. this.searchSeqInfo()
  3425. },
  3426. currentChangeHandle3 (val) {
  3427. this.pageIndex3 = val
  3428. this.searchSeqInfo()
  3429. },
  3430. // 多选
  3431. selectionChangeHandle (val) {
  3432. this.dataListSelections = val
  3433. },
  3434. // 删除检验记录
  3435. deleteModal () {
  3436. if (this.IPQCSelections.length === 0) {
  3437. this.$alert('请勾选要删除的检验单!', '提示', {
  3438. confirmButtonText: '确定'
  3439. })
  3440. return false
  3441. }
  3442. this.$confirm(`是否删除该 `+ this.IPQCSelections.length +` 条检验记录?`, '提示', {
  3443. confirmButtonText: '确定',
  3444. cancelButtonText: '取消',
  3445. type: 'warning'
  3446. }).then(() => {
  3447. let tempData = {
  3448. site: this.$store.state.user.site,
  3449. submitList: this.IPQCSelections
  3450. }
  3451. ipqcRecordDelete(tempData).then(({data}) => {
  3452. if (data && data.code === 0) {
  3453. this.getDataList()
  3454. this.IPQCSelections = []
  3455. this.$message({
  3456. message: '操作成功',
  3457. type: 'success',
  3458. duration: 1500,
  3459. onClose: () => {}
  3460. })
  3461. } else {
  3462. this.$alert(data.msg, '错误', {
  3463. confirmButtonText: '确定'
  3464. })
  3465. }
  3466. })
  3467. }).catch(() => {
  3468. })
  3469. },
  3470. Transfer () {
  3471. if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) {
  3472. this.$message.warning('请选择检验结论!')
  3473. return
  3474. }
  3475. if (this.detailData.inspectionResult === '不合格' && (this.detailData.disposalMeasures == null || this.detailData.disposalMeasures === '')) {
  3476. this.$message.warning('请选择处置措施!')
  3477. return
  3478. }
  3479. if (this.detailList.length > 0 && this.detailData.inspectionResult === '不合格') {
  3480. const flag = this.detailList.some(item => item.itemResult === 'N')
  3481. if (!flag) {
  3482. this.$message.warning('请选择不合格项目!')
  3483. return
  3484. }
  3485. }
  3486. this.$confirm(`确认保存检验数据?`, '提示', {
  3487. confirmButtonText: '确定',
  3488. cancelButtonText: '取消',
  3489. type: 'warning'
  3490. }).then(() => {
  3491. if (this.detailData.inspectionResult !== '不合格') {
  3492. this.detailData.disposalMeasures = ''
  3493. this.detailData.disposalRemark = ''
  3494. }
  3495. this.saveDetailInformation()
  3496. })
  3497. },
  3498. // 新增明细信息
  3499. saveDetailInformation () {
  3500. this.saveInformationData.site = this.detailData.site
  3501. this.saveInformationData.buNo = this.detailData.buNo
  3502. this.saveInformationData.inspectionNo = this.detailData.inspectionNo
  3503. this.saveInformationData.disposalMeasures = this.detailData.disposalMeasures
  3504. this.saveInformationData.disposalRemark = this.detailData.disposalRemark
  3505. this.saveInformationData.inspectorNo = this.$store.state.user.name
  3506. this.saveInformationData.inspectionResult = this.detailData.inspectionResult
  3507. this.saveInformationData.inspectionRemark = this.detailData.inspectionRemark
  3508. this.saveInformationData.rollQty = this.detailData.rollQty
  3509. this.saveInformationData.samplingQty = this.detailData.samplingQty
  3510. this.saveInformationData.unqualifiedQty = this.detailData.unqualifiedQty
  3511. this.saveInformationData.partNo = this.detailData.partNo
  3512. this.saveInformationData.partDesc = this.detailData.partDesc
  3513. this.saveInformationData.operator = this.detailData.operator
  3514. this.saveInformationData.responsiblePerson = this.detailData.responsiblePerson
  3515. this.saveInformationData.itemList = JSON.parse(JSON.stringify(this.detailList))
  3516. this.saveInformationData.passQty = this.detailData.passQty == null ? 0 : this.detailData.passQty
  3517. this.saveInformationData.notPassQty = this.detailData.notPassQty == null ? 0 : this.detailData.notPassQty
  3518. // this.saveInformationData.subDetailList = this.acquisitionList
  3519. saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => {
  3520. if (data && data.code === 0) {
  3521. this.getDataList()
  3522. this.detailInformationFlag = false
  3523. this.$message({
  3524. message: '操作成功',
  3525. type: 'success',
  3526. duration: 1500,
  3527. onClose: () => {}
  3528. })
  3529. } else {
  3530. this.$alert(data.msg, '错误', {
  3531. confirmButtonText: '确定'
  3532. })
  3533. }
  3534. })
  3535. },
  3536. // 开始检验
  3537. actionModal (row) {
  3538. this.$confirm(`确认开始检验?`, '提示', {
  3539. confirmButtonText: '确定',
  3540. cancelButtonText: '取消',
  3541. type: 'warning'
  3542. }).then(() => {
  3543. let tempData = {
  3544. site: row.site,
  3545. buNo: row.buNo,
  3546. inspectionNo: row.inspectionNo,
  3547. actionBy: this.$store.state.user.name,
  3548. state: '待检验'
  3549. }
  3550. actionIPQCInspection(tempData).then(({data}) => {
  3551. if (data && data.code === 0) {
  3552. this.getDataList()
  3553. this.$message({
  3554. message: '操作成功',
  3555. type: 'success',
  3556. duration: 1500,
  3557. onClose: () => {}
  3558. })
  3559. } else {
  3560. this.$alert(data.msg, '错误', {
  3561. confirmButtonText: '确定'
  3562. })
  3563. }
  3564. })
  3565. })
  3566. },
  3567. // 明细记录信息查询
  3568. detailModal (row) {
  3569. this.detailData.site = row.site
  3570. this.detailData.buNo = row.buNo
  3571. this.detailData.inspectionNo = row.inspectionNo
  3572. this.detailData.partNo = row.partNo
  3573. this.detailData.partDesc = row.partDesc
  3574. this.detailData.rollQty = row.rollQty
  3575. this.detailData.samplingQty = row.samplingQty
  3576. this.detailData.unqualifiedQty = row.unqualifiedQty
  3577. this.detailData.unqualifiedQuantity = row.unqualifiedQuantity
  3578. this.detailData.submitFlag = row.submitFlag
  3579. this.detailData.disposalMeasures = row.disposalMeasures
  3580. this.detailData.disposalRemark = row.disposalRemark
  3581. this.detailData.inspectionResult = row.inspectionResult
  3582. this.detailData.inspectorNo = row.inspectorNo
  3583. this.detailData.inspectorName = row.inspectorName
  3584. this.detailData.inspectionRemark = row.inspectionRemark
  3585. this.detailData.spec = row.spec
  3586. this.detailData.umId = row.umId
  3587. this.detailData.umName = row.umName
  3588. this.detailData.operator = row.operator
  3589. this.detailData.operatorName = row.operatorName
  3590. this.detailData.responsiblePerson = row.responsiblePerson
  3591. this.detailData.responsiblePersonName = row.responsiblePersonName
  3592. if (row.state === '待检验') {
  3593. this.detailData.passQty = row.samplingQty
  3594. } else {
  3595. this.detailData.passQty = row.passQty
  3596. this.detailData.notPassQty = row.notPassQty
  3597. }
  3598. this.getInspectionFormData()
  3599. // this.inspectorSearch()
  3600. // this.acquisitionList = []
  3601. this.detailInformationFlag = true
  3602. },
  3603. // 检验单明细
  3604. getInspectionFormData () {
  3605. ipqcDetailSearch(this.detailData).then(({data}) => {
  3606. if (data && data.code === 0) {
  3607. this.detailList = data.rows
  3608. } else {
  3609. this.detailList = []
  3610. }
  3611. })
  3612. },
  3613. // 子明细记录信息查询
  3614. subDetailModal (row) {
  3615. this.subDetailData = row
  3616. this.pageIndex2 = 1
  3617. selectIPQCSubDetailedRecord(this.subDetailData).then(({data}) => {
  3618. this.tableData = data.rows
  3619. })
  3620. this.batchAddData = {
  3621. samplingLocation: '',
  3622. samplingLocationB: '',
  3623. samplingNumber: ''
  3624. }
  3625. this.subDetailFlag = true
  3626. },
  3627. // 审核按钮
  3628. submitResult () {
  3629. let tempData1 = '' // 记录不是待审核状态的单号
  3630. let tempData2 = '' // 记录处置措施未填写的单号
  3631. if (this.IPQCSelections.length === 0) {
  3632. this.$alert('请勾选要审核的检验单!', '提示', {
  3633. confirmButtonText: '确定'
  3634. })
  3635. return false
  3636. }
  3637. for (let i = 0; i < this.IPQCSelections.length; i++) {
  3638. if (this.IPQCSelections[i].state !== '待审核'){
  3639. tempData1 = tempData1 + this.IPQCSelections[i].inspectionNo + '、'
  3640. }
  3641. if (this.IPQCSelections[i].inspectionResult === '不合格' && (this.IPQCSelections[i].disposalMeasures === '' || this.IPQCSelections[i].disposalMeasures == null)) {
  3642. tempData2 = tempData2 + this.IPQCSelections[i].inspectionNo + '、'
  3643. }
  3644. }
  3645. if (tempData1 !== ''){
  3646. tempData1 = tempData1.substring(0, tempData1.length - 1)
  3647. this.$alert('检验单号 ' + tempData1 + ' 不是待审核状态!', '提示', {
  3648. confirmButtonText: '确定'
  3649. })
  3650. return false
  3651. }
  3652. if (tempData2 !== ''){
  3653. tempData2 = tempData2.substring(0, tempData2.length - 1)
  3654. this.$alert('检验单号 ' + tempData2 + ' 的处置措施未选择!', '提示', {
  3655. confirmButtonText: '确定'
  3656. })
  3657. return false
  3658. }
  3659. this.$confirm(`已确认单据信息无误,确定审核该 ` + this.IPQCSelections.length + ` 条记录`, '提示', {
  3660. confirmButtonText: '确定',
  3661. cancelButtonText: '取消',
  3662. type: 'warning'
  3663. }).then(() => {
  3664. this.submitData.submitList = this.IPQCSelections
  3665. saveIPQCSubmitResult(this.submitData).then(({data}) => {
  3666. if (data && data.code === 0) {
  3667. this.getDataList()
  3668. this.IPQCSelections = []
  3669. this.$message({
  3670. message: '操作成功',
  3671. type: 'success',
  3672. duration: 1500,
  3673. onClose: () => {}
  3674. })
  3675. } else {
  3676. this.$alert(data.msg, '错误', {
  3677. confirmButtonText: '确定'
  3678. })
  3679. }
  3680. })
  3681. }).catch(() => {
  3682. })
  3683. },
  3684. // 子明细每页数
  3685. sizeChangeHandle2 (val) {
  3686. this.pageSize2 = val
  3687. },
  3688. // 子明细当前页
  3689. currentChangeHandle2 (val) {
  3690. this.pageIndex2 = val
  3691. },
  3692. // 子明细方法
  3693. // 表格的新增
  3694. rowClassName ({ row, rowIndex }) {
  3695. row.xh = rowIndex + 1
  3696. row.rowI = this.tableData.indexOf(row) + 1
  3697. },
  3698. // 单选框选中数据
  3699. handleDetailSelectionChange (selection) {
  3700. this.checkedDetail = selection
  3701. },
  3702. // 点击新增更多
  3703. handleAddBtn (td) {
  3704. checkIPQCIsSubmit(td).then(({data}) => {
  3705. if (data.flag !== 1) {
  3706. let obj = {}
  3707. obj.subDetailValue = ""
  3708. obj.samplingLocation = ""
  3709. this.tableData.push(obj)
  3710. } else {
  3711. this.$alert("记录已提交!", '错误', {
  3712. confirmButtonText: '确定'
  3713. })
  3714. }
  3715. })
  3716. },
  3717. // 批量新增操作
  3718. batchHandleAdd (td) {
  3719. checkIPQCIsSubmit(td).then(({data}) => {
  3720. if (data.flag !== 1) {
  3721. this.batchHandleAddModalFlag = true
  3722. } else {
  3723. this.$alert("记录已提交!", '错误', {
  3724. confirmButtonText: '确定'
  3725. })
  3726. }
  3727. })
  3728. },
  3729. // 批量新增行
  3730. batchHandleAddModal () {
  3731. for (let i = 0; i < this.batchAddData.samplingNumber; i++) {
  3732. let obj = {}
  3733. obj.samplingLocation = this.batchAddData.samplingLocation
  3734. obj.samplingLocationB = this.batchAddData.samplingLocationB
  3735. obj.subDetailValue = ""
  3736. this.tableData.push(obj)
  3737. }
  3738. this.batchHandleAddModalFlag = false
  3739. },
  3740. // 回车事件
  3741. nextFocus1 (index) {
  3742. let a1 = `${index + 1}` + `a`
  3743. this.$nextTick(() => {
  3744. this.$refs[a1].focus()
  3745. })
  3746. },
  3747. nextFocus2 (index) {
  3748. let a2 = `${index + 1}` + `b`
  3749. this.$nextTick(() => {
  3750. this.$refs[a2].focus()
  3751. })
  3752. },
  3753. nextFocus3 (index) {
  3754. let a3 = `${index + 1}` + `c`
  3755. this.$nextTick(() => {
  3756. this.$refs[a3].focus()
  3757. })
  3758. },
  3759. focusNextInput (index, type) {
  3760. let aaa = ''
  3761. if (this.detailList.length - 1 === index) {
  3762. aaa = `${type}0`
  3763. } else {
  3764. aaa = `${type}${index + 1}`
  3765. }
  3766. this.$nextTick(() => {
  3767. this.$refs[aaa].focus()
  3768. })
  3769. },
  3770. //删除
  3771. handleDeleteBtn (td) {
  3772. checkIPQCIsSubmit(td).then(({data}) => {
  3773. if (data.flag !== 1) {
  3774. if (this.checkedDetail.length === 0) {
  3775. this.$alert("请先选择要删除的数据", "提示", {
  3776. confirmButtonText: "确定",
  3777. })
  3778. } else {
  3779. this.$confirm("请是否确认删除该子明细记录?", "提示", {
  3780. confirmButtonText: "确定",
  3781. cancelButtonText: "取消",
  3782. type: "warning",
  3783. callback: (action) => {
  3784. if (action === "confirm") {
  3785. let val = this.checkedDetail
  3786. val.forEach((val, index) => {
  3787. this.tableData.splice(this.tableData.indexOf(val), 1)
  3788. if (this.templateTableData.length === 0) {
  3789. this.pageIndex2--
  3790. }
  3791. })
  3792. this.$message({
  3793. message: "删除成功!",
  3794. type: "success",
  3795. })
  3796. return
  3797. } else {
  3798. this.$message({
  3799. message: "已取消删除操作",
  3800. type: "warning",
  3801. })
  3802. return
  3803. }
  3804. },
  3805. })
  3806. }
  3807. } else {
  3808. this.$alert("记录已提交!", '错误', {
  3809. confirmButtonText: '确定'
  3810. })
  3811. }
  3812. })
  3813. },
  3814. // 新增子明细记录
  3815. saveSubDetailResult () {
  3816. for (let i = 0; i < this.tableData.length; i++) {
  3817. if (this.tableData[i].subDetailValue === '' || this.tableData[i].subDetailValue == null) {
  3818. this.$message.warning('序号' + (i+1) +'未填写实测值!')
  3819. return
  3820. }
  3821. }
  3822. this.subDetailData.subDetailValues = this.tableData
  3823. saveIPQCSubDetailed(this.subDetailData).then(({data}) => {
  3824. if (data && data.code === 0) {
  3825. if (data.count > 0) {
  3826. this.subDetailData.itemResult = 'N'
  3827. this.subDetailData.unqualifiedQuantity = data.count
  3828. }
  3829. if (this.subDetailData.subDetailValues.length > 0) {
  3830. this.subDetailData.subDetailRecordNum = 1
  3831. } else {
  3832. this.subDetailData.subDetailRecordNum = -1
  3833. this.subDetailData.unqualifiedQuantity = 0
  3834. this.subDetailData.itemResult = 'Y'
  3835. }
  3836. this.subDetailFlag = false
  3837. this.tableData = []
  3838. this.$message({
  3839. message: '操作成功',
  3840. type: 'success',
  3841. duration: 1500,
  3842. onClose: () => {}
  3843. })
  3844. } else {
  3845. this.$alert(data.msg, '错误', {
  3846. confirmButtonText: '确定'
  3847. })
  3848. }
  3849. })
  3850. },
  3851. // 校验用户是否收藏
  3852. favoriteIsOk () {
  3853. let userFavorite = {
  3854. userId: this.$store.state.user.id,
  3855. languageCode: this.$i18n.locale
  3856. }
  3857. userFavoriteList(userFavorite).then(({data}) => {
  3858. for (let i = 0; i < data.list.length; i++) {
  3859. if(this.$route.meta.menuId === data.list[i].menuId){
  3860. this.favorite = true
  3861. }
  3862. }
  3863. })
  3864. },
  3865. // 收藏 OR 取消收藏
  3866. favoriteFunction () {
  3867. let userFavorite = {
  3868. userId: this.$store.state.user.id,
  3869. functionId: this.$route.meta.menuId,
  3870. }
  3871. if (this.favorite) {
  3872. removeUserFavorite(userFavorite).then(({data}) => {
  3873. this.$message.success(data.msg)
  3874. this.favorite = false
  3875. })
  3876. } else {
  3877. // 收藏
  3878. saveUserFavorite(userFavorite).then(({data}) => {
  3879. this.$message.success(data.msg)
  3880. this.favorite = true
  3881. })
  3882. }
  3883. },
  3884. //导出excel
  3885. async createExportData () {
  3886. this.searchData.limit = -1
  3887. this.searchData.page = 1
  3888. await qcIPQCInspectionSearch(this.searchData).then(({data}) => {
  3889. this.exportList= data.page.list
  3890. })
  3891. return this.exportList
  3892. },
  3893. startDownload() {},
  3894. finishDownload() {},
  3895. fields () {
  3896. let json = "{"
  3897. this.columnList1.forEach((item, index) => {
  3898. if (index == this.columnList1.length - 1) {
  3899. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  3900. } else {
  3901. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  3902. }
  3903. })
  3904. json += "}"
  3905. let s = eval("(" + json + ")")
  3906. return s
  3907. },
  3908. // 动态列开始 获取 用户保存的 格式列
  3909. async getTableUserColumn (tableId, columnId) {
  3910. let queryTableUser = {
  3911. userId: this.$store.state.user.name,
  3912. functionId: this.$route.meta.menuId,
  3913. tableId: tableId,
  3914. status: true,
  3915. languageCode: this.$i18n.locale
  3916. }
  3917. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3918. if (data.rows.length > 0) {
  3919. //this.columnList1 = []
  3920. switch (columnId) {
  3921. case 1:
  3922. this.columnList1 = data.rows
  3923. break;
  3924. case 2:
  3925. this.detailColumnList = data.rows
  3926. break;
  3927. case 3:
  3928. this.seqDetailColumnList = data.rows
  3929. break;
  3930. // case 4:
  3931. // this.columnList3 = data.rows
  3932. // break;
  3933. }
  3934. } else {
  3935. this.getColumnList(tableId, columnId)
  3936. }
  3937. })
  3938. },
  3939. // 获取 tableDefault 列
  3940. async getColumnList (tableId, columnId) {
  3941. let queryTable= {
  3942. functionId: this.$route.meta.menuId,
  3943. tableId: tableId,
  3944. languageCode: this.$i18n.locale
  3945. }
  3946. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3947. if (!data.rows.length == 0) {
  3948. switch (columnId) {
  3949. case 1:
  3950. this.columnList1 = data.rows
  3951. break;
  3952. case 2:
  3953. this.detailColumnList = data.rows
  3954. break;
  3955. case 3:
  3956. this.seqDetailColumnList = data.rows
  3957. break;
  3958. // case 4:
  3959. // this.columnList3 = data.rows
  3960. // break;
  3961. }
  3962. } else {
  3963. // this.showDefault = true.
  3964. }
  3965. })
  3966. },
  3967. /**
  3968. * 明细导入后将返回值回传给父组件
  3969. * @param val
  3970. */
  3971. changeMyString (val) {
  3972. for (let i = 0; i < this.detailList.length; i++) {
  3973. if (val[this.detailList[i].itemNo] !== undefined) {
  3974. this.detailList[i].unqualifiedQuantity = val[this.detailList[i].itemNo]
  3975. if (val[this.detailList[i].itemNo] != null) {
  3976. this.detailList[i].subDetailRecordNum = 1
  3977. }
  3978. if (val[this.detailList[i].itemNo] > 0) {
  3979. this.detailList[i].itemResult = 'N'
  3980. }
  3981. }
  3982. }
  3983. },
  3984. searchSeqInfo () {
  3985. if (this.seqDetailData.cancelFlag === 'Y' && this.seqDetailData.status.length > 0) {
  3986. this.$message.warning('状态冲突!')
  3987. return
  3988. }
  3989. if (!this.seqDetailData.seqNo && !this.seqDetailData.orderNo && !this.seqDetailData.partNo && !this.seqDetailData.partDesc && !this.seqDetailData.operationDesc){
  3990. this.pageIndex3 = 1
  3991. this.pageSize3 = 20
  3992. this.totalPage3 = 0
  3993. this.seqInfoList = []
  3994. } else {
  3995. let tempData = {
  3996. // 取modalData.bu中index为0的字符作为site 例:2_01-Label 取2
  3997. limit: this.pageSize3,
  3998. page: this.pageIndex3,
  3999. site: this.modalData.bu.at(0),
  4000. seqNo: this.seqDetailData.seqNo,
  4001. orderNo: this.seqDetailData.orderNo,
  4002. partDesc: this.seqDetailData.partDesc,
  4003. partNo: this.seqDetailData.partNo,
  4004. operationDesc: this.seqDetailData.operationDesc,
  4005. status: this.seqDetailData.status,
  4006. cancelFlag: this.seqDetailData.cancelFlag,
  4007. }
  4008. searchSeqInfo(tempData).then(({data}) => {
  4009. if (data && data.code === 0) {
  4010. this.seqInfoList = data.page.list
  4011. this.pageIndex3 = data.page.currPage
  4012. this.pageSize3 = data.page.pageSize
  4013. this.totalPage3 = data.page.totalCount
  4014. } else {
  4015. this.$alert(data.msg, '错误', {
  4016. confirmButtonText: '确定'
  4017. })
  4018. }
  4019. })
  4020. }
  4021. },
  4022. closeDialog () {
  4023. this.seqDetailData = {
  4024. seqNo : '',
  4025. orderNo: '',
  4026. partNo: '',
  4027. partDesc: '',
  4028. operationDesc: '',
  4029. status: '',
  4030. cancelFlag: '',
  4031. page: 1,
  4032. limit: 10
  4033. }
  4034. this.seqInfoList = []
  4035. },
  4036. //获取按钮的权限数据
  4037. getButtonAuthData () {
  4038. let searchFlag = this.isAuth(this.menuId+":search")
  4039. let checkFlag = this.isAuth(this.menuId+":check")
  4040. let saveFlag = this.isAuth(this.menuId+":save")
  4041. let deleteFlag = this.isAuth(this.menuId+":delete")
  4042. let detailFlag = this.isAuth(this.menuId+":detail")
  4043. let fileFlag = this.isAuth(this.menuId+":file")
  4044. //处理页面的权限数据
  4045. this.authSearch = !searchFlag
  4046. this.authCheck = !checkFlag
  4047. this.authSave = !saveFlag
  4048. this.authDelete = !deleteFlag
  4049. this.authDetail = !detailFlag
  4050. this.authFile = !fileFlag
  4051. },
  4052. }
  4053. }
  4054. </script>
  4055. <style scoped>
  4056. /deep/ .redElSelect .el-input--suffix .el-input__inner{
  4057. color: red;
  4058. font-weight: bold;
  4059. }
  4060. /deep/ .greenElSelect .el-input--suffix .el-input__inner{
  4061. color: rgb(103,194,58);
  4062. font-weight: bold;
  4063. }
  4064. .numInput /deep/ .el-input__inner{
  4065. text-align: right;
  4066. }
  4067. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  4068. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  4069. -webkit-appearance: none;
  4070. }
  4071. /deep/ .inlineNumber input[type="number"]{
  4072. -moz-appearance: textfield;
  4073. padding-right: 5px !important;
  4074. }
  4075. .el-table /deep/ .cell{
  4076. height: auto;
  4077. line-height: 1.5;
  4078. }
  4079. </style>