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.

2191 lines
74 KiB

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