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.

2256 lines
76 KiB

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