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.

421 lines
13 KiB

2 years ago
1 year 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
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
  1. <template>
  2. <div class="mod-config" v-highlight-container>
  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!=='Flexo'">
  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" v-if="!ifDisableFlag">
  167. <el-button type="primary" @click="saveData()" >保存</el-button>
  168. </el-form>
  169. <el-dialog append-to-body 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. ifDisableFlag:'',
  227. },
  228. ifDisableFlag:false,
  229. dataForm:{
  230. site: '',
  231. codeNo:'',
  232. plateNo:'',
  233. cutterNumber:'',
  234. cutterLayout:'',
  235. action:'',
  236. feedback:'',
  237. remark:'',
  238. },
  239. colorTable:[],
  240. colorData:{
  241. id:'',
  242. site: '',
  243. codeNo:'',
  244. order:'',
  245. color:'',
  246. meshModel:'',
  247. meshSize:'',
  248. angle:'',
  249. coatingType:'',
  250. filmNo:'',
  251. stencilNo:'',
  252. updateBy:'',
  253. updateDate:'',
  254. },
  255. colorFlag:false,
  256. }
  257. },
  258. methods: {
  259. // 获取基础数据列表S
  260. getBaseList (val, type) {
  261. this.tagNo = val
  262. this.tagNo1 = type
  263. this.$nextTick(() => {
  264. let strVal = ''
  265. if (val === 1013) {
  266. if(type==1) {
  267. strVal = this.dataForm.partType
  268. }
  269. }
  270. this.$refs.baseList.init(val, strVal)
  271. })
  272. },
  273. /* 列表方法的回调 */
  274. getBaseData (val) {
  275. if (this.tagNo === 1013) {
  276. if(this.tagNo1==1) {
  277. this.dataForm.partType = val.Base_id
  278. this.dataForm.partTypeDesc = val.Base_desc
  279. }
  280. }
  281. },
  282. //初始化组件的参数
  283. init(inData) {
  284. if(this.dataForm.codeNo!=null&&this.dataForm.codeNo!=''){
  285. return false;
  286. }
  287. //初始化参数
  288. this.searchData = JSON.parse(JSON.stringify(inData));
  289. if(this.searchData.ifDisableFlag){
  290. this.ifDisableFlag=true
  291. }
  292. //刷新表格
  293. this.searchTable();
  294. this.colorSearch();
  295. },
  296. searchTable(){
  297. searchBMPrepressDetail(this.searchData).then(({data}) => {
  298. if(data.rows.length>0){
  299. this.dataForm = data.rows[0];
  300. }else {
  301. this.dataForm.site=this.searchData.site
  302. this.dataForm.codeNo=this.searchData.codeNo
  303. }
  304. });
  305. },
  306. saveData(){
  307. this.$confirm("是否保存信息?", '保存提示', {
  308. confirmButtonText: '确定',
  309. cancelButtonText: '取消',
  310. }).then(() => {
  311. updateBMPrepressDetail(this.dataForm).then(({data}) => {
  312. if (data && data.code === 0) {
  313. this.$clearHighLight()
  314. this.$message.success( '操作成功')
  315. this.$emit("closeModel")
  316. } else {
  317. this.$message.error(data.msg)
  318. }
  319. })
  320. }).catch(() => {
  321. return
  322. })
  323. },
  324. newColor(){
  325. if(this.searchData.codeNo==''){
  326. this.$message.success('数据错误,请关闭页面重试!')
  327. return false;
  328. }
  329. let number=1;
  330. for (let i = 0; i <this.colorTable.length ; i++) {
  331. if(number<=this.colorTable[i].order){
  332. number=Number(this.colorTable[i].order)+1
  333. }
  334. }
  335. this.colorData={
  336. id:0,
  337. site: this.searchData.site,
  338. codeNo:this.searchData.codeNo,
  339. order:number,
  340. color:'',
  341. meshModel:'',
  342. meshSize:'',
  343. angle:'',
  344. coatingType:'',
  345. filmNo:'',
  346. stencilNo:'',
  347. updateBy:'',
  348. updateDate:'',
  349. }
  350. this.colorFlag=true;
  351. },
  352. updateColor(row){
  353. this.colorData=JSON.parse(JSON.stringify(row))
  354. this.colorFlag=true;
  355. },
  356. colorSearch(){
  357. searchBMPrepressColor(this.searchData).then(({data}) => {
  358. this.$clearHighLight()
  359. this.colorTable = data.rows
  360. });
  361. },
  362. colorSave(){
  363. this.$confirm("是否保存信息?", '保存提示', {
  364. confirmButtonText: '确定',
  365. cancelButtonText: '取消',
  366. }).then(() => {
  367. saveBMPrepressColor(this.colorData).then(({data}) => {
  368. if (data && data.code === 0) {
  369. this.colorSearch();
  370. this.$message.success( '操作成功')
  371. } else {
  372. this.$message.error(data.msg)
  373. }
  374. })
  375. }).catch(() => {
  376. })
  377. },
  378. deleteColor(row){
  379. this.$confirm(`是否删除这条信息?`, '提示', {
  380. confirmButtonText: '确定',
  381. cancelButtonText: '取消',
  382. type: 'warning'
  383. }).then(() => {
  384. deleteBMPrepressColor(row).then(({data}) => {
  385. if (data && data.code === 0) {
  386. this.colorSearch();
  387. this.$message({
  388. message: '操作成功',
  389. type: 'success',
  390. duration: 1500,
  391. onClose: () => {}
  392. })
  393. } else {
  394. this.$alert(data.msg, '错误', {
  395. confirmButtonText: '确定'
  396. })
  397. }
  398. })
  399. }).catch(() => {
  400. })
  401. },
  402. },
  403. }
  404. </script>
  405. <style scoped>
  406. </style>