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
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">
  7. <el-option
  8. v-for = "i in userBuList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buDesc">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'物料编码'">
  16. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'SKU'">
  19. <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'物料名称'">
  22. <el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'PN'">
  25. <el-input v-model="searchData.cinvSourceCode" clearable style="width: 120px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'类别名称'">
  28. <el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="' '">
  31. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  32. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  33. </el-form-item>
  34. <el-form-item :label="' '">
  35. <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>
  36. <download-excel
  37. :fields="fields()"
  38. :data="exportData"
  39. type="xls"
  40. :name="exportName"
  41. :header="exportHeader"
  42. :footer="exportFooter"
  43. :fetch="createExportData"
  44. :before-generate="startDownload"
  45. :before-finish="finishDownload"
  46. worksheet="导出信息"
  47. class="el-button el-button--primary el-button--medium">
  48. {{ "导出" }}
  49. </download-excel>
  50. </el-form-item>
  51. </el-form>
  52. <!-- 展示列表 -->
  53. <el-table
  54. :height="height"
  55. :data="dataList"
  56. border
  57. style="width: 100%;">
  58. <el-table-column
  59. v-for="(item,index) in columnList" :key="index"
  60. :sortable="item.columnSortable"
  61. :prop="item.columnProp"
  62. :header-align="item.headerAlign"
  63. :show-overflow-tooltip="item.showOverflowTooltip"
  64. :align="item.align"
  65. :fixed="item.fixed === ''?false:item.fixed"
  66. :min-width="item.columnWidth"
  67. :label="item.columnLabel">
  68. <template slot-scope="scope">
  69. <span v-if="!item.columnHidden">
  70. <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  71. <span v-else>
  72. {{ scope.row[item.columnProp] }}
  73. </span>
  74. </span>
  75. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column
  79. fixed="right"
  80. header-align="center"
  81. align="center"
  82. width="180"
  83. label="操作">
  84. <template slot-scope="scope">
  85. <a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
  86. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  87. <a v-if="!authDelete" type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a>
  88. <a v-if="!authFile" type="text" size="small" @click="sopFileList(scope.row)">SOP文件</a>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!-- 分页栏 -->
  93. <el-pagination
  94. @size-change="sizeChangeHandle"
  95. @current-change="currentChangeHandle"
  96. :current-page="pageIndex"
  97. :page-sizes="[20, 50, 100, 200, 500]"
  98. :page-size="pageSize"
  99. :total="totalPage"
  100. layout="total, sizes, prev, pager, next, jumper">
  101. </el-pagination>
  102. <!-- 物料属性新增/修改 -->
  103. <el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
  104. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  105. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  106. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">
  107. <el-option
  108. v-for = "i in userBuList"
  109. :key = "i.buNo"
  110. :label = "i.sitename"
  111. :value = "i.buNo">
  112. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  113. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  114. {{ i.buDesc }}
  115. </span>
  116. </el-option>
  117. </el-select>
  118. </el-form-item>
  119. <el-form-item style="margin-top: 23px;margin-left: 2px">
  120. <el-checkbox v-model="modalData.exemptInspection" true-label="Y">是否免检</el-checkbox><br>
  121. </el-form-item>
  122. </el-form>
  123. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  124. <el-form-item prop="partNo" :rules="rules.partNoType">
  125. <span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
  126. <span v-if="modalDisableFlag === true" slot="label">物料编码:</span>
  127. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 120px"></el-input>
  128. </el-form-item>
  129. <el-form-item label="物料名称:" prop="partDesc" :rules="rules.partDescType">
  130. <el-input v-model="modalData.partDesc" disabled style="width: 250px"></el-input>
  131. </el-form-item>
  132. </el-form>
  133. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  134. <el-form-item label="备注:">
  135. <el-input v-model="modalData.attributeRemark" style="width: 385px"></el-input>
  136. </el-form-item>
  137. <!-- <el-form-item label="是否免检">-->
  138. <!-- <input type="checkbox" value="Y" name="isExemptInspection" v-model="modalData.exemptInspection"/>-->
  139. <!-- </el-form-item>-->
  140. </el-form>
  141. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  142. <el-button type="primary" @click="saveData()">保存</el-button>
  143. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  144. </el-footer>
  145. </el-dialog>
  146. <!-- 检验模板 -->
  147. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
  148. <el-form :inline="true" label-position="top">
  149. <el-form-item :label="'物料编码'">
  150. <el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
  151. </el-form-item>
  152. <el-form-item :label="'物料名称'">
  153. <el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
  154. </el-form-item>
  155. <el-form-item :label="' '">
  156. <el-button type="primary" @click="addFastModal()">新增</el-button>
  157. </el-form-item>
  158. </el-form>
  159. <!-- 检验项目展示列表 -->
  160. <div class="rq ">
  161. <el-table
  162. :height="300"
  163. :data="detailList"
  164. border
  165. style="width: 100%;">
  166. <el-table-column
  167. v-for="(item,index) in columnDetailList" :key="index"
  168. :sortable="item.columnSortable"
  169. :prop="item.columnProp"
  170. :header-align="item.headerAlign"
  171. :show-overflow-tooltip="item.showOverflowTooltip"
  172. :align="item.align"
  173. :fixed="item.fixed===''?false:item.fixed"
  174. :min-width="item.columnWidth"
  175. :label="item.columnLabel">
  176. <template slot-scope="scope">
  177. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  178. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. prop=""
  183. header-align="center"
  184. align="center"
  185. min-width="170"
  186. label="检验水平">
  187. <template slot-scope="scope">
  188. <el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  189. <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
  190. </template>
  191. </el-table-column>
  192. <el-table-column
  193. prop=""
  194. header-align="center"
  195. align="center"
  196. min-width="60"
  197. label="检验周期(h)">
  198. <template slot-scope="scope">
  199. <el-input v-model="scope.row.inspectionCycle" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  200. </template>
  201. </el-table-column>
  202. <el-table-column
  203. prop=""
  204. header-align="center"
  205. align="center"
  206. min-width="170"
  207. label="抽样方案">
  208. <template slot-scope="scope">
  209. <el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px" >·&nbsp;·&nbsp;·</el-button>
  210. <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. prop=""
  215. header-align="center"
  216. align="center"
  217. min-width="60"
  218. label="AQL">
  219. <template slot-scope="scope">
  220. <el-input v-model="scope.row.aql" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  221. </template>
  222. </el-table-column>
  223. <el-table-column
  224. prop=""
  225. header-align="center"
  226. align="center"
  227. min-width="60"
  228. label="AC">
  229. <template slot-scope="scope">
  230. <el-input v-model="scope.row.ac" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. prop=""
  235. header-align="center"
  236. align="center"
  237. min-width="60"
  238. label="RE">
  239. <template slot-scope="scope">
  240. <el-input v-model="scope.row.re" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  241. </template>
  242. </el-table-column>
  243. <el-table-column
  244. prop="templateRemark"
  245. header-align="center"
  246. align="center"
  247. label="备注">
  248. </el-table-column>
  249. <el-table-column
  250. fixed="right"
  251. header-align="center"
  252. align="center"
  253. width="80"
  254. label="操作">
  255. <template slot-scope="scope">
  256. <a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
  257. </template>
  258. </el-table-column>
  259. </el-table>
  260. </div>
  261. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  262. <el-button type="primary" @click="saveDetail()">保存</el-button>
  263. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  264. </el-footer>
  265. </el-dialog>
  266. <!-- 检验模板->快速新增 -->
  267. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  268. <div style="font-size: 12px">
  269. <el-form :inline="true" label-position="top" :model="detailData">
  270. <el-form-item :label="'模板编码'">
  271. <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
  272. </el-form-item>
  273. <el-form-item :label="'模板名称'">
  274. <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
  275. </el-form-item>
  276. <el-form-item label="检验类型">
  277. <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType()" placeholder="请选择">
  278. <el-option
  279. v-for = "i in options"
  280. :key = "i.inspectionTypeNo"
  281. :label = "i.inspectionTypeName"
  282. :value = "i.inspectionTypeNo">
  283. </el-option>
  284. </el-select>
  285. </el-form-item>
  286. <el-form-item :label="' '">
  287. <el-button type="primary" @click="checkInspectionType()">查询</el-button>
  288. </el-form-item>
  289. <el-form-item style="margin-left: 117px" :label="' '">
  290. <el-button type="primary" @click="getOperationList()" style="width: 63px" v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107' || this.detailData.inspectionTypeNo === '108'">工序</el-button>
  291. <el-button type="primary" @click="getManufacturerList()" v-if="this.detailData.inspectionTypeNo === '105'" style="width: 63px">供应商</el-button>
  292. </el-form-item>
  293. <el-form-item :label="' '">
  294. <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>
  295. </el-form-item>
  296. </el-form>
  297. </div>
  298. <el-container style="margin-top: 0px;">
  299. <el-main style="width: 470px;padding: 1px">
  300. <span style="font-size: 12px" >可选模板</span>
  301. <el-table
  302. height="400px"
  303. :data="itemList1"
  304. border
  305. ref="itemTable1"
  306. @row-click="itemClickRow1"
  307. @selection-change="selectionItem1"
  308. highlight-current-row
  309. style="width: 100%">
  310. <el-table-column
  311. type="selection"
  312. header-align="center"
  313. align="center"
  314. :selectable="selectFlag"
  315. width="50">
  316. </el-table-column>
  317. <el-table-column
  318. prop="templateId"
  319. header-align="center"
  320. align="center"
  321. min-width="80"
  322. label="模板编码">
  323. </el-table-column>
  324. <el-table-column
  325. prop="templateName"
  326. header-align="center"
  327. align="center"
  328. min-width="170"
  329. label="模板名称">
  330. </el-table-column>
  331. <el-table-column
  332. prop="inspectionTypeName"
  333. header-align="center"
  334. align="center"
  335. min-width="80"
  336. label="检验类型">
  337. </el-table-column>
  338. </el-table>
  339. </el-main>
  340. <el-main style="width: 100px;padding: 1px">
  341. <div style="margin-top: 180px;margin-left: 18px">
  342. <el-button type="primary" @click="addItem()">添加>></el-button>
  343. </div>
  344. <div style="margin-top: 15px;margin-left: 18px">
  345. <el-button type="primary" @click="deleteItem()">删除<<</el-button>
  346. </div>
  347. </el-main>
  348. <el-main style="width: 470px;padding: 1px">
  349. <span style="font-size: 12px">已有模板</span>
  350. <el-table
  351. height="400px"
  352. :data="itemList2"
  353. border
  354. ref="itemTable2"
  355. @row-click="itemClickRow2"
  356. @selection-change="selectionItem2"
  357. highlight-current-row
  358. style="width: 100%">
  359. <el-table-column
  360. type="selection"
  361. header-align="center"
  362. align="center"
  363. :selectable="selectFlag"
  364. width="50">
  365. </el-table-column>
  366. <el-table-column
  367. prop="templateId"
  368. header-align="center"
  369. align="center"
  370. label="模板编码">
  371. </el-table-column>
  372. <el-table-column
  373. prop="templateName"
  374. header-align="center"
  375. align="center"
  376. label="模板名称">
  377. </el-table-column>
  378. <el-table-column
  379. prop="operation"
  380. header-align="center"
  381. align="center"
  382. label="工序">
  383. </el-table-column>
  384. <el-table-column
  385. prop="resourceID"
  386. header-align="center"
  387. align="center"
  388. label="机台">
  389. </el-table-column>
  390. <el-table-column
  391. prop="manufacturerName"
  392. header-align="center"
  393. align="center"
  394. label="供应商">
  395. </el-table-column>
  396. <el-table-column
  397. prop="inspectionTypeName"
  398. header-align="center"
  399. align="center"
  400. label="检验类型">
  401. </el-table-column>
  402. </el-table>
  403. </el-main>
  404. </el-container>
  405. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  406. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  407. </el-footer>
  408. </el-dialog>
  409. <!-- 工序 -->
  410. <el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
  411. <div class="rq">
  412. <el-form :inline="true" label-position="top" :model="operationData">
  413. <el-form-item :label="'工序:'">
  414. <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input>
  415. </el-form-item>
  416. <el-form-item :label="' '">
  417. <el-button type="primary" @click="getOperationList2()">查询</el-button>
  418. </el-form-item>
  419. </el-form>
  420. <el-table
  421. :height="300"
  422. :data="operationList"
  423. ref="operationTable"
  424. @row-click="operationClickRow"
  425. @selection-change="selectionOperationChangeHandle"
  426. border
  427. :row-class-name="operationRowClassName"
  428. style="width: 100%;">
  429. <el-table-column type="index" width="50" align="center">
  430. <template slot-scope="scope">
  431. <el-radio v-model="operationCurrent" :label="scope.row.index">{{''}}</el-radio>
  432. </template>
  433. </el-table-column>
  434. <el-table-column
  435. prop="operationDesc"
  436. header-align="center"
  437. align="center"
  438. label="工序">
  439. </el-table-column>
  440. </el-table>
  441. </div>
  442. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  443. <el-button type="primary" @click="confirmOperation()">确认</el-button>
  444. </el-footer>
  445. </el-dialog>
  446. <!-- 机台 -->
  447. <el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
  448. <div class="rq">
  449. <el-form :inline="true" label-position="top" :model="resourceData">
  450. <el-form-item :label="'机台编码'">
  451. <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
  452. </el-form-item>
  453. <el-form-item :label="'机台名称'">
  454. <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input>
  455. </el-form-item>
  456. <el-form-item :label="' '">
  457. <el-button type="primary" @click="getAllResourceList2()">查询</el-button>
  458. </el-form-item>
  459. </el-form>
  460. <el-table
  461. :height="300"
  462. :data="resourceList"
  463. ref="resourceTable"
  464. @row-click="resourceClickRow"
  465. @selection-change="selectionResourceChangeHandle"
  466. border
  467. :row-class-name="resourceRowClassName"
  468. style="width: 100%;">
  469. <el-table-column type="index" width="50" align="center">
  470. <template slot-scope="scope">
  471. <el-radio v-model="resourceCurrent" :label="scope.row.index">{{''}}</el-radio>
  472. </template>
  473. </el-table-column>
  474. <el-table-column
  475. prop="resourceId"
  476. header-align="center"
  477. align="center"
  478. label="机台编码">
  479. </el-table-column>
  480. <el-table-column
  481. prop="resourceDesc"
  482. header-align="center"
  483. align="center"
  484. label="机台名称">
  485. </el-table-column>
  486. </el-table>
  487. </div>
  488. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  489. <el-button type="primary" @click="confirmResource()">确认</el-button>
  490. </el-footer>
  491. </el-dialog>
  492. <!-- 供应商 -->
  493. <el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px">
  494. <div class="rq">
  495. <el-form :inline="true" label-position="top" :model="manufacturerData">
  496. <el-form-item :label="'供应商编码:'">
  497. <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input>
  498. </el-form-item>
  499. <el-form-item :label="'供应商名称:'">
  500. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
  501. </el-form-item>
  502. <el-form-item :label="' '">
  503. <el-button type="primary" @click="getManufacturerList()">查询</el-button>
  504. </el-form-item>
  505. </el-form>
  506. <el-table
  507. :height="300"
  508. :data="manufacturerList"
  509. ref="manufacturerTable"
  510. @row-click="manufacturerClickRow"
  511. @selection-change="selectionManufacturerChangeHandle"
  512. border
  513. style="width: 100%;">
  514. <el-table-column
  515. type="selection"
  516. header-align="center"
  517. align="center"
  518. :selectable="selectFlag"
  519. width="50">
  520. </el-table-column>
  521. <el-table-column
  522. prop="manufacturerID"
  523. header-align="center"
  524. align="center"
  525. label="供应商编码">
  526. </el-table-column>
  527. <el-table-column
  528. prop="manufacturerName"
  529. header-align="center"
  530. align="center"
  531. label="供应商名称">
  532. </el-table-column>
  533. </el-table>
  534. </div>
  535. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  536. <el-button type="primary" @click="confirmManufacturer()">确认</el-button>
  537. <el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
  538. </el-footer>
  539. </el-dialog>
  540. <!-- sop文件清单 -->
  541. <el-dialog title="SOP文件清单" :close-on-click-modal="false" v-drag :visible.sync="sopFileModelFlag" width="800px">
  542. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  543. <el-form-item :label="' '">
  544. <el-button type="primary" @click="uploadSopFile">上传文件</el-button>
  545. </el-form-item>
  546. <el-form-item label="检验类型" style="margin-left: 448px">
  547. <el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
  548. <el-option label="全部" value=""></el-option>
  549. <el-option
  550. v-for = "i in options"
  551. :key = "i.inspectionTypeNo"
  552. :label = "i.inspectionTypeName"
  553. :value = "i.inspectionTypeNo">
  554. </el-option>
  555. </el-select>
  556. </el-form-item>
  557. <el-form-item :label="' '">
  558. <el-button type="primary" @click="getFileContentList">查询</el-button>
  559. </el-form-item>
  560. </el-form>
  561. <el-table
  562. :height="350"
  563. :data="sopList"
  564. border
  565. style="width: 100%; ">
  566. <el-table-column
  567. v-for="(item,index) in sopColumnList" :key="index"
  568. :sortable="item.columnSortable"
  569. :prop="item.columnProp"
  570. :header-align="item.headerAlign"
  571. :show-overflow-tooltip="item.showOverflowTooltip"
  572. :align="item.align"
  573. :fixed="item.fixed===''?false:item.fixed"
  574. :min-width="item.columnWidth"
  575. :label="item.columnLabel">
  576. <template slot-scope="scope">
  577. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  578. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  579. </template>
  580. </el-table-column>
  581. <el-table-column
  582. fixed="right"
  583. header-align="center"
  584. align="center"
  585. width="100"
  586. label="操作">
  587. <template slot-scope="scope">
  588. <a @click="downloadFile(scope.row)">下载</a>
  589. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  590. </template>
  591. </el-table-column>
  592. </el-table>
  593. </el-dialog>
  594. <!-- 物料编码 -->
  595. <el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px">
  596. <el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
  597. <el-form-item label="物料编码">
  598. <el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
  599. </el-form-item>
  600. <el-form-item label="物料名称">
  601. <el-input v-model="partDetailData.partDesc" clearable style="width: 137px"></el-input>
  602. </el-form-item>
  603. <el-form-item label="SKU">
  604. <el-input v-model="partDetailData.sku" clearable style="width: 100px"></el-input>
  605. </el-form-item>
  606. <el-form-item label="PN">
  607. <el-input v-model="partDetailData.cinvSourceCode" clearable style="width: 100px"></el-input>
  608. </el-form-item>
  609. <el-form-item>
  610. <el-button type="primary" @click="searchPartInfo()" style="margin-top: 24px">查询</el-button>
  611. </el-form-item>
  612. </el-form>
  613. <el-table
  614. :height="400"
  615. :data="partInfoList"
  616. @row-dblclick="getRowData1"
  617. border
  618. v-loading="dataListLoading"
  619. style="width: 100%;">
  620. <el-table-column
  621. prop="partNo"
  622. header-align="center"
  623. align="center"
  624. label="物料编码">
  625. </el-table-column>
  626. <el-table-column
  627. prop="partDesc"
  628. header-align="center"
  629. align="center"
  630. label="物料名称">
  631. </el-table-column>
  632. <el-table-column
  633. prop="sku"
  634. header-align="center"
  635. align="center"
  636. label="SKU">
  637. </el-table-column>
  638. <el-table-column
  639. prop="cinvSourceCode"
  640. header-align="center"
  641. align="center"
  642. label="PN">
  643. </el-table-column>
  644. </el-table>
  645. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  646. <el-button type="primary" @click="partDisableFlag = false">关闭</el-button>
  647. </el-footer>
  648. </el-dialog>
  649. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  650. <!-- 上传sop文件的modal -->
  651. <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
  652. <!-- 导入 -->
  653. <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
  654. </div>
  655. </template>
  656. <script>
  657. import {
  658. qcPartAttributeSearch, // 查询物料属性
  659. qcPartAttributeSave, // 新增物料属性
  660. qcPartAttributeDelete, // 删除物料属性
  661. qcPartAttributeEdit, // 修改物料属性
  662. searchPartAttributeDetails, // 查询物料属性模板
  663. savePartAttributeDetails, // 新增物料属性模板
  664. deletePartAttributeDetails, // 删除物料属性模板
  665. saveAttributeDetailed, // 新增物料属性模板详情
  666. getPartTemplateLists, // 获取模板列表
  667. inspectionTypeSearch, // 搜索所有检验类型
  668. getOperationDescList, // 查询工序列表
  669. getManufacturerList, // 查询供应商列表
  670. getAllResourceList, // 查询机台列表
  671. getSiteAndBuByUserName,
  672. searchPartInfo, // 查询物料信息
  673. } from "@/api/qc/qc.js"
  674. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  675. import Chooselist from '@/views/modules/common/Chooselist_eam'
  676. import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  677. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  678. import {deleteObjectFile} from '@/api/eam/eam.js'
  679. import qcUpload from "./qc_upload"
  680. import qcSOPUploadFile from "./qc_SOP_upload_file"
  681. export default {
  682. components: {
  683. qcSOPUploadFile,
  684. Chooselist,
  685. qcUpload
  686. },
  687. data () {
  688. return {
  689. columnsProp:['createBy', 'updateBy'],
  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: '301003Table2Operation',
  1126. tableId: "301003Table2",
  1127. tableName: "检验模板清单表",
  1128. columnProp: 'operation',
  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: '301003Table2ResourceID',
  1144. tableId: "301003Table2",
  1145. tableName: "检验模板清单表",
  1146. columnProp: 'resourceID',
  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: ['blur','change']
  1194. }
  1195. ],
  1196. partDescType:[
  1197. {
  1198. required: true,
  1199. message: ' ',
  1200. trigger: ['blur','change']
  1201. }
  1202. ],
  1203. bu: [
  1204. {
  1205. required: true,
  1206. message: ' ',
  1207. trigger: ['blur','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 - 180
  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. this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
  1627. getPartTemplateLists(this.detailData).then(({data}) => {
  1628. this.operation = ''
  1629. this.resourceId = ''
  1630. this.itemList1 = data.row1
  1631. this.itemList2 = data.row2
  1632. })
  1633. },
  1634. // 快速新增
  1635. addFastModal () {
  1636. this.itemSelections1 = null
  1637. this.itemSelections2 = null
  1638. getPartTemplateLists(this.detailData).then(({data}) => {
  1639. this.itemList1 = data.row1
  1640. this.itemList2 = data.row2
  1641. })
  1642. this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  1643. this.checkInspectionType()
  1644. this.dataListOperationSelections = []
  1645. this.operation = ''
  1646. this.resourceId = ''
  1647. this.operationData.operationDesc = ''
  1648. this.resourceData.resourceId = ''
  1649. this.resourceData.resourceDesc = ''
  1650. this.operationCurrent = -1
  1651. this.resourceCurrent = -1
  1652. this.selectionManufacturer = []
  1653. this.dataListManufacturerSelections = []
  1654. this.fastAddFlag = true
  1655. },
  1656. // 可选项目
  1657. itemClickRow1 (row) {
  1658. this.$refs.itemTable1.toggleRowSelection(row)
  1659. },
  1660. // 已有项目
  1661. itemClickRow2 (row) {
  1662. this.$refs.itemTable2.toggleRowSelection(row)
  1663. },
  1664. selectFlag () {
  1665. return true
  1666. },
  1667. selectionItem1 (val) {
  1668. this.itemSelections1 = val
  1669. },
  1670. selectionItem2 (val) {
  1671. this.itemSelections2 = val
  1672. },
  1673. // 添加模板
  1674. addItem () {
  1675. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  1676. this.$message.warning('请选择可选模板!')
  1677. return
  1678. }
  1679. if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107' || this.detailData.inspectionTypeNo === '108') && (this.operation == null || this.operation === '')) {
  1680. this.$message.warning('请选择工序!')
  1681. return
  1682. }
  1683. 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 === '')) {
  1684. this.$message.warning('请选择机台!')
  1685. return
  1686. }
  1687. if ((this.detailData.inspectionTypeNo === '105') && (this.selectionManufacturer == null || this.selectionManufacturer.length === 0)) {
  1688. this.$message.warning('请选择供应商!')
  1689. return
  1690. }
  1691. let inData = {
  1692. site: this.detailData.site,
  1693. buNo: this.detailData.buNo,
  1694. attributeNo: this.detailData.partNo,
  1695. itemList: this.itemSelections1,
  1696. operation: this.operation,
  1697. resourceID: this.resourceId,
  1698. manufacturerList: this.selectionManufacturer,
  1699. attributeType: this.detailData.attributeType,
  1700. inspectionTypeNo: this.detailData.inspectionTypeNo
  1701. }
  1702. savePartAttributeDetails(inData).then(({data}) => {
  1703. if (data && data.code === 0) {
  1704. getPartTemplateLists(this.detailData).then(({data}) => {
  1705. this.itemList1 = data.row1
  1706. this.itemList2 = data.row2
  1707. })
  1708. this.itemSelections1 = []
  1709. this.operation = ''
  1710. this.resourceId = ''
  1711. this.selectionManufacturer = []
  1712. } else {
  1713. this.$alert(data.msg, '错误', {
  1714. confirmButtonText: '确定'
  1715. })
  1716. }
  1717. })
  1718. },
  1719. // 删除模板
  1720. deleteItem () {
  1721. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  1722. this.$message.warning('请选择已有模板!')
  1723. return
  1724. }
  1725. let inData = {
  1726. attributeNo:this.detailData.partNo,
  1727. itemList: this.itemSelections2,
  1728. attributeType: this.detailData.attributeType,
  1729. site: this.detailData.site,
  1730. buNo: this.detailData.buNo,
  1731. }
  1732. deletePartAttributeDetails(inData).then(({data}) => {
  1733. if (data && data.code === 0) {
  1734. getPartTemplateLists(this.detailData).then(({data}) => {
  1735. this.itemList1 = data.row1
  1736. this.itemList2 = data.row2
  1737. })
  1738. this.itemSelections2 = []
  1739. } else {
  1740. this.$alert(data.msg, '错误', {
  1741. confirmButtonText: '确定'
  1742. })
  1743. }
  1744. })
  1745. },
  1746. // 关闭后刷新列表
  1747. refreshDetailList () {
  1748. searchPartAttributeDetails(this.detailData).then(({data}) => {
  1749. this.detailList = data.rows
  1750. })
  1751. },
  1752. // 删除物料属性中的模板
  1753. deletePartAttributeDetails (row) {
  1754. this.$confirm(`是否删除这个检验模板?`, '提示', {
  1755. confirmButtonText: '确定',
  1756. cancelButtonText: '取消',
  1757. type: 'warning'
  1758. }).then(() => {
  1759. deletePartAttributeDetails(row).then(({data}) => {
  1760. if (data && data.code === 0) {
  1761. searchPartAttributeDetails(this.detailData).then(({data}) => {
  1762. this.detailList = data.rows
  1763. })
  1764. this.$message({
  1765. message: '操作成功',
  1766. type: 'success',
  1767. duration: 1500,
  1768. onClose: () => {}
  1769. })
  1770. } else {
  1771. this.$alert(data.msg, '错误', {
  1772. confirmButtonText: '确定'
  1773. })
  1774. }
  1775. })
  1776. }).catch(() => {
  1777. })
  1778. },
  1779. // 校验用户是否收藏
  1780. favoriteIsOk () {
  1781. let userFavorite = {
  1782. userId: this.$store.state.user.id,
  1783. languageCode: this.$i18n.locale
  1784. }
  1785. userFavoriteList(userFavorite).then(({data}) => {
  1786. for (let i = 0; i < data.list.length; i++) {
  1787. if (this.$route.meta.menuId === data.list[i].menuId) {
  1788. this.favorite = true
  1789. }
  1790. }
  1791. })
  1792. },
  1793. // 收藏 OR 取消收藏
  1794. favoriteFunction () {
  1795. let userFavorite = {
  1796. userId: this.$store.state.user.id,
  1797. functionId: this.$route.meta.menuId,
  1798. }
  1799. if (this.favorite) {
  1800. removeUserFavorite(userFavorite).then(({data}) => {
  1801. this.$message.success(data.msg)
  1802. this.favorite = false
  1803. })
  1804. } else {
  1805. // 收藏
  1806. saveUserFavorite(userFavorite).then(({data}) => {
  1807. this.$message.success(data.msg)
  1808. this.favorite = true
  1809. })
  1810. }
  1811. },
  1812. //导出excel
  1813. async createExportData() {
  1814. this.searchData.limit = -1
  1815. this.searchData.page = 1
  1816. await qcPartAttributeSearch(this.searchData).then(({data}) => {
  1817. this.exportList= data.page.list
  1818. })
  1819. return this.exportList
  1820. },
  1821. startDownload() {},
  1822. finishDownload() {},
  1823. fields () {
  1824. let json = "{"
  1825. this.columnList.forEach((item, index) => {
  1826. if (index == this.columnList.length - 1) {
  1827. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1828. } else {
  1829. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1830. }
  1831. })
  1832. json += "}"
  1833. let s = eval("(" + json + ")")
  1834. return s
  1835. },
  1836. // 导入
  1837. qcUpload () {
  1838. let currentData = {
  1839. flag: 'partAttribute',
  1840. createBy: this.$store.state.user.name,
  1841. site: this.$store.state.user.site,
  1842. }
  1843. //打开组件 去做新增业务
  1844. this.$nextTick(() => {
  1845. this.$refs.qcUpload.init(currentData)
  1846. })
  1847. },
  1848. // 获取工序列表
  1849. getOperationList () {
  1850. this.$message.success(this.operationData)
  1851. getOperationDescList(this.operationData).then(({data}) => {
  1852. if (data && data.code === 0) {
  1853. this.operationList = data.rows
  1854. // // 回显数据
  1855. // // 先清空缓存选中
  1856. // this.$nextTick(() => this.$refs.operationTable.clearSelection())
  1857. // // 拿到选中的工序
  1858. // let tempDataList = this.operationDesc
  1859. // this.operationList.forEach(val => {
  1860. // // 回显选中的工序
  1861. // if (tempDataList === val.operationDesc) {
  1862. // this.$nextTick(() => this.$refs.operationTable.toggleRowSelection(val, true))
  1863. // }
  1864. // })
  1865. this.operationModelFlag = true
  1866. } else {
  1867. this.$alert(data.msg, '错误', {
  1868. confirmButtonText: '确定'
  1869. })
  1870. }
  1871. })
  1872. },
  1873. // 获取机台列表
  1874. getAllResourceList () {
  1875. this.resourceData.site = this.detailData.site
  1876. getAllResourceList(this.resourceData).then(({data}) => {
  1877. if (data && data.code === 0) {
  1878. this.resourceList = data.rows
  1879. this.resourceModelFlag = true
  1880. } else {
  1881. this.$alert(data.msg, '错误', {
  1882. confirmButtonText: '确定'
  1883. })
  1884. }
  1885. })
  1886. },
  1887. // 条件查询获取工序列表
  1888. getOperationList2 () {
  1889. getOperationDescList(this.operationData).then(({data}) => {
  1890. if (data && data.code === 0) {
  1891. this.operationList = data.rows
  1892. this.operationCurrent = -1
  1893. } else {
  1894. this.$alert(data.msg, '错误', {
  1895. confirmButtonText: '确定'
  1896. })
  1897. }
  1898. })
  1899. },
  1900. // 条件查询获取机台列表
  1901. getAllResourceList2 () {
  1902. this.resourceData.site = this.detailData.site
  1903. getAllResourceList(this.resourceData).then(({data}) => {
  1904. if (data && data.code === 0) {
  1905. this.resourceList = data.rows
  1906. this.resourceCurrent = -1
  1907. } else {
  1908. this.$alert(data.msg, '错误', {
  1909. confirmButtonText: '确定'
  1910. })
  1911. }
  1912. })
  1913. },
  1914. // 点击行选中工序复选框
  1915. operationClickRow (row) {
  1916. this.$refs.operationTable.toggleRowSelection(row)
  1917. },
  1918. // 点击行选中机台复选框
  1919. resourceClickRow (row) {
  1920. this.$refs.resourceTable.toggleRowSelection(row)
  1921. },
  1922. // 多选工序
  1923. selectionOperationChangeHandle (val) {
  1924. this.operation = val[0].operationDesc
  1925. if (val) {
  1926. this.operationCurrent = val.index
  1927. }
  1928. },
  1929. // 多选机台
  1930. selectionResourceChangeHandle (val) {
  1931. this.resourceId = val[0].resourceId
  1932. if (val) {
  1933. this.resourceCurrent = val.index
  1934. }
  1935. },
  1936. operationRowClassName ({row, rowIndex}) {
  1937. row.index = rowIndex // 在原有的数据上加一个index
  1938. },
  1939. resourceRowClassName ({row, rowIndex}) {
  1940. row.index = rowIndex // 在原有的数据上加一个index
  1941. },
  1942. // // 单选
  1943. // clickChange (row) {
  1944. // this.radioOperation = row.operationDesc
  1945. // },
  1946. // 确认选择工序
  1947. confirmOperation () {
  1948. //this.operationDesc = ''
  1949. // this.operationDesc = this.radioOperation
  1950. // this.radioOperation = ''
  1951. // for (let i = 0; i < this.dataListOperationSelections.length; i++) {
  1952. // this.selectionOperation.push(this.dataListOperationSelections[i].operationDesc)
  1953. // }
  1954. this.operationModelFlag = false
  1955. },
  1956. // 确认选择工序
  1957. confirmResource () {
  1958. this.resourceModelFlag = false
  1959. },
  1960. // 获取供应商列表
  1961. getManufacturerList () {
  1962. this.manufacturerData.site = this.detailData.site
  1963. getManufacturerList(this.manufacturerData).then(({data}) => {
  1964. if (data && data.code === 0) {
  1965. this.manufacturerList = data.rows
  1966. // 回显数据
  1967. // 先清空缓存选中
  1968. this.$nextTick(() => this.$refs.manufacturerTable.clearSelection())
  1969. // 拿到选中的供应商
  1970. let tempDataList = this.selectionManufacturer
  1971. this.manufacturerList.forEach(val => {
  1972. // 回显选中的供应商
  1973. if (tempDataList.includes(val.manufacturerID)) {
  1974. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  1975. }
  1976. })
  1977. this.manufacturerModelFlag = true
  1978. } else {
  1979. this.$alert(data.msg, '错误', {
  1980. confirmButtonText: '确定'
  1981. })
  1982. }
  1983. })
  1984. },
  1985. // 点击行选中复选框
  1986. manufacturerClickRow (row) {
  1987. this.$refs.manufacturerTable.toggleRowSelection(row)
  1988. },
  1989. // 多选
  1990. selectionManufacturerChangeHandle (val) {
  1991. this.dataListManufacturerSelections = val
  1992. },
  1993. // 确认多选供应商
  1994. confirmManufacturer () {
  1995. this.selectionManufacturer = []
  1996. for (let i = 0; i < this.dataListManufacturerSelections.length; i++) {
  1997. this.selectionManufacturer.push(this.dataListManufacturerSelections[i].manufacturerID)
  1998. }
  1999. this.manufacturerModelFlag = false
  2000. },
  2001. // sop文件列表
  2002. sopFileList (row) {
  2003. this.sopData = {
  2004. site: row.site,
  2005. buNo: row.buNo,
  2006. partNo: row.partNo,
  2007. inspectionTypeNo: ''
  2008. }
  2009. this.getFileContentList()
  2010. },
  2011. getFileContentList () {
  2012. let tempData = {
  2013. orderRef1: this.sopData.site,
  2014. orderRef2: this.sopData.partNo,
  2015. orderRef3:this.sopData.inspectionTypeNo,
  2016. orderRef4: this.sopData.buNo,
  2017. }
  2018. getFileContentList(tempData).then(({data}) => {
  2019. if (data && data.code === 200) {
  2020. this.sopList = data.rows
  2021. } else {
  2022. this.sopList = []
  2023. }
  2024. })
  2025. this.sopFileModelFlag = true
  2026. },
  2027. // 上传sop文件模态框
  2028. uploadSopFile () {
  2029. let currentData = {
  2030. titleCon: 'SOP文件上传',
  2031. site: this.sopData.site,
  2032. buNo: this.sopData.buNo,
  2033. createBy: this.$store.state.user.name,
  2034. partNo: this.sopData.partNo,
  2035. inspectionTypeNo: '',
  2036. options: this.options
  2037. }
  2038. //打开组件 去做新增业务
  2039. this.$nextTick(() => {
  2040. this.$refs.qcSOPUploadFile.init(currentData)
  2041. })
  2042. },
  2043. // 文件下载
  2044. downloadFile (row) {
  2045. downLoadObjectFile(row).then(({data}) => {
  2046. // 不限制文件下载类型
  2047. const blob = new Blob([data], {type: "application/octet-stream"})
  2048. // 下载文件名称
  2049. const fileName = row.fileName
  2050. // a标签下载
  2051. const linkNode = document.createElement('a')
  2052. // a标签的download属性规定下载文件的名称
  2053. linkNode.download = fileName
  2054. linkNode.style.display = 'none'
  2055. // 生成一个Blob URL
  2056. linkNode.href = URL.createObjectURL(blob)
  2057. document.body.appendChild(linkNode)
  2058. // 模拟在按钮上的一次鼠标单击
  2059. linkNode.click()
  2060. // 释放URL 对象
  2061. URL.revokeObjectURL(linkNode.href)
  2062. document.body.removeChild(linkNode)
  2063. })
  2064. },
  2065. // 删除文件
  2066. deleteFile (row) {
  2067. this.$confirm('确定要删除此文件?', '提示', {
  2068. confirmButtonText: '确定',
  2069. cancelButtonText: '取消',
  2070. type: 'warning'
  2071. }).then(() => {
  2072. deleteObjectFile(row).then(({data}) => {
  2073. if (data && data.code === 0) {
  2074. this.getFileContentList()
  2075. this.$message({
  2076. message: '操作成功',
  2077. type: 'success',
  2078. duration: 1500,
  2079. onClose: () => {}
  2080. })
  2081. } else {
  2082. this.$alert(data.msg, '错误', {
  2083. confirmButtonText: '确定'
  2084. })
  2085. }
  2086. })
  2087. }).catch(() => {
  2088. })
  2089. },
  2090. // 动态列开始 获取 用户保存的 格式列
  2091. async getTableUserColumn (tableId, columnId) {
  2092. let queryTableUser = {
  2093. userId: this.$store.state.user.name,
  2094. functionId: this.$route.meta.menuId,
  2095. tableId: tableId,
  2096. status: true,
  2097. languageCode: this.$i18n.locale
  2098. }
  2099. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2100. if (data.rows.length > 0) {
  2101. //this.columnList1 = []
  2102. switch (columnId) {
  2103. case 1:
  2104. this.columnList = data.rows
  2105. break;
  2106. case 2:
  2107. this.columnDetailList = data.rows
  2108. break;
  2109. // case 3:
  2110. // this.columnList2 = data.rows
  2111. // break;
  2112. // case 4:
  2113. // this.columnList3 = data.rows
  2114. // break;
  2115. }
  2116. } else {
  2117. this.getColumnList(tableId, columnId)
  2118. }
  2119. })
  2120. },
  2121. // 获取 tableDefault 列
  2122. async getColumnList (tableId, columnId) {
  2123. let queryTable = {
  2124. functionId: this.$route.meta.menuId,
  2125. tableId: tableId,
  2126. languageCode: this.$i18n.locale
  2127. }
  2128. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2129. if (!data.rows.length == 0) {
  2130. switch (columnId) {
  2131. case 1:
  2132. this.columnList = data.rows
  2133. break;
  2134. case 2:
  2135. this.columnDetailList = data.rows
  2136. break;
  2137. // case 3:
  2138. // this.columnList2 = data.rows
  2139. // break;
  2140. // case 4:
  2141. // this.columnList3 = data.rows
  2142. // break;
  2143. }
  2144. } else {
  2145. // this.showDefault = true.
  2146. }
  2147. })
  2148. },
  2149. closeDialog () {
  2150. this.partDetailData = {
  2151. partNo: '',
  2152. partDesc: '',
  2153. seqNo: '',
  2154. sku: '',
  2155. }
  2156. this.partInfoList = []
  2157. },
  2158. //获取按钮的权限数据
  2159. getButtonAuthData () {
  2160. let searchFlag = this.isAuth(this.menuId+":search")
  2161. let saveFlag = this.isAuth(this.menuId+":save")
  2162. let updateFlag = this.isAuth(this.menuId+":update")
  2163. let deleteFlag = this.isAuth(this.menuId+":delete")
  2164. let detailFlag = this.isAuth(this.menuId+":detail")
  2165. let fileFlag = this.isAuth(this.menuId+":file")
  2166. //处理页面的权限数据
  2167. this.authSearch = !searchFlag
  2168. this.authSave = !saveFlag
  2169. this.authUpdate = !updateFlag
  2170. this.authDelete = !deleteFlag
  2171. this.authDetail = !detailFlag
  2172. this.authFile = !fileFlag
  2173. },
  2174. }
  2175. }
  2176. </script>
  2177. <style scoped>
  2178. .el-table /deep/ .cell{
  2179. height: auto;
  2180. line-height: 1.5;
  2181. }
  2182. </style>