plm前端
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.

490 lines
17 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
7 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <printing ref="printing"></printing>
  4. <el-form label-position="top" style="margin-top: 10px;">
  5. <el-form-item>
  6. <el-button type="primary" @click="colorSearch(true)" >刷新</el-button>
  7. <template v-if="isAuth('103002:bmRoute')">
  8. <el-button type="primary" @click="newColor()" v-if="!ifDisableFlag">新增</el-button>
  9. <el-button type="primary" @click="colorSaveBatch()" v-if="!ifDisableFlag">一键导入</el-button>
  10. <el-button v-if="!editBatchVisible" @click="editBatchModel">批量编辑</el-button>
  11. <el-button v-if="editBatchVisible" @click="batchModel" :loading="batchLoading">批量保存</el-button>
  12. </template>
  13. </el-form-item>
  14. <div class="rq">
  15. <el-table
  16. height="400"
  17. :data="colorTable"
  18. border
  19. style="width: 100%">
  20. <el-table-column
  21. prop=""
  22. header-align="center"
  23. align="center"
  24. min-width="30"
  25. v-if="!ifDisableFlag"
  26. label="操作">
  27. <template slot-scope="scope" v-if="isAuth('103002:bmRoute')">
  28. <a type="text" size="small" @click="updateColor(scope.row)">编辑</a>
  29. <a type="text" size="small" @click="deleteColor(scope.row)">删除</a>
  30. </template>
  31. </el-table-column>
  32. <el-table-column
  33. prop="order"
  34. header-align="center"
  35. align="left"
  36. min-width="40"
  37. label="色序">
  38. <template slot-scope="scope">
  39. <span v-if="editBatchVisible">
  40. <el-input :controls="false" v-model="scope.row.order"
  41. @input="value=>scope.row.order= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
  42. style="height: 11px; width: 98%;">
  43. </el-input>
  44. </span>
  45. <span v-else>
  46. <span>{{scope.row[scope.column.property]}}</span>
  47. </span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="油墨类型" header-align="center">
  51. <el-table-column
  52. prop="inkType"
  53. header-align="center"
  54. align="left"
  55. min-width="60"
  56. label="Ink Type">
  57. <template slot-scope="scope">
  58. <span v-if="editBatchVisible">
  59. <el-input :controls="false" v-model="scope.row.inkType" style="height: 11px; width: 98%;"></el-input>
  60. </span>
  61. <span v-else>
  62. <span>{{scope.row[scope.column.property]}}</span>
  63. </span>
  64. </template>
  65. </el-table-column>
  66. </el-table-column>
  67. <el-table-column label="颜色参考" header-align="center">
  68. <el-table-column
  69. prop="colorReference"
  70. header-align="center"
  71. align="left"
  72. min-width="60"
  73. label="Color Reference">
  74. </el-table-column>
  75. </el-table-column>
  76. <el-table-column label="颜色匹配" header-align="center">
  77. <el-table-column
  78. prop="colorMatch"
  79. header-align="center"
  80. align="left"
  81. min-width="60"
  82. label="Color Match">
  83. <template slot-scope="scope">
  84. <span v-if="editBatchVisible">
  85. <el-input :controls="false" v-model="scope.row.colorMatch" style="height: 11px; width: 98%;"></el-input>
  86. </span>
  87. <span v-else>
  88. <span>{{scope.row[scope.column.property]}}</span>
  89. </span>
  90. </template>
  91. </el-table-column>
  92. </el-table-column>
  93. <el-table-column label="容积" header-align="center">
  94. <el-table-column
  95. prop="bcm"
  96. header-align="center"
  97. align="left"
  98. min-width="60"
  99. label="BCM">
  100. <template slot-scope="scope">
  101. <span v-if="editBatchVisible">
  102. <el-input :controls="false" v-model="scope.row.bcm" style="height: 11px; width: 98%;"></el-input>
  103. </span>
  104. <span v-else>
  105. <span>{{scope.row[scope.column.property]}}</span>
  106. </span>
  107. </template>
  108. </el-table-column>
  109. </el-table-column>
  110. <el-table-column label="印刷速度" header-align="center">
  111. <el-table-column
  112. prop="speed"
  113. header-align="center"
  114. align="left"
  115. min-width="60"
  116. label="Speed">
  117. <template slot-scope="scope">
  118. <span v-if="editBatchVisible">
  119. <el-input :controls="false" v-model="scope.row.speed" style="height: 11px; width: 98%;"></el-input>
  120. </span>
  121. <span v-else>
  122. <span>{{scope.row[scope.column.property]}}</span>
  123. </span>
  124. </template>
  125. </el-table-column>
  126. </el-table-column>
  127. <el-table-column label="外干燥" header-align="center">
  128. <el-table-column
  129. prop="dry"
  130. header-align="center"
  131. align="left"
  132. min-width="60"
  133. label="Dry">
  134. <template slot-scope="scope">
  135. <span v-if="editBatchVisible">
  136. <el-input :controls="false" v-model="scope.row.dry" style="height: 11px; width: 98%;"></el-input>
  137. </span>
  138. <span v-else>
  139. <span>{{scope.row[scope.column.property]}}</span>
  140. </span>
  141. </template>
  142. </el-table-column>
  143. </el-table-column>
  144. <el-table-column label="UV固化/UV Curing" header-align="center">
  145. <el-table-column
  146. prop="resourceNo"
  147. header-align="center"
  148. align="left"
  149. min-width="60"
  150. label="机台">
  151. <template slot-scope="scope">
  152. <span v-if="editBatchVisible">
  153. <dict-data-select :site="searchData.site" v-if="searchData.site" v-model="scope.row.resourceNo" style="height: 11px; width: 98%;" dict-type="bm_printing_resource"></dict-data-select>
  154. </span>
  155. <span v-else>
  156. <span>{{scope.row[scope.column.property]}}</span>
  157. </span>
  158. </template>
  159. </el-table-column>
  160. <!-- <el-table-column-->
  161. <!-- prop="gallus"-->
  162. <!-- header-align="center"-->
  163. <!-- align="left"-->
  164. <!-- min-width="60"-->
  165. <!-- label="Gallus(level%)">-->
  166. <!-- </el-table-column>-->
  167. <!-- <el-table-column-->
  168. <!-- prop="markAndy"-->
  169. <!-- header-align="center"-->
  170. <!-- align="left"-->
  171. <!-- min-width="60"-->
  172. <!-- label="MarkAndy(level%)">-->
  173. <!-- </el-table-column>-->
  174. <!-- <el-table-column-->
  175. <!-- prop="lp"-->
  176. <!-- header-align="center"-->
  177. <!-- align="left"-->
  178. <!-- min-width="60"-->
  179. <!-- label="LP(L/M/H)">-->
  180. <!-- </el-table-column>-->
  181. <!-- <el-table-column-->
  182. <!-- prop="hexiang"-->
  183. <!-- header-align="center"-->
  184. <!-- align="left"-->
  185. <!-- min-width="60"-->
  186. <!-- label="Hexiang(L/H)">-->
  187. <!-- </el-table-column>-->
  188. </el-table-column>
  189. </el-table>
  190. </div>
  191. <div class="rq-bmPic" >
  192. <img style="max-width: 100%;max-height: 100%;vertical-align:middle;" :src="picUrl">
  193. </div>
  194. </el-form>
  195. <el-dialog append-to-body title="颜色信息" :close-on-click-modal="false" v-drag :visible.sync="colorFlag" width="600px">
  196. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  197. <el-form-item :label="'色序'">
  198. <el-input v-model="colorData.order" type="number" style="width: 130px" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" ></el-input>
  199. </el-form-item>
  200. <el-form-item :label="'油墨类型'">
  201. <el-input v-model="colorData.inkType" style="width: 130px" ></el-input>
  202. </el-form-item>
  203. <el-form-item >
  204. <span slot="label" style="" @click="getBaseList(133,1)" ><a herf="#">颜色参考</a></span>
  205. <el-input v-model="colorData.colorReference" style="width: 130px" ></el-input>
  206. </el-form-item>
  207. <el-form-item :label="'颜色匹配'">
  208. <el-input v-model="colorData.colorMatch" style="width: 130px" ></el-input>
  209. </el-form-item>
  210. </el-form>
  211. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  212. <el-form-item :label="'容积'">
  213. <el-input v-model="colorData.bcm" style="width: 130px" ></el-input>
  214. </el-form-item>
  215. <el-form-item :label="'印刷速度'">
  216. <el-input v-model="colorData.speed" style="width: 130px" ></el-input>
  217. </el-form-item>
  218. <el-form-item :label="'外干燥'">
  219. <el-input v-model="colorData.dry" style="width: 130px" ></el-input>
  220. </el-form-item>
  221. <el-form-item :label="'机台'">
  222. <dict-data-select :site="colorData.site" v-if="colorData.site" v-model="colorData.resourceNo" style="width: 130px" dict-type="bm_printing_resource"></dict-data-select>
  223. </el-form-item>
  224. <!-- <el-form-item :label="'Gallus(level%)'">-->
  225. <!-- <el-input v-model="colorData.gallus" style="width: 130px" ></el-input>-->
  226. <!-- </el-form-item>-->
  227. </el-form>
  228. <!-- <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">-->
  229. <!-- <el-form-item :label="'MarkAndy(level%)'">-->
  230. <!-- <el-input v-model="colorData.markAndy" style="width: 130px" ></el-input>-->
  231. <!-- </el-form-item>-->
  232. <!-- <el-form-item :label="'LP(L/M/H)'">-->
  233. <!-- <el-input v-model="colorData.lp" style="width: 130px" ></el-input>-->
  234. <!-- </el-form-item>-->
  235. <!-- <el-form-item :label="'Hexiang(L/H)'">-->
  236. <!-- <el-input v-model="colorData.hexiang" style="width: 130px" ></el-input>-->
  237. <!-- </el-form-item>-->
  238. <!-- </el-form>-->
  239. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  240. <el-button type="primary" @click="colorSave()">保存</el-button>
  241. <el-button type="primary" @click="colorFlag = false">取消</el-button>
  242. </el-footer>
  243. </el-dialog>
  244. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  245. </div>
  246. </template>
  247. <script>
  248. import printing from "./com_bm_demoSlot";/*组件*/
  249. import {
  250. searchBMPrintingDetail,
  251. updateBMPrintingDetail,
  252. searchBMPrintingColor,
  253. saveBMPrintingColor,
  254. deleteBMPrintingColor,
  255. saveBMPrintingColorBatch, // 一键导入
  256. updateBMPrintingColorBatch, // 批量修改
  257. } from "@/api/sampleManagement/technicalSpecificationList.js"
  258. import Chooselist from '@/views/modules/common/Chooselist'
  259. import DictDataSelect from "../../sys/dict-data-select-highlight.vue";
  260. export default {
  261. components: {
  262. DictDataSelect,
  263. Chooselist,printing
  264. },
  265. data() {
  266. return {
  267. searchData: {
  268. site: '',
  269. username: this.$store.state.user.name,
  270. codeNo: '',
  271. buNo:'',
  272. type:'',
  273. },
  274. picUrl:this.$store.state.user.bmPicUrl+'defaultPaperOrientation.png',
  275. ifDisableFlag:false,
  276. colorTable:[],
  277. colorData:{
  278. id:'',
  279. site: '',
  280. codeNo:'',
  281. order:'',
  282. inkType:'',
  283. colorReference:'',
  284. colorMatch:'',
  285. bcm:'',
  286. speed:'',
  287. dry:'',
  288. gallus:'',
  289. markAndy:'',
  290. lp:'',
  291. hexiang:'',
  292. updateBy:'',
  293. updateDate:'',
  294. resourceNo: ''
  295. },
  296. colorFlag:false,
  297. editBatchVisible: false,
  298. batchLoading: false,
  299. }
  300. },
  301. methods: {
  302. // 批量编辑模态框
  303. editBatchModel() {
  304. if (this.editBatchVisible) {
  305. this.editBatchVisible = false
  306. } else {
  307. this.editBatchVisible = true
  308. }
  309. },
  310. // 批量保存
  311. batchModel() {
  312. let params = []
  313. params = this.colorTable
  314. this.batchLoading = true
  315. updateBMPrintingColorBatch(params).then(({data}) => {
  316. if (data && data.code === 0) {
  317. this.colorSearch()
  318. this.$message.success(data.msg)
  319. this.editBatchVisible = false
  320. } else {
  321. this.$message.error(data.msg)
  322. }
  323. }).finally(() => {
  324. this.batchLoading = false
  325. })
  326. },
  327. // 获取基础数据列表S
  328. getBaseList (val, type) {
  329. this.tagNo = val
  330. this.tagNo1 = type
  331. this.$nextTick(() => {
  332. let strVal = ''
  333. if (val === 133) {
  334. if(type==1) {
  335. strVal = this.colorData.colorReference
  336. }
  337. }
  338. this.$refs.baseList.init(val, strVal)
  339. })
  340. },
  341. /* 列表方法的回调 */
  342. getBaseData (val) {
  343. if (this.tagNo === 133) {
  344. if(this.tagNo1==1) {
  345. this.colorData.colorReference = val.part_no
  346. }
  347. }
  348. },
  349. //初始化组件的参数
  350. init (inData) {
  351. if (this.searchData.codeNo != null && this.searchData.codeNo !== '') {
  352. return false;
  353. }
  354. //初始化参数
  355. this.searchData = JSON.parse(JSON.stringify(inData))
  356. // if (this.searchData.ifDisableFlag) {
  357. // this.ifDisableFlag = true
  358. // }
  359. //刷新表格
  360. this.searchTable()
  361. this.colorSearch()
  362. //刷新表格
  363. this.searchData.type='printing'
  364. this.$refs.printing.init(JSON.parse(JSON.stringify(this.searchData)))
  365. },
  366. searchTable () {
  367. },
  368. newColor () {
  369. if (this.searchData.codeNo === '') {
  370. this.$message.success('数据错误,请关闭页面重试!')
  371. return false;
  372. }
  373. let number = 1
  374. for (let i = 0; i < this.colorTable.length; i++) {
  375. if (number <= this.colorTable[i].order) {
  376. number = Number(this.colorTable[i].order) + 1
  377. }
  378. }
  379. this.colorData = {
  380. id: 0,
  381. site: this.searchData.site,
  382. codeNo: this.searchData.codeNo,
  383. order: number,
  384. inkType: '',
  385. colorReference: '',
  386. colorMatch: '',
  387. bcm: '',
  388. speed: '',
  389. dry: '',
  390. gallus: '',
  391. markAndy: '',
  392. lp: '',
  393. hexiang: '',
  394. updateBy: '',
  395. updateDate: '',
  396. resourceNo: ''
  397. }
  398. this.colorFlag = true
  399. },
  400. updateColor (row) {
  401. this.colorData = JSON.parse(JSON.stringify(row))
  402. this.colorFlag = true
  403. },
  404. colorSearch (type) {
  405. searchBMPrintingColor(this.searchData).then(({data}) => {
  406. if (type) {
  407. this.$message.success( '操作成功')
  408. }
  409. this.colorTable = data.rows
  410. })
  411. },
  412. colorSave () {
  413. saveBMPrintingColor(this.colorData).then(({data}) => {
  414. if (data && data.code === 0) {
  415. this.colorSearch()
  416. this.colorFlag = false
  417. this.$message.success( '操作成功')
  418. } else {
  419. this.$message.error(data.msg)
  420. }
  421. })
  422. },
  423. // 一键导入
  424. colorSaveBatch () {
  425. this.$confirm("此操作将清空已填写的数据,是否继续?", '保存提示', {
  426. confirmButtonText: '确定',
  427. cancelButtonText: '取消',
  428. }).then(() => {
  429. let tempData = {
  430. site: this.searchData.site,
  431. codeNo: this.searchData.codeNo,
  432. createBy: this.$store.state.user.name,
  433. }
  434. saveBMPrintingColorBatch(tempData).then(({data}) => {
  435. if (data && data.code === 0) {
  436. this.colorSearch()
  437. this.$message.success( '操作成功')
  438. } else {
  439. this.$message.error(data.msg)
  440. }
  441. })
  442. })
  443. },
  444. deleteColor(row){
  445. this.$confirm(`是否删除这条信息?`, '提示', {
  446. confirmButtonText: '确定',
  447. cancelButtonText: '取消',
  448. type: 'warning'
  449. }).then(() => {
  450. deleteBMPrintingColor(row).then(({data}) => {
  451. if (data && data.code === 0) {
  452. this.colorSearch();
  453. this.$message({
  454. message: '操作成功',
  455. type: 'success',
  456. duration: 1500,
  457. onClose: () => {}
  458. })
  459. } else {
  460. this.$alert(data.msg, '错误', {
  461. confirmButtonText: '确定'
  462. })
  463. }
  464. })
  465. })
  466. },
  467. },
  468. }
  469. </script>
  470. <style scoped>
  471. </style>