Browse Source

产线只显示两个,不用显示保障平台

姚云青 3 years ago
parent
commit
244d72bb7a

+ 10 - 0
imcs-ui/src/api/resourceProductMgr/areaMgr.js

@@ -5,6 +5,10 @@ const apiList = {
     method: 'GET',
     url: `/authority/zZone/all`
   },
+  zoneListExceptBz: {
+    method: 'GET',
+    url: `/authority/zZone/zoneListExceptBz`
+  },
   page: {
     method: 'POST',
     url: `/authority/zZone/page`
@@ -62,6 +66,12 @@ export default {
       data
     })
   },
+  zoneListExceptBz (data) {
+    return axiosApi({
+      ...apiList.zoneListExceptBz,
+      data
+    })
+  },
   page (data) {
     return axiosApi({
       ...apiList.page,

+ 1 - 1
imcs-ui/src/lang/zh/prepare.js

@@ -249,7 +249,7 @@ export default {
 			// 【托盘管理】列表table字段名称
 			tray: {
 				no: '物料编码',
-				name: '托名称',
+				name: '托名称',
         materialType: '物料类型',
         factory: '生产分厂/制造商',
 

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

@@ -250,7 +250,7 @@ export default {
   methods: {
   	// 获取【所属产线】下拉数据
     getZoneList() {
-      areaMgrApi.getList({ status: 1 }).then((res) => {
+      areaMgrApi.zoneListExceptBz({ status: 1 }).then((res) => {
         res = res.data;
         if (res.isSuccess) {
           this.zoneList = res.data;

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

@@ -1,363 +1,363 @@
-<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 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='物料编码:' prop="meterialCode">
-        <el-input v-model.trim="tenant.meterialCode" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-      <!--<el-form-item label='材料牌号:' prop="category" >
-        <el-select style="width:100%" :placeholder='$t("common.pleaseSelect")' v-model="tenant.category.key" value @change="selectCategory($event)">
-          <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.METERIAL_CATEGORY" />
-        </el-select>
-      </el-form-item>
-      <el-form-item :label='$t("prepare.table.tools.materialType")+":"' prop="materialType" v-show="materialTypeShowFlag">
-        <el-select style="width:100%" :placeholder='$t("common.pleaseSelect")' v-model="tenant.materialType.key" value>
-          <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.MATERIAL_TYPE" />
-        </el-select>
-      </el-form-item>
-      <el-form-item :label='$t("prepare.table.tools.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='材料牌号:' prop="tradeMark">
-        <el-input v-model.trim="tenant.tradeMark" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-      <el-form-item label='器材名称:' prop="equipmentName">
-        <el-input v-model.trim="tenant.equipmentName" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-      <el-form-item label='规格型号:' prop="specification">
-        <el-input v-model.trim="tenant.specification" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>      
-      <!--<el-form-item :label='$t("prepare.table.tools.joinDate")+":"' prop="joinDate">        
-        <el-date-picker
-            v-model="tenant.joinDate"
-            type="date"
-            value-format="yyyy-MM-dd"            
-            placeholder="">
-         </el-date-picker>
-      </el-form-item>-->
-      <el-form-item label='处理状态:' prop="handleStatus">
-        <el-input v-model.trim="tenant.handleStatus" :placeholder='$t("common.pleaseEnter")'/>
-      </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 MaterialApi from "@/api/prepareProductMgr/material"
-	//【所属产线】-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',
-	      tableData: [],
-	      zoneList: [],
-	      materialTypeShowFlag: false,
-	      tenant: this.initTenant(),
-	      screenWidth: 0,
-	      width: this.initWidth(),
-	      confirmDisabled: false,
-	      dicts: {
-		      METERIAL_BRAND: {},  //工具材料品牌
-		      METERIAL_CATEGORY: {}, //工具材料分类
-	        MATERIAL_TYPE: {}  //工具材料毛坯成品分类
-		    },
-	      roles: [],
-	      rules: {
-	        meterialCode: [
-	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-	        ],
-	        tradeMark: [
-	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-	        ],
-	        specification: [
-	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-	        ]
-	      }
-	    }
-	  },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-	    // 加载列表数据
-	    this.getZoneList();
-	    // console.log("用户登录的信息:",this.$store.state.account.user.roles.indexOf("舱体") < 0);
-	  },
-	  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: "",
-	      	tradeMark: "",
-	      	specification: "",
-	      	isEdit: true
-	      })
-	    },
-	    // Table的选择事件
-	    onSelectChange (selection) {
-	      this.selection = selection
-	    },
-	    // 【删除】按钮事件
-	    singleDelete(row){
-	    	this.$confirm("删除数据后,将会消失,您的努力将白费,请确认删除?", this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: "确认",
-	        cancelButtonText: "取消",
-	        type: "warning"
-	      }).then(() => {
-	      	// 过滤符合条件的数据
-	      	let arr = this.tableData.filter(item => item.key != row.key || item.id != row.id)
-	      	// 给新的数据赋值
-	    		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
-	      	meterialCode: '',
-	        tradeMark: '',
-	        equipmentName: '',
-	        specification: '',
-	        handleStatus: '',
-	        status: '1'
-	      }
-	    },
-	
-	    selectCategory(id){
-	      if("04" === id){
-	          this.materialTypeShowFlag = true;
-	      }else{
-	          this.materialTypeShowFlag = false;
-	      }
-	    },
-	    
-	    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 }
-	    		/*if("04" === this.tenant.category.key){
-	            this.materialTypeShowFlag = true;
-	        }else{
-	            this.materialTypeShowFlag = false;
-	        }*/
-	    		// 根据id,查询规格列表数据
-	    		// this.getSpecsList(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 () {
-	      console.log(this.tenant)
-	      MaterialApi.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 () {
-	      MaterialApi.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
-	        })
-	    },
-	    // 根据【工具原材料】的id,查询,规格列表数据
-	    getSpecsList(row){
-	    	/*let obj = {
-	    		current: 1,
-	    		size: 1000,
-	    		model: {
-	    			meterialId: row.id
-	    		}
-	    	}*/
-	    	MaterialApi.listSpecs({meterialId: row.id}).then(res => {
-	    		res = res.data
-	    		console.log("规格数据:", res)
-	    		if(res.isSuccess){
-	    			this.tableData = 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 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='物料编码:' prop="meterialCode">
+        <el-input v-model.trim="tenant.meterialCode" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <!--<el-form-item label='材料牌号:' prop="category" >
+        <el-select style="width:100%" :placeholder='$t("common.pleaseSelect")' v-model="tenant.category.key" value @change="selectCategory($event)">
+          <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.METERIAL_CATEGORY" />
+        </el-select>
+      </el-form-item>
+      <el-form-item :label='$t("prepare.table.tools.materialType")+":"' prop="materialType" v-show="materialTypeShowFlag">
+        <el-select style="width:100%" :placeholder='$t("common.pleaseSelect")' v-model="tenant.materialType.key" value>
+          <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.MATERIAL_TYPE" />
+        </el-select>
+      </el-form-item>
+      <el-form-item :label='$t("prepare.table.tools.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='材料牌号:' prop="tradeMark">
+        <el-input v-model.trim="tenant.tradeMark" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item label='器材名称:' prop="equipmentName">
+        <el-input v-model.trim="tenant.equipmentName" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item label='规格型号:' prop="specification">
+        <el-input v-model.trim="tenant.specification" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <!--<el-form-item :label='$t("prepare.table.tools.joinDate")+":"' prop="joinDate">
+        <el-date-picker
+            v-model="tenant.joinDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="">
+         </el-date-picker>
+      </el-form-item>-->
+      <el-form-item label='处理状态:' prop="handleStatus">
+        <el-input v-model.trim="tenant.handleStatus" :placeholder='$t("common.pleaseEnter")'/>
+      </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 MaterialApi from "@/api/prepareProductMgr/material"
+	//【所属产线】-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',
+	      tableData: [],
+	      zoneList: [],
+	      materialTypeShowFlag: false,
+	      tenant: this.initTenant(),
+	      screenWidth: 0,
+	      width: this.initWidth(),
+	      confirmDisabled: false,
+	      dicts: {
+		      METERIAL_BRAND: {},  //工具材料品牌
+		      METERIAL_CATEGORY: {}, //工具材料分类
+	        MATERIAL_TYPE: {}  //工具材料毛坯成品分类
+		    },
+	      roles: [],
+	      rules: {
+	        meterialCode: [
+	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+	        ],
+	        tradeMark: [
+	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+	        ],
+	        specification: [
+	        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+	        ]
+	      }
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	    // 加载列表数据
+	    this.getZoneList();
+	    // console.log("用户登录的信息:",this.$store.state.account.user.roles.indexOf("舱体") < 0);
+	  },
+	  computed: {
+	    isVisible: {
+	      get () {
+	        return this.dialogVisible
+	      },
+	      set () {
+	        this.close()
+	        this.reset()
+	      }
+	    }
+	  },
+	  mounted () {
+	    window.onresize = () => {
+	      return (() => {
+	        this.width = this.initWidth()
+	      })()
+	    }
+	  },
+	  methods: {
+	  	// 获取【所属产线】下拉数据
+	    getZoneList() {
+	      areaMgrApi.zoneListExceptBz({ status: 1 }).then((res) => {
+	        res = res.data;
+	        if (res.isSuccess) {
+	          this.zoneList = res.data;
+	        }
+	      });
+	    },
+
+	  	// 【新增】按钮-事件
+	    addRes(){
+	      this.tableData.push({
+	      	key: "WKS_"+ Math.random(),
+	      	id: "",
+	      	tradeMark: "",
+	      	specification: "",
+	      	isEdit: true
+	      })
+	    },
+	    // Table的选择事件
+	    onSelectChange (selection) {
+	      this.selection = selection
+	    },
+	    // 【删除】按钮事件
+	    singleDelete(row){
+	    	this.$confirm("删除数据后,将会消失,您的努力将白费,请确认删除?", this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: "确认",
+	        cancelButtonText: "取消",
+	        type: "warning"
+	      }).then(() => {
+	      	// 过滤符合条件的数据
+	      	let arr = this.tableData.filter(item => item.key != row.key || item.id != row.id)
+	      	// 给新的数据赋值
+	    		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
+	      	meterialCode: '',
+	        tradeMark: '',
+	        equipmentName: '',
+	        specification: '',
+	        handleStatus: '',
+	        status: '1'
+	      }
+	    },
+
+	    selectCategory(id){
+	      if("04" === id){
+	          this.materialTypeShowFlag = true;
+	      }else{
+	          this.materialTypeShowFlag = false;
+	      }
+	    },
+
+	    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 }
+	    		/*if("04" === this.tenant.category.key){
+	            this.materialTypeShowFlag = true;
+	        }else{
+	            this.materialTypeShowFlag = false;
+	        }*/
+	    		// 根据id,查询规格列表数据
+	    		// this.getSpecsList(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 () {
+	      console.log(this.tenant)
+	      MaterialApi.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 () {
+	      MaterialApi.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
+	        })
+	    },
+	    // 根据【工具原材料】的id,查询,规格列表数据
+	    getSpecsList(row){
+	    	/*let obj = {
+	    		current: 1,
+	    		size: 1000,
+	    		model: {
+	    			meterialId: row.id
+	    		}
+	    	}*/
+	    	MaterialApi.listSpecs({meterialId: row.id}).then(res => {
+	    		res = res.data
+	    		console.log("规格数据:", res)
+	    		if(res.isSuccess){
+	    			this.tableData = 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>

+ 15 - 361
imcs-ui/src/views/zuihou/prepareProductMgr/trayMgr/components/Edit.vue

@@ -1,349 +1,3 @@
-<<<<<<< HEAD
-<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 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.no")+":"' prop="no">
-        <el-input v-model="tenant.no" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-      <!--名称-->
-      <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.materialType")+":"' prop="materialType">
-        <el-input v-model="tenant.materialType" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-<!--      &lt;!&ndash;品牌&ndash;&gt;-->
-<!--    	<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.factory")+":"' prop="factory">
-        <el-input v-model="tenant.factory" :placeholder='$t("common.pleaseEnter")'/>
-      </el-form-item>
-
-      <el-form-item :label='$t("prepare.table.tray.joinDate")+":"' prop="joinDate">
-        <el-date-picker
-          v-model="tenant.joinDate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item :label='$t("prepare.table.tray.period")+":"' prop="period">
-        <el-input-number v-model="tenant.period" :min="1" :max="1000" label="12"></el-input-number>&nbsp;&nbsp;月
-      </el-form-item>
-      <el-form-item :label="$t('prepare.table.tray.expiryDate')+':'" prop="expiryDate">
-        <el-input-number v-model="tenant.expiryDate" :min="1" :max="1000" label="12"></el-input-number>&nbsp;&nbsp;月
-      </el-form-item>
-      <el-form-item :label='$t("prepare.table.tray.num")+":"' prop="num">
-        <el-input-number v-model="tenant.num" :min="1" :max="1000" label="1"></el-input-number>&nbsp;&nbsp;个
-      </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 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: {} //工具材料品牌
-	    },
-      roles: [],
-      rules: {
-        name: [
-        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-  created() {
-    // 加载列表数据
-    // this.getZoneList();
-  },
-  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
-      })
-    },
-    
-    // 获取【所属产线】下拉数据
-    getZoneList() {
-      areaMgrApi.getList({ status: 1 }).then((res) => {
-        res = res.data;
-        if (res.isSuccess) {
-          this.zoneList = res.data;
-        }
-      });
-    },
-    
-    // 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
-      	model: '',
-        name: '',
-        zoneId: '',
-        category: {
-          key: ''
-        },
-        brand: {
-          key: ''
-        },
-        status: '1',
-        num: '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 }
-    		// 根据id,查询规格列表数据
-    		this.getSpecsList(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 () {
-    	// 添加夹紧位置数据
-    	this.tenant.trayPositionList = this.tableData
-    	//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 () {
-      trayMgrApi.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 () {
-      trayMgrApi.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
-        })
-    },
-    // 根据【托盘】的id,查询,夹紧位置列表数据
-    getSpecsList(row){
-    	trayMgrApi.listSpecs(row).then(res => {
-    		res = res.data
-    		// console.log("夹紧位置数据:", res)
-    		if(res.isSuccess){
-    			this.tableData = 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"
@@ -356,20 +10,20 @@ export default {
   >
     <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-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 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.no")+":"' prop="no">
         <el-input v-model="tenant.no" :placeholder='$t("common.pleaseEnter")'/>
@@ -499,7 +153,7 @@ export default {
 
     // 获取【所属产线】下拉数据
     getZoneList() {
-      areaMgrApi.getList({ status: 1 }).then((res) => {
+      areaMgrApi.zoneListExceptBz({ status: 1 }).then((res) => {
         res = res.data;
         if (res.isSuccess) {
           this.zoneList = res.data;