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.

415 lines
13 KiB

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