王克恕 %!s(int64=3) %!d(string=hai) anos
pai
achega
b0a50841ed

+ 2 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/frockMgr/components/Edit.vue

@@ -10,7 +10,7 @@
   >
     <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="150px">
     	<!--所属产线-->
-      <el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 || $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
+      <el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 && $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
         <el-select
           v-model="tenant.zoneId"
            :placeholder='$t("common.pleaseSelect")'
@@ -292,6 +292,7 @@ export default {
     },
     initTenant () {
       return {
+      	userId: this.$store.state.account.user.id,  // 默认添加登录用户ID
       	model: '',
         name: '',
         category: {

+ 2 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/material/components/Edit.vue

@@ -10,7 +10,7 @@
   >
     <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
     	<!--所属产线-->
-      <el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 || $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
+      <el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 && $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
         <el-select
           v-model="tenant.zoneId"
            :placeholder='$t("common.pleaseSelect")'
@@ -201,6 +201,7 @@
 	    },
 	    initTenant () {
 	      return {
+	      	userId: this.$store.state.account.user.id,  // 默认添加登录用户ID
 	      	meterialCode: '',
 	        tradeMark: '',
 	        equipmentName: '',

+ 337 - 307
imcs-ui/src/views/zuihou/prepareProductMgr/plateMgr/components/Edit.vue

@@ -1,307 +1,337 @@
-<template>
-  <el-dialog
-  	:close-on-click-modal="false"
-  	:close-on-press-escape="false"
-  	:title="title"
-  	:append-to-body="true"
-  	:visible.sync="isVisible"
-  	:width="width"
-  	top="50px"
-  >
-    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
-      <!--名称-->
-      <el-form-item :label='$t("prepare.table.tray.name")+":"' prop="name">
-        <el-input v-model="tenant.name" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-      <!--品牌-->
-    	<el-form-item :label='$t("prepare.table.tray.brand")+":"' prop="brand">
-      	<el-select style="width:100%" :placeholder='$t("common.pleaseSelect")' v-model="tenant.brand.key" value>
-          <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.METERIAL_BRAND" />
-        </el-select>
-      </el-form-item>
-      <!--规格-->
-      <el-form-item :label='$t("prepare.table.tray.specification")+":"' prop="specification">
-        <el-input v-model="tenant.specification" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-<!--      &lt;!&ndash;可放托盘&ndash;&gt;-->
-<!--      <el-form-item :label='$t("prepare.table.tray.tray")+":"' prop="trayId">-->
-<!--        <el-select v-model="tenant.trayId" :placeholder='$t("common.pleaseSelect")' style="width: 50%;">-->
-<!--          <el-option-->
-<!--            v-for="item in trayList"-->
-<!--            :key="item.id"-->
-<!--            :label="item.name"-->
-<!--            :value="item.id"-->
-<!--          >-->
-<!--          </el-option>-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
-      <!--可放托盘数量-->
-      <el-form-item :label='$t("prepare.table.tray.plateMaxNum")+":"' prop="number">
-        <el-input-number v-model="tenant.number"  :min="1" ></el-input-number>
-      </el-form-item>
-      <!--排序(升序)-->
-<!--      <el-form-item :label='$t("common.weight")+":"' prop="weight">-->
-<!--        <el-input-number v-model="tenant.weight" :min="0" :max="9999" label=""></el-input-number>-->
-<!--      </el-form-item>-->
-      <!--状态-->
-      <el-form-item :label='$t("prepare.table.tools.status")+":"' prop="status">
-        <template>
-				  <el-radio v-model="tenant.status" label="1">{{$t("common.status.valid")}}</el-radio>
-				  <el-radio v-model="tenant.status" label="0">{{$t("common.frozen")}}</el-radio>
-				</template>
-      </el-form-item>
-    </el-form>
-    <div slot="footer" class="dialog-footer">
-      <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
-      <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
-    </div>
-  </el-dialog>
-</template>
-<script>
-// 【托板管理】-API
-import plateMgrApi from "@/api/prepareProductMgr/plateMgr"
-// 【托盘管理】-API
-import trayMgrApi from "@/api/prepareProductMgr/trayMgr"
-
-export default {
-  name: 'TenantEdit',
-  props: {
-    dialogVisible: {
-      type: Boolean,
-      default: false
-    },
-    title: {
-      type: String,
-      default: ''
-    }
-  },
-  data () {
-    return {
-    	loading: false,
-      type: 'add',
-      tableData: [],
-      tenant: this.initTenant(),
-      screenWidth: 0,
-      width: this.initWidth(),
-      confirmDisabled: false,
-      dicts: {
-	      METERIAL_BRAND: {} //工具材料品牌
-	    },
-      trayList: [],
-      roles: [],
-      rules: {
-        name: [
-        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-        ],
-        number: [
-          { required: true, message: this.$t("rules.require"), trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  //实例已经在内存中创建好,此时data喝methods已将ok,如果要操作data中得数据或是调用methods中的方法,最早只能在created中操作
-  created() {
-    //加载托盘列表数据
-    this.traymerList();
-  },
-  computed: {
-    isVisible: {
-      get () {
-        return this.dialogVisible
-      },
-      set () {
-        this.close()
-        this.reset()
-      }
-    }
-  },
-  mounted () {
-    window.onresize = () => {
-      return (() => {
-        this.width = this.initWidth()
-      })()
-    }
-  },
-  methods: {
-  	// 【新增】按钮-事件
-    addRes(){
-      this.tableData.push({
-      	key: "WKS_"+ Math.random(),
-      	id: '',
-      	positionSort: this.tableData.length + 1,
-      	size: '',
-      	remark: '',
-      	isEdit: true
-      })
-    },
-    // Table的选择事件
-    onSelectChange (selection) {
-      this.selection = selection
-    },
-    // 【删除】按钮事件
-    singleDelete(row){
-    	this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
-      	distinguishCancelAndClose: true,
-        confirmButtonText: this.$t("common.confirm"),
-        cancelButtonText: this.$t("common.cancel"),
-        type: "warning"
-      }).then(() => {
-      	// 过滤符合条件的数据
-      	let arr = this.tableData.filter(item => item.key != row.key || item.id != row.id)
-      	// 给数据排序
-    		arr.forEach((item, index) => {
-    			item.positionSort = index + 1
-    		})
-      	// 给新的数据赋值
-    		this.tableData = arr;
-
-      }).catch(() => {})
-    },
-    // 【修改】按钮事件
-    edit(row){
-    	let list = new Array();
-    	this.tableData.forEach((item, index) => {
-    		// 当前编辑行
-    		if(!!item.id && item.id == row.id){
-    			item.isEdit = true
-    		}
-    		list.push(item)
-    	})
-    	// 赋值给当前
-    	this.tableData = list
-    },
-    initTenant () {
-      return {
-        name: '',
-        brand: {
-          key: ''
-        },
-        status: '1',
-        number: 1,
-      }
-    },
-    initWidth () {
-      this.screenWidth = document.body.clientWidth
-      if (this.screenWidth < 991) {
-        return '90%'
-      } else if (this.screenWidth < 1400) {
-        return '45%'
-      } else {
-        return '800px'
-      }
-    },
-    setTenant (val, dicts) {
-    	if(val){
-    		this.tenant = { ...val }
-    	}
-      // 字典表
-      this.dicts = dicts
-    },
-    close () {
-      this.$emit('close')
-    },
-    reset () {
-      // 先清除校验,再清除表单,不然有奇怪的bug
-      this.$refs.form.clearValidate()
-      this.$refs.form.resetFields()
-      this.tenant = this.initTenant()
-      this.tableData = []  	//清空【规格】数据
-    },
-    submitForm () {
-    	console.log("Form数据:", this.tenant)
-      this.$refs.form.validate((valid) => {
-        if (valid) {
-          this.confirmDisabled = true
-          if (this.type === 'add') {
-            this.save()
-          } else {
-            this.update()
-          }
-        } else {
-          return false
-        }
-      })
-    },
-    save () {
-      plateMgrApi.save(this.tenant)
-        .then((response) => {
-          const res = response.data
-          if (res.isSuccess) {
-            this.isVisible = false
-            this.$message({
-              message: this.$t('tips.createSuccess'),
-              type: 'success'
-            })
-            // 通知列表
-	          this.$emit("success");
-	          // 通知列表-并关闭弹出框
-	          this.$emit("close");
-          }
-        }).finally(() => {
-          this.confirmDisabled = false
-          return true
-        })
-    },
-    update () {
-      plateMgrApi.update(this.tenant)
-        .then((response) => {
-          const res = response.data
-          if (res.isSuccess) {
-            this.isVisible = false
-            this.$message({
-              message: this.$t('tips.updateSuccess'),
-              type: 'success'
-            })
-            // 通知列表
-	          this.$emit("success");
-	          // 通知列表-并关闭弹出框
-	          this.$emit("close");
-          }
-        }).finally(() => {
-          this.confirmDisabled = false
-          return true
-        })
-    },
-    // 托盘下拉数据
-    traymerList(){
-      trayMgrApi.getList({}).then(res => {
-        res = res.data
-        if(res.isSuccess){
-          // console.log("88888== ",res)
-          this.trayList = res.data
-        }
-      })
-    },
-  }
-}
-</script>
-<style lang="scss" >
-.avatar-uploader .el-upload {
-  border: 1px dashed #d9d9d9;
-  border-radius: 6px;
-  cursor: pointer;
-  position: relative;
-  overflow: hidden;
-}
-.avatar-uploader .el-upload:hover {
-  border-color: #409eff;
-}
-.avatar-uploader-icon {
-  font-size: 28px;
-  color: #8c939d;
-  width: 100px;
-  height: 100px;
-  line-height: 100px;
-  text-align: center;
-}
-.avatar {
-  width: 100px;
-  height: 100px;
-  display: block;
-}
-.checkUsed{
-	display: inline-block;
-	margin-left: 10px;
-	color: #1890ff;
-}
-</style>
+<template>
+  <el-dialog
+  	:close-on-click-modal="false"
+  	:close-on-press-escape="false"
+  	:title="title"
+  	:append-to-body="true"
+  	:visible.sync="isVisible"
+  	:width="width"
+  	top="50px"
+  >
+    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
+      <!--名称-->
+      <el-form-item :label='$t("prepare.table.tray.name")+":"' prop="name">
+        <el-input v-model="tenant.name" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <!--所属产线-->
+      <el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 && $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
+        <el-select
+          v-model="tenant.zoneId"
+           :placeholder='$t("common.pleaseSelect")'
+          style="width: 50%"
+        >
+          <el-option
+            v-for="(item, index) in zoneList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <!--品牌-->
+    	<el-form-item :label='$t("prepare.table.tray.brand")+":"' prop="brand">
+      	<el-select style="width:100%" :placeholder='$t("common.pleaseSelect")' v-model="tenant.brand.key" value>
+          <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.METERIAL_BRAND" />
+        </el-select>
+      </el-form-item>
+      <!--规格-->
+      <el-form-item :label='$t("prepare.table.tray.specification")+":"' prop="specification">
+        <el-input v-model="tenant.specification" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+<!--      &lt;!&ndash;可放托盘&ndash;&gt;-->
+<!--      <el-form-item :label='$t("prepare.table.tray.tray")+":"' prop="trayId">-->
+<!--        <el-select v-model="tenant.trayId" :placeholder='$t("common.pleaseSelect")' style="width: 50%;">-->
+<!--          <el-option-->
+<!--            v-for="item in trayList"-->
+<!--            :key="item.id"-->
+<!--            :label="item.name"-->
+<!--            :value="item.id"-->
+<!--          >-->
+<!--          </el-option>-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+      <!--可放托盘数量-->
+      <el-form-item :label='$t("prepare.table.tray.plateMaxNum")+":"' prop="number">
+        <el-input-number v-model="tenant.number"  :min="1" ></el-input-number>
+      </el-form-item>
+      <!--排序(升序)-->
+<!--      <el-form-item :label='$t("common.weight")+":"' prop="weight">-->
+<!--        <el-input-number v-model="tenant.weight" :min="0" :max="9999" label=""></el-input-number>-->
+<!--      </el-form-item>-->
+      <!--状态-->
+      <el-form-item :label='$t("prepare.table.tools.status")+":"' prop="status">
+        <template>
+				  <el-radio v-model="tenant.status" label="1">{{$t("common.status.valid")}}</el-radio>
+				  <el-radio v-model="tenant.status" label="0">{{$t("common.frozen")}}</el-radio>
+				</template>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+      <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// 【托板管理】-API
+import plateMgrApi from "@/api/prepareProductMgr/plateMgr"
+// 【托盘管理】-API
+import trayMgrApi from "@/api/prepareProductMgr/trayMgr"
+//【所属产线】-API
+import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
+export default {
+  name: 'TenantEdit',
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+    	loading: false,
+      type: 'add',
+      zoneList: [],
+      tableData: [],
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      confirmDisabled: false,
+      dicts: {
+	      METERIAL_BRAND: {} //工具材料品牌
+	    },
+      trayList: [],
+      roles: [],
+      rules: {
+        name: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ],
+        number: [
+          { required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  //实例已经在内存中创建好,此时data喝methods已将ok,如果要操作data中得数据或是调用methods中的方法,最早只能在created中操作
+  created() {
+    //加载托盘列表数据
+    this.traymerList();
+    // 加载列表数据
+    this.getZoneList();
+  },
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+  	// 获取【所属产线】下拉数据
+    getZoneList() {
+      areaMgrApi.getList({ status: 1 }).then((res) => {
+        res = res.data;
+        if (res.isSuccess) {
+          this.zoneList = res.data;
+        }
+      });
+    },
+    
+  	// 【新增】按钮-事件
+    addRes(){
+      this.tableData.push({
+      	key: "WKS_"+ Math.random(),
+      	id: '',
+      	positionSort: this.tableData.length + 1,
+      	size: '',
+      	remark: '',
+      	isEdit: true
+      })
+    },
+    // Table的选择事件
+    onSelectChange (selection) {
+      this.selection = selection
+    },
+    // 【删除】按钮事件
+    singleDelete(row){
+    	this.$confirm(this.$t("tips.comTips"), this.$t("common.tips"), {
+      	distinguishCancelAndClose: true,
+        confirmButtonText: this.$t("common.confirm"),
+        cancelButtonText: this.$t("common.cancel"),
+        type: "warning"
+      }).then(() => {
+      	// 过滤符合条件的数据
+      	let arr = this.tableData.filter(item => item.key != row.key || item.id != row.id)
+      	// 给数据排序
+    		arr.forEach((item, index) => {
+    			item.positionSort = index + 1
+    		})
+      	// 给新的数据赋值
+    		this.tableData = arr;
+
+      }).catch(() => {})
+    },
+    // 【修改】按钮事件
+    edit(row){
+    	let list = new Array();
+    	this.tableData.forEach((item, index) => {
+    		// 当前编辑行
+    		if(!!item.id && item.id == row.id){
+    			item.isEdit = true
+    		}
+    		list.push(item)
+    	})
+    	// 赋值给当前
+    	this.tableData = list
+    },
+    initTenant () {
+      return {
+      	userId: this.$store.state.account.user.id,  // 默认添加登录用户ID
+        name: '',
+        brand: {
+          key: ''
+        },
+        status: '1',
+        number: 1,
+      }
+    },
+    initWidth () {
+      this.screenWidth = document.body.clientWidth
+      if (this.screenWidth < 991) {
+        return '90%'
+      } else if (this.screenWidth < 1400) {
+        return '45%'
+      } else {
+        return '800px'
+      }
+    },
+    setTenant (val, dicts) {
+    	if(val){
+    		this.tenant = { ...val }
+    	}
+      // 字典表
+      this.dicts = dicts
+    },
+    close () {
+      this.$emit('close')
+    },
+    reset () {
+      // 先清除校验,再清除表单,不然有奇怪的bug
+      this.$refs.form.clearValidate()
+      this.$refs.form.resetFields()
+      this.tenant = this.initTenant()
+      this.tableData = []  	//清空【规格】数据
+    },
+    submitForm () {
+    	console.log("Form数据:", this.tenant)
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.confirmDisabled = true
+          if (this.type === 'add') {
+            this.save()
+          } else {
+            this.update()
+          }
+        } else {
+          return false
+        }
+      })
+    },
+    save () {
+      plateMgrApi.save(this.tenant)
+        .then((response) => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.isVisible = false
+            this.$message({
+              message: this.$t('tips.createSuccess'),
+              type: 'success'
+            })
+            // 通知列表
+	          this.$emit("success");
+	          // 通知列表-并关闭弹出框
+	          this.$emit("close");
+          }
+        }).finally(() => {
+          this.confirmDisabled = false
+          return true
+        })
+    },
+    update () {
+      plateMgrApi.update(this.tenant)
+        .then((response) => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.isVisible = false
+            this.$message({
+              message: this.$t('tips.updateSuccess'),
+              type: 'success'
+            })
+            // 通知列表
+	          this.$emit("success");
+	          // 通知列表-并关闭弹出框
+	          this.$emit("close");
+          }
+        }).finally(() => {
+          this.confirmDisabled = false
+          return true
+        })
+    },
+    // 托盘下拉数据
+    traymerList(){
+      trayMgrApi.getList({}).then(res => {
+        res = res.data
+        if(res.isSuccess){
+          // console.log("88888== ",res)
+          this.trayList = res.data
+        }
+      })
+    },
+  }
+}
+</script>
+<style lang="scss" >
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+  text-align: center;
+}
+.avatar {
+  width: 100px;
+  height: 100px;
+  display: block;
+}
+.checkUsed{
+	display: inline-block;
+	margin-left: 10px;
+	color: #1890ff;
+}
+</style>

