赫艾前端
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.

3070 lines
108 KiB

3 months ago
3 months ago
6 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
3 months ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <!-- <el-form-item :label="'BU'">-->
  6. <!-- <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">-->
  7. <!-- <el-option-->
  8. <!-- v-for = "i in userBuList"-->
  9. <!-- :key = "i.buNo"-->
  10. <!-- :label = "i.buDesc"-->
  11. <!-- :value = "i.buDesc">-->
  12. <!-- </el-option>-->
  13. <!-- </el-select>-->
  14. <!-- </el-form-item>-->
  15. <el-form-item :label="'工厂编码'">
  16. <el-input v-model="searchData.site" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'物料编码'">
  19. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'SKU'">
  22. <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'物料名称'">
  25. <el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'PN'">
  28. <el-input v-model="searchData.cinvSourceCode" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'类别名称'">
  31. <el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
  32. </el-form-item>
  33. <el-form-item :label="' '">
  34. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  35. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  36. </el-form-item>
  37. <el-form-item :label="' '">
  38. <!-- <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>-->
  39. <download-excel
  40. :fields="fields()"
  41. :data="exportData"
  42. type="xls"
  43. :name="exportName"
  44. :header="exportHeader"
  45. :footer="exportFooter"
  46. :fetch="createExportData"
  47. :before-generate="startDownload"
  48. :before-finish="finishDownload"
  49. worksheet="导出信息"
  50. class="el-button el-button--primary el-button--medium">
  51. {{ "导出" }}
  52. </download-excel>
  53. </el-form-item>
  54. </el-form>
  55. <!-- 展示列表 -->
  56. <el-table
  57. :height="height"
  58. :data="dataList"
  59. border
  60. style="width: 100%;">
  61. <el-table-column
  62. v-for="(item,index) in columnList" :key="index"
  63. :sortable="item.columnSortable"
  64. :prop="item.columnProp"
  65. :header-align="item.headerAlign"
  66. :show-overflow-tooltip="item.showOverflowTooltip"
  67. :align="item.align"
  68. :fixed="item.fixed === ''?false:item.fixed"
  69. :min-width="item.columnWidth"
  70. :label="item.columnLabel">
  71. <template slot-scope="scope">
  72. <span v-if="!item.columnHidden">
  73. <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  74. <span v-else>
  75. {{ scope.row[item.columnProp] }}
  76. </span>
  77. </span>
  78. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column
  82. fixed="right"
  83. header-align="center"
  84. align="center"
  85. width="240"
  86. label="操作">
  87. <template slot-scope="scope">
  88. <a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
  89. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  90. <a v-if="!authCheckout" type="text" size="small" @click="standardDetailModal(scope.row)">检验标准</a>
  91. <a v-if="!authDelete" type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a>
  92. <a v-if="!authFile" type="text" size="small" @click="sopFileList(scope.row)">SOP文件</a>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <!-- 分页栏 -->
  97. <el-pagination
  98. @size-change="sizeChangeHandle"
  99. @current-change="currentChangeHandle"
  100. :current-page="pageIndex"
  101. :page-sizes="[20, 50, 100, 200, 500]"
  102. :page-size="pageSize"
  103. :total="totalPage"
  104. layout="total, sizes, prev, pager, next, jumper">
  105. </el-pagination>
  106. <!-- 物料属性新增/修改 -->
  107. <el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
  108. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  109. <!-- <el-form-item label="BU" prop="bu" :rules="rules.bu">-->
  110. <!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">-->
  111. <!-- <el-option-->
  112. <!-- v-for = "i in userBuList"-->
  113. <!-- :key = "i.buNo"-->
  114. <!-- :label = "i.sitename"-->
  115. <!-- :value = "i.buNo">-->
  116. <!-- <span style="float: left;width: 100px">{{ i.sitename }}</span>-->
  117. <!-- <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">-->
  118. <!-- {{ i.buDesc }}-->
  119. <!-- </span>-->
  120. <!-- </el-option>-->
  121. <!-- </el-select>-->
  122. <!-- </el-form-item>-->
  123. <el-form-item label="工厂编码:" prop="partDesc" :rules="rules.site">
  124. <el-input v-model="modalData.site" disabled style="width: 250px"></el-input>
  125. </el-form-item>
  126. <el-form-item style="margin-top: 23px;margin-left: 2px">
  127. <el-checkbox v-model="modalData.exemptInspection" true-label="Y" false-label="N">是否免检</el-checkbox><br>
  128. </el-form-item>
  129. </el-form>
  130. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  131. <el-form-item prop="partNo" :rules="rules.partNoType">
  132. <span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
  133. <span v-if="modalDisableFlag === true" slot="label">物料编码:</span>
  134. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 120px"></el-input>
  135. </el-form-item>
  136. <el-form-item label="物料名称:" prop="partDesc" :rules="rules.partDescType">
  137. <el-input v-model="modalData.partDesc" disabled style="width: 250px"></el-input>
  138. </el-form-item>
  139. </el-form>
  140. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  141. <el-form-item label="默认值:" prop="defaultValue" >
  142. <el-input v-model="modalData.defaultValue" style="width: 85px"></el-input>
  143. </el-form-item>
  144. <el-form-item label="标准值:" prop="standardValue" >
  145. <el-input v-model="modalData.standardValue" style="width: 85px"></el-input>
  146. </el-form-item>
  147. <el-form-item label="上限值:" prop="maxValue" >
  148. <el-input v-model="modalData.maxValue" style="width: 85px"></el-input>
  149. </el-form-item>
  150. <el-form-item label="下限值:" prop="minValue" >
  151. <el-input v-model="modalData.minValue" style="width: 85px"></el-input>
  152. </el-form-item>
  153. <el-form-item label="首次巡检时长(h):" prop="firstIPQCPatrolTime" >
  154. <el-input type="number" v-model="modalData.firstIPQCPatrolTime" style="width: 117px"></el-input>
  155. </el-form-item>
  156. <el-form-item label="下次巡检时长(h):" prop="lastIPQCPatrolTime" >
  157. <el-input type="number" v-model="modalData.lastIPQCPatrolTime" style="width: 117px"></el-input>
  158. </el-form-item>
  159. <el-form-item label="累计巡检时长(h):" prop="cycleIPQCPatrolTime" >
  160. <el-input type="number" v-model="modalData.cycleIPQCPatrolTime" style="width: 117px"></el-input>
  161. </el-form-item>
  162. <el-form-item label="检验配置:" >
  163. <el-row :gutter="12">
  164. <el-col :span="6">
  165. <el-checkbox v-model="modalData.iqcExempt" true-label="Y" false-label="N">IQC检验</el-checkbox>
  166. </el-col>
  167. <el-col :span="6">
  168. <el-checkbox v-model="modalData.faiExempt" true-label="Y" false-label="N">FAI检验</el-checkbox>
  169. </el-col>
  170. <el-col :span="6">
  171. <el-checkbox v-model="modalData.ipqcExempt" true-label="Y" false-label="N">IPQC检验</el-checkbox>
  172. </el-col>
  173. <el-col :span="6">
  174. <el-checkbox v-model="modalData.pqcExempt" true-label="Y" false-label="N">PQC检验</el-checkbox>
  175. </el-col>
  176. </el-row>
  177. <el-row :gutter="12">
  178. <el-col :span="6">
  179. <el-checkbox v-model="modalData.fqcExempt" true-label="Y" false-label="N">FQC检验</el-checkbox>
  180. </el-col>
  181. <el-col :span="6">
  182. <el-checkbox v-model="modalData.sqcExempt" true-label="Y" false-label="N">SQC检验</el-checkbox>
  183. </el-col>
  184. </el-row>
  185. </el-form-item>
  186. <el-form-item label="备注:">
  187. <el-input v-model="modalData.attributeRemark" style="width: 385px"></el-input>
  188. </el-form-item>
  189. <!-- <el-form-item label="是否免检">-->
  190. <!-- <input type="checkbox" value="Y" name="isExemptInspection" v-model="modalData.exemptInspection"/>-->
  191. <!-- </el-form-item>-->
  192. </el-form>
  193. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  194. <el-button type="primary" @click="saveData()">保存</el-button>
  195. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  196. </el-footer>
  197. </el-dialog>
  198. <!-- 检验模板 -->
  199. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
  200. <el-form :inline="true" label-position="top">
  201. <el-form-item :label="'物料编码'">
  202. <el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
  203. </el-form-item>
  204. <el-form-item :label="'物料名称'">
  205. <el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
  206. </el-form-item>
  207. <el-form-item :label="' '">
  208. <el-button type="primary" @click="addFastModal()">新增</el-button>
  209. </el-form-item>
  210. </el-form>
  211. <!-- 检验项目展示列表 -->
  212. <div class="rq ">
  213. <el-table
  214. :height="300"
  215. :data="detailList"
  216. border
  217. style="width: 100%;">
  218. <el-table-column
  219. v-for="(item,index) in detailColumnsBeforeIpqc" :key="'before-' + index"
  220. :sortable="item.columnSortable"
  221. :prop="item.columnProp"
  222. :header-align="item.headerAlign"
  223. :show-overflow-tooltip="item.showOverflowTooltip"
  224. :align="item.align"
  225. :fixed="item.fixed===''?false:item.fixed"
  226. :min-width="item.columnWidth"
  227. :label="item.columnLabel">
  228. <template slot-scope="scope">
  229. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  230. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. prop="ipqcInspectionMethod"
  235. header-align="center"
  236. align="center"
  237. min-width="140"
  238. label="IPQC检验方式">
  239. <template slot-scope="scope">
  240. <el-select
  241. v-model="scope.row.ipqcInspectionMethod"
  242. placeholder="请选择"
  243. size="mini"
  244. style="width: 120px"
  245. :disabled="!isIPQCInspectionType(scope.row)">
  246. <el-option
  247. v-for="opt in ipqcInspectionMethodOptions"
  248. :key="opt"
  249. :label="opt"
  250. :value="opt">
  251. </el-option>
  252. </el-select>
  253. <span v-if="isIPQCInspectionType(scope.row) && !scope.row.ipqcInspectionMethod" style="color:#F56C6C;margin-left:6px">*</span>
  254. </template>
  255. </el-table-column>
  256. <el-table-column
  257. v-for="(item,index) in detailColumnsAfterIpqc" :key="'after-' + index"
  258. :sortable="item.columnSortable"
  259. :prop="item.columnProp"
  260. :header-align="item.headerAlign"
  261. :show-overflow-tooltip="item.showOverflowTooltip"
  262. :align="item.align"
  263. :fixed="item.fixed===''?false:item.fixed"
  264. :min-width="item.columnWidth"
  265. :label="item.columnLabel">
  266. <template slot-scope="scope">
  267. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  268. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  269. </template>
  270. </el-table-column>
  271. <el-table-column
  272. prop=""
  273. header-align="center"
  274. align="center"
  275. min-width="170"
  276. label="检验水平">
  277. <template slot-scope="scope">
  278. <el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  279. <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
  280. </template>
  281. </el-table-column>
  282. <el-table-column
  283. prop=""
  284. header-align="center"
  285. align="center"
  286. min-width="60"
  287. label="检验周期(h)">
  288. <template slot-scope="scope">
  289. <el-input v-model="scope.row.inspectionCycle" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  290. </template>
  291. </el-table-column>
  292. <el-table-column
  293. prop=""
  294. header-align="center"
  295. align="center"
  296. min-width="170"
  297. label="抽样方案">
  298. <template slot-scope="scope">
  299. <el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px" >·&nbsp;·&nbsp;·</el-button>
  300. <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
  301. </template>
  302. </el-table-column>
  303. <el-table-column
  304. prop=""
  305. header-align="center"
  306. align="center"
  307. min-width="60"
  308. label="AQL">
  309. <template slot-scope="scope">
  310. <el-input v-model="scope.row.aql" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  311. </template>
  312. </el-table-column>
  313. <el-table-column
  314. prop=""
  315. header-align="center"
  316. align="center"
  317. min-width="60"
  318. label="AC">
  319. <template slot-scope="scope">
  320. <el-input v-model="scope.row.ac" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  321. </template>
  322. </el-table-column>
  323. <el-table-column
  324. prop=""
  325. header-align="center"
  326. align="center"
  327. min-width="60"
  328. label="RE">
  329. <template slot-scope="scope">
  330. <el-input v-model="scope.row.re" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  331. </template>
  332. </el-table-column>
  333. <el-table-column
  334. prop="templateRemark"
  335. header-align="center"
  336. align="center"
  337. label="备注">
  338. </el-table-column>
  339. <el-table-column
  340. fixed="right"
  341. header-align="center"
  342. align="center"
  343. width="80"
  344. label="操作">
  345. <template slot-scope="scope">
  346. <a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
  347. </template>
  348. </el-table-column>
  349. </el-table>
  350. </div>
  351. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  352. <el-button type="primary" @click="saveDetail()">保存</el-button>
  353. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  354. </el-footer>
  355. </el-dialog>
  356. <!-- 检验模板->快速新增 -->
  357. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  358. <div style="font-size: 12px">
  359. <el-form :inline="true" label-position="top" :model="detailData">
  360. <el-form-item :label="'模板编码'">
  361. <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
  362. </el-form-item>
  363. <el-form-item :label="'模板名称'">
  364. <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
  365. </el-form-item>
  366. <el-form-item label="检验类型">
  367. <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType()" placeholder="请选择">
  368. <el-option
  369. v-for = "i in options"
  370. :key = "i.inspectionTypeNo"
  371. :label = "i.inspectionTypeName"
  372. :value = "i.inspectionTypeNo">
  373. </el-option>
  374. </el-select>
  375. </el-form-item>
  376. <el-form-item :label="' '">
  377. <el-button type="primary" @click="checkInspectionType()">查询</el-button>
  378. </el-form-item>
  379. <el-form-item style="margin-left: 117px" :label="' '">
  380. <el-button type="primary" @click="getOperationList()" style="width: 63px" v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107' || this.detailData.inspectionTypeNo === '108'">工序</el-button>
  381. <el-button type="primary" @click="getManufacturerList()" v-if="this.detailData.inspectionTypeNo === '105'" style="width: 63px">供应商</el-button>
  382. </el-form-item>
  383. <el-form-item :label="' '">
  384. <el-button type="primary" @click="getAllResourceList()" style="width: 63px" v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107'">机台</el-button>
  385. </el-form-item>
  386. </el-form>
  387. </div>
  388. <el-container style="margin-top: 0px;">
  389. <el-main style="width: 470px;padding: 1px">
  390. <span style="font-size: 12px" >可选模板</span>
  391. <el-table
  392. height="400px"
  393. :data="itemList1"
  394. border
  395. ref="itemTable1"
  396. @row-click="itemClickRow1"
  397. @selection-change="selectionItem1"
  398. highlight-current-row
  399. style="width: 100%">
  400. <el-table-column
  401. type="selection"
  402. header-align="center"
  403. align="center"
  404. :selectable="selectFlag"
  405. width="50">
  406. </el-table-column>
  407. <el-table-column
  408. prop="templateId"
  409. header-align="center"
  410. align="center"
  411. min-width="80"
  412. label="模板编码">
  413. </el-table-column>
  414. <el-table-column
  415. prop="templateName"
  416. header-align="center"
  417. align="center"
  418. min-width="170"
  419. label="模板名称">
  420. </el-table-column>
  421. <el-table-column
  422. prop="inspectionTypeName"
  423. header-align="center"
  424. align="center"
  425. min-width="80"
  426. label="检验类型">
  427. </el-table-column>
  428. </el-table>
  429. </el-main>
  430. <el-main style="width: 100px;padding: 1px">
  431. <div style="margin-top: 180px;margin-left: 18px">
  432. <el-button type="primary" @click="addItem()">添加>></el-button>
  433. </div>
  434. <div style="margin-top: 15px;margin-left: 18px">
  435. <el-button type="primary" @click="deleteItem()">删除<<</el-button>
  436. </div>
  437. </el-main>
  438. <el-main style="width: 470px;padding: 1px">
  439. <span style="font-size: 12px">已有模板</span>
  440. <el-table
  441. height="400px"
  442. :data="itemList2"
  443. border
  444. ref="itemTable2"
  445. @row-click="itemClickRow2"
  446. @selection-change="selectionItem2"
  447. highlight-current-row
  448. style="width: 100%">
  449. <el-table-column
  450. type="selection"
  451. header-align="center"
  452. align="center"
  453. :selectable="selectFlag"
  454. width="50">
  455. </el-table-column>
  456. <el-table-column
  457. prop="templateId"
  458. header-align="center"
  459. align="center"
  460. label="模板编码">
  461. </el-table-column>
  462. <el-table-column
  463. prop="templateName"
  464. header-align="center"
  465. align="center"
  466. label="模板名称">
  467. </el-table-column>
  468. <el-table-column
  469. prop="operation"
  470. header-align="center"
  471. align="center"
  472. label="工序">
  473. </el-table-column>
  474. <el-table-column
  475. prop="resourceID"
  476. header-align="center"
  477. align="center"
  478. label="机台">
  479. </el-table-column>
  480. <el-table-column
  481. prop="manufacturerName"
  482. header-align="center"
  483. align="center"
  484. label="供应商">
  485. </el-table-column>
  486. <el-table-column
  487. prop="inspectionTypeName"
  488. header-align="center"
  489. align="center"
  490. label="检验类型">
  491. </el-table-column>
  492. </el-table>
  493. </el-main>
  494. </el-container>
  495. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  496. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  497. </el-footer>
  498. </el-dialog>
  499. <!-- 检验标准qc_part_attr_detailed -->
  500. <el-dialog title="检验标准清单" @close="closeStandardDialog" :close-on-click-modal="false" v-drag :visible.sync="standardDetailModelFlag" width="940px">
  501. <el-form :inline="true" label-position="top">
  502. <el-form-item :label="'物料编码'">
  503. <el-input v-model="standardDetailData.partNo" readonly style="width: 120px"></el-input>
  504. </el-form-item>
  505. <el-form-item :label="'物料名称'">
  506. <el-input v-model="standardDetailData.partDesc" readonly style="width: 240px"></el-input>
  507. </el-form-item>
  508. <el-form-item label="检验类型">
  509. <el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
  510. <el-option
  511. v-for="i in options"
  512. :key="i.inspectionTypeNo"
  513. :label="i.inspectionTypeName"
  514. :value="i.inspectionTypeNo">
  515. </el-option>
  516. </el-select>
  517. </el-form-item>
  518. <el-form-item :label="' '">
  519. <el-button type="primary" @click="standardAddFastModal()">新增</el-button>
  520. <!-- <el-button type="primary" @click="standardGoUp()">上移</el-button>
  521. <el-button type="primary" @click="standardGoDown()">下移</el-button> -->
  522. </el-form-item>
  523. </el-form>
  524. <div class="rq">
  525. <el-table
  526. :height="400"
  527. :data="standardDetailList"
  528. @row-click="standardItemClickRow"
  529. ref="standardDetailTable"
  530. highlight-current-row
  531. border
  532. style="width: 100%;">
  533. <el-table-column
  534. v-for="(item,index) in standardColumnDetailList"
  535. :key="'std-col-' + index"
  536. :sortable="item.columnSortable"
  537. :prop="item.columnProp"
  538. :header-align="item.headerAlign"
  539. :show-overflow-tooltip="item.showOverflowTooltip"
  540. :align="item.align"
  541. :fixed="item.fixed===''?false:item.fixed"
  542. :min-width="item.columnWidth"
  543. :label="item.columnLabel">
  544. <template slot-scope="scope">
  545. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  546. </template>
  547. </el-table-column>
  548. <el-table-column
  549. prop=""
  550. header-align="center"
  551. align="right"
  552. min-width="60"
  553. label="标准值">
  554. <template slot-scope="scope">
  555. <el-input v-model="scope.row.defaultValue" style="height: 11px;width:98%"></el-input>
  556. </template>
  557. </el-table-column>
  558. <el-table-column
  559. prop=""
  560. header-align="center"
  561. align="right"
  562. min-width="60"
  563. label="最大值">
  564. <template slot-scope="scope">
  565. <el-input v-model="scope.row.maxValue" style="height: 11px;width:98%"></el-input>
  566. </template>
  567. </el-table-column>
  568. <el-table-column
  569. prop=""
  570. header-align="center"
  571. align="right"
  572. min-width="60"
  573. label="最小值">
  574. <template slot-scope="scope">
  575. <el-input v-model="scope.row.minValue" style="height: 11px;width:98%"></el-input>
  576. </template>
  577. </el-table-column>
  578. <el-table-column
  579. fixed="right"
  580. header-align="center"
  581. align="center"
  582. width="100"
  583. label="操作">
  584. <template slot-scope="scope">
  585. <a type="text" size="small" @click="standardDelItemDetails(scope.row)">删除项目</a>
  586. </template>
  587. </el-table-column>
  588. </el-table>
  589. </div>
  590. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  591. <el-button type="primary" @click="saveStandardDetail()">保存</el-button>
  592. <el-button type="primary" @click="standardDetailModelFlag = false">关闭</el-button>
  593. </el-footer>
  594. </el-dialog>
  595. <!-- 检验标准->快速新增 -->
  596. <el-dialog title="新增检验项目" @close="standardRefreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="standardFastAddFlag" width="1100px">
  597. <div style="font-size: 12px">
  598. <el-form :inline="true" label-position="top" :model="standardDetailData">
  599. <el-form-item :label="'项目编码'">
  600. <el-input v-model="standardDetailData.itemNo" clearable style="width: 120px"></el-input>
  601. </el-form-item>
  602. <el-form-item :label="'项目名称'">
  603. <el-input v-model="standardDetailData.itemDesc" clearable style="width: 200px"></el-input>
  604. </el-form-item>
  605. <el-form-item label="检验类型">
  606. <el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
  607. <el-option
  608. v-for="i in options"
  609. :key="i.inspectionTypeNo"
  610. :label="i.inspectionTypeName"
  611. :value="i.inspectionTypeNo">
  612. </el-option>
  613. </el-select>
  614. </el-form-item>
  615. <el-form-item :label="' '">
  616. <el-button type="primary" @click="standardGetItem()">查询</el-button>
  617. </el-form-item>
  618. </el-form>
  619. </div>
  620. <el-container style="margin-top: 0px;">
  621. <el-main style="width: 720px; padding: 1px">
  622. <span style="font-size: 12px">可选项目</span>
  623. <el-table
  624. height="400px"
  625. :data="standardItemList1"
  626. border
  627. ref="standardItemTable1"
  628. @row-click="standardItemClickRow1"
  629. @selection-change="standardSelectionItem1"
  630. highlight-current-row
  631. style="width: 100%">
  632. <el-table-column
  633. type="selection"
  634. header-align="center"
  635. align="center"
  636. :selectable="selectFlag"
  637. width="50">
  638. </el-table-column>
  639. <el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
  640. <el-table-column prop="itemDesc" header-align="center" align="center" min-width="120" label="项目名称"></el-table-column>
  641. <el-table-column prop="defaultValue" header-align="center" align="center" min-width="100" label="标准值"></el-table-column>
  642. <el-table-column prop="maxValue" header-align="center" align="center" min-width="60" label="最大值"></el-table-column>
  643. <el-table-column prop="minValue" header-align="center" align="center" min-width="60" label="最小值"></el-table-column>
  644. </el-table>
  645. </el-main>
  646. <el-main style="width: 111px;padding: 1px">
  647. <div style="margin-top: 182px;margin-left: 18px">
  648. <el-button type="primary" @click="standardAddItem()">添加>></el-button>
  649. </div>
  650. <div style="margin-top: 15px;margin-left: 18px">
  651. <el-button type="primary" @click="standardDeleteItem()">删除<<</el-button>
  652. </div>
  653. </el-main>
  654. <el-main style="width: 400px;padding: 1px">
  655. <span style="font-size: 12px">已有项目</span>
  656. <el-table
  657. height="400px"
  658. :data="standardItemList2"
  659. border
  660. ref="standardItemTable2"
  661. @row-click="standardItemClickRow2"
  662. @selection-change="standardSelectionItem2"
  663. highlight-current-row
  664. style="width: 100%">
  665. <el-table-column
  666. type="selection"
  667. header-align="center"
  668. align="center"
  669. :selectable="selectFlag"
  670. width="50">
  671. </el-table-column>
  672. <el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
  673. <el-table-column prop="itemDesc" header-align="center" align="center" min-width="200" label="项目名称"></el-table-column>
  674. </el-table>
  675. </el-main>
  676. </el-container>
  677. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  678. <el-button type="primary" @click="standardFastAddFlag = false">关闭</el-button>
  679. </el-footer>
  680. </el-dialog>
  681. <!-- 工序 -->
  682. <el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
  683. <div class="rq">
  684. <el-form :inline="true" label-position="top" :model="operationData">
  685. <el-form-item :label="'工序:'">
  686. <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input>
  687. </el-form-item>
  688. <el-form-item :label="' '">
  689. <el-button type="primary" @click="getOperationList2()">查询</el-button>
  690. </el-form-item>
  691. </el-form>
  692. <el-table
  693. :height="300"
  694. :data="operationList"
  695. ref="operationTable"
  696. @row-click="operationClickRow"
  697. @selection-change="selectionOperationChangeHandle"
  698. border
  699. :row-class-name="operationRowClassName"
  700. style="width: 100%;">
  701. <el-table-column type="index" width="50" align="center">
  702. <template slot-scope="scope">
  703. <el-radio v-model="operationCurrent" :label="scope.row.index">{{''}}</el-radio>
  704. </template>
  705. </el-table-column>
  706. <el-table-column
  707. prop="operationDesc"
  708. header-align="center"
  709. align="center"
  710. label="工序">
  711. </el-table-column>
  712. </el-table>
  713. </div>
  714. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  715. <el-button type="primary" @click="confirmOperation()">确认</el-button>
  716. </el-footer>
  717. </el-dialog>
  718. <!-- 机台 -->
  719. <el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
  720. <div class="rq">
  721. <el-form :inline="true" label-position="top" :model="resourceData">
  722. <el-form-item :label="'机台编码'">
  723. <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
  724. </el-form-item>
  725. <el-form-item :label="'机台名称'">
  726. <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input>
  727. </el-form-item>
  728. <el-form-item :label="' '">
  729. <el-button type="primary" @click="getAllResourceList2()">查询</el-button>
  730. </el-form-item>
  731. </el-form>
  732. <el-table
  733. :height="300"
  734. :data="resourceList"
  735. ref="resourceTable"
  736. @row-click="resourceClickRow"
  737. @selection-change="selectionResourceChangeHandle"
  738. border
  739. :row-class-name="resourceRowClassName"
  740. style="width: 100%;">
  741. <el-table-column type="index" width="50" align="center">
  742. <template slot-scope="scope">
  743. <el-radio v-model="resourceCurrent" :label="scope.row.index">{{''}}</el-radio>
  744. </template>
  745. </el-table-column>
  746. <el-table-column
  747. prop="resourceId"
  748. header-align="center"
  749. align="center"
  750. label="机台编码">
  751. </el-table-column>
  752. <el-table-column
  753. prop="resourceDesc"
  754. header-align="center"
  755. align="center"
  756. label="机台名称">
  757. </el-table-column>
  758. </el-table>
  759. </div>
  760. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  761. <el-button type="primary" @click="confirmResource()">确认</el-button>
  762. </el-footer>
  763. </el-dialog>
  764. <!-- 供应商 -->
  765. <el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px">
  766. <div class="rq">
  767. <el-form :inline="true" label-position="top" :model="manufacturerData">
  768. <el-form-item :label="'供应商编码:'">
  769. <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input>
  770. </el-form-item>
  771. <el-form-item :label="'供应商名称:'">
  772. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
  773. </el-form-item>
  774. <el-form-item :label="' '">
  775. <el-button type="primary" @click="getManufacturerList()">查询</el-button>
  776. </el-form-item>
  777. </el-form>
  778. <el-table
  779. :height="300"
  780. :data="manufacturerList"
  781. ref="manufacturerTable"
  782. @row-click="manufacturerClickRow"
  783. @selection-change="selectionManufacturerChangeHandle"
  784. border
  785. style="width: 100%;">
  786. <el-table-column
  787. type="selection"
  788. header-align="center"
  789. align="center"
  790. :selectable="selectFlag"
  791. width="50">
  792. </el-table-column>
  793. <el-table-column
  794. prop="manufacturerID"
  795. header-align="center"
  796. align="center"
  797. label="供应商编码">
  798. </el-table-column>
  799. <el-table-column
  800. prop="manufacturerName"
  801. header-align="center"
  802. align="center"
  803. label="供应商名称">
  804. </el-table-column>
  805. </el-table>
  806. </div>
  807. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  808. <el-button type="primary" @click="confirmManufacturer()">确认</el-button>
  809. <el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
  810. </el-footer>
  811. </el-dialog>
  812. <!-- sop文件清单 -->
  813. <el-dialog title="SOP文件清单" :close-on-click-modal="false" v-drag :visible.sync="sopFileModelFlag" width="800px">
  814. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  815. <el-form-item :label="' '">
  816. <el-button type="primary" @click="uploadSopFile">上传文件</el-button>
  817. </el-form-item>
  818. <el-form-item label="检验类型" style="margin-left: 448px">
  819. <el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
  820. <el-option label="全部" value=""></el-option>
  821. <el-option
  822. v-for = "i in options"
  823. :key = "i.inspectionTypeNo"
  824. :label = "i.inspectionTypeName"
  825. :value = "i.inspectionTypeNo">
  826. </el-option>
  827. </el-select>
  828. </el-form-item>
  829. <el-form-item :label="' '">
  830. <el-button type="primary" @click="getFileContentList">查询</el-button>
  831. </el-form-item>
  832. </el-form>
  833. <el-table
  834. :height="350"
  835. :data="sopList"
  836. border
  837. style="width: 100%; ">
  838. <el-table-column
  839. v-for="(item,index) in sopColumnList" :key="index"
  840. :sortable="item.columnSortable"
  841. :prop="item.columnProp"
  842. :header-align="item.headerAlign"
  843. :show-overflow-tooltip="item.showOverflowTooltip"
  844. :align="item.align"
  845. :fixed="item.fixed===''?false:item.fixed"
  846. :min-width="item.columnWidth"
  847. :label="item.columnLabel">
  848. <template slot-scope="scope">
  849. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  850. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  851. </template>
  852. </el-table-column>
  853. <el-table-column
  854. fixed="right"
  855. header-align="center"
  856. align="center"
  857. width="100"
  858. label="操作">
  859. <template slot-scope="scope">
  860. <a @click="downloadFile(scope.row)">下载</a>
  861. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  862. </template>
  863. </el-table-column>
  864. </el-table>
  865. </el-dialog>
  866. <!-- 物料编码 -->
  867. <el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px">
  868. <el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
  869. <el-form-item label="物料编码">
  870. <el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
  871. </el-form-item>
  872. <el-form-item label="物料名称">
  873. <el-input v-model="partDetailData.partDesc" clearable style="width: 137px"></el-input>
  874. </el-form-item>
  875. <el-form-item label="SKU">
  876. <el-input v-model="partDetailData.sku" clearable style="width: 100px"></el-input>
  877. </el-form-item>
  878. <el-form-item label="PN">
  879. <el-input v-model="partDetailData.cinvSourceCode" clearable style="width: 100px"></el-input>
  880. </el-form-item>
  881. <el-form-item>
  882. <el-button type="primary" @click="searchPartInfo()" style="margin-top: 24px">查询</el-button>
  883. </el-form-item>
  884. </el-form>
  885. <el-table
  886. :height="400"
  887. :data="partInfoList"
  888. @row-dblclick="getRowData1"
  889. border
  890. v-loading="dataListLoading"
  891. style="width: 100%;">
  892. <el-table-column
  893. prop="partNo"
  894. header-align="center"
  895. align="center"
  896. label="物料编码">
  897. </el-table-column>
  898. <el-table-column
  899. prop="partDesc"
  900. header-align="center"
  901. align="center"
  902. label="物料名称">
  903. </el-table-column>
  904. <el-table-column
  905. prop="sku"
  906. header-align="center"
  907. align="center"
  908. label="SKU">
  909. </el-table-column>
  910. <el-table-column
  911. prop="cinvSourceCode"
  912. header-align="center"
  913. align="center"
  914. label="PN">
  915. </el-table-column>
  916. </el-table>
  917. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  918. <el-button type="primary" @click="partDisableFlag = false">关闭</el-button>
  919. </el-footer>
  920. </el-dialog>
  921. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  922. <!-- 上传sop文件的modal -->
  923. <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
  924. <!-- 导入 -->
  925. <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
  926. </div>
  927. </template>
  928. <script>
  929. import {
  930. qcPartAttributeSearch, // 查询物料属性
  931. qcPartAttributeSave, // 新增物料属性
  932. qcPartAttributeDelete, // 删除物料属性
  933. qcPartAttributeEdit, // 修改物料属性
  934. searchPartAttributeDetails, // 查询物料属性模板
  935. savePartAttributeDetails, // 新增物料属性模板
  936. deletePartAttributeDetails, // 删除物料属性模板
  937. saveAttributeDetailed, // 新增物料属性模板详情
  938. getPartTemplateLists, // 获取模板列表
  939. inspectionTypeSearch, // 搜索所有检验类型
  940. getOperationDescList, // 查询工序列表
  941. getManufacturerList, // 查询供应商列表
  942. getAllResourceList, // 查询机台列表
  943. getSiteAndBuByUserName,
  944. searchPartInfo, // 查询物料信息
  945. partAttrDetailedSearch,
  946. getPartAttrItemList,
  947. getPartAttrItem,
  948. addPartAttrItemDetails,
  949. delPartAttrItemDetails,
  950. savePartAttrDetailed,
  951. goUpPartAttrItem,
  952. goDownPartAttrItem
  953. } from "@/api/qc/qc.js"
  954. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  955. import Chooselist from '@/views/modules/common/Chooselist_eam'
  956. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  957. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  958. import {deleteObjectFile} from '@/api/eam/eam.js'
  959. import qcUpload from "./qc_upload"
  960. import qcSOPUploadFile from "./qc_SOP_upload_file"
  961. export default {
  962. components: {
  963. qcSOPUploadFile,
  964. Chooselist,
  965. qcUpload
  966. },
  967. data () {
  968. return {
  969. columnsProp:['createBy', 'updateBy'],
  970. // 是否收藏
  971. favorite: false,
  972. // 导出 start
  973. exportData: [],
  974. exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
  975. exportHeader: ["根据物料设置检验模板"],
  976. exportFooter: [],
  977. exportList: [],
  978. // 导出 end
  979. tagNo: '',
  980. searchData: {
  981. site: '',
  982. userName: this.$store.state.user.name,
  983. partNo: '',
  984. partDesc: '',
  985. cinvSourceCode: '',
  986. sku: '',
  987. familyID: '',
  988. familyName: '',
  989. buDesc: '',
  990. attributeType: 'A',
  991. page: 1,
  992. limit: 10,
  993. },
  994. height: 200,
  995. pageIndex: 1,
  996. pageSize: 20,
  997. totalPage: 0,
  998. modalFlag: false,
  999. modalDisableFlag: false,
  1000. partDisableFlag: false,
  1001. modalData: {
  1002. site: '',
  1003. bu: '',
  1004. flag: '',
  1005. partNo: '',
  1006. partDesc: '',
  1007. familyID: '',
  1008. familyName: '',
  1009. cinvSourceCode: '',
  1010. sku: '',
  1011. umid: '',
  1012. supplierNo: '',
  1013. supplierDesc: '',
  1014. attributeRemark: '',
  1015. createTime: '',
  1016. createBy: this.$store.state.user.name,
  1017. attributeType: 'A',
  1018. exemptInspection: 'N',
  1019. iqcExempt: 'N',
  1020. faiExempt: 'N',
  1021. ipqcExempt: 'N',
  1022. pqcExempt: 'N',
  1023. fqcExempt: 'N',
  1024. oqcExempt: 'N',
  1025. sqcExempt: 'N'
  1026. },
  1027. detailData: {
  1028. site: '',
  1029. buNo: '',
  1030. partNo: '',
  1031. attributeNo: '',
  1032. partDesc: '',
  1033. cinvSourceCode: '',
  1034. sku: '',
  1035. attributeType: 'A',
  1036. inspectionTypeNo: '',
  1037. templateId: '',
  1038. templateName: '',
  1039. createBy: this.$store.state.user.name
  1040. },
  1041. standardDetailModelFlag: false,
  1042. standardFastAddFlag: false,
  1043. standardDetailList: [],
  1044. standardItemList1: [],
  1045. standardItemList2: [],
  1046. standardItemSelections1: [],
  1047. standardItemSelections2: [],
  1048. standardCurrentRow: {},
  1049. standardDetailData: {
  1050. site: '',
  1051. buNo: '',
  1052. partNo: '',
  1053. partDesc: '',
  1054. attributeNo: '',
  1055. attributeType: 'A',
  1056. itemType: 'D',
  1057. itemNo: '',
  1058. itemDesc: '',
  1059. inspectionTypeNo: '',
  1060. inspectionTypeName: '',
  1061. createBy: this.$store.state.user.name
  1062. },
  1063. standardColumnDetailList: [
  1064. {
  1065. columnProp: 'itemNo',
  1066. headerAlign: 'center',
  1067. align: 'center',
  1068. columnLabel: '检验项目编码',
  1069. columnHidden: false,
  1070. columnImage: false,
  1071. columnSortable: false,
  1072. columnWidth: 80
  1073. },
  1074. {
  1075. columnProp: 'itemDesc',
  1076. headerAlign: 'center',
  1077. align: 'left',
  1078. columnLabel: '检验项目名称',
  1079. columnHidden: false,
  1080. columnImage: false,
  1081. columnSortable: false,
  1082. columnWidth: 250
  1083. },
  1084. {
  1085. columnProp: 'valueType',
  1086. headerAlign: 'center',
  1087. align: 'center',
  1088. columnLabel: '检测值类型',
  1089. columnHidden: false,
  1090. columnImage: false,
  1091. columnSortable: false,
  1092. columnWidth: 90
  1093. }
  1094. ],
  1095. columnList: [
  1096. {
  1097. userId: this.$store.state.user.name,
  1098. functionId: 301003,
  1099. serialNumber: '301003Table1Site',
  1100. tableId: "301003Table1",
  1101. tableName: "物料属性设置表",
  1102. columnProp: 'site',
  1103. headerAlign: "center",
  1104. align: "center",
  1105. columnLabel: '工厂编码',
  1106. columnHidden: false,
  1107. columnImage: false,
  1108. columnSortable: false,
  1109. sortLv: 0,
  1110. status: true,
  1111. fixed: '',
  1112. columnWidth: 100,
  1113. },
  1114. {
  1115. userId: this.$store.state.user.name,
  1116. functionId: 301003,
  1117. serialNumber: '301003Table1PartNo',
  1118. tableId: "301003Table1",
  1119. tableName: "物料属性设置表",
  1120. columnProp: 'partNo',
  1121. headerAlign: "center",
  1122. align: "center",
  1123. columnLabel: '物料编码',
  1124. columnHidden: false,
  1125. columnImage: false,
  1126. columnSortable: false,
  1127. sortLv: 0,
  1128. status: true,
  1129. fixed: '',
  1130. columnWidth: 120,
  1131. },
  1132. {
  1133. userId: this.$store.state.user.name,
  1134. functionId: 301003,
  1135. serialNumber: '301003Table1SKU',
  1136. tableId: "301003Table1",
  1137. tableName: "物料属性设置表",
  1138. columnProp: 'sku',
  1139. headerAlign: "center",
  1140. align: "center",
  1141. columnLabel: 'SKU',
  1142. columnHidden: false,
  1143. columnImage: false,
  1144. columnSortable: false,
  1145. sortLv: 0,
  1146. status: true,
  1147. fixed: '',
  1148. columnWidth: 120,
  1149. },
  1150. {
  1151. userId: this.$store.state.user.name,
  1152. functionId: 301003,
  1153. serialNumber: '301003Table1PartDesc',
  1154. tableId: "301003Table1",
  1155. tableName: "物料属性设置表",
  1156. columnProp: 'partDesc',
  1157. headerAlign: "center",
  1158. align: "left",
  1159. columnLabel: '物料名称',
  1160. columnHidden: false,
  1161. columnImage: false,
  1162. columnSortable: false,
  1163. sortLv: 0,
  1164. status: true,
  1165. fixed: '',
  1166. columnWidth: 300,
  1167. },
  1168. {
  1169. userId: this.$store.state.user.name,
  1170. functionId: 301003,
  1171. serialNumber: '301003Table1DefaultValue',
  1172. tableId: "301003Table1",
  1173. tableName: "物料属性设置表",
  1174. columnProp: 'defaultValue',
  1175. headerAlign: "center",
  1176. align: "left",
  1177. columnLabel: '默认值',
  1178. columnHidden: false,
  1179. columnImage: false,
  1180. columnSortable: false,
  1181. sortLv: 0,
  1182. status: true,
  1183. fixed: '',
  1184. columnWidth: 100,
  1185. },
  1186. {
  1187. userId: this.$store.state.user.name,
  1188. functionId: 301003,
  1189. serialNumber: '301003Table1StandardValue',
  1190. tableId: "301003Table1",
  1191. tableName: "物料属性设置表",
  1192. columnProp: 'standardValue',
  1193. headerAlign: "center",
  1194. align: "left",
  1195. columnLabel: '标准值',
  1196. columnHidden: false,
  1197. columnImage: false,
  1198. columnSortable: false,
  1199. sortLv: 0,
  1200. status: true,
  1201. fixed: '',
  1202. columnWidth: 100,
  1203. },
  1204. {
  1205. userId: this.$store.state.user.name,
  1206. functionId: 301003,
  1207. serialNumber: '301003Table1MaxValue',
  1208. tableId: "301003Table1",
  1209. tableName: "物料属性设置表",
  1210. columnProp: 'maxValue',
  1211. headerAlign: "center",
  1212. align: "left",
  1213. columnLabel: '上限值',
  1214. columnHidden: false,
  1215. columnImage: false,
  1216. columnSortable: false,
  1217. sortLv: 0,
  1218. status: true,
  1219. fixed: '',
  1220. columnWidth: 100,
  1221. },
  1222. {
  1223. userId: this.$store.state.user.name,
  1224. functionId: 301003,
  1225. serialNumber: '301003Table1MinValue',
  1226. tableId: "301003Table1",
  1227. tableName: "物料属性设置表",
  1228. columnProp: 'minValue',
  1229. headerAlign: "center",
  1230. align: "left",
  1231. columnLabel: '下限值',
  1232. columnHidden: false,
  1233. columnImage: false,
  1234. columnSortable: false,
  1235. sortLv: 0,
  1236. status: true,
  1237. fixed: '',
  1238. columnWidth: 100,
  1239. },
  1240. {
  1241. userId: this.$store.state.user.name,
  1242. functionId: 301003,
  1243. serialNumber: '301003Table1FirstIPQCPatrolTime',
  1244. tableId: "301003Table1",
  1245. tableName: "物料属性设置表",
  1246. columnProp: 'firstIPQCPatrolTime',
  1247. headerAlign: "center",
  1248. align: "left",
  1249. columnLabel: '首次巡检时间(h)',
  1250. columnHidden: false,
  1251. columnImage: false,
  1252. columnSortable: false,
  1253. sortLv: 0,
  1254. status: true,
  1255. fixed: '',
  1256. columnWidth: 100,
  1257. },
  1258. {
  1259. userId: this.$store.state.user.name,
  1260. functionId: 301003,
  1261. serialNumber: '301003Table1LastIPQCPatrolTime',
  1262. tableId: "301003Table1",
  1263. tableName: "物料属性设置表",
  1264. columnProp: 'lastIPQCPatrolTime',
  1265. headerAlign: "center",
  1266. align: "left",
  1267. columnLabel: '下次巡检时间(h)',
  1268. columnHidden: false,
  1269. columnImage: false,
  1270. columnSortable: false,
  1271. sortLv: 0,
  1272. status: true,
  1273. fixed: '',
  1274. columnWidth: 100,
  1275. },
  1276. {
  1277. userId: this.$store.state.user.name,
  1278. functionId: 301003,
  1279. serialNumber: '301003Table1CycleIPQCPatrolTime',
  1280. tableId: "301003Table1",
  1281. tableName: "物料属性设置表",
  1282. columnProp: 'cycleIPQCPatrolTime',
  1283. headerAlign: "center",
  1284. align: "left",
  1285. columnLabel: '累计巡检时间(h)',
  1286. columnHidden: false,
  1287. columnImage: false,
  1288. columnSortable: false,
  1289. sortLv: 0,
  1290. status: true,
  1291. fixed: '',
  1292. columnWidth: 100,
  1293. },
  1294. // {
  1295. // userId: this.$store.state.user.name,
  1296. // functionId: 301003,
  1297. // serialNumber: '301003Table1CinvSourceCode',
  1298. // tableId: "301003Table1",
  1299. // tableName: "物料属性设置表",
  1300. // columnProp: 'cinvSourceCode',
  1301. // headerAlign: "center",
  1302. // align: "center",
  1303. // columnLabel: 'PN',
  1304. // columnHidden: false,
  1305. // columnImage: false,
  1306. // columnSortable: false,
  1307. // sortLv: 0,
  1308. // status: true,
  1309. // fixed: '',
  1310. // columnWidth: 120,
  1311. // },
  1312. // {
  1313. // userId: this.$store.state.user.name,
  1314. // functionId: 301003,
  1315. // serialNumber: '301003Table1FamilyName',
  1316. // tableId: "301003Table1",
  1317. // tableName: "物料属性设置表",
  1318. // columnProp: 'familyName',
  1319. // headerAlign: "center",
  1320. // align: "left",
  1321. // columnLabel: '物料类别',
  1322. // columnHidden: false,
  1323. // columnImage: false,
  1324. // columnSortable: false,
  1325. // sortLv: 0,
  1326. // status: true,
  1327. // fixed: '',
  1328. // columnWidth: 150,
  1329. // },
  1330. // {
  1331. // userId: this.$store.state.user.name,
  1332. // functionId: 301003,
  1333. // serialNumber: '301003Table1Spec',
  1334. // tableId: "301003Table1",
  1335. // tableName: "物料属性设置表",
  1336. // columnProp: 'spec',
  1337. // headerAlign: "center",
  1338. // align: "left",
  1339. // columnLabel: '规格型号',
  1340. // columnHidden: false,
  1341. // columnImage: false,
  1342. // columnSortable: false,
  1343. // sortLv: 0,
  1344. // status: true,
  1345. // fixed: '',
  1346. // columnWidth: 300,
  1347. // },
  1348. // {
  1349. // userId: this.$store.state.user.name,
  1350. // functionId: 301003,
  1351. // serialNumber: '301003Table1Umid',
  1352. // tableId: "301003Table1",
  1353. // tableName: "物料属性设置表",
  1354. // columnProp: 'umid',
  1355. // headerAlign: "center",
  1356. // align: "left",
  1357. // columnLabel: '单位',
  1358. // columnHidden: false,
  1359. // columnImage: false,
  1360. // columnSortable: false,
  1361. // sortLv: 0,
  1362. // status: true,
  1363. // fixed: '',
  1364. // columnWidth: 100,
  1365. // },
  1366. {
  1367. userId: this.$store.state.user.name,
  1368. functionId: 301003,
  1369. serialNumber: '301003Table1ExemptInspection',
  1370. tableId: "301003Table1",
  1371. tableName: "物料属性设置表",
  1372. columnProp: 'exemptInspection',
  1373. headerAlign: "center",
  1374. align: "center",
  1375. columnLabel: '是否免检',
  1376. columnHidden: false,
  1377. columnImage: false,
  1378. columnSortable: false,
  1379. sortLv: 0,
  1380. status: true,
  1381. fixed: '',
  1382. columnWidth: 100,
  1383. },
  1384. {
  1385. userId: this.$store.state.user.name,
  1386. functionId: 301003,
  1387. serialNumber: '301003Table1AttributeRemark',
  1388. tableId: "301003Table1",
  1389. tableName: "物料属性设置表",
  1390. columnProp: 'attributeRemark',
  1391. headerAlign: "center",
  1392. align: "left",
  1393. columnLabel: '备注',
  1394. columnHidden: false,
  1395. columnImage: false,
  1396. columnSortable: false,
  1397. sortLv: 0,
  1398. status: true,
  1399. fixed: '',
  1400. columnWidth: 200,
  1401. },
  1402. {
  1403. userId: this.$store.state.user.name,
  1404. functionId: 301003,
  1405. serialNumber: '301003Table1CreateTime',
  1406. tableId: "301003Table1",
  1407. tableName: "物料属性设置表",
  1408. columnProp: 'createTime',
  1409. headerAlign: "center",
  1410. align: "center",
  1411. columnLabel: '创建时间',
  1412. columnHidden: false,
  1413. columnImage: false,
  1414. columnSortable: false,
  1415. sortLv: 0,
  1416. status: true,
  1417. fixed: '',
  1418. columnWidth: 170,
  1419. },
  1420. {
  1421. userId: this.$store.state.user.name,
  1422. functionId: 301003,
  1423. serialNumber: '301003Table1CreateBy',
  1424. tableId: "301003Table1",
  1425. tableName: "物料属性设置表",
  1426. columnProp: 'createBy',
  1427. headerAlign: "center",
  1428. align: "center",
  1429. columnLabel: '创建人',
  1430. columnHidden: false,
  1431. columnImage: false,
  1432. columnSortable: false,
  1433. sortLv: 0,
  1434. status: true,
  1435. fixed: '',
  1436. columnWidth: 100,
  1437. },
  1438. {
  1439. userId: this.$store.state.user.name,
  1440. functionId: 301003,
  1441. serialNumber: '301003Table1UpdateDate',
  1442. tableId: "301003Table1",
  1443. tableName: "物料属性设置表",
  1444. columnProp: 'updateDate',
  1445. headerAlign: "center",
  1446. align: "center",
  1447. columnLabel: '更新时间',
  1448. columnHidden: false,
  1449. columnImage: false,
  1450. columnSortable: false,
  1451. sortLv: 0,
  1452. status: true,
  1453. fixed: '',
  1454. columnWidth: 170,
  1455. },
  1456. {
  1457. userId: this.$store.state.user.name,
  1458. functionId: 301003,
  1459. serialNumber: '301003Table1UpdateBy',
  1460. tableId: "301003Table1",
  1461. tableName: "物料属性设置表",
  1462. columnProp: 'updateBy',
  1463. headerAlign: "center",
  1464. align: "center",
  1465. columnLabel: '更新人',
  1466. columnHidden: false,
  1467. columnImage: false,
  1468. columnSortable: false,
  1469. sortLv: 0,
  1470. status: true,
  1471. fixed: '',
  1472. columnWidth: 100,
  1473. },
  1474. ],
  1475. detailModelFlag: false,
  1476. detailList: [],
  1477. dataList: [],
  1478. dataListLoading: false,
  1479. ipqcInspectionMethodOptions: ['首件检', '自检', '巡检', '末件检'],
  1480. // 展示列集
  1481. columnDetailList: [
  1482. {
  1483. userId: this.$store.state.user.name,
  1484. functionId: 301003,
  1485. serialNumber: '301003Table2TemplateId',
  1486. tableId: "301003Table2",
  1487. tableName: "检验模板清单表",
  1488. columnProp: 'templateId',
  1489. headerAlign: "center",
  1490. align: "center",
  1491. columnLabel: '模板编码',
  1492. columnHidden: false,
  1493. columnImage: false,
  1494. columnSortable: false,
  1495. sortLv: 0,
  1496. status: true,
  1497. fixed: '',
  1498. columnWidth: 120,
  1499. },
  1500. {
  1501. userId: this.$store.state.user.name,
  1502. functionId: 301003,
  1503. serialNumber: '301003Table2TemplateName',
  1504. tableId: "301003Table2",
  1505. tableName: "检验模板清单表",
  1506. columnProp: 'templateName',
  1507. headerAlign: "center",
  1508. align: "left",
  1509. columnLabel: '模板名称',
  1510. columnHidden: false,
  1511. columnImage: false,
  1512. columnSortable: false,
  1513. sortLv: 0,
  1514. status: true,
  1515. fixed: '',
  1516. columnWidth: 250,
  1517. },
  1518. {
  1519. userId: this.$store.state.user.name,
  1520. functionId: 301003,
  1521. serialNumber: '301003Table2InspectionTypeName',
  1522. tableId: "301003Table2",
  1523. tableName: "检验模板清单表",
  1524. columnProp: 'inspectionTypeName',
  1525. headerAlign: "center",
  1526. align: "center",
  1527. columnLabel: '检验类型',
  1528. columnHidden: false,
  1529. columnImage: false,
  1530. columnSortable: false,
  1531. sortLv: 0,
  1532. status: true,
  1533. fixed: '',
  1534. columnWidth: 100,
  1535. },
  1536. {
  1537. userId: this.$store.state.user.name,
  1538. functionId: 301003,
  1539. serialNumber: '301003Table2TemplateVersion',
  1540. tableId: "301003Table2",
  1541. tableName: "检验模板清单表",
  1542. columnProp: 'templateVersion',
  1543. headerAlign: "center",
  1544. align: "center",
  1545. columnLabel: '版本号',
  1546. columnHidden: false,
  1547. columnImage: false,
  1548. columnSortable: false,
  1549. sortLv: 0,
  1550. status: true,
  1551. fixed: '',
  1552. columnWidth: 100,
  1553. },
  1554. {
  1555. userId: this.$store.state.user.name,
  1556. functionId: 301003,
  1557. serialNumber: '301003Table2DefaultSamplingQuantity',
  1558. tableId: "301003Table2",
  1559. tableName: "检验模板清单表",
  1560. columnProp: 'defaultSamplingQuantity',
  1561. headerAlign: "center",
  1562. align: "right",
  1563. columnLabel: '默认抽样数量',
  1564. columnHidden: false,
  1565. columnImage: false,
  1566. columnSortable: false,
  1567. sortLv: 0,
  1568. status: true,
  1569. fixed: '',
  1570. columnWidth: 100,
  1571. },
  1572. {
  1573. userId: this.$store.state.user.name,
  1574. functionId: 301003,
  1575. serialNumber: '301003Table2DefaultSamplingProportion',
  1576. tableId: "301003Table2",
  1577. tableName: "检验模板清单表",
  1578. columnProp: 'defaultSamplingProportion',
  1579. headerAlign: "center",
  1580. align: "right",
  1581. columnLabel: '默认抽样比例',
  1582. columnHidden: false,
  1583. columnImage: false,
  1584. columnSortable: false,
  1585. sortLv: 0,
  1586. status: true,
  1587. fixed: '',
  1588. columnWidth: 100,
  1589. },
  1590. {
  1591. userId: this.$store.state.user.name,
  1592. functionId: 301003,
  1593. serialNumber: '301003Table2Operation',
  1594. tableId: "301003Table2",
  1595. tableName: "检验模板清单表",
  1596. columnProp: 'operation',
  1597. headerAlign: "center",
  1598. align: "left",
  1599. columnLabel: '工序',
  1600. columnHidden: false,
  1601. columnImage: false,
  1602. columnSortable: false,
  1603. sortLv: 0,
  1604. status: true,
  1605. fixed: '',
  1606. columnWidth: 120,
  1607. },
  1608. {
  1609. userId: this.$store.state.user.name,
  1610. functionId: 301003,
  1611. serialNumber: '301003Table2ResourceID',
  1612. tableId: "301003Table2",
  1613. tableName: "检验模板清单表",
  1614. columnProp: 'resourceID',
  1615. headerAlign: "center",
  1616. align: "left",
  1617. columnLabel: '机台',
  1618. columnHidden: false,
  1619. columnImage: false,
  1620. columnSortable: false,
  1621. sortLv: 0,
  1622. status: true,
  1623. fixed: '',
  1624. columnWidth: 120,
  1625. },
  1626. {
  1627. userId: this.$store.state.user.name,
  1628. functionId: 301003,
  1629. serialNumber: '301003Table2ManufacturerName',
  1630. tableId: "301003Table2",
  1631. tableName: "检验模板清单表",
  1632. columnProp: 'manufacturerName',
  1633. headerAlign: "center",
  1634. align: "left",
  1635. columnLabel: '供应商',
  1636. columnHidden: false,
  1637. columnImage: false,
  1638. columnSortable: false,
  1639. sortLv: 0,
  1640. status: true,
  1641. fixed: '',
  1642. columnWidth: 200,
  1643. },
  1644. ],
  1645. // 快速添加
  1646. fastAddFlag: false,
  1647. itemList1: [],
  1648. itemList2: [],
  1649. itemListRow1: {},
  1650. itemListRow2: {},
  1651. tempLevelRow: '',
  1652. tempProgrammeRow: '',
  1653. options: [],
  1654. itemSelections1: [],
  1655. itemSelections2: [],
  1656. rules: {
  1657. site:[
  1658. {
  1659. required: true,
  1660. message: ' ',
  1661. trigger: ['blur','change']
  1662. }
  1663. ],
  1664. partNoType:[
  1665. {
  1666. required: true,
  1667. message: ' ',
  1668. trigger: ['blur','change']
  1669. }
  1670. ],
  1671. partDescType:[
  1672. {
  1673. required: true,
  1674. message: ' ',
  1675. trigger: ['blur','change']
  1676. }
  1677. ],
  1678. bu: [
  1679. {
  1680. required: true,
  1681. message: ' ',
  1682. trigger: ['blur','change']
  1683. }
  1684. ]
  1685. },
  1686. // 工序
  1687. operationList: [],
  1688. resourceList: [],
  1689. operationModelFlag: false,
  1690. resourceModelFlag: false,
  1691. dataListOperationSelections: [],
  1692. operationData: {
  1693. operationDesc: ''
  1694. },
  1695. resourceData: {
  1696. site: '',
  1697. resourceId: '',
  1698. resourceDesc: ''
  1699. },
  1700. operation: '',
  1701. resourceId: '',
  1702. selectionManufacturer: [],
  1703. // 供应商
  1704. manufacturerList: [],
  1705. manufacturerModelFlag: false,
  1706. dataListManufacturerSelections: [],
  1707. manufacturerData: {
  1708. site: '',
  1709. manufacturerID: '',
  1710. manufacturerName: ''
  1711. },
  1712. // 单选框绑定的值
  1713. operationCurrent: -1,
  1714. resourceCurrent: -1,
  1715. sopData: {
  1716. site: '',
  1717. buNo: '',
  1718. partNo: '',
  1719. inspectionTypeNo: '',
  1720. inspectionTypeName: ''
  1721. },
  1722. sopList: [],
  1723. sopFileModelFlag: false,
  1724. sopColumnList: [
  1725. {
  1726. columnProp: 'fileName',
  1727. headerAlign: "center",
  1728. align: "center",
  1729. columnLabel: '文件名称',
  1730. columnHidden: false,
  1731. columnImage: false,
  1732. columnSortable: false,
  1733. sortLv: 0,
  1734. status: true,
  1735. fixed: '',
  1736. },
  1737. {
  1738. columnProp: 'createdBy',
  1739. headerAlign: "center",
  1740. align: 'center',
  1741. columnLabel: '上传人',
  1742. columnHidden: false,
  1743. columnImage: false,
  1744. columnSortable: true,
  1745. sortLv: 0,
  1746. status: true,
  1747. fixed: false
  1748. },
  1749. {
  1750. columnProp: 'createDate',
  1751. headerAlign: "center",
  1752. align: 'center',
  1753. columnLabel: '上传时间',
  1754. columnHidden: false,
  1755. columnImage: false,
  1756. columnSortable: true,
  1757. sortLv: 0,
  1758. status: true,
  1759. fixed: false
  1760. },
  1761. {
  1762. columnProp: 'orderRef3',
  1763. headerAlign: "center",
  1764. align: 'center',
  1765. columnLabel: '检验类型',
  1766. columnHidden: false,
  1767. columnImage: false,
  1768. columnSortable: true,
  1769. sortLv: 0,
  1770. status: true,
  1771. fixed: false
  1772. },
  1773. ],
  1774. userBuList: [],
  1775. partInfoList: [],
  1776. partDetailData: {
  1777. bu: '',
  1778. partNo: '',
  1779. partDesc: '',
  1780. seqNo: '',
  1781. sku: '',
  1782. cinvSourceCode:'',
  1783. },
  1784. authSearch: false,
  1785. authSave: false,
  1786. authUpdate: false,
  1787. authDelete: false,
  1788. authDetail: false,
  1789. authCheckout: false,
  1790. authFile: false,
  1791. menuId: this.$route.meta.menuId,
  1792. }
  1793. },
  1794. computed: {
  1795. detailColumnsBeforeIpqc () {
  1796. const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
  1797. const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
  1798. if (idx === -1) return list
  1799. return list.slice(0, idx + 1)
  1800. },
  1801. detailColumnsAfterIpqc () {
  1802. const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
  1803. const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
  1804. if (idx === -1) return []
  1805. return list.slice(idx + 1)
  1806. }
  1807. },
  1808. mounted () {
  1809. this.$nextTick(() => {
  1810. this.height = window.innerHeight - 180
  1811. })
  1812. },
  1813. created () {
  1814. // 按钮控制
  1815. this.getButtonAuthData()
  1816. // 获取用户的 site 和 bu
  1817. // this.getSiteAndBuByUserName()
  1818. // 校验用户是否收藏
  1819. // this.favoriteIsOk()
  1820. // 获取检验类型
  1821. this.inspectionTypeSearch()
  1822. // 动态列
  1823. // this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1824. // this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  1825. if (!this.authSearch) {
  1826. // 获取数据列表
  1827. this.getDataList()
  1828. }
  1829. },
  1830. methods: {
  1831. // 获取用户的bu
  1832. getSiteAndBuByUserName () {
  1833. let tempData = {
  1834. username: this.$store.state.user.name,
  1835. }
  1836. getSiteAndBuByUserName(tempData).then(({data}) => {
  1837. if (data.code === 0) {
  1838. this.userBuList = data.rows
  1839. }
  1840. })
  1841. },
  1842. searchPartInfo () {
  1843. this.partDetailData.site = this.modalData.site
  1844. if (!this.partDetailData.partNo && !this.partDetailData.partDesc && !this.partDetailData.sku && !this.partDetailData.cinvSourceCode) {
  1845. this.partInfoList = []
  1846. this.partDisableFlag = true
  1847. }else {
  1848. searchPartInfo(this.partDetailData).then(({data}) => {
  1849. if (data.code === 0) {
  1850. this.partInfoList = data.rows
  1851. this.partDisableFlag = true
  1852. } else {
  1853. this.$alert(data.msg, '错误', {
  1854. confirmButtonText: '确定'
  1855. })
  1856. }
  1857. })
  1858. }
  1859. },
  1860. // 查询检验类型
  1861. inspectionTypeSearch () {
  1862. let tempData = {
  1863. site: this.$store.state.user.site
  1864. }
  1865. inspectionTypeSearch(tempData).then(({data}) => {
  1866. if (data.code === 0) {
  1867. this.options = data.rows
  1868. }
  1869. })
  1870. },
  1871. isIPQCInspectionType (row) {
  1872. const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
  1873. const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
  1874. return name.toUpperCase().includes('IPQC') || no.toUpperCase().includes('IPQC')
  1875. },
  1876. normalizeIpqcInspectionMethod (row) {
  1877. if (!row) return
  1878. if (this.isIPQCInspectionType(row)) {
  1879. if (!row.ipqcInspectionMethod) {
  1880. this.$set(row, 'ipqcInspectionMethod', '首件检')
  1881. }
  1882. } else {
  1883. if (row.ipqcInspectionMethod) {
  1884. this.$set(row, 'ipqcInspectionMethod', '')
  1885. }
  1886. }
  1887. },
  1888. normalizeDetailListIpqcInspectionMethod () {
  1889. if (!Array.isArray(this.detailList)) return
  1890. this.detailList.forEach(r => this.normalizeIpqcInspectionMethod(r))
  1891. },
  1892. chooseLevel (row) {
  1893. this.tempLevelRow = row
  1894. this.getBaseList(208)
  1895. },
  1896. chooseProgrammeRow (row) {
  1897. this.tempProgrammeRow = row
  1898. this.getBaseList(207)
  1899. },
  1900. // 获取基础数据列表S
  1901. getBaseList (val,type) {
  1902. this.tagNo = val
  1903. this.$nextTick(() => {
  1904. let strVal = ''
  1905. // if (val === 507) {
  1906. // strVal = this.modalData.partNo
  1907. // this.$refs.baseList.init(val, strVal)
  1908. // }
  1909. if (val === 208) {
  1910. strVal = this.tempLevelRow.samplingLevelNo
  1911. this.$refs.baseList.init(val, strVal)
  1912. }
  1913. if (val === 207) {
  1914. strVal = this.tempProgrammeRow.samplingProgrammeNo
  1915. this.$refs.baseList.init(val, strVal)
  1916. }
  1917. if (val === 1056) {
  1918. strVal = this.modalData.supplierNo
  1919. this.$refs.baseList.init(val, strVal)
  1920. }
  1921. })
  1922. },
  1923. // 列表方法的回调
  1924. getBaseData (val) {
  1925. if (this.tagNo === 507) {
  1926. this.modalData.partNo = val.part_no
  1927. this.modalData.partDesc = val.part_desc
  1928. }
  1929. if (this.tagNo === 208) {
  1930. this.tempLevelRow.samplingLevelNo = val.sampling_level_no
  1931. this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc
  1932. }
  1933. if (this.tagNo === 207) {
  1934. this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no
  1935. this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc
  1936. }
  1937. if (this.tagNo === 1056) {
  1938. this.modalData.supplierNo = val.supplier_id
  1939. this.modalData.supplierDesc = val.supplier_name
  1940. }
  1941. },
  1942. // 获取数据列表
  1943. getDataList () {
  1944. this.searchData.limit = this.pageSize
  1945. this.searchData.page = this.pageIndex
  1946. qcPartAttributeSearch(this.searchData).then(({data}) => {
  1947. if (data.code === 0) {
  1948. this.dataList = data.page.list
  1949. this.pageIndex = data.page.currPage
  1950. this.pageSize = data.page.pageSize
  1951. this.totalPage = data.page.totalCount
  1952. }
  1953. })
  1954. },
  1955. getRowData1 (row) {
  1956. this.modalData.sku = row.sku
  1957. this.modalData.cinvSourceCode = row.cinvSourceCode
  1958. this.modalData.partNo = row.partNo
  1959. this.modalData.partDesc = row.partDesc
  1960. this.partDisableFlag = false
  1961. },
  1962. // 每页数
  1963. sizeChangeHandle (val) {
  1964. this.pageSize = val
  1965. this.pageIndex = 1
  1966. this.getDataList()
  1967. },
  1968. // 当前页
  1969. currentChangeHandle (val) {
  1970. this.pageIndex = val
  1971. this.getDataList()
  1972. },
  1973. addModal () {
  1974. this.modalData = {
  1975. site: this.$store.state.user.site,
  1976. buNo: '*',
  1977. // bu: this.userBuList[0].buNo,
  1978. flag: '1',
  1979. partNo: '',
  1980. partDesc: '',
  1981. familyID: '',
  1982. familyName: '',
  1983. umid: '',
  1984. supplierNo: '',
  1985. supplierDesc: '',
  1986. attributeRemark: '',
  1987. createTime: '',
  1988. updateBy: this.$store.state.user.name,
  1989. createBy: this.$store.state.user.name,
  1990. attributeType: 'A',
  1991. defaultValue: '',
  1992. standardValue: '',
  1993. maxValue: '',
  1994. minValue: '',
  1995. firstIPQCPatrolTime: '',
  1996. lastIPQCPatrolTime: '',
  1997. cycleIPQCPatrolTime: '',
  1998. exemptInspection: 'N',
  1999. iqcExempt: 'N',
  2000. faiExempt: 'N',
  2001. ipqcExempt: 'N',
  2002. pqcExempt: 'N',
  2003. fqcExempt: 'N',
  2004. oqcExempt: 'N',
  2005. sqcExempt: 'N'
  2006. }
  2007. this.modalDisableFlag = false
  2008. this.modalFlag = true
  2009. },
  2010. updateModal (row) {
  2011. this.modalData = {
  2012. site: row.site,
  2013. bu: row.site + '_' + row.buNo,
  2014. flag: '2',
  2015. partNo: row.partNo,
  2016. partDesc: row.partDesc,
  2017. familyID: row.familyID,
  2018. familyName: row.familyName,
  2019. umid: row.umid,
  2020. supplierNo: row.supplierNo,
  2021. supplierDesc: row.supplierDesc,
  2022. attributeRemark: row.attributeRemark,
  2023. updateBy: this.$store.state.user.name,
  2024. createBy: this.$store.state.user.name,
  2025. attributeType: 'A',
  2026. defaultValue: row.defaultValue,
  2027. standardValue: row.standardValue,
  2028. maxValue: row.maxValue,
  2029. minValue: row.minValue,
  2030. firstIPQCPatrolTime: row.firstIPQCPatrolTime,
  2031. lastIPQCPatrolTime: row.lastIPQCPatrolTime,
  2032. cycleIPQCPatrolTime: row.cycleIPQCPatrolTime,
  2033. exemptInspection: row.exemptInspection || 'N',
  2034. iqcExempt: row.iqcExempt || 'N',
  2035. faiExempt: row.faiExempt || 'N',
  2036. ipqcExempt: row.ipqcExempt || 'N',
  2037. pqcExempt: row.pqcExempt || 'N',
  2038. fqcExempt: row.fqcExempt || 'N',
  2039. oqcExempt: row.oqcExempt || 'N',
  2040. sqcExempt: row.sqcExempt || 'N'
  2041. }
  2042. this.modalDisableFlag = true
  2043. this.modalFlag = true
  2044. },
  2045. // 删除
  2046. deletePropertiesModel (row) {
  2047. this.$confirm(`是否删除这个检验模板?`, '提示', {
  2048. confirmButtonText: '确定',
  2049. cancelButtonText: '取消',
  2050. type: 'warning'
  2051. }).then(() => {
  2052. qcPartAttributeDelete(row).then(({data}) => {
  2053. if (data && data.code === 0) {
  2054. this.getDataList()
  2055. this.$message({
  2056. message: '操作成功',
  2057. type: 'success',
  2058. duration: 1500,
  2059. onClose: () => {}
  2060. })
  2061. } else {
  2062. this.$alert(data.msg, '错误', {
  2063. confirmButtonText: '确定'
  2064. })
  2065. }
  2066. })
  2067. }).catch(() => {
  2068. })
  2069. },
  2070. saveData () {
  2071. if (this.modalData.site === '' || this.modalData.site == null) {
  2072. this.$message.warning('请填写工厂编码!')
  2073. return
  2074. }
  2075. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2076. this.$message.warning('请选择物料编码!')
  2077. return
  2078. }
  2079. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  2080. this.$message.warning('请选择物料名称!')
  2081. return
  2082. }
  2083. // let obj = document.getElementsByName('isExemptInspection')
  2084. // let s = ''
  2085. // for (let i = 0; i < obj.length; i++) {
  2086. // if (obj[i].checked) {
  2087. // s += obj[i].value + ','
  2088. // }
  2089. // }
  2090. // s = s.substring(0, s.length - 1)
  2091. // this.modalData.exemptInspection = s
  2092. if (this.modalData.flag === '1') {
  2093. qcPartAttributeSave(this.modalData).then(({data}) => {
  2094. if (data && data.code === 0) {
  2095. this.getDataList()
  2096. this.modalFlag = false
  2097. this.$message({
  2098. message: '操作成功',
  2099. type: 'success',
  2100. duration: 1500,
  2101. onClose: () => {}
  2102. })
  2103. } else {
  2104. this.$alert(data.msg, '错误', {
  2105. confirmButtonText: '确定'
  2106. })
  2107. }
  2108. })
  2109. } else {
  2110. qcPartAttributeEdit(this.modalData).then(({data}) => {
  2111. if (data && data.code === 0) {
  2112. this.getDataList()
  2113. this.modalFlag = false
  2114. this.$message({
  2115. message: '操作成功',
  2116. type: 'success',
  2117. duration: 1500,
  2118. onClose: () => {}
  2119. })
  2120. } else {
  2121. this.$alert(data.msg, '错误', {
  2122. confirmButtonText: '确定'
  2123. })
  2124. }
  2125. })
  2126. }
  2127. },
  2128. // 保存属性模板
  2129. saveDetail () {
  2130. // IPQC 的检验方式必填(默认:IPQC首件检)
  2131. this.normalizeDetailListIpqcInspectionMethod()
  2132. const missingIpqc = (this.detailList || []).find(r => this.isIPQCInspectionType(r) && !r.ipqcInspectionMethod)
  2133. if (missingIpqc) {
  2134. this.$message.warning('检验类型为IPQC时,“IPQC检验方式”为必填!')
  2135. return
  2136. }
  2137. for (let i = 0; i < this.detailList.length; i++) {
  2138. this.detailList[i].updateBy = this.$store.state.user.name
  2139. saveAttributeDetailed(this.detailList[i]).then(({data}) => {
  2140. if (data && data.code === 0) {
  2141. this.getDataList()
  2142. this.detailModelFlag = false
  2143. this.$message({
  2144. message: '操作成功',
  2145. type: 'success',
  2146. duration: 1500,
  2147. onClose: () => {}
  2148. })
  2149. } else {
  2150. this.$alert(data.msg, '错误', {
  2151. confirmButtonText: '确定'
  2152. }).then(() => {
  2153. return false
  2154. })
  2155. }
  2156. })
  2157. }
  2158. },
  2159. // 打开物料模板清单
  2160. detailModal (row) {
  2161. this.detailData.site = row.site
  2162. this.detailData.buNo = row.buNo
  2163. this.detailData.partNo = row.partNo
  2164. this.detailData.attributeNo = row.partNo
  2165. this.detailData.partDesc = row.partDesc
  2166. this.$set(this.detailData, 'inspectionTypeNo', '')
  2167. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2168. this.detailList = data.rows
  2169. this.normalizeDetailListIpqcInspectionMethod()
  2170. })
  2171. this.detailModelFlag = true
  2172. },
  2173. checkInspectionType () {
  2174. this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
  2175. getPartTemplateLists(this.detailData).then(({data}) => {
  2176. this.operation = ''
  2177. this.resourceId = ''
  2178. this.itemList1 = data.row1
  2179. this.itemList2 = data.row2
  2180. })
  2181. },
  2182. // 快速新增
  2183. addFastModal () {
  2184. this.itemSelections1 = null
  2185. this.itemSelections2 = null
  2186. getPartTemplateLists(this.detailData).then(({data}) => {
  2187. this.itemList1 = data.row1
  2188. this.itemList2 = data.row2
  2189. })
  2190. this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  2191. this.checkInspectionType()
  2192. this.dataListOperationSelections = []
  2193. this.operation = ''
  2194. this.resourceId = ''
  2195. this.operationData.operationDesc = ''
  2196. this.resourceData.resourceId = ''
  2197. this.resourceData.resourceDesc = ''
  2198. this.operationCurrent = -1
  2199. this.resourceCurrent = -1
  2200. this.selectionManufacturer = []
  2201. this.dataListManufacturerSelections = []
  2202. this.fastAddFlag = true
  2203. },
  2204. // 可选项目
  2205. itemClickRow1 (row) {
  2206. this.$refs.itemTable1.toggleRowSelection(row)
  2207. },
  2208. // 已有项目
  2209. itemClickRow2 (row) {
  2210. this.$refs.itemTable2.toggleRowSelection(row)
  2211. },
  2212. selectFlag () {
  2213. return true
  2214. },
  2215. selectionItem1 (val) {
  2216. this.itemSelections1 = val
  2217. },
  2218. selectionItem2 (val) {
  2219. this.itemSelections2 = val
  2220. },
  2221. // 添加模板
  2222. addItem () {
  2223. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  2224. this.$message.warning('请选择可选模板!')
  2225. return
  2226. }
  2227. /* if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107' || this.detailData.inspectionTypeNo === '108') && (this.operation == null || this.operation === '')) {
  2228. this.$message.warning('请选择工序!')
  2229. return
  2230. }
  2231. if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107') && (this.resourceId == null || this.resourceId === '')) {
  2232. this.$message.warning('请选择机台!')
  2233. return
  2234. } */
  2235. if ((this.detailData.inspectionTypeNo === '105') && (this.selectionManufacturer == null || this.selectionManufacturer.length === 0)) {
  2236. this.$message.warning('请选择供应商!')
  2237. return
  2238. }
  2239. let inData = {
  2240. site: this.detailData.site,
  2241. buNo: this.detailData.buNo,
  2242. attributeNo: this.detailData.partNo,
  2243. itemList: this.itemSelections1,
  2244. operation: this.operation,
  2245. resourceID: this.resourceId,
  2246. manufacturerList: this.selectionManufacturer,
  2247. attributeType: this.detailData.attributeType,
  2248. inspectionTypeNo: this.detailData.inspectionTypeNo
  2249. }
  2250. savePartAttributeDetails(inData).then(({data}) => {
  2251. if (data && data.code === 0) {
  2252. getPartTemplateLists(this.detailData).then(({data}) => {
  2253. this.itemList1 = data.row1
  2254. this.itemList2 = data.row2
  2255. })
  2256. this.itemSelections1 = []
  2257. this.operation = ''
  2258. this.resourceId = ''
  2259. this.selectionManufacturer = []
  2260. } else {
  2261. this.$alert(data.msg, '错误', {
  2262. confirmButtonText: '确定'
  2263. })
  2264. }
  2265. })
  2266. },
  2267. // 删除模板
  2268. deleteItem () {
  2269. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  2270. this.$message.warning('请选择已有模板!')
  2271. return
  2272. }
  2273. let inData = {
  2274. attributeNo:this.detailData.partNo,
  2275. itemList: this.itemSelections2,
  2276. attributeType: this.detailData.attributeType,
  2277. site: this.detailData.site,
  2278. buNo: this.detailData.buNo,
  2279. }
  2280. deletePartAttributeDetails(inData).then(({data}) => {
  2281. if (data && data.code === 0) {
  2282. getPartTemplateLists(this.detailData).then(({data}) => {
  2283. this.itemList1 = data.row1
  2284. this.itemList2 = data.row2
  2285. })
  2286. this.itemSelections2 = []
  2287. } else {
  2288. this.$alert(data.msg, '错误', {
  2289. confirmButtonText: '确定'
  2290. })
  2291. }
  2292. })
  2293. },
  2294. // 关闭后刷新列表
  2295. refreshDetailList () {
  2296. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2297. this.detailList = data.rows
  2298. this.normalizeDetailListIpqcInspectionMethod()
  2299. })
  2300. },
  2301. syncStandardInspectionTypeName () {
  2302. const o = this.options.find(i => i.inspectionTypeNo === this.standardDetailData.inspectionTypeNo)
  2303. if (o) {
  2304. this.standardDetailData.inspectionTypeName = o.inspectionTypeName
  2305. }
  2306. },
  2307. standardDetailModal (row) {
  2308. this.standardDetailData.site = row.site
  2309. this.standardDetailData.buNo = row.buNo
  2310. this.standardDetailData.partNo = row.partNo
  2311. this.standardDetailData.partDesc = row.partDesc
  2312. this.standardDetailData.attributeNo = row.partNo
  2313. this.standardDetailData.attributeType = 'A'
  2314. this.standardDetailData.itemType = 'D'
  2315. if (this.options && this.options.length > 0) {
  2316. this.standardDetailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  2317. this.standardDetailData.inspectionTypeName = this.options[0].inspectionTypeName
  2318. }
  2319. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2320. if (data.code === 0) {
  2321. this.standardDetailList = data.rows || []
  2322. }
  2323. })
  2324. this.standardDetailModelFlag = true
  2325. },
  2326. closeStandardDialog () {
  2327. this.standardDetailList = []
  2328. this.standardItemList1 = []
  2329. this.standardItemList2 = []
  2330. },
  2331. standardAddFastModal () {
  2332. this.syncStandardInspectionTypeName()
  2333. this.standardItemSelections1 = null
  2334. this.standardItemSelections2 = null
  2335. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2336. if (data.code === 0) {
  2337. this.standardItemList1 = data.row1 || []
  2338. this.standardItemList2 = data.row2 || []
  2339. }
  2340. })
  2341. this.standardFastAddFlag = true
  2342. },
  2343. standardGetItem () {
  2344. this.syncStandardInspectionTypeName()
  2345. getPartAttrItem(this.standardDetailData).then(({data}) => {
  2346. if (data.code === 0) {
  2347. this.standardItemList1 = data.rows || []
  2348. }
  2349. })
  2350. },
  2351. standardItemClickRow (row) {
  2352. this.standardCurrentRow = JSON.parse(JSON.stringify(row))
  2353. },
  2354. standardItemClickRow1 (row) {
  2355. this.$refs.standardItemTable1.toggleRowSelection(row)
  2356. },
  2357. standardItemClickRow2 (row) {
  2358. this.$refs.standardItemTable2.toggleRowSelection(row)
  2359. },
  2360. standardSelectionItem1 (val) {
  2361. this.standardItemSelections1 = val
  2362. },
  2363. standardSelectionItem2 (val) {
  2364. this.standardItemSelections2 = val
  2365. },
  2366. standardAddItem () {
  2367. if (this.standardItemSelections1 == null || this.standardItemSelections1.length === 0) {
  2368. this.$message.warning('请选择可选项目!')
  2369. return
  2370. }
  2371. if (!this.standardDetailData.inspectionTypeName) {
  2372. this.syncStandardInspectionTypeName()
  2373. }
  2374. let inData = {
  2375. site: this.standardDetailData.site,
  2376. buNo: this.standardDetailData.buNo,
  2377. attributeNo: this.standardDetailData.attributeNo,
  2378. attributeType: 'A',
  2379. inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
  2380. itemType: this.standardDetailData.itemType,
  2381. updateBy: this.$store.state.user.name,
  2382. itemList: this.standardItemSelections1
  2383. }
  2384. addPartAttrItemDetails(inData).then(({data}) => {
  2385. if (data && data.code === 0) {
  2386. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2387. if (data.code === 0) {
  2388. this.standardItemList1 = data.row1 || []
  2389. this.standardItemList2 = data.row2 || []
  2390. }
  2391. })
  2392. this.standardItemSelections1 = []
  2393. this.$message.success('操作成功')
  2394. } else {
  2395. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  2396. }
  2397. })
  2398. },
  2399. standardDeleteItem () {
  2400. if (this.standardItemSelections2 == null || this.standardItemSelections2.length === 0) {
  2401. this.$message.warning('请选择已有项目!')
  2402. return
  2403. }
  2404. let inData = {
  2405. site: this.standardDetailData.site,
  2406. buNo: this.standardDetailData.buNo,
  2407. attributeNo: this.standardDetailData.attributeNo,
  2408. attributeType: 'A',
  2409. updateBy: this.$store.state.user.name,
  2410. itemList: this.standardItemSelections2
  2411. }
  2412. delPartAttrItemDetails(inData).then(({data}) => {
  2413. if (data && data.code === 0) {
  2414. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2415. if (data.code === 0) {
  2416. this.standardItemList1 = data.row1 || []
  2417. this.standardItemList2 = data.row2 || []
  2418. }
  2419. })
  2420. this.standardItemSelections2 = []
  2421. this.$message.success('操作成功')
  2422. } else {
  2423. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  2424. }
  2425. })
  2426. },
  2427. standardRefreshDetailList () {
  2428. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2429. if (data.code === 0) {
  2430. this.standardDetailList = data.rows || []
  2431. }
  2432. })
  2433. },
  2434. saveStandardDetail () {
  2435. let tempData = {
  2436. site: this.standardDetailData.site,
  2437. buNo: this.standardDetailData.buNo,
  2438. attributeNo: this.standardDetailData.attributeNo,
  2439. attributeType: 'A',
  2440. inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
  2441. updateBy: this.$store.state.user.name,
  2442. itemList: this.standardDetailList
  2443. }
  2444. savePartAttrDetailed(tempData).then(({data}) => {
  2445. if (data && data.code === 0) {
  2446. this.getDataList()
  2447. this.standardDetailModelFlag = false
  2448. this.$message.success('操作成功')
  2449. } else {
  2450. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  2451. }
  2452. })
  2453. },
  2454. standardDelItemDetails (row) {
  2455. this.$confirm('是否删除该检验项目?', '提示', {
  2456. confirmButtonText: '确定',
  2457. cancelButtonText: '取消',
  2458. type: 'warning'
  2459. }).then(() => {
  2460. delPartAttrItemDetails({
  2461. site: this.standardDetailData.site,
  2462. buNo: this.standardDetailData.buNo,
  2463. attributeNo: this.standardDetailData.attributeNo,
  2464. attributeType: 'A',
  2465. updateBy: this.$store.state.user.name,
  2466. itemList: [row]
  2467. }).then(({data}) => {
  2468. if (data && data.code === 0) {
  2469. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2470. if (data.code === 0) {
  2471. this.standardDetailList = data.rows || []
  2472. }
  2473. })
  2474. this.$message.success('操作成功')
  2475. } else {
  2476. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  2477. }
  2478. })
  2479. }).catch(() => {})
  2480. },
  2481. standardGoUp () {
  2482. if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
  2483. this.$message.warning('请先点击表格选择一行')
  2484. return
  2485. }
  2486. const row = {
  2487. ...this.standardCurrentRow,
  2488. site: this.standardDetailData.site,
  2489. buNo: this.standardDetailData.buNo,
  2490. attributeNo: this.standardDetailData.attributeNo
  2491. }
  2492. goUpPartAttrItem(row).then(({data}) => {
  2493. if (data && data.code === 0) {
  2494. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2495. if (data.code === 0) {
  2496. this.standardDetailList = data.rows || []
  2497. for (let i = 0; i < this.standardDetailList.length; i++) {
  2498. if (this.standardDetailList[i].itemNo === row.itemNo) {
  2499. this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
  2500. this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
  2501. break
  2502. }
  2503. }
  2504. this.$message.success('操作成功')
  2505. }
  2506. })
  2507. }
  2508. })
  2509. },
  2510. standardGoDown () {
  2511. if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
  2512. this.$message.warning('请先点击表格选择一行')
  2513. return
  2514. }
  2515. const row = {
  2516. ...this.standardCurrentRow,
  2517. site: this.standardDetailData.site,
  2518. buNo: this.standardDetailData.buNo,
  2519. attributeNo: this.standardDetailData.attributeNo
  2520. }
  2521. goDownPartAttrItem(row).then(({data}) => {
  2522. if (data && data.code === 0) {
  2523. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2524. if (data.code === 0) {
  2525. this.standardDetailList = data.rows || []
  2526. for (let i = 0; i < this.standardDetailList.length; i++) {
  2527. if (this.standardDetailList[i].itemNo === row.itemNo) {
  2528. this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
  2529. this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
  2530. break
  2531. }
  2532. }
  2533. this.$message.success('操作成功')
  2534. }
  2535. })
  2536. }
  2537. })
  2538. },
  2539. // 删除物料属性中的模板
  2540. deletePartAttributeDetails (row) {
  2541. this.$confirm(`是否删除这个检验模板?`, '提示', {
  2542. confirmButtonText: '确定',
  2543. cancelButtonText: '取消',
  2544. type: 'warning'
  2545. }).then(() => {
  2546. deletePartAttributeDetails(row).then(({data}) => {
  2547. if (data && data.code === 0) {
  2548. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2549. this.detailList = data.rows
  2550. this.normalizeDetailListIpqcInspectionMethod()
  2551. })
  2552. this.$message({
  2553. message: '操作成功',
  2554. type: 'success',
  2555. duration: 1500,
  2556. onClose: () => {}
  2557. })
  2558. } else {
  2559. this.$alert(data.msg, '错误', {
  2560. confirmButtonText: '确定'
  2561. })
  2562. }
  2563. })
  2564. }).catch(() => {
  2565. })
  2566. },
  2567. // 校验用户是否收藏
  2568. favoriteIsOk () {
  2569. let userFavorite = {
  2570. userId: this.$store.state.user.id,
  2571. languageCode: this.$i18n.locale
  2572. }
  2573. userFavoriteList(userFavorite).then(({data}) => {
  2574. for (let i = 0; i < data.list.length; i++) {
  2575. if (this.$route.meta.menuId === data.list[i].menuId) {
  2576. this.favorite = true
  2577. }
  2578. }
  2579. })
  2580. },
  2581. // 收藏 OR 取消收藏
  2582. favoriteFunction () {
  2583. let userFavorite = {
  2584. userId: this.$store.state.user.id,
  2585. functionId: this.$route.meta.menuId,
  2586. }
  2587. if (this.favorite) {
  2588. removeUserFavorite(userFavorite).then(({data}) => {
  2589. this.$message.success(data.msg)
  2590. this.favorite = false
  2591. })
  2592. } else {
  2593. // 收藏
  2594. saveUserFavorite(userFavorite).then(({data}) => {
  2595. this.$message.success(data.msg)
  2596. this.favorite = true
  2597. })
  2598. }
  2599. },
  2600. //导出excel
  2601. async createExportData() {
  2602. this.searchData.limit = -1
  2603. this.searchData.page = 1
  2604. await qcPartAttributeSearch(this.searchData).then(({data}) => {
  2605. this.exportList= data.page.list
  2606. })
  2607. return this.exportList
  2608. },
  2609. startDownload() {},
  2610. finishDownload() {},
  2611. fields () {
  2612. let json = "{"
  2613. this.columnList.forEach((item, index) => {
  2614. if (index == this.columnList.length - 1) {
  2615. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  2616. } else {
  2617. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  2618. }
  2619. })
  2620. json += "}"
  2621. let s = eval("(" + json + ")")
  2622. return s
  2623. },
  2624. // 导入
  2625. qcUpload () {
  2626. let currentData = {
  2627. flag: 'partAttribute',
  2628. createBy: this.$store.state.user.name,
  2629. site: this.$store.state.user.site,
  2630. }
  2631. //打开组件 去做新增业务
  2632. this.$nextTick(() => {
  2633. this.$refs.qcUpload.init(currentData)
  2634. })
  2635. },
  2636. // 获取工序列表
  2637. getOperationList () {
  2638. getOperationDescList(this.operationData).then(({data}) => {
  2639. if (data && data.code === 0) {
  2640. this.operationList = data.rows
  2641. // // 回显数据
  2642. // // 先清空缓存选中
  2643. // this.$nextTick(() => this.$refs.operationTable.clearSelection())
  2644. // // 拿到选中的工序
  2645. // let tempDataList = this.operationDesc
  2646. // this.operationList.forEach(val => {
  2647. // // 回显选中的工序
  2648. // if (tempDataList === val.operationDesc) {
  2649. // this.$nextTick(() => this.$refs.operationTable.toggleRowSelection(val, true))
  2650. // }
  2651. // })
  2652. this.operationModelFlag = true
  2653. } else {
  2654. this.$alert(data.msg, '错误', {
  2655. confirmButtonText: '确定'
  2656. })
  2657. }
  2658. })
  2659. },
  2660. // 获取机台列表
  2661. getAllResourceList () {
  2662. this.resourceData.site = this.detailData.site
  2663. getAllResourceList(this.resourceData).then(({data}) => {
  2664. if (data && data.code === 0) {
  2665. this.resourceList = data.rows
  2666. this.resourceModelFlag = true
  2667. } else {
  2668. this.$alert(data.msg, '错误', {
  2669. confirmButtonText: '确定'
  2670. })
  2671. }
  2672. })
  2673. },
  2674. // 条件查询获取工序列表
  2675. getOperationList2 () {
  2676. getOperationDescList(this.operationData).then(({data}) => {
  2677. if (data && data.code === 0) {
  2678. this.operationList = data.rows
  2679. this.operationCurrent = -1
  2680. } else {
  2681. this.$alert(data.msg, '错误', {
  2682. confirmButtonText: '确定'
  2683. })
  2684. }
  2685. })
  2686. },
  2687. // 条件查询获取机台列表
  2688. getAllResourceList2 () {
  2689. this.resourceData.site = this.detailData.site
  2690. getAllResourceList(this.resourceData).then(({data}) => {
  2691. if (data && data.code === 0) {
  2692. this.resourceList = data.rows
  2693. this.resourceCurrent = -1
  2694. } else {
  2695. this.$alert(data.msg, '错误', {
  2696. confirmButtonText: '确定'
  2697. })
  2698. }
  2699. })
  2700. },
  2701. // 点击行选中工序复选框
  2702. operationClickRow (row) {
  2703. this.$refs.operationTable.toggleRowSelection(row)
  2704. },
  2705. // 点击行选中机台复选框
  2706. resourceClickRow (row) {
  2707. this.$refs.resourceTable.toggleRowSelection(row)
  2708. },
  2709. // 多选工序
  2710. selectionOperationChangeHandle (val) {
  2711. this.operation = val[0].operationDesc
  2712. if (val) {
  2713. this.operationCurrent = val.index
  2714. }
  2715. },
  2716. // 多选机台
  2717. selectionResourceChangeHandle (val) {
  2718. this.resourceId = val[0].resourceId
  2719. if (val) {
  2720. this.resourceCurrent = val.index
  2721. }
  2722. },
  2723. operationRowClassName ({row, rowIndex}) {
  2724. row.index = rowIndex // 在原有的数据上加一个index
  2725. },
  2726. resourceRowClassName ({row, rowIndex}) {
  2727. row.index = rowIndex // 在原有的数据上加一个index
  2728. },
  2729. // // 单选
  2730. // clickChange (row) {
  2731. // this.radioOperation = row.operationDesc
  2732. // },
  2733. // 确认选择工序
  2734. confirmOperation () {
  2735. //this.operationDesc = ''
  2736. // this.operationDesc = this.radioOperation
  2737. // this.radioOperation = ''
  2738. // for (let i = 0; i < this.dataListOperationSelections.length; i++) {
  2739. // this.selectionOperation.push(this.dataListOperationSelections[i].operationDesc)
  2740. // }
  2741. this.operationModelFlag = false
  2742. },
  2743. // 确认选择工序
  2744. confirmResource () {
  2745. this.resourceModelFlag = false
  2746. },
  2747. // 获取供应商列表
  2748. getManufacturerList () {
  2749. this.manufacturerData.site = this.detailData.site
  2750. getManufacturerList(this.manufacturerData).then(({data}) => {
  2751. if (data && data.code === 0) {
  2752. this.manufacturerList = data.rows
  2753. // 回显数据
  2754. // 先清空缓存选中
  2755. this.$nextTick(() => this.$refs.manufacturerTable.clearSelection())
  2756. // 拿到选中的供应商
  2757. let tempDataList = this.selectionManufacturer
  2758. this.manufacturerList.forEach(val => {
  2759. // 回显选中的供应商
  2760. if (tempDataList.includes(val.manufacturerID)) {
  2761. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  2762. }
  2763. })
  2764. this.manufacturerModelFlag = true
  2765. } else {
  2766. this.$alert(data.msg, '错误', {
  2767. confirmButtonText: '确定'
  2768. })
  2769. }
  2770. })
  2771. },
  2772. // 点击行选中复选框
  2773. manufacturerClickRow (row) {
  2774. this.$refs.manufacturerTable.toggleRowSelection(row)
  2775. },
  2776. // 多选
  2777. selectionManufacturerChangeHandle (val) {
  2778. this.dataListManufacturerSelections = val
  2779. },
  2780. // 确认多选供应商
  2781. confirmManufacturer () {
  2782. this.selectionManufacturer = []
  2783. for (let i = 0; i < this.dataListManufacturerSelections.length; i++) {
  2784. this.selectionManufacturer.push(this.dataListManufacturerSelections[i].manufacturerID)
  2785. }
  2786. this.manufacturerModelFlag = false
  2787. },
  2788. // sop文件列表
  2789. sopFileList (row) {
  2790. this.sopData = {
  2791. site: row.site,
  2792. buNo: row.buNo,
  2793. partNo: row.partNo,
  2794. inspectionTypeNo: ''
  2795. }
  2796. this.getFileContentList()
  2797. },
  2798. getFileContentList () {
  2799. let tempData = {
  2800. orderRef1: this.sopData.site,
  2801. orderRef2: this.sopData.partNo,
  2802. orderRef3:this.sopData.inspectionTypeNo,
  2803. orderRef4: this.sopData.buNo,
  2804. }
  2805. getFileContentList(tempData).then(({data}) => {
  2806. if (data && data.code === 200) {
  2807. this.sopList = data.rows
  2808. } else {
  2809. this.sopList = []
  2810. }
  2811. })
  2812. this.sopFileModelFlag = true
  2813. },
  2814. // 上传sop文件模态框
  2815. uploadSopFile () {
  2816. let currentData = {
  2817. titleCon: 'SOP文件上传',
  2818. site: this.sopData.site,
  2819. buNo: this.sopData.buNo,
  2820. createBy: this.$store.state.user.name,
  2821. partNo: this.sopData.partNo,
  2822. inspectionTypeNo: '',
  2823. options: this.options
  2824. }
  2825. //打开组件 去做新增业务
  2826. this.$nextTick(() => {
  2827. this.$refs.qcSOPUploadFile.init(currentData)
  2828. })
  2829. },
  2830. // 文件下载
  2831. downloadFile (row) {
  2832. downLoadObjectFile(row).then(({data}) => {
  2833. // 不限制文件下载类型
  2834. const blob = new Blob([data], {type: "application/octet-stream"})
  2835. // 下载文件名称
  2836. const fileName = row.fileName
  2837. // a标签下载
  2838. const linkNode = document.createElement('a')
  2839. // a标签的download属性规定下载文件的名称
  2840. linkNode.download = fileName
  2841. linkNode.style.display = 'none'
  2842. // 生成一个Blob URL
  2843. linkNode.href = URL.createObjectURL(blob)
  2844. document.body.appendChild(linkNode)
  2845. // 模拟在按钮上的一次鼠标单击
  2846. linkNode.click()
  2847. // 释放URL 对象
  2848. URL.revokeObjectURL(linkNode.href)
  2849. document.body.removeChild(linkNode)
  2850. })
  2851. },
  2852. // 删除文件
  2853. deleteFile (row) {
  2854. this.$confirm('确定要删除此文件?', '提示', {
  2855. confirmButtonText: '确定',
  2856. cancelButtonText: '取消',
  2857. type: 'warning'
  2858. }).then(() => {
  2859. deleteObjectFile(row).then(({data}) => {
  2860. if (data && data.code === 0) {
  2861. this.getFileContentList()
  2862. this.$message({
  2863. message: '操作成功',
  2864. type: 'success',
  2865. duration: 1500,
  2866. onClose: () => {}
  2867. })
  2868. } else {
  2869. this.$alert(data.msg, '错误', {
  2870. confirmButtonText: '确定'
  2871. })
  2872. }
  2873. })
  2874. }).catch(() => {
  2875. })
  2876. },
  2877. // 动态列开始 获取 用户保存的 格式列
  2878. async getTableUserColumn (tableId, columnId) {
  2879. let queryTableUser = {
  2880. userId: this.$store.state.user.name,
  2881. functionId: this.$route.meta.menuId,
  2882. tableId: tableId,
  2883. status: true,
  2884. languageCode: this.$i18n.locale
  2885. }
  2886. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2887. if (data.rows.length > 0) {
  2888. //this.columnList1 = []
  2889. switch (columnId) {
  2890. case 1:
  2891. this.columnList = data.rows
  2892. break;
  2893. case 2:
  2894. this.columnDetailList = data.rows
  2895. break;
  2896. // case 3:
  2897. // this.columnList2 = data.rows
  2898. // break;
  2899. // case 4:
  2900. // this.columnList3 = data.rows
  2901. // break;
  2902. }
  2903. } else {
  2904. this.getColumnList(tableId, columnId)
  2905. }
  2906. })
  2907. },
  2908. // 获取 tableDefault 列
  2909. async getColumnList (tableId, columnId) {
  2910. let queryTable = {
  2911. functionId: this.$route.meta.menuId,
  2912. tableId: tableId,
  2913. languageCode: this.$i18n.locale
  2914. }
  2915. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2916. if (!data.rows.length == 0) {
  2917. switch (columnId) {
  2918. case 1:
  2919. this.columnList = data.rows
  2920. break;
  2921. case 2:
  2922. this.columnDetailList = data.rows
  2923. break;
  2924. // case 3:
  2925. // this.columnList2 = data.rows
  2926. // break;
  2927. // case 4:
  2928. // this.columnList3 = data.rows
  2929. // break;
  2930. }
  2931. } else {
  2932. // this.showDefault = true.
  2933. }
  2934. })
  2935. },
  2936. closeDialog () {
  2937. this.partDetailData = {
  2938. partNo: '',
  2939. partDesc: '',
  2940. seqNo: '',
  2941. sku: '',
  2942. }
  2943. this.partInfoList = []
  2944. },
  2945. //获取按钮的权限数据
  2946. getButtonAuthData () {
  2947. let searchFlag = this.isAuth(this.menuId+":search")
  2948. let saveFlag = this.isAuth(this.menuId+":save")
  2949. let updateFlag = this.isAuth(this.menuId+":update")
  2950. let deleteFlag = this.isAuth(this.menuId+":delete")
  2951. let detailFlag = this.isAuth(this.menuId+":detail")
  2952. let fileFlag = this.isAuth(this.menuId+":file")
  2953. let checkoutFlag = this.isAuth(this.menuId+":checkout")
  2954. //处理页面的权限数据
  2955. this.authSearch = !searchFlag
  2956. this.authSave = !saveFlag
  2957. this.authUpdate = !updateFlag
  2958. this.authDelete = !deleteFlag
  2959. this.authDetail = !detailFlag
  2960. this.authFile = !fileFlag
  2961. this.authCheckout = !checkoutFlag
  2962. },
  2963. }
  2964. }
  2965. </script>
  2966. <style scoped>
  2967. .el-table /deep/ .cell{
  2968. height: auto;
  2969. line-height: 1.5;
  2970. }
  2971. </style>