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.

385 lines
12 KiB

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