+ 4 - 3
imcs-ui/src/views/zuihou/prepareProductMgr/trayMgr/components/Edit.vue

@@ -10,7 +10,7 @@
   >
     <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
     	<!--所属产线-->
-      <el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 || $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
+      <!--<el-form-item v-if="$store.state.account.user.roles.indexOf('舱体') < 0 && $store.state.account.user.roles.indexOf('框体') < 0" label='所属产线:' prop="zoneId">
         <el-select
           v-model="tenant.zoneId"
            :placeholder='$t("common.pleaseSelect")'
@@ -23,7 +23,7 @@
             :value="item.id"
           />
         </el-select>
-      </el-form-item>
+      </el-form-item>-->
       <!--编码-->
       <el-form-item :label='$t("prepare.table.tray.no")+":"' prop="no">
         <el-input v-model="tenant.no" :placeholder='$t("common.pleaseEnter")'/>
@@ -118,7 +118,7 @@ export default {
   // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
   created() {
     // 加载列表数据
-    this.getZoneList();
+    // this.getZoneList();
   },
   computed: {
     isVisible: {
@@ -199,6 +199,7 @@ export default {
     },
     initTenant () {
       return {
+      	userId: this.$store.state.account.user.id,  // 默认添加登录用户ID
       	model: '',
         name: '',
         zoneId: '',