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

2427 lines
82 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 收藏 -->
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  9. <!-- 条件查询 -->
  10. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  11. <el-form-item :label="'BU'">
  12. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 130px">
  13. <el-option
  14. v-for = "i in userBuList"
  15. :key = "i.buNo"
  16. :label = "i.buDesc"
  17. :value = "i.buDesc">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'物料编码'">
  22. <el-input v-model="searchData.partNo" 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: 120px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'类别名称'">
  28. <el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="' '">
  31. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  32. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  33. </el-form-item>
  34. <el-form-item :label="' '">
  35. <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>
  36. <download-excel
  37. :fields="fields()"
  38. :data="exportData"
  39. type="xls"
  40. :name="exportName"
  41. :header="exportHeader"
  42. :footer="exportFooter"
  43. :fetch="createExportData"
  44. :before-generate="startDownload"
  45. :before-finish="finishDownload"
  46. worksheet="导出信息"
  47. class="el-button el-button--primary el-button--medium">
  48. {{ "导出" }}
  49. </download-excel>
  50. </el-form-item>
  51. </el-form>
  52. <!-- 展示列表 -->
  53. <el-table
  54. :height="height"
  55. :data="dataList"
  56. border
  57. style="width: 100%;">
  58. <el-table-column
  59. v-for="(item,index) in columnList" :key="index"
  60. :sortable="item.columnSortable"
  61. :prop="item.columnProp"
  62. :header-align="item.headerAlign"
  63. :show-overflow-tooltip="item.showOverflowTooltip"
  64. :align="item.align"
  65. :fixed="item.fixed === ''?false:item.fixed"
  66. :width="item.columnWidth"
  67. :label="item.columnLabel">
  68. <template slot-scope="scope">
  69. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  70. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column
  74. fixed="right"
  75. header-align="center"
  76. align="center"
  77. width="180"
  78. label="操作">
  79. <template slot-scope="scope">
  80. <a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
  81. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  82. <a v-if="!authDelete" type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a>
  83. <a v-if="!authFile" type="text" size="small" @click="sopFileList(scope.row)">SOP文件</a>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. <!-- 分页栏 -->
  88. <el-pagination
  89. @size-change="sizeChangeHandle"
  90. @current-change="currentChangeHandle"
  91. :current-page="pageIndex"
  92. :page-sizes="[20, 50, 100, 200, 500]"
  93. :page-size="pageSize"
  94. :total="totalPage"
  95. layout="total, sizes, prev, pager, next, jumper">
  96. </el-pagination>
  97. <!-- 物料属性新增/修改 -->
  98. <el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
  99. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  100. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  101. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">
  102. <el-option
  103. v-for = "i in userBuList"
  104. :key = "i.buNo"
  105. :label = "i.buNo"
  106. :value = "i.buNo">
  107. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  108. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  109. {{ i.buDesc }}
  110. </span>
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. <el-form-item style="margin-top: 23px;margin-left: 2px">
  115. <el-checkbox v-model="modalData.exemptInspection" true-label="Y">是否免检</el-checkbox><br>
  116. </el-form-item>
  117. </el-form>
  118. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  119. <el-form-item prop="partNo" :rules="rules.partNoType">
  120. <span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
  121. <span v-if="modalDisableFlag === true" slot="label">物料编码:</span>
  122. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 120px"></el-input>
  123. </el-form-item>
  124. <el-form-item label="物料名称:" prop="partDesc" :rules="rules.partDescType">
  125. <el-input v-model="modalData.partDesc" disabled style="width: 250px"></el-input>
  126. </el-form-item>
  127. </el-form>
  128. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  129. <el-form-item label="备注:">
  130. <el-input v-model="modalData.attributeRemark" style="width: 385px"></el-input>
  131. </el-form-item>
  132. <!-- <el-form-item label="是否免检">-->
  133. <!-- <input type="checkbox" value="Y" name="isExemptInspection" v-model="modalData.exemptInspection"/>-->
  134. <!-- </el-form-item>-->
  135. </el-form>
  136. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  137. <el-button type="primary" @click="saveData()">保存</el-button>
  138. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  139. </el-footer>
  140. </el-dialog>
  141. <!-- 检验模板 -->
  142. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
  143. <el-form :inline="true" label-position="top">
  144. <el-form-item :label="'物料编码'">
  145. <el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
  146. </el-form-item>
  147. <el-form-item :label="'物料名称'">
  148. <el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
  149. </el-form-item>
  150. <el-form-item :label="' '">
  151. <el-button type="primary" @click="addFastModal">新增</el-button>
  152. </el-form-item>
  153. </el-form>
  154. <!-- 检验项目展示列表 -->
  155. <div class="rq ">
  156. <el-table
  157. :height="300"
  158. :data="detailList"
  159. border
  160. style="width: 100%;">
  161. <el-table-column
  162. v-for="(item,index) in columnDetailList" :key="index"
  163. :sortable="item.columnSortable"
  164. :prop="item.columnProp"
  165. :header-align="item.headerAlign"
  166. :show-overflow-tooltip="item.showOverflowTooltip"
  167. :align="item.align"
  168. :fixed="item.fixed===''?false:item.fixed"
  169. :min-width="item.columnWidth"
  170. :label="item.columnLabel">
  171. <template slot-scope="scope">
  172. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  173. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. prop=""
  178. header-align="center"
  179. align="center"
  180. min-width="170"
  181. label="检验水平">
  182. <template slot-scope="scope">
  183. <el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  184. <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
  185. </template>
  186. </el-table-column>
  187. <el-table-column
  188. prop=""
  189. header-align="center"
  190. align="center"
  191. min-width="60"
  192. label="检验周期(h)">
  193. <template slot-scope="scope">
  194. <el-input v-model="scope.row.inspectionCycle" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  195. </template>
  196. </el-table-column>
  197. <el-table-column
  198. prop=""
  199. header-align="center"
  200. align="center"
  201. min-width="170"
  202. label="抽样方案">
  203. <template slot-scope="scope">
  204. <el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px" >·&nbsp;·&nbsp;·</el-button>
  205. <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
  206. </template>
  207. </el-table-column>
  208. <el-table-column
  209. prop=""
  210. header-align="center"
  211. align="center"
  212. min-width="60"
  213. label="AQL">
  214. <template slot-scope="scope">
  215. <el-input v-model="scope.row.aql" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  216. </template>
  217. </el-table-column>
  218. <el-table-column
  219. prop=""
  220. header-align="center"
  221. align="center"
  222. min-width="60"
  223. label="AC">
  224. <template slot-scope="scope">
  225. <el-input v-model="scope.row.ac" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  226. </template>
  227. </el-table-column>
  228. <el-table-column
  229. prop=""
  230. header-align="center"
  231. align="center"
  232. min-width="60"
  233. label="RE">
  234. <template slot-scope="scope">
  235. <el-input v-model="scope.row.re" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  236. </template>
  237. </el-table-column>
  238. <el-table-column
  239. prop="templateRemark"
  240. header-align="center"
  241. align="center"
  242. label="备注">
  243. </el-table-column>
  244. <el-table-column
  245. fixed="right"
  246. header-align="center"
  247. align="center"
  248. width="80"
  249. label="操作">
  250. <template slot-scope="scope">
  251. <a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
  252. </template>
  253. </el-table-column>
  254. </el-table>
  255. </div>
  256. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  257. <el-button type="primary" @click="saveDetail()">保存</el-button>
  258. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  259. </el-footer>
  260. </el-dialog>
  261. <!-- 检验模板->快速新增 -->
  262. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  263. <div style="font-size: 12px">
  264. <el-form :inline="true" label-position="top" :model="detailData">
  265. <el-form-item :label="'模板编码'">
  266. <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
  267. </el-form-item>
  268. <el-form-item :label="'模板名称'">
  269. <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
  270. </el-form-item>
  271. <el-form-item label="检验类型">
  272. <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType" placeholder="请选择">
  273. <el-option
  274. v-for = "i in options"
  275. :key = "i.inspectionTypeNo"
  276. :label = "i.inspectionTypeName"
  277. :value = "i.inspectionTypeNo">
  278. </el-option>
  279. </el-select>
  280. </el-form-item>
  281. <el-form-item :label="' '">
  282. <el-button type="primary" @click="checkInspectionType2">查询</el-button>
  283. </el-form-item>
  284. <el-form-item :label="' '" style="margin-left: 63px">
  285. <el-button type="primary" @click="getOperationList" 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'" style="width: 63px" >工序</el-button>
  286. <el-button type="primary" @click="getManufacturerList" v-if="this.detailData.inspectionTypeNo === '105'" style="width: 63px">供应商</el-button>
  287. <el-button type="primary" @click="getCustomerList" v-if="this.detailData.inspectionTypeNo === '109'" style="width: 63px">客户</el-button>
  288. </el-form-item>
  289. <el-form-item :label="' '" style="margin-left: 195px">
  290. <el-button type="primary" @click="getAllResourceList" 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'" style="width: 63px">机台</el-button>
  291. </el-form-item>
  292. </el-form>
  293. </div>
  294. <el-container>
  295. <el-header style="width: 1080px;height: 200px;padding: 0 0 0 0">
  296. <el-row :gutter="5">
  297. <el-col :span="span1">
  298. <span style="font-size: 12px" >可选模板:</span>
  299. <el-table
  300. height="210px"
  301. :data="itemList1"
  302. border
  303. ref="itemTable1"
  304. @row-click="itemClickRow1"
  305. @selection-change="selectionItem1"
  306. highlight-current-row
  307. style="width: 100%">
  308. <el-table-column
  309. type="selection"
  310. header-align="center"
  311. align="center"
  312. width="50">
  313. </el-table-column>
  314. <el-table-column
  315. prop="templateId"
  316. header-align="center"
  317. align="center"
  318. min-width="80"
  319. label="模板编码">
  320. </el-table-column>
  321. <el-table-column
  322. prop="templateName"
  323. header-align="center"
  324. align="left"
  325. min-width="200"
  326. label="模板名称">
  327. </el-table-column>
  328. <el-table-column
  329. prop="inspectionTypeName"
  330. header-align="center"
  331. align="center"
  332. min-width="60"
  333. label="检验类型">
  334. </el-table-column>
  335. </el-table>
  336. </el-col>
  337. <el-col v-if="detailData.inspectionTypeNo === '105' || detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '109'" :span="span2" style="margin-top: 25px">
  338. <el-table
  339. v-if="detailData.inspectionTypeNo === '105'"
  340. height="210px"
  341. :data="selectionManufacturer2"
  342. border
  343. highlight-current-row
  344. style="width: 100%">
  345. <el-table-column
  346. prop="manufacturerID"
  347. header-align="center"
  348. align="center"
  349. min-width="100"
  350. label="供应商编码">
  351. </el-table-column>
  352. <el-table-column
  353. prop="manufacturerName"
  354. header-align="center"
  355. align="left"
  356. min-width="150"
  357. label="供应商名称">
  358. </el-table-column>
  359. </el-table>
  360. <el-table
  361. v-else-if="detailData.inspectionTypeNo === '109'"
  362. height="210px"
  363. :data="selectionCustomer2"
  364. border
  365. highlight-current-row
  366. style="width: 100%">
  367. <el-table-column
  368. prop="customerID"
  369. header-align="center"
  370. align="center"
  371. min-width="100"
  372. label="客户编码">
  373. </el-table-column>
  374. <el-table-column
  375. prop="customerName"
  376. header-align="center"
  377. align="left"
  378. min-width="150"
  379. label="客户名称">
  380. </el-table-column>
  381. </el-table>
  382. <el-table
  383. v-else
  384. height="210px"
  385. :data="operationSelections"
  386. border
  387. highlight-current-row
  388. style="width: 100%">
  389. <el-table-column
  390. prop="operationDesc"
  391. header-align="center"
  392. align="center"
  393. label="工序">
  394. </el-table-column>
  395. </el-table>
  396. </el-col>
  397. <el-col v-if="this.detailData.inspectionTypeNo === '101'" :span="span3" style="margin-top: 25px">
  398. <el-table
  399. height="210px"
  400. :data="resourceSelections"
  401. border
  402. highlight-current-row
  403. style="width: 100%">
  404. <el-table-column
  405. prop="resourceId"
  406. header-align="center"
  407. align="center"
  408. min-width="100"
  409. label="机台编码">
  410. </el-table-column>
  411. <el-table-column
  412. prop="resourceDesc"
  413. header-align="center"
  414. align="left"
  415. min-width="150"
  416. label="机台名称">
  417. </el-table-column>
  418. </el-table>
  419. </el-col>
  420. </el-row>
  421. </el-header>
  422. <el-main style="width: 880px;height: 25px;margin-top: 50px;padding: 0 0 0 0;text-align:center">
  423. <div>
  424. <el-button type="primary" @click="addItem">添加<i class="el-icon-caret-bottom el-icon--right"></i></el-button>
  425. <el-button type="primary" @click="deleteItem">删除<i class="el-icon-caret-top el-icon--right"></i></el-button>
  426. </div>
  427. </el-main>
  428. <el-footer style="width: 1080px;height: 222px;padding: 0 0 0 0;margin-top: -4px">
  429. <span style="font-size: 12px" >已有模板:</span>
  430. <div class="rq">
  431. <el-table
  432. height="200px"
  433. :data="itemList2"
  434. border
  435. ref="itemTable2"
  436. @row-click="itemClickRow2"
  437. @selection-change="selectionItem2"
  438. highlight-current-row
  439. style="width: 100%">
  440. <el-table-column
  441. type="selection"
  442. header-align="center"
  443. align="center"
  444. width="50">
  445. </el-table-column>
  446. <el-table-column
  447. prop="templateId"
  448. header-align="center"
  449. align="center"
  450. min-width="80"
  451. label="模板编码">
  452. </el-table-column>
  453. <el-table-column
  454. prop="templateName"
  455. header-align="center"
  456. align="center"
  457. min-width="200"
  458. label="模板名称">
  459. </el-table-column>
  460. <el-table-column
  461. prop="operation"
  462. header-align="center"
  463. align="center"
  464. min-width="100"
  465. label="工序">
  466. </el-table-column>
  467. <el-table-column
  468. prop="resourceID"
  469. header-align="center"
  470. align="center"
  471. min-width="100"
  472. label="机台">
  473. </el-table-column>
  474. <el-table-column
  475. prop="manufacturerName"
  476. header-align="center"
  477. align="center"
  478. min-width="200"
  479. label="供应商">
  480. </el-table-column>
  481. <el-table-column
  482. prop="customerName"
  483. header-align="center"
  484. align="center"
  485. min-width="200"
  486. label="客户">
  487. </el-table-column>
  488. <el-table-column
  489. prop="inspectionTypeName"
  490. header-align="center"
  491. align="center"
  492. min-width="60"
  493. label="检验类型">
  494. </el-table-column>
  495. </el-table>
  496. </div>
  497. </el-footer>
  498. </el-container>
  499. <el-footer style="height:35px;margin-top: 18px;text-align:center">
  500. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  501. </el-footer>
  502. </el-dialog>
  503. <!-- 工序 -->
  504. <el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
  505. <div class="rq">
  506. <el-form :inline="true" label-position="top" :model="operationData">
  507. <el-form-item :label="'工序:'">
  508. <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input>
  509. </el-form-item>
  510. <el-form-item :label="' '">
  511. <el-button type="primary" @click="getOperationList2">查询</el-button>
  512. </el-form-item>
  513. </el-form>
  514. <el-table
  515. :height="300"
  516. :data="operationList"
  517. ref="operationTable"
  518. @selection-change="selectionOperationChangeHandle"
  519. @select="operationSelect"
  520. :row-key="getRowKeys"
  521. border
  522. style="width: 100%;">
  523. <el-table-column
  524. type="selection"
  525. header-align="center"
  526. align="center"
  527. :reserve-selection="true"
  528. width="50">
  529. </el-table-column>
  530. <el-table-column
  531. prop="operationDesc"
  532. header-align="center"
  533. align="center"
  534. label="工序">
  535. </el-table-column>
  536. </el-table>
  537. </div>
  538. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  539. <el-button type="primary" @click="confirmOperation">确认</el-button>
  540. </el-footer>
  541. </el-dialog>
  542. <!-- 机台 -->
  543. <el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
  544. <div class="rq">
  545. <el-form :inline="true" label-position="top" :model="resourceData">
  546. <el-form-item :label="'机台编码'">
  547. <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
  548. </el-form-item>
  549. <el-form-item :label="'机台名称'">
  550. <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input>
  551. </el-form-item>
  552. <el-form-item :label="' '">
  553. <el-button type="primary" @click="getAllResourceList2">查询</el-button>
  554. </el-form-item>
  555. </el-form>
  556. <el-table
  557. :height="300"
  558. :data="resourceList"
  559. ref="resourceTable"
  560. @selection-change="selectionResourceChangeHandle"
  561. @select="resourceSelect"
  562. :row-key="getRowKeys2"
  563. border
  564. style="width: 100%;">
  565. <el-table-column
  566. type="selection"
  567. header-align="center"
  568. align="center"
  569. :reserve-selection="true"
  570. width="50">
  571. </el-table-column>
  572. <el-table-column
  573. prop="resourceId"
  574. header-align="center"
  575. align="center"
  576. label="机台编码">
  577. </el-table-column>
  578. <el-table-column
  579. prop="resourceDesc"
  580. header-align="center"
  581. align="center"
  582. label="机台名称">
  583. </el-table-column>
  584. </el-table>
  585. </div>
  586. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  587. <el-button type="primary" @click="confirmResource">确认</el-button>
  588. </el-footer>
  589. </el-dialog>
  590. <!-- 供应商 -->
  591. <el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px">
  592. <div class="rq">
  593. <el-form :inline="true" label-position="top" :model="manufacturerData">
  594. <el-form-item :label="'供应商编码:'">
  595. <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input>
  596. </el-form-item>
  597. <el-form-item :label="'供应商名称:'">
  598. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
  599. </el-form-item>
  600. <el-form-item :label="' '">
  601. <el-button type="primary" @click="getManufacturerList2">查询</el-button>
  602. </el-form-item>
  603. </el-form>
  604. <el-table
  605. :height="300"
  606. :data="manufacturerList"
  607. ref="manufacturerTable"
  608. @row-click="manufacturerClickRow"
  609. @selection-change="selectionManufacturerChangeHandle"
  610. :row-key="getRowKeys3"
  611. border
  612. style="width: 100%;">
  613. <el-table-column
  614. type="selection"
  615. header-align="center"
  616. align="center"
  617. :reserve-selection="true"
  618. width="50">
  619. </el-table-column>
  620. <el-table-column
  621. prop="manufacturerID"
  622. header-align="center"
  623. align="center"
  624. label="供应商编码">
  625. </el-table-column>
  626. <el-table-column
  627. prop="manufacturerName"
  628. header-align="center"
  629. align="center"
  630. label="供应商名称">
  631. </el-table-column>
  632. </el-table>
  633. </div>
  634. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  635. <el-button type="primary" @click="confirmManufacturer">确认</el-button>
  636. <el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
  637. </el-footer>
  638. </el-dialog>
  639. <!-- 客户 -->
  640. <el-dialog title="客户清单" :close-on-click-modal="false" v-drag :visible.sync="customerModelFlag" width="520px">
  641. <div class="rq">
  642. <el-form :inline="true" label-position="top" :model="customerData">
  643. <el-form-item :label="'客户编码:'">
  644. <el-input v-model="customerData.customerID" clearable style="width: 120px"></el-input>
  645. </el-form-item>
  646. <el-form-item :label="'客户名称:'">
  647. <el-input v-model="customerData.customerName" clearable style="width: 120px"></el-input>
  648. </el-form-item>
  649. <el-form-item :label="' '">
  650. <el-button type="primary" @click="getCustomerList2">查询</el-button>
  651. </el-form-item>
  652. </el-form>
  653. <el-table
  654. :height="300"
  655. :data="customerList"
  656. ref="customerTable"
  657. @row-click="customerClickRow"
  658. @selection-change="selectionCustomerChangeHandle"
  659. :row-key="getRowKeys4"
  660. border
  661. style="width: 100%;">
  662. <el-table-column
  663. type="selection"
  664. header-align="center"
  665. align="center"
  666. :reserve-selection="true"
  667. width="50">
  668. </el-table-column>
  669. <el-table-column
  670. prop="customerID"
  671. header-align="center"
  672. align="center"
  673. label="客户编码">
  674. </el-table-column>
  675. <el-table-column
  676. prop="customerName"
  677. header-align="center"
  678. align="center"
  679. label="客户名称">
  680. </el-table-column>
  681. </el-table>
  682. </div>
  683. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  684. <el-button type="primary" @click="confirmCustomer">确认</el-button>
  685. <el-button type="primary" @click="customerModelFlag = false">关闭</el-button>
  686. </el-footer>
  687. </el-dialog>
  688. <!-- sop文件清单 -->
  689. <el-dialog title="SOP文件清单" :close-on-click-modal="false" v-drag :visible.sync="sopFileModelFlag" width="800px">
  690. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  691. <el-form-item :label="' '">
  692. <el-button type="primary" @click="uploadSopFile">上传文件</el-button>
  693. </el-form-item>
  694. <el-form-item label="检验类型" style="margin-left: 448px">
  695. <el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
  696. <el-option label="全部" value=""></el-option>
  697. <el-option
  698. v-for = "i in options"
  699. :key = "i.inspectionTypeNo"
  700. :label = "i.inspectionTypeName"
  701. :value = "i.inspectionTypeNo">
  702. </el-option>
  703. </el-select>
  704. </el-form-item>
  705. <el-form-item :label="' '">
  706. <el-button type="primary" @click="getFileContentList">查询</el-button>
  707. </el-form-item>
  708. </el-form>
  709. <el-table
  710. :height="350"
  711. :data="sopList"
  712. border
  713. style="width: 100%; ">
  714. <el-table-column
  715. v-for="(item,index) in sopColumnList" :key="index"
  716. :sortable="item.columnSortable"
  717. :prop="item.columnProp"
  718. :header-align="item.headerAlign"
  719. :show-overflow-tooltip="item.showOverflowTooltip"
  720. :align="item.align"
  721. :fixed="item.fixed===''?false:item.fixed"
  722. :min-width="item.columnWidth"
  723. :label="item.columnLabel">
  724. <template slot-scope="scope">
  725. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  726. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  727. </template>
  728. </el-table-column>
  729. <el-table-column
  730. fixed="right"
  731. header-align="center"
  732. align="center"
  733. width="100"
  734. label="操作">
  735. <template slot-scope="scope">
  736. <a @click="downloadFile(scope.row)">下载</a>
  737. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  738. </template>
  739. </el-table-column>
  740. </el-table>
  741. </el-dialog>
  742. <!-- 物料编码 -->
  743. <el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px">
  744. <el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
  745. <el-form-item label="物料编码">
  746. <el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
  747. </el-form-item>
  748. <el-form-item label="物料名称">
  749. <el-input v-model="partDetailData.partDesc" clearable style="width: 137px"></el-input>
  750. </el-form-item>
  751. <el-form-item label="属性标识">
  752. <el-select v-model="partDetailData.attributeFlag" clearable style="width: 137px">
  753. <el-option label="Y" value="Y"></el-option>
  754. <el-option label="N" value="N"></el-option>
  755. </el-select>
  756. </el-form-item>
  757. <el-form-item>
  758. <el-button type="primary" @click="searchPartInfo" style="margin-top: 24px">查询</el-button>
  759. </el-form-item>
  760. </el-form>
  761. <el-table
  762. :height="400"
  763. :data="partInfoList"
  764. @row-dblclick="getRowData1"
  765. border
  766. style="width: 100%;">
  767. <el-table-column
  768. prop="partNo"
  769. header-align="center"
  770. align="center"
  771. min-width="100"
  772. label="物料编码">
  773. </el-table-column>
  774. <el-table-column
  775. prop="partDesc"
  776. header-align="center"
  777. align="center"
  778. min-width="200"
  779. label="物料名称">
  780. </el-table-column>
  781. </el-table>
  782. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  783. <el-button type="primary" @click="partDisableFlag = false">关闭</el-button>
  784. </el-footer>
  785. </el-dialog>
  786. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  787. <!-- 上传sop文件的modal -->
  788. <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList" v-drag></qcSOPUploadFile>
  789. <!-- 导入 -->
  790. <qcUpload ref="qcUpload" @refreshPageTables="getDataList" v-drag></qcUpload>
  791. </div>
  792. </template>
  793. <script>
  794. import {
  795. qcPartAttributeSearch, // 查询物料属性
  796. qcPartAttributeSave, // 新增物料属性
  797. qcPartAttributeDelete, // 删除物料属性
  798. qcPartAttributeEdit, // 修改物料属性
  799. searchPartAttributeDetails, // 查询物料属性模板
  800. savePartAttributeDetails, // 新增物料属性模板
  801. deletePartAttributeDetails, // 删除物料属性模板
  802. saveAttributeDetailed, // 新增物料属性模板详情
  803. getPartTemplateLists, // 获取模板列表
  804. inspectionTypeSearch, // 搜索所有检验类型
  805. getOperationDescList, // 查询工序列表
  806. getManufacturerList, // 查询供应商列表
  807. getAllResourceList, // 查询机台列表
  808. getSiteAndBuByUserName,
  809. searchPartInfo, // 查询物料信息
  810. getCustomerList, // 查询客户列表
  811. } from "@/api/qc/qc.js"
  812. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  813. import Chooselist from '@/views/modules/common/Chooselist_eam'
  814. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  815. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  816. import {deleteObjectFile} from '@/api/eam/eam.js'
  817. import qcUpload from "./qc_upload"
  818. import qcSOPUploadFile from "./qc_SOP_upload_file"
  819. export default {
  820. components: {
  821. qcSOPUploadFile,
  822. Chooselist,
  823. qcUpload
  824. },
  825. data () {
  826. return {
  827. // 是否收藏
  828. favorite: false,
  829. // 导出 start
  830. exportData: [],
  831. exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
  832. exportHeader: ["根据物料设置检验模板"],
  833. exportFooter: [],
  834. exportList: [],
  835. // 导出 end
  836. tagNo: '',
  837. searchData: {
  838. site: '',
  839. userName: this.$store.state.user.name,
  840. partNo: '',
  841. partDesc: '',
  842. familyID: '',
  843. familyName: '',
  844. buDesc: '',
  845. attributeType: 'A',
  846. page: 1,
  847. limit: 10,
  848. },
  849. height: 200,
  850. pageIndex: 1,
  851. pageSize: 20,
  852. totalPage: 0,
  853. modalFlag: false,
  854. modalDisableFlag: false,
  855. partDisableFlag: false,
  856. modalData: {
  857. site: '',
  858. bu: '',
  859. flag: '',
  860. partNo: '',
  861. partDesc: '',
  862. familyID: '',
  863. familyName: '',
  864. umid: '',
  865. supplierNo: '',
  866. supplierDesc: '',
  867. attributeRemark: '',
  868. createTime: '',
  869. createBy: this.$store.state.user.name,
  870. attributeType: 'A',
  871. exemptInspection: ''
  872. },
  873. detailData: {
  874. site: '',
  875. buNo: '',
  876. partNo: '',
  877. attributeNo: '',
  878. partDesc: '',
  879. attributeType: 'A',
  880. inspectionTypeNo: '',
  881. templateId: '',
  882. templateName: '',
  883. createBy: this.$store.state.user.name
  884. },
  885. columnList: [
  886. {
  887. userId: this.$store.state.user.name,
  888. functionId: 301003,
  889. serialNumber: '301003Table1BuDesc',
  890. tableId: "301003Table1",
  891. tableName: "物料属性设置表",
  892. columnWidth: 100,
  893. columnProp: 'buDesc',
  894. headerAlign: "center",
  895. align: "center",
  896. columnLabel: 'BU',
  897. columnHidden: false,
  898. columnImage: false,
  899. columnSortable: false,
  900. sortLv: 0,
  901. status: true,
  902. fixed: '',
  903. },
  904. {
  905. userId: this.$store.state.user.name,
  906. functionId: 301003,
  907. serialNumber: '301003Table1PartNo',
  908. tableId: "301003Table1",
  909. tableName: "物料属性设置表",
  910. columnWidth: 146,
  911. columnProp: 'partNo',
  912. headerAlign: "center",
  913. align: "center",
  914. columnLabel: '物料编码',
  915. columnHidden: false,
  916. columnImage: false,
  917. columnSortable: false,
  918. sortLv: 0,
  919. status: true,
  920. fixed: '',
  921. },
  922. {
  923. userId: this.$store.state.user.name,
  924. functionId: 301003,
  925. serialNumber: '301003Table1PartDesc',
  926. tableId: "301003Table1",
  927. tableName: "物料属性设置表",
  928. columnWidth: 144,
  929. columnProp: 'partDesc',
  930. headerAlign: "center",
  931. align: "left",
  932. columnLabel: '物料名称',
  933. columnHidden: false,
  934. columnImage: false,
  935. columnSortable: false,
  936. sortLv: 0,
  937. status: true,
  938. fixed: '',
  939. },
  940. {
  941. userId: this.$store.state.user.name,
  942. functionId: 301003,
  943. serialNumber: '301003Table1FamilyName',
  944. tableId: "301003Table1",
  945. tableName: "物料属性设置表",
  946. columnWidth: 144,
  947. columnProp: 'familyName',
  948. headerAlign: "center",
  949. align: "center",
  950. columnLabel: '物料类别',
  951. columnHidden: false,
  952. columnImage: false,
  953. columnSortable: false,
  954. sortLv: 0,
  955. status: true,
  956. fixed: '',
  957. },
  958. {
  959. userId: this.$store.state.user.name,
  960. functionId: 301003,
  961. serialNumber: '301003Table1Umid',
  962. tableId: "301003Table1",
  963. tableName: "物料属性设置表",
  964. columnWidth: 144,
  965. columnProp: 'umid',
  966. headerAlign: "center",
  967. align: "center",
  968. columnLabel: '规格型号',
  969. columnHidden: false,
  970. columnImage: false,
  971. columnSortable: false,
  972. sortLv: 0,
  973. status: true,
  974. fixed: '',
  975. },
  976. {
  977. userId: this.$store.state.user.name,
  978. functionId: 301003,
  979. serialNumber: '301003Table1ExemptInspection',
  980. tableId: "301003Table1",
  981. tableName: "物料属性设置表",
  982. columnWidth: 144,
  983. columnProp: 'exemptInspection',
  984. headerAlign: "center",
  985. align: "center",
  986. columnLabel: '是否免检',
  987. columnHidden: false,
  988. columnImage: false,
  989. columnSortable: false,
  990. sortLv: 0,
  991. status: true,
  992. fixed: '',
  993. },
  994. {
  995. userId: this.$store.state.user.name,
  996. functionId: 301003,
  997. serialNumber: '301003Table1AttributeRemark',
  998. tableId: "301003Table1",
  999. tableName: "物料属性设置表",
  1000. columnWidth: 144,
  1001. columnProp: 'attributeRemark',
  1002. headerAlign: "center",
  1003. align: "center",
  1004. columnLabel: '备注',
  1005. columnHidden: false,
  1006. columnImage: false,
  1007. columnSortable: false,
  1008. sortLv: 0,
  1009. status: true,
  1010. fixed: '',
  1011. },
  1012. {
  1013. userId: this.$store.state.user.name,
  1014. functionId: 301003,
  1015. serialNumber: '301003Table1CreateTime',
  1016. tableId: "301003Table1",
  1017. tableName: "物料属性设置表",
  1018. columnWidth: 144,
  1019. columnProp: 'createTime',
  1020. headerAlign: "center",
  1021. align: "center",
  1022. columnLabel: '创建时间',
  1023. columnHidden: false,
  1024. columnImage: false,
  1025. columnSortable: false,
  1026. sortLv: 0,
  1027. status: true,
  1028. fixed: '',
  1029. },
  1030. {
  1031. userId: this.$store.state.user.name,
  1032. functionId: 301003,
  1033. serialNumber: '301003Table1CreateBy',
  1034. tableId: "301003Table1",
  1035. tableName: "物料属性设置表",
  1036. columnWidth: 144,
  1037. columnProp: 'createBy',
  1038. headerAlign: "center",
  1039. align: "center",
  1040. columnLabel: '创建人',
  1041. columnHidden: false,
  1042. columnImage: false,
  1043. columnSortable: false,
  1044. sortLv: 0,
  1045. status: true,
  1046. fixed: '',
  1047. },
  1048. {
  1049. userId: this.$store.state.user.name,
  1050. functionId: 301003,
  1051. serialNumber: '301003Table1UpdateDate',
  1052. tableId: "301003Table1",
  1053. tableName: "物料属性设置表",
  1054. columnWidth: 144,
  1055. columnProp: 'updateDate',
  1056. headerAlign: "center",
  1057. align: "center",
  1058. columnLabel: '更新时间',
  1059. columnHidden: false,
  1060. columnImage: false,
  1061. columnSortable: false,
  1062. sortLv: 0,
  1063. status: true,
  1064. fixed: '',
  1065. },
  1066. {
  1067. userId: this.$store.state.user.name,
  1068. functionId: 301003,
  1069. serialNumber: '301003Table1UpdateBy',
  1070. tableId: "301003Table1",
  1071. tableName: "物料属性设置表",
  1072. columnWidth: 144,
  1073. columnProp: 'updateBy',
  1074. headerAlign: "center",
  1075. align: "center",
  1076. columnLabel: '更新人',
  1077. columnHidden: false,
  1078. columnImage: false,
  1079. columnSortable: false,
  1080. sortLv: 0,
  1081. status: true,
  1082. fixed: '',
  1083. },
  1084. ],
  1085. detailModelFlag: false,
  1086. detailList: [],
  1087. dataList: [],
  1088. // 展示列集
  1089. columnDetailList: [
  1090. {
  1091. userId: this.$store.state.user.name,
  1092. functionId: 301003,
  1093. serialNumber: '301003Table2TemplateId',
  1094. tableId: "301003Table2",
  1095. tableName: "检验模板清单表",
  1096. columnWidth: 80,
  1097. columnProp: 'templateId',
  1098. headerAlign: "center",
  1099. align: "center",
  1100. columnLabel: '模板编码',
  1101. columnHidden: false,
  1102. columnImage: false,
  1103. columnSortable: false,
  1104. sortLv: 0,
  1105. status: true,
  1106. fixed: '',
  1107. },
  1108. {
  1109. userId: this.$store.state.user.name,
  1110. functionId: 301003,
  1111. serialNumber: '301003Table2TemplateName',
  1112. tableId: "301003Table2",
  1113. tableName: "检验模板清单表",
  1114. columnWidth: 137,
  1115. columnProp: 'templateName',
  1116. headerAlign: "center",
  1117. align: "center",
  1118. columnLabel: '模板名称',
  1119. columnHidden: false,
  1120. columnImage: false,
  1121. columnSortable: false,
  1122. sortLv: 0,
  1123. status: true,
  1124. fixed: '',
  1125. },
  1126. {
  1127. userId: this.$store.state.user.name,
  1128. functionId: 301003,
  1129. serialNumber: '301003Table2InspectionTypeName',
  1130. tableId: "301003Table2",
  1131. tableName: "检验模板清单表",
  1132. columnWidth: 80,
  1133. columnProp: 'inspectionTypeName',
  1134. headerAlign: "center",
  1135. align: "center",
  1136. columnLabel: '检验类型',
  1137. columnHidden: false,
  1138. columnImage: false,
  1139. columnSortable: false,
  1140. sortLv: 0,
  1141. status: true,
  1142. fixed: '',
  1143. },
  1144. {
  1145. userId: this.$store.state.user.name,
  1146. functionId: 301003,
  1147. serialNumber: '301003Table2TemplateVersion',
  1148. tableId: "301003Table2",
  1149. tableName: "检验模板清单表",
  1150. columnWidth: 80,
  1151. columnProp: 'templateVersion',
  1152. headerAlign: "center",
  1153. align: "center",
  1154. columnLabel: '版本号',
  1155. columnHidden: false,
  1156. columnImage: false,
  1157. columnSortable: false,
  1158. sortLv: 0,
  1159. status: true,
  1160. fixed: '',
  1161. },
  1162. {
  1163. userId: this.$store.state.user.name,
  1164. functionId: 301003,
  1165. serialNumber: '301003Table2DefaultSamplingQuantity',
  1166. tableId: "301003Table2",
  1167. tableName: "检验模板清单表",
  1168. columnWidth: 80,
  1169. columnProp: 'defaultSamplingQuantity',
  1170. headerAlign: "center",
  1171. align: "right",
  1172. columnLabel: '默认抽样数量',
  1173. columnHidden: false,
  1174. columnImage: false,
  1175. columnSortable: false,
  1176. sortLv: 0,
  1177. status: true,
  1178. fixed: '',
  1179. },
  1180. {
  1181. userId: this.$store.state.user.name,
  1182. functionId: 301003,
  1183. serialNumber: '301003Table2DefaultSamplingProportion',
  1184. tableId: "301003Table2",
  1185. tableName: "检验模板清单表",
  1186. columnWidth: 80,
  1187. columnProp: 'defaultSamplingProportion',
  1188. headerAlign: "center",
  1189. align: "right",
  1190. columnLabel: '默认抽样比例',
  1191. columnHidden: false,
  1192. columnImage: false,
  1193. columnSortable: false,
  1194. sortLv: 0,
  1195. status: true,
  1196. fixed: '',
  1197. },
  1198. {
  1199. userId: this.$store.state.user.name,
  1200. functionId: 301003,
  1201. serialNumber: '301003Table2OperationDesc',
  1202. tableId: "301003Table2",
  1203. tableName: "检验模板清单表",
  1204. columnWidth: 80,
  1205. columnProp: 'operation',
  1206. headerAlign: "center",
  1207. align: "left",
  1208. columnLabel: '工序',
  1209. columnHidden: false,
  1210. columnImage: false,
  1211. columnSortable: false,
  1212. sortLv: 0,
  1213. status: true,
  1214. fixed: '',
  1215. },
  1216. {
  1217. userId: this.$store.state.user.name,
  1218. functionId: 301003,
  1219. serialNumber: '301003Table2ResourceDesc',
  1220. tableId: "301003Table2",
  1221. tableName: "检验模板清单表",
  1222. columnWidth: 80,
  1223. columnProp: 'resourceID',
  1224. headerAlign: "center",
  1225. align: "left",
  1226. columnLabel: '机台',
  1227. columnHidden: false,
  1228. columnImage: false,
  1229. columnSortable: false,
  1230. sortLv: 0,
  1231. status: true,
  1232. fixed: '',
  1233. },
  1234. {
  1235. userId: this.$store.state.user.name,
  1236. functionId: 301003,
  1237. serialNumber: '301003Table2ManufacturerName',
  1238. tableId: "301003Table2",
  1239. tableName: "检验模板清单表",
  1240. columnWidth: 150,
  1241. columnProp: 'manufacturerName',
  1242. headerAlign: "center",
  1243. align: "left",
  1244. columnLabel: '供应商',
  1245. columnHidden: false,
  1246. columnImage: false,
  1247. columnSortable: false,
  1248. sortLv: 0,
  1249. status: true,
  1250. fixed: '',
  1251. },
  1252. {
  1253. userId: this.$store.state.user.name,
  1254. functionId: 301003,
  1255. serialNumber: '301003Table2CustomerName',
  1256. tableId: "301003Table2",
  1257. tableName: "检验模板清单表",
  1258. columnWidth: 150,
  1259. columnProp: 'customerName',
  1260. headerAlign: "center",
  1261. align: "left",
  1262. columnLabel: '客户',
  1263. columnHidden: false,
  1264. columnImage: false,
  1265. columnSortable: false,
  1266. sortLv: 0,
  1267. status: true,
  1268. fixed: '',
  1269. },
  1270. ],
  1271. // 快速添加
  1272. fastAddFlag: false,
  1273. itemList1: [],
  1274. itemList2: [],
  1275. itemListRow1: {},
  1276. itemListRow2: {},
  1277. tempLevelRow: '',
  1278. tempProgrammeRow: '',
  1279. options: [],
  1280. itemSelections1: [],
  1281. itemSelections2: [],
  1282. rules: {
  1283. partNoType:[
  1284. {
  1285. required: true,
  1286. message: ' ',
  1287. trigger: 'change'
  1288. }
  1289. ],
  1290. partDescType:[
  1291. {
  1292. required: true,
  1293. message: ' ',
  1294. trigger: 'change'
  1295. }
  1296. ],
  1297. bu: [
  1298. {
  1299. required: true,
  1300. message: ' ',
  1301. trigger: 'change'
  1302. }
  1303. ]
  1304. },
  1305. // 工序
  1306. operationList: [],
  1307. resourceList: [],
  1308. operationModelFlag: false,
  1309. resourceModelFlag: false,
  1310. dataListOperationSelections: [],
  1311. operationData: {
  1312. operationDesc: ''
  1313. },
  1314. resourceData: {
  1315. site: '',
  1316. resourceId: '',
  1317. resourceDesc: ''
  1318. },
  1319. // 供应商
  1320. selectionManufacturer: [],
  1321. selectionManufacturer2: [],
  1322. manufacturerList: [],
  1323. manufacturerModelFlag: false,
  1324. dataListManufacturerSelections: [],
  1325. manufacturerData: {
  1326. site: '',
  1327. manufacturerID: '',
  1328. manufacturerName: ''
  1329. },
  1330. sopData: {
  1331. site: '',
  1332. buNo: '',
  1333. partNo: '',
  1334. inspectionTypeNo: '',
  1335. inspectionTypeName: ''
  1336. },
  1337. sopList: [],
  1338. sopFileModelFlag: false,
  1339. sopColumnList: [
  1340. {
  1341. columnProp: 'fileName',
  1342. headerAlign: "center",
  1343. align: "center",
  1344. columnLabel: '文件名称',
  1345. columnHidden: false,
  1346. columnImage: false,
  1347. columnSortable: false,
  1348. sortLv: 0,
  1349. status: true,
  1350. fixed: '',
  1351. },
  1352. {
  1353. columnProp: 'createdBy',
  1354. headerAlign: "center",
  1355. align: 'center',
  1356. columnLabel: '上传人',
  1357. columnHidden: false,
  1358. columnImage: false,
  1359. columnSortable: true,
  1360. sortLv: 0,
  1361. status: true,
  1362. fixed: false
  1363. },
  1364. {
  1365. columnProp: 'createDate',
  1366. headerAlign: "center",
  1367. align: 'center',
  1368. columnLabel: '上传时间',
  1369. columnHidden: false,
  1370. columnImage: false,
  1371. columnSortable: true,
  1372. sortLv: 0,
  1373. status: true,
  1374. fixed: false
  1375. },
  1376. {
  1377. columnProp: 'orderRef3',
  1378. headerAlign: "center",
  1379. align: 'center',
  1380. columnLabel: '检验类型',
  1381. columnHidden: false,
  1382. columnImage: false,
  1383. columnSortable: true,
  1384. sortLv: 0,
  1385. status: true,
  1386. fixed: false
  1387. },
  1388. ],
  1389. userBuList: [],
  1390. partInfoList: [],
  1391. partDetailData: {
  1392. bu: '',
  1393. partNo: '',
  1394. partDesc: '',
  1395. seqNo: '',
  1396. attributeFlag: ''
  1397. },
  1398. authSearch: false,
  1399. authSave: false,
  1400. authUpdate: false,
  1401. authDelete: false,
  1402. authDetail: false,
  1403. authFile: false,
  1404. menuId: this.$route.meta.menuId,
  1405. span1: 12,
  1406. span2: 12,
  1407. span3: 12,
  1408. operationSelections: [],
  1409. resourceSelections: [],
  1410. // 客户
  1411. selectionCustomer: [],
  1412. selectionCustomer2: [],
  1413. customerList: [],
  1414. customerModelFlag: false,
  1415. dataListCustomerSelections: [],
  1416. customerData: {
  1417. site: '',
  1418. customerID: '',
  1419. customerName: ''
  1420. },
  1421. }
  1422. },
  1423. mounted () {
  1424. this.$nextTick(() => {
  1425. this.height = window.innerHeight - 210
  1426. })
  1427. },
  1428. created () {
  1429. // 按钮控制
  1430. this.getButtonAuthData()
  1431. // 获取用户的 site 和 bu
  1432. this.getSiteAndBuByUserName()
  1433. // 校验用户是否收藏
  1434. this.favoriteIsOk()
  1435. // 获取检验类型
  1436. this.inspectionTypeSearch()
  1437. // 动态列
  1438. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1439. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  1440. if (!this.authSearch) {
  1441. // 获取数据列表
  1442. this.getDataList()
  1443. }
  1444. },
  1445. methods: {
  1446. // 获取用户的bu
  1447. getSiteAndBuByUserName () {
  1448. let tempData = {
  1449. username: this.$store.state.user.name,
  1450. }
  1451. getSiteAndBuByUserName(tempData).then(({data}) => {
  1452. if (data.code === 0) {
  1453. this.userBuList = data.rows
  1454. }
  1455. })
  1456. },
  1457. searchPartInfo () {
  1458. this.partDetailData.bu = this.modalData.bu
  1459. if (!this.partDetailData.partNo && !this.partDetailData.partDesc) {
  1460. this.partInfoList = []
  1461. this.partDisableFlag = true
  1462. } else {
  1463. searchPartInfo(this.partDetailData).then(({data}) => {
  1464. if (data.code === 0) {
  1465. this.partInfoList = data.rows
  1466. this.partDisableFlag = true
  1467. } else {
  1468. this.$alert(data.msg, '错误', {
  1469. confirmButtonText: '确定'
  1470. })
  1471. }
  1472. })
  1473. }
  1474. },
  1475. // 查询检验类型
  1476. inspectionTypeSearch () {
  1477. let tempData = {
  1478. site: this.$store.state.user.site
  1479. }
  1480. inspectionTypeSearch(tempData).then(({data}) => {
  1481. if (data.code === 0) {
  1482. this.options = data.rows
  1483. }
  1484. })
  1485. },
  1486. chooseLevel (row) {
  1487. this.tempLevelRow = row
  1488. this.getBaseList(208)
  1489. },
  1490. chooseProgrammeRow (row) {
  1491. this.tempProgrammeRow = row
  1492. this.getBaseList(207)
  1493. },
  1494. // 获取基础数据列表S
  1495. getBaseList (val,type) {
  1496. this.tagNo = val
  1497. this.$nextTick(() => {
  1498. let strVal = ''
  1499. // if (val === 507) {
  1500. // strVal = this.modalData.partNo
  1501. // this.$refs.baseList.init(val, strVal)
  1502. // }
  1503. if (val === 208) {
  1504. strVal = this.tempLevelRow.samplingLevelNo
  1505. this.$refs.baseList.init(val, strVal)
  1506. }
  1507. if (val === 207) {
  1508. strVal = this.tempProgrammeRow.samplingProgrammeNo
  1509. this.$refs.baseList.init(val, strVal)
  1510. }
  1511. if (val === 1056) {
  1512. strVal = this.modalData.supplierNo
  1513. this.$refs.baseList.init(val, strVal)
  1514. }
  1515. })
  1516. },
  1517. // 列表方法的回调
  1518. getBaseData (val) {
  1519. if (this.tagNo === 507) {
  1520. this.modalData.partNo = val.part_no
  1521. this.modalData.partDesc = val.part_desc
  1522. }
  1523. if (this.tagNo === 208) {
  1524. this.tempLevelRow.samplingLevelNo = val.sampling_level_no
  1525. this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc
  1526. }
  1527. if (this.tagNo === 207) {
  1528. this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no
  1529. this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc
  1530. }
  1531. if (this.tagNo === 1056) {
  1532. this.modalData.supplierNo = val.supplier_id
  1533. this.modalData.supplierDesc = val.supplier_name
  1534. }
  1535. },
  1536. // 获取数据列表
  1537. getDataList () {
  1538. this.searchData.limit = this.pageSize
  1539. this.searchData.page = this.pageIndex
  1540. qcPartAttributeSearch(this.searchData).then(({data}) => {
  1541. if (data.code === 0) {
  1542. this.dataList = data.page.list
  1543. this.pageIndex = data.page.currPage
  1544. this.pageSize = data.page.pageSize
  1545. this.totalPage = data.page.totalCount
  1546. }
  1547. })
  1548. },
  1549. getRowData1 (row) {
  1550. this.modalData.partNo = row.partNo
  1551. this.modalData.partDesc = row.partDesc
  1552. this.partDisableFlag = false
  1553. },
  1554. // 每页数
  1555. sizeChangeHandle (val) {
  1556. this.pageSize = val
  1557. this.pageIndex = 1
  1558. this.getDataList()
  1559. },
  1560. // 当前页
  1561. currentChangeHandle (val) {
  1562. this.pageIndex = val
  1563. this.getDataList()
  1564. },
  1565. addModal () {
  1566. this.modalData = {
  1567. site: '',
  1568. bu: this.userBuList[0].buNo,
  1569. flag: '1',
  1570. partNo: '',
  1571. partDesc: '',
  1572. familyID: '',
  1573. familyName: '',
  1574. umid: '',
  1575. supplierNo: '',
  1576. supplierDesc: '',
  1577. attributeRemark: '',
  1578. createTime: '',
  1579. updateBy: this.$store.state.user.name,
  1580. createBy: this.$store.state.user.name,
  1581. attributeType: 'A',
  1582. exemptInspection: ''
  1583. }
  1584. this.modalDisableFlag = false
  1585. this.modalFlag = true
  1586. },
  1587. updateModal (row) {
  1588. this.modalData = {
  1589. site: row.site,
  1590. bu: row.site + '_' + row.buNo,
  1591. flag: '2',
  1592. partNo: row.partNo,
  1593. partDesc: row.partDesc,
  1594. familyID: row.familyID,
  1595. familyName: row.familyName,
  1596. umid: row.umid,
  1597. supplierNo: row.supplierNo,
  1598. supplierDesc: row.supplierDesc,
  1599. attributeRemark: row.attributeRemark,
  1600. updateBy: this.$store.state.user.name,
  1601. createBy: this.$store.state.user.name,
  1602. attributeType: 'A',
  1603. exemptInspection: row.exemptInspection
  1604. }
  1605. this.modalDisableFlag = true
  1606. this.modalFlag = true
  1607. },
  1608. // 删除
  1609. deletePropertiesModel (row) {
  1610. this.$confirm(`是否删除这个检验模板?`, '提示', {
  1611. confirmButtonText: '确定',
  1612. cancelButtonText: '取消',
  1613. type: 'warning'
  1614. }).then(() => {
  1615. qcPartAttributeDelete(row).then(({data}) => {
  1616. if (data && data.code === 0) {
  1617. this.getDataList()
  1618. this.$message({
  1619. message: '操作成功',
  1620. type: 'success',
  1621. duration: 1500,
  1622. onClose: () => {}
  1623. })
  1624. } else {
  1625. this.$alert(data.msg, '错误', {
  1626. confirmButtonText: '确定'
  1627. })
  1628. }
  1629. })
  1630. }).catch(() => {
  1631. })
  1632. },
  1633. saveData () {
  1634. if (this.modalData.bu === '' || this.modalData.bu == null) {
  1635. this.$message.warning('请选择BU!')
  1636. return
  1637. }
  1638. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  1639. this.$message.warning('请选择物料编码!')
  1640. return
  1641. }
  1642. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  1643. this.$message.warning('请选择物料名称!')
  1644. return
  1645. }
  1646. if (this.modalData.flag === '1') {
  1647. qcPartAttributeSave(this.modalData).then(({data}) => {
  1648. if (data && data.code === 0) {
  1649. this.getDataList()
  1650. this.modalFlag = false
  1651. this.$message({
  1652. message: '操作成功',
  1653. type: 'success',
  1654. duration: 1500,
  1655. onClose: () => {}
  1656. })
  1657. } else {
  1658. this.$alert(data.msg, '错误', {
  1659. confirmButtonText: '确定'
  1660. })
  1661. }
  1662. })
  1663. } else {
  1664. qcPartAttributeEdit(this.modalData).then(({data}) => {
  1665. if (data && data.code === 0) {
  1666. this.getDataList()
  1667. this.modalFlag = false
  1668. this.$message({
  1669. message: '操作成功',
  1670. type: 'success',
  1671. duration: 1500,
  1672. onClose: () => {}
  1673. })
  1674. } else {
  1675. this.$alert(data.msg, '错误', {
  1676. confirmButtonText: '确定'
  1677. })
  1678. }
  1679. })
  1680. }
  1681. },
  1682. // 保存属性模板
  1683. saveDetail () {
  1684. for (let i = 0; i < this.detailList.length; i++) {
  1685. this.detailList[i].updateBy = this.$store.state.user.name
  1686. saveAttributeDetailed(this.detailList[i]).then(({data}) => {
  1687. if (data && data.code === 0) {
  1688. this.getDataList()
  1689. this.detailModelFlag = false
  1690. this.$message({
  1691. message: '操作成功',
  1692. type: 'success',
  1693. duration: 1500,
  1694. onClose: () => {}
  1695. })
  1696. } else {
  1697. this.$alert(data.msg, '错误', {
  1698. confirmButtonText: '确定'
  1699. }).then(() => {
  1700. return false
  1701. })
  1702. }
  1703. })
  1704. }
  1705. },
  1706. // 打开物料模板清单
  1707. detailModal (row) {
  1708. this.detailData.site = row.site
  1709. this.detailData.buNo = row.buNo
  1710. this.detailData.partNo = row.partNo
  1711. this.detailData.attributeNo = row.partNo
  1712. this.detailData.partDesc = row.partDesc
  1713. searchPartAttributeDetails(this.detailData).then(({data}) => {
  1714. this.detailList = data.rows
  1715. })
  1716. this.detailModelFlag = true
  1717. },
  1718. checkInspectionType () {
  1719. getPartTemplateLists(this.detailData).then(({data}) => {
  1720. this.itemList1 = data.row1
  1721. this.itemList2 = data.row2
  1722. })
  1723. if (this.detailData.inspectionTypeNo === '101') {
  1724. this.span1 = 12
  1725. this.span2 = 6
  1726. this.span3 = 6
  1727. } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '109') {
  1728. this.span1 = 12
  1729. this.span2 = 12
  1730. } else {
  1731. this.span1 = 24
  1732. }
  1733. },
  1734. checkInspectionType2 () {
  1735. getPartTemplateLists(this.detailData).then(({data}) => {
  1736. this.itemList1 = data.row1
  1737. this.itemList2 = data.row2
  1738. })
  1739. },
  1740. // 快速新增
  1741. addFastModal () {
  1742. this.itemSelections1 = null
  1743. this.itemSelections2 = null
  1744. getPartTemplateLists(this.detailData).then(({data}) => {
  1745. this.itemList1 = data.row1
  1746. this.itemList2 = data.row2
  1747. })
  1748. this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  1749. this.checkInspectionType()
  1750. this.dataListOperationSelections = []
  1751. this.operationData.operationDesc = ''
  1752. this.resourceData.resourceId = ''
  1753. this.resourceData.resourceDesc = ''
  1754. this.selectionManufacturer = []
  1755. this.selectionManufacturer2 = []
  1756. this.dataListManufacturerSelections = []
  1757. this.selectionCustomer = []
  1758. this.selectionCustomer2 = []
  1759. this.dataListCustomerSelections = []
  1760. this.fastAddFlag = true
  1761. },
  1762. // 可选项目
  1763. itemClickRow1 (row) {
  1764. this.$refs.itemTable1.toggleRowSelection(row)
  1765. },
  1766. // 已有项目
  1767. itemClickRow2 (row) {
  1768. this.$refs.itemTable2.toggleRowSelection(row)
  1769. },
  1770. selectionItem1 (val) {
  1771. this.itemSelections1 = val
  1772. },
  1773. selectionItem2 (val) {
  1774. this.itemSelections2 = val
  1775. },
  1776. // 添加模板
  1777. addItem () {
  1778. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  1779. this.$message.warning('请选择可选模板!')
  1780. return
  1781. }
  1782. 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.operationSelections.length === 0)) {
  1783. this.$message.warning('请选择工序!')
  1784. return
  1785. }
  1786. 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.resourceSelections.length === 0)) {
  1787. this.$message.warning('请选择机台!')
  1788. return
  1789. }
  1790. if ((this.detailData.inspectionTypeNo === '105') && (this.selectionManufacturer == null || this.selectionManufacturer.length === 0)) {
  1791. this.$message.warning('请选择供应商!')
  1792. return
  1793. }
  1794. let inData = {
  1795. site: this.detailData.site,
  1796. buNo: this.detailData.buNo,
  1797. attributeNo: this.detailData.partNo,
  1798. itemList: this.itemSelections1,
  1799. operation: this.operationSelections.length === 0 ? '' : this.operationSelections[0].operationDesc,
  1800. resourceID: this.resourceSelections.length === 0 ? '' : this.resourceSelections[0].resourceId,
  1801. manufacturerList: this.selectionManufacturer,
  1802. customerList: this.selectionCustomer,
  1803. attributeType: this.detailData.attributeType,
  1804. inspectionTypeNo: this.detailData.inspectionTypeNo
  1805. }
  1806. savePartAttributeDetails(inData).then(({data}) => {
  1807. if (data && data.code === 0) {
  1808. getPartTemplateLists(this.detailData).then(({data}) => {
  1809. this.itemList1 = data.row1
  1810. this.itemList2 = data.row2
  1811. })
  1812. this.itemSelections1 = []
  1813. this.selectionManufacturer = []
  1814. this.selectionManufacturer2 = []
  1815. this.selectionCustomer = []
  1816. this.selectionCustomer2 = []
  1817. } else {
  1818. this.$alert(data.msg, '错误', {
  1819. confirmButtonText: '确定'
  1820. })
  1821. }
  1822. })
  1823. },
  1824. // 删除模板
  1825. deleteItem () {
  1826. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  1827. this.$message.warning('请选择已有模板!')
  1828. return
  1829. }
  1830. let inData = {
  1831. attributeNo:this.detailData.partNo,
  1832. itemList: this.itemSelections2,
  1833. attributeType: this.detailData.attributeType,
  1834. site: this.detailData.site,
  1835. buNo: this.detailData.buNo,
  1836. }
  1837. deletePartAttributeDetails(inData).then(({data}) => {
  1838. if (data && data.code === 0) {
  1839. getPartTemplateLists(this.detailData).then(({data}) => {
  1840. this.itemList1 = data.row1
  1841. this.itemList2 = data.row2
  1842. })
  1843. this.itemSelections2 = []
  1844. } else {
  1845. this.$alert(data.msg, '错误', {
  1846. confirmButtonText: '确定'
  1847. })
  1848. }
  1849. })
  1850. },
  1851. // 关闭后刷新列表
  1852. refreshDetailList () {
  1853. searchPartAttributeDetails(this.detailData).then(({data}) => {
  1854. this.detailList = data.rows
  1855. })
  1856. },
  1857. // 删除物料属性中的模板
  1858. deletePartAttributeDetails (row) {
  1859. this.$confirm(`是否删除这个检验模板?`, '提示', {
  1860. confirmButtonText: '确定',
  1861. cancelButtonText: '取消',
  1862. type: 'warning'
  1863. }).then(() => {
  1864. deletePartAttributeDetails(row).then(({data}) => {
  1865. if (data && data.code === 0) {
  1866. searchPartAttributeDetails(this.detailData).then(({data}) => {
  1867. this.detailList = data.rows
  1868. })
  1869. this.$message({
  1870. message: '操作成功',
  1871. type: 'success',
  1872. duration: 1500,
  1873. onClose: () => {}
  1874. })
  1875. } else {
  1876. this.$alert(data.msg, '错误', {
  1877. confirmButtonText: '确定'
  1878. })
  1879. }
  1880. })
  1881. }).catch(() => {
  1882. })
  1883. },
  1884. // 校验用户是否收藏
  1885. favoriteIsOk () {
  1886. let userFavorite = {
  1887. userId: this.$store.state.user.id,
  1888. languageCode: this.$i18n.locale
  1889. }
  1890. userFavoriteList(userFavorite).then(({data}) => {
  1891. for (let i = 0; i < data.list.length; i++) {
  1892. if (this.$route.meta.menuId === data.list[i].menuId) {
  1893. this.favorite = true
  1894. }
  1895. }
  1896. })
  1897. },
  1898. // 收藏 OR 取消收藏
  1899. favoriteFunction () {
  1900. let userFavorite = {
  1901. userId: this.$store.state.user.id,
  1902. functionId: this.$route.meta.menuId,
  1903. }
  1904. if (this.favorite) {
  1905. removeUserFavorite(userFavorite).then(({data}) => {
  1906. this.$message.success(data.msg)
  1907. this.favorite = false
  1908. })
  1909. } else {
  1910. // 收藏
  1911. saveUserFavorite(userFavorite).then(({data}) => {
  1912. this.$message.success(data.msg)
  1913. this.favorite = true
  1914. })
  1915. }
  1916. },
  1917. //导出excel
  1918. async createExportData() {
  1919. this.searchData.limit = -1
  1920. this.searchData.page = 1
  1921. await qcPartAttributeSearch(this.searchData).then(({data}) => {
  1922. this.exportList= data.page.list
  1923. })
  1924. return this.exportList
  1925. },
  1926. startDownload() {},
  1927. finishDownload() {},
  1928. fields () {
  1929. let json = "{"
  1930. this.columnList.forEach((item, index) => {
  1931. if (index == this.columnList.length - 1) {
  1932. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1933. } else {
  1934. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1935. }
  1936. })
  1937. json += "}"
  1938. let s = eval("(" + json + ")")
  1939. return s
  1940. },
  1941. // 导入
  1942. qcUpload () {
  1943. let currentData = {
  1944. flag: 'partAttribute',
  1945. createBy: this.$store.state.user.name,
  1946. site: this.$store.state.user.site,
  1947. }
  1948. //打开组件 去做新增业务
  1949. this.$nextTick(() => {
  1950. this.$refs.qcUpload.init(currentData)
  1951. })
  1952. },
  1953. // 获取工序列表
  1954. getOperationList () {
  1955. this.operationData.operationDesc = ''
  1956. getOperationDescList(this.operationData).then(({data}) => {
  1957. if (data && data.code === 0) {
  1958. this.operationList = data.rows
  1959. this.operationModelFlag = true
  1960. } else {
  1961. this.$alert(data.msg, '错误', {
  1962. confirmButtonText: '确定'
  1963. })
  1964. }
  1965. })
  1966. },
  1967. // 条件查询获取工序列表
  1968. getOperationList2 () {
  1969. getOperationDescList(this.operationData).then(({data}) => {
  1970. if (data && data.code === 0) {
  1971. this.operationList = data.rows
  1972. } else {
  1973. this.$alert(data.msg, '错误', {
  1974. confirmButtonText: '确定'
  1975. })
  1976. }
  1977. })
  1978. },
  1979. // 获取机台列表
  1980. getAllResourceList () {
  1981. this.resourceData.site = this.detailData.site
  1982. getAllResourceList(this.resourceData).then(({data}) => {
  1983. if (data && data.code === 0) {
  1984. this.resourceList = data.rows
  1985. this.resourceModelFlag = true
  1986. } else {
  1987. this.$alert(data.msg, '错误', {
  1988. confirmButtonText: '确定'
  1989. })
  1990. }
  1991. })
  1992. },
  1993. // 条件查询获取机台列表
  1994. getAllResourceList2 () {
  1995. this.resourceData.site = this.detailData.site
  1996. getAllResourceList(this.resourceData).then(({data}) => {
  1997. if (data && data.code === 0) {
  1998. this.resourceList = data.rows
  1999. } else {
  2000. this.$alert(data.msg, '错误', {
  2001. confirmButtonText: '确定'
  2002. })
  2003. }
  2004. })
  2005. },
  2006. getRowKeys (row) {
  2007. return row.operationDesc
  2008. },
  2009. getRowKeys2 (row) {
  2010. return row.resourceId
  2011. },
  2012. getRowKeys3 (row) {
  2013. return row.manufacturerID
  2014. },
  2015. getRowKeys4 (row) {
  2016. return row.customerID
  2017. },
  2018. // 多选工序
  2019. selectionOperationChangeHandle (val) {
  2020. this.operationSelections = val
  2021. },
  2022. operationSelect (selection, row) {
  2023. this.$refs.operationTable.clearSelection()
  2024. this.$refs.operationTable.toggleRowSelection(row, true)
  2025. },
  2026. // 多选机台
  2027. selectionResourceChangeHandle (val) {
  2028. this.resourceSelections = val
  2029. },
  2030. resourceSelect (selection, row) {
  2031. this.$refs.resourceTable.clearSelection()
  2032. this.$refs.resourceTable.toggleRowSelection(row, true)
  2033. },
  2034. // 确认选择工序
  2035. confirmOperation () {
  2036. this.operationModelFlag = false
  2037. },
  2038. // 确认选择机台
  2039. confirmResource () {
  2040. this.resourceModelFlag = false
  2041. },
  2042. // 获取供应商列表
  2043. getManufacturerList () {
  2044. this.manufacturerData.site = this.detailData.site
  2045. getManufacturerList(this.manufacturerData).then(({data}) => {
  2046. if (data && data.code === 0) {
  2047. this.manufacturerList = data.rows
  2048. // 先清空缓存选中
  2049. this.$nextTick(() => this.$refs.manufacturerTable.clearSelection())
  2050. // 拿到选中的供应商
  2051. let tempDataList = this.selectionManufacturer
  2052. this.manufacturerList.forEach(val => {
  2053. // 回显选中的供应商
  2054. if (tempDataList.includes(val.manufacturerID)) {
  2055. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  2056. }
  2057. })
  2058. this.manufacturerModelFlag = true
  2059. } else {
  2060. this.$alert(data.msg, '错误', {
  2061. confirmButtonText: '确定'
  2062. })
  2063. }
  2064. })
  2065. },
  2066. // 获取供应商列表
  2067. getManufacturerList2 () {
  2068. this.manufacturerData.site = this.detailData.site
  2069. getManufacturerList(this.manufacturerData).then(({data}) => {
  2070. if (data && data.code === 0) {
  2071. this.manufacturerList = data.rows
  2072. //拿到选中的供应商
  2073. let tempDataList = this.selectionManufacturer
  2074. this.manufacturerList.forEach(val => {
  2075. // 回显选中的供应商
  2076. if (tempDataList.includes(val.manufacturerID)) {
  2077. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  2078. }
  2079. })
  2080. } else {
  2081. this.manufacturerList = []
  2082. }
  2083. })
  2084. },
  2085. // 点击行选中复选框
  2086. manufacturerClickRow (row) {
  2087. this.$refs.manufacturerTable.toggleRowSelection(row)
  2088. },
  2089. // 多选供应商
  2090. selectionManufacturerChangeHandle (val) {
  2091. this.dataListManufacturerSelections = val
  2092. },
  2093. // 确认多选供应商
  2094. confirmManufacturer () {
  2095. this.selectionManufacturer = []
  2096. this.selectionManufacturer2 = []
  2097. for (let i = 0; i < this.dataListManufacturerSelections.length; i++) {
  2098. this.selectionManufacturer.push(this.dataListManufacturerSelections[i].manufacturerID)
  2099. this.selectionManufacturer2.push(this.dataListManufacturerSelections[i])
  2100. }
  2101. this.manufacturerModelFlag = false
  2102. },
  2103. // 获取客户列表
  2104. getCustomerList () {
  2105. this.customerData.site = this.detailData.site
  2106. getCustomerList(this.customerData).then(({data}) => {
  2107. if (data && data.code === 0) {
  2108. this.customerList = data.rows
  2109. // 先清空缓存选中
  2110. this.$nextTick(() => this.$refs.customerTable.clearSelection())
  2111. // 拿到选中的客户
  2112. let tempDataList = this.selectionCustomer
  2113. this.customerList.forEach(val => {
  2114. // 回显选中的客户
  2115. if (tempDataList.includes(val.customerID)) {
  2116. this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
  2117. }
  2118. })
  2119. this.customerModelFlag = true
  2120. } else {
  2121. this.$alert(data.msg, '错误', {
  2122. confirmButtonText: '确定'
  2123. })
  2124. }
  2125. })
  2126. },
  2127. // 获取客户列表
  2128. getCustomerList2 () {
  2129. this.customerData.site = this.detailData.site
  2130. getCustomerList(this.customerData).then(({data}) => {
  2131. if (data && data.code === 0) {
  2132. this.customerList = data.rows
  2133. //拿到选中的客户
  2134. let tempDataList = this.selectionCustomer
  2135. this.manufacturerList.forEach(val => {
  2136. // 回显选中的客户
  2137. if (tempDataList.includes(val.customerID)) {
  2138. this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
  2139. }
  2140. })
  2141. } else {
  2142. this.customerList = []
  2143. }
  2144. })
  2145. },
  2146. // 点击行选中复选框
  2147. customerClickRow (row) {
  2148. this.$refs.customerTable.toggleRowSelection(row)
  2149. },
  2150. // 多选客户
  2151. selectionCustomerChangeHandle (val) {
  2152. this.dataListCustomerSelections = val
  2153. },
  2154. // 确认多选客户
  2155. confirmCustomer () {
  2156. this.selectionCustomer = []
  2157. this.selectionCustomer2 = []
  2158. for (let i = 0; i < this.dataListCustomerSelections.length; i++) {
  2159. this.selectionCustomer.push(this.dataListCustomerSelections[i].customerID)
  2160. this.selectionCustomer2.push(this.dataListCustomerSelections[i])
  2161. }
  2162. this.customerModelFlag = false
  2163. },
  2164. // sop文件列表
  2165. sopFileList (row) {
  2166. this.sopData = {
  2167. site: row.site,
  2168. buNo: row.buNo,
  2169. partNo: row.partNo,
  2170. inspectionTypeNo: ''
  2171. }
  2172. this.getFileContentList()
  2173. },
  2174. getFileContentList () {
  2175. let tempData = {
  2176. orderRef1: this.sopData.site,
  2177. orderRef2: this.sopData.partNo,
  2178. orderRef3:this.sopData.inspectionTypeNo,
  2179. orderRef4: this.sopData.buNo,
  2180. }
  2181. getFileContentList(tempData).then(({data}) => {
  2182. if (data && data.code === 200) {
  2183. this.sopList = data.rows
  2184. } else {
  2185. this.sopList = []
  2186. }
  2187. })
  2188. this.sopFileModelFlag = true
  2189. },
  2190. // 上传sop文件模态框
  2191. uploadSopFile () {
  2192. let currentData = {
  2193. titleCon: 'SOP文件上传',
  2194. site: this.sopData.site,
  2195. buNo: this.sopData.buNo,
  2196. createBy: this.$store.state.user.name,
  2197. partNo: this.sopData.partNo,
  2198. inspectionTypeNo: '',
  2199. options: this.options,
  2200. fileType2: 'sop'
  2201. }
  2202. //打开组件 去做新增业务
  2203. this.$nextTick(() => {
  2204. this.$refs.qcSOPUploadFile.init(currentData)
  2205. })
  2206. },
  2207. // 文件下载
  2208. downloadFile (row) {
  2209. downLoadObjectFile(row).then(({data}) => {
  2210. // 不限制文件下载类型
  2211. const blob = new Blob([data], {type: "application/octet-stream"})
  2212. // 下载文件名称
  2213. const fileName = row.fileName
  2214. // a标签下载
  2215. const linkNode = document.createElement('a')
  2216. // a标签的download属性规定下载文件的名称
  2217. linkNode.download = fileName
  2218. linkNode.style.display = 'none'
  2219. // 生成一个Blob URL
  2220. linkNode.href = URL.createObjectURL(blob)
  2221. document.body.appendChild(linkNode)
  2222. // 模拟在按钮上的一次鼠标单击
  2223. linkNode.click()
  2224. // 释放URL 对象
  2225. URL.revokeObjectURL(linkNode.href)
  2226. document.body.removeChild(linkNode)
  2227. })
  2228. },
  2229. // 删除文件
  2230. deleteFile (row) {
  2231. this.$confirm('确定要删除此文件?', '提示', {
  2232. confirmButtonText: '确定',
  2233. cancelButtonText: '取消',
  2234. type: 'warning'
  2235. }).then(() => {
  2236. deleteObjectFile(row).then(({data}) => {
  2237. if (data && data.code === 0) {
  2238. this.getFileContentList()
  2239. this.$message({
  2240. message: '操作成功',
  2241. type: 'success',
  2242. duration: 1500,
  2243. onClose: () => {}
  2244. })
  2245. } else {
  2246. this.$alert(data.msg, '错误', {
  2247. confirmButtonText: '确定'
  2248. })
  2249. }
  2250. })
  2251. }).catch(() => {
  2252. })
  2253. },
  2254. // 动态列开始 获取 用户保存的 格式列
  2255. async getTableUserColumn (tableId, columnId) {
  2256. let queryTableUser = {
  2257. userId: this.$store.state.user.name,
  2258. functionId: this.$route.meta.menuId,
  2259. tableId: tableId,
  2260. status: true,
  2261. languageCode: this.$i18n.locale
  2262. }
  2263. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2264. if (data.rows.length > 0) {
  2265. //this.columnList1 = []
  2266. switch (columnId) {
  2267. case 1:
  2268. this.columnList = data.rows
  2269. break;
  2270. case 2:
  2271. this.columnDetailList = data.rows
  2272. break;
  2273. // case 3:
  2274. // this.columnList2 = data.rows
  2275. // break;
  2276. // case 4:
  2277. // this.columnList3 = data.rows
  2278. // break;
  2279. }
  2280. } else {
  2281. this.getColumnList(tableId, columnId)
  2282. }
  2283. })
  2284. },
  2285. // 获取 tableDefault 列
  2286. async getColumnList (tableId, columnId) {
  2287. let queryTable = {
  2288. functionId: this.$route.meta.menuId,
  2289. tableId: tableId,
  2290. languageCode: this.$i18n.locale
  2291. }
  2292. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2293. if (!data.rows.length == 0) {
  2294. switch (columnId) {
  2295. case 1:
  2296. this.columnList = data.rows
  2297. break;
  2298. case 2:
  2299. this.columnDetailList = data.rows
  2300. break;
  2301. // case 3:
  2302. // this.columnList2 = data.rows
  2303. // break;
  2304. // case 4:
  2305. // this.columnList3 = data.rows
  2306. // break;
  2307. }
  2308. } else {
  2309. // this.showDefault = true.
  2310. }
  2311. })
  2312. },
  2313. closeDialog () {
  2314. this.partDetailData = {
  2315. bu: '',
  2316. partNo: '',
  2317. partDesc: '',
  2318. seqNo: '',
  2319. attributeFlag: ''
  2320. }
  2321. this.partInfoList = []
  2322. },
  2323. //获取按钮的权限数据
  2324. getButtonAuthData () {
  2325. let searchFlag = this.isAuth(this.menuId+":search")
  2326. let saveFlag = this.isAuth(this.menuId+":save")
  2327. let updateFlag = this.isAuth(this.menuId+":update")
  2328. let deleteFlag = this.isAuth(this.menuId+":delete")
  2329. let detailFlag = this.isAuth(this.menuId+":detail")
  2330. let fileFlag = this.isAuth(this.menuId+":file")
  2331. //处理页面的权限数据
  2332. this.authSearch = !searchFlag
  2333. this.authSave = !saveFlag
  2334. this.authUpdate = !updateFlag
  2335. this.authDelete = !deleteFlag
  2336. this.authDetail = !detailFlag
  2337. this.authFile = !fileFlag
  2338. },
  2339. }
  2340. }
  2341. </script>