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
  1. <template>
  2. <div class="mod-config">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;" v-if="searchData.buNo==='Flexo'">
  4. <el-row :gutter="20">
  5. <el-col :span="6"><div class="grid-content bg-purple">
  6. <el-form-item :label="'印版编号/PlateNo'">
  7. <el-input v-model="dataForm.plateNo" :disabled="ifDisableFlag" ></el-input>
  8. </el-form-item>
  9. </div></el-col>
  10. <el-col :span="6"><div class="grid-content bg-purple">
  11. <el-form-item :label="'刀模编号/CutterNumber'">
  12. <el-input v-model="dataForm.cutterNumber" :disabled="ifDisableFlag" ></el-input>
  13. </el-form-item>
  14. </div></el-col>
  15. <el-col :span="6"><div class="grid-content bg-purple">
  16. <el-form-item :label="'刀模排位/CutterLayout'" >
  17. <el-input v-model="dataForm.cutterLayout" :disabled="ifDisableFlag" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input>
  18. </el-form-item>
  19. </div></el-col>
  20. </el-row>
  21. <el-row :gutter="20">
  22. <el-col :span="24"><div class="grid-content bg-purple">
  23. <el-form-item :label="'材料准备阶段/Action'">
  24. <el-input
  25. type="textarea"
  26. v-model="dataForm.action "
  27. :rows="3"
  28. resize='none'
  29. maxlength="120"
  30. show-word-limit
  31. :disabled="ifDisableFlag"
  32. style="height: 60px" >
  33. </el-input>
  34. </el-form-item>
  35. </div></el-col>
  36. </el-row>
  37. </el-form>
  38. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;" v-if="searchData.buNo==='SS'||searchData.buNo==='DBE'">
  39. <el-form-item >
  40. <el-button type="primary" @click="colorSearch()" >刷新</el-button>
  41. <el-button type="primary" @click="newColor()" v-if="!ifDisableFlag">新增</el-button>
  42. </el-form-item>
  43. <el-table
  44. height="400"
  45. :data="colorTable"
  46. border
  47. style="width: 100%">
  48. <el-table-column
  49. prop=""
  50. header-align="center"
  51. align="center"
  52. min-width="30"
  53. v-if="!ifDisableFlag"
  54. label="操作">
  55. <template slot-scope="scope">
  56. <a type="text" size="small" @click="updateColor(scope.row)">编辑</a>
  57. <a type="text" size="small" @click="deleteColor(scope.row)">删除</a>
  58. </template>
  59. </el-table-column>
  60. <el-table-column
  61. prop="order"
  62. header-align="center"
  63. align="left"
  64. min-width="40"
  65. label="色序">
  66. </el-table-column>
  67. <el-table-column
  68. prop="color"
  69. header-align="center"
  70. align="left"
  71. min-width="60"
  72. label="颜色">
  73. </el-table-column>
  74. <el-table-column
  75. prop="meshModel"
  76. header-align="center"
  77. align="left"
  78. min-width="60"
  79. label="类型">
  80. </el-table-column>
  81. <el-table-column
  82. prop="meshSize"
  83. header-align="center"
  84. align="right"
  85. min-width="60"
  86. label="目数">
  87. </el-table-column>
  88. <el-table-column
  89. prop="angle"
  90. header-align="center"
  91. align="right"
  92. min-width="60"
  93. label="角度">
  94. </el-table-column>
  95. <el-table-column
  96. prop="coatingType"
  97. header-align="center"
  98. align="left"
  99. min-width="60"
  100. label="涂膜种类">
  101. </el-table-column>
  102. <el-table-column
  103. prop="filmNo"
  104. header-align="center"
  105. align="left"
  106. min-width="60"
  107. label="菲林编号">
  108. </el-table-column>
  109. <el-table-column
  110. prop="stencilNo"
  111. header-align="center"
  112. align="left"
  113. min-width="60"
  114. label="网版编号">
  115. </el-table-column>
  116. </el-table>
  117. <el-row :gutter="20">
  118. <el-col :span="24"><div class="grid-content bg-purple">
  119. <el-form-item :label="'备注/Remarks'">
  120. <el-input
  121. type="textarea"
  122. v-model="dataForm.remark "
  123. :rows="3"
  124. resize='none'
  125. maxlength="120"
  126. show-word-limit
  127. :disabled="ifDisableFlag"
  128. style="height: 60px" >
  129. </el-input>
  130. </el-form-item>
  131. </div></el-col>
  132. </el-row>
  133. <el-row :gutter="20" style="margin-top: 60px">
  134. <el-col :span="24"><div class="grid-content bg-purple">
  135. <el-form-item :label="'问题反馈'">
  136. <el-input
  137. type="textarea"
  138. v-model="dataForm.feedback "
  139. :rows="3"
  140. resize='none'
  141. maxlength="120"
  142. show-word-limit
  143. :disabled="ifDisableFlag"
  144. style="height: 60px" >
  145. </el-input>
  146. </el-form-item>
  147. </div></el-col>
  148. </el-row>
  149. <el-row :gutter="20" style="margin-top: 60px">
  150. <el-col :span="24"><div class="grid-content bg-purple">
  151. <el-form-item :label="'Action'">
  152. <el-input
  153. type="textarea"
  154. v-model="dataForm.action "
  155. :rows="3"
  156. resize='none'
  157. maxlength="120"
  158. show-word-limit
  159. :disabled="ifDisableFlag"
  160. style="height: 60px" >
  161. </el-input>
  162. </el-form-item>
  163. </div></el-col>
  164. </el-row>
  165. </el-form>
  166. <el-form label-position="top" style="margin-top:60px; margin-left: 0px;text-align:center">
  167. <el-button type="primary" @click="saveData()" v-if="!ifDisableFlag&&searchData.buNo==='Flexo'||searchData.buNo==='SS'||searchData.buNo==='DBE'" >保存</el-button>
  168. </el-form>
  169. <el-dialog title="颜色信息" :close-on-click-modal="false" v-drag :visible.sync="colorFlag" width="600px">
  170. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  171. <el-form-item :label="'色序'">
  172. <el-input v-model="colorData.order" type="number" style="width: 130px" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" ></el-input>
  173. </el-form-item>
  174. <el-form-item :label="'颜色'">
  175. <el-input v-model="colorData.color" style="width: 130px" ></el-input>
  176. </el-form-item>
  177. <el-form-item :label="'类型'">
  178. <el-input v-model="colorData.meshModel" style="width: 130px" ></el-input>
  179. </el-form-item>
  180. <el-form-item :label="'目数'">
  181. <el-input v-model="colorData.meshSize" type="number" style="width: 130px" ></el-input>
  182. </el-form-item>
  183. </el-form>
  184. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  185. <el-form-item :label="'颜色匹配'">
  186. <el-input v-model="colorData.angle" type="number" style="width: 130px" ></el-input>
  187. </el-form-item>
  188. <el-form-item :label="'涂膜种类'">
  189. <el-input v-model="colorData.coatingType" style="width: 130px" ></el-input>
  190. </el-form-item>
  191. <el-form-item :label="'菲林编号'">
  192. <el-input v-model="colorData.filmNo" style="width: 130px" ></el-input>
  193. </el-form-item>
  194. <el-form-item :label="'网版编号'">
  195. <el-input v-model="colorData.stencilNo" style="width: 130px" ></el-input>
  196. </el-form-item>
  197. </el-form>
  198. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  199. <el-button type="primary" @click="colorSave()">保存</el-button>
  200. <el-button type="primary" @click="colorFlag = false">取消</el-button>
  201. </el-footer>
  202. </el-dialog>
  203. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  204. </div>
  205. </template>
  206. <script>
  207. import {
  208. searchBMPrepressDetail,
  209. updateBMPrepressDetail,
  210. searchBMPrepressColor,
  211. saveBMPrepressColor,
  212. deleteBMPrepressColor,
  213. } from "@/api/sampleManagement/technicalSpecificationList.js"
  214. import Chooselist from '@/views/modules/common/Chooselist'
  215. export default {
  216. components: {
  217. Chooselist
  218. },
  219. data() {
  220. return {
  221. searchData: {
  222. site: '',
  223. username: this.$store.state.user.name,
  224. codeNo: '',
  225. buNo:'',
  226. },
  227. ifDisableFlag:false,
  228. dataForm:{
  229. site: '',
  230. codeNo:'',
  231. plateNo:'',
  232. cutterNumber:'',
  233. cutterLayout:'',
  234. action:'',
  235. feedback:'',
  236. remark:'',
  237. },
  238. colorTable:[],
  239. colorData:{
  240. id:'',
  241. site: '',
  242. codeNo:'',
  243. order:'',
  244. color:'',
  245. meshModel:'',
  246. meshSize:'',
  247. angle:'',
  248. coatingType:'',
  249. filmNo:'',
  250. stencilNo:'',
  251. updateBy:'',
  252. updateDate:'',
  253. },
  254. colorFlag:false,
  255. }
  256. },
  257. methods: {
  258. // 获取基础数据列表S
  259. getBaseList (val, type) {
  260. this.tagNo = val
  261. this.tagNo1 = type
  262. this.$nextTick(() => {
  263. let strVal = ''
  264. if (val === 1013) {
  265. if(type==1) {
  266. strVal = this.dataForm.partType
  267. }
  268. }
  269. this.$refs.baseList.init(val, strVal)
  270. })
  271. },
  272. /* 列表方法的回调 */
  273. getBaseData (val) {
  274. if (this.tagNo === 1013) {
  275. if(this.tagNo1==1) {
  276. this.dataForm.partType = val.Base_id
  277. this.dataForm.partTypeDesc = val.Base_desc
  278. }
  279. }
  280. },
  281. //初始化组件的参数
  282. init(inData) {
  283. if(this.dataForm.codeNo!=null&&this.dataForm.codeNo!=''){
  284. return false;
  285. }
  286. //初始化参数
  287. this.searchData = JSON.parse(JSON.stringify(inData));
  288. //刷新表格
  289. this.searchTable();
  290. this.colorSearch();
  291. },
  292. searchTable(){
  293. searchBMPrepressDetail(this.searchData).then(({data}) => {
  294. if(data.rows.length>0){
  295. this.dataForm = data.rows[0];
  296. }else {
  297. this.dataForm.site=this.searchData.site
  298. this.dataForm.codeNo=this.searchData.codeNo
  299. }
  300. });
  301. },
  302. saveData(){
  303. this.$confirm("是否保存信息?", '保存提示', {
  304. confirmButtonText: '确定',
  305. cancelButtonText: '取消',
  306. }).then(() => {
  307. updateBMPrepressDetail(this.dataForm).then(({data}) => {
  308. if (data && data.code === 0) {
  309. this.$message.success( '操作成功')
  310. } else {
  311. this.$message.error(data.msg)
  312. }
  313. })
  314. }).catch(() => {
  315. return
  316. })
  317. },
  318. newColor(){
  319. if(this.searchData.codeNo==''){
  320. this.$message.success('数据错误,请关闭页面重试!')
  321. return false;
  322. }
  323. let number=1;
  324. for (let i = 0; i <this.colorTable.length ; i++) {
  325. if(number<=this.colorTable[i].order){
  326. number=Number(this.colorTable[i].order)+1
  327. }
  328. }
  329. this.colorData={
  330. id:0,
  331. site: this.searchData.site,
  332. codeNo:this.searchData.codeNo,
  333. order:number,
  334. color:'',
  335. meshModel:'',
  336. meshSize:'',
  337. angle:'',
  338. coatingType:'',
  339. filmNo:'',
  340. stencilNo:'',
  341. updateBy:'',
  342. updateDate:'',
  343. }
  344. this.colorFlag=true;
  345. },
  346. updateColor(row){
  347. this.colorData=JSON.parse(JSON.stringify(row))
  348. this.colorFlag=true;
  349. },
  350. colorSearch(){
  351. searchBMPrepressColor(this.searchData).then(({data}) => {
  352. this.colorTable = data.rows
  353. });
  354. },
  355. colorSave(){
  356. this.$confirm("是否保存信息?", '保存提示', {
  357. confirmButtonText: '确定',
  358. cancelButtonText: '取消',
  359. }).then(() => {
  360. saveBMPrepressColor(this.colorData).then(({data}) => {
  361. if (data && data.code === 0) {
  362. this.colorSearch();
  363. this.colorFlag=false
  364. this.$message.success( '操作成功')
  365. } else {
  366. this.$message.error(data.msg)
  367. }
  368. })
  369. }).catch(() => {
  370. })
  371. },
  372. deleteColor(row){
  373. this.$confirm(`是否删除这条信息?`, '提示', {
  374. confirmButtonText: '确定',
  375. cancelButtonText: '取消',
  376. type: 'warning'
  377. }).then(() => {
  378. deleteBMPrepressColor(row).then(({data}) => {
  379. if (data && data.code === 0) {
  380. this.colorSearch();
  381. this.$message({
  382. message: '操作成功',
  383. type: 'success',
  384. duration: 1500,
  385. onClose: () => {}
  386. })
  387. } else {
  388. this.$alert(data.msg, '错误', {
  389. confirmButtonText: '确定'
  390. })
  391. }
  392. })
  393. }).catch(() => {
  394. })
  395. },
  396. },
  397. }
  398. </script>
  399. <style scoped>
  400. </style>