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.

338 lines
9.9 KiB

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