Bläddra i källkod

2022-03-13 10:43

王克恕 3 år sedan
förälder
incheckning
eb5512999d

+ 320 - 317
imcs-ui/src/views/zuihou/resourceProductMgr/equipmentPosition/components/Edit.vue

@@ -1,317 +1,320 @@
-<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">
-    	<template v-if="type == 'link'">
-    		<el-form-item :label='$t("resource.form.selectLink")+":"' prop="selectLink">
-	          <el-select
-					    v-model="tenant.shelvesId"
-					    multiple
-					    collapse-tags
-					    style="width:100%;"
-					    :placeholder='$t("common.pleaseSelect")'
-					  >
-					    <el-option
-					      v-for="item in options"
-					      :key="item.id"
-					      :label="item.name"
-					      :value="item.id">
-					    </el-option>
-					  </el-select>
-	      </el-form-item>
-      </template>
-      <template v-else="">
-      	<!-- 位置名称 -->
-      	<el-form-item :label='$t("resource.form.positionName")+":"' prop="name">
-	          <el-input v-model="tenant.name" :placeholder='$t("common.pleaseEnter")'/>
-	      </el-form-item>
-	      <!-- 关联库位 -->
-      	<el-form-item :label='$t("resource.form.relationStorage")+":"' prop="relationLocationList">
-	        <el-cascader 
-	        	v-model="tenant.relationLocationList" 
-	        	clearable 
-	        	filterable 
-	        	:props="storgeOpts"
-	        	:options="storageList"
-	        	style="width: 50%;"
-	        ></el-cascader>
-	      </el-form-item>
-	      <!-- 点位ID -->
-      	<el-form-item :label='$t("resource.form.pointId")+":"' prop="pointId">
-	          <el-input v-model="tenant.pointId" :placeholder='$t("common.pleaseEnter")'/>
-	      </el-form-item>
-	      <!-- 是否锁定 -->
-	      <el-form-item :label='$t("resource.form.isLock")+":"' prop="status">
-	        <template>
-					  <el-radio v-model="tenant.status" label="1">{{$t("common.lock")}}</el-radio>
-					  <el-radio v-model="tenant.status" label="0">{{$t("common.unlock")}}</el-radio>
-					</template>
-	      </el-form-item>
-      </template>
-    </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 equipmentPositionApi from "@/api/resourceProductMgr/equipmentPosition"
-// 【货架管理】-API
-import goodsShelvesMgrApi from "@/api/modelingCenter/goodsShelvesMgr"
-	
-export default {
-  name: 'TenantEdit',
-  props: {
-    dialogVisible: {
-      type: Boolean,
-      default: false
-    },
-    title: {
-      type: String,
-      default: ''
-    }
-  },
-  data () {
-    return {
-    	options: [],
-      type: 'add',
-      tenant: this.initTenant(),
-      screenWidth: 0,
-      positionId: null,  // 生产资源位置id
-      width: this.initWidth(),
-      confirmDisabled: false,
-      dicts:{
-        NATION: {}
-      },
-      storgeOpts:{
-      	value: 'id',
-      	label: 'name'
-      },
-      storageList: [], // 关联库位
-      roles: [],
-      rules: {
-        name: [
-        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-  created() {
-  	// 调用常量-初始化值
-  	// this.options = this.$constWKS.OPTIONS;
-  	// 获取【货架】下拉-数据
-    this.getShelves()
-    // 获取【关联库位】数据
-   	this.getRelationLocationList()
-	},
-  computed: {
-    isVisible: {
-      get () {
-        return this.dialogVisible
-      },
-      set () {
-        this.close()
-        this.reset()
-      }
-    }
-  },
-  mounted () {
-    window.onresize = () => {
-      return (() => {
-        this.width = this.initWidth()
-      })()
-    }
-  },
-  methods: {
-    initTenant () {
-      return {
-        id: '',
-        name: '',
-        pointId: '',
-        status: '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, rowData) {
-    	if(val){
-    		this.tenant = { ...val }
-    		// 生产资源位置id
-    		this.positionId = val.id
-    	}
-    	// 所属生产资源id
-    	this.tenant.resourceId = rowData.id
-      // 字典表
-      this.dicts = dicts
-    },
-    close () {
-      this.$emit('close')
-    },
-    reset () {
-      // 先清除校验,再清除表单,不然有奇怪的bug
-      this.$refs.form.clearValidate()
-      this.$refs.form.resetFields()
-      this.tenant = this.initTenant()
-    },
-    submitForm () {
-    	console.log("form表单数据:", this.tenant)
-    	// return false
-      this.$refs.form.validate((valid) => {
-        if (valid) {
-          this.confirmDisabled = true
-          // 关联边线库-货架
-          if (this.type == 'link') {
-            this.saveShelves()
-          }else if(this.type === 'add'){
-          	this.save()
-          } else {
-            this.update()
-          }
-        } else {
-          return false
-        }
-      })
-    },
-    // 【关联边线库】确定-事件
-    saveShelves () {
-    	let obj= {
-    		positionId: this.positionId,
-				resourceId: this.tenant.resourceId,
-				shelvesId: this.tenant.shelvesId
-    	}
-    	// console.log("【关联边线库】数据:", obj)
-      equipmentPositionApi.saveShelves(obj)
-        .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
-        })
-    },
-    save () {
-      equipmentPositionApi.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 () {
-      equipmentPositionApi.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
-        })
-    },
-    // 获取【货架】下拉-数据
-    getShelves () {
-    	// 参数固定,只查询,货架
-      goodsShelvesMgrApi.list({type: '1'}).then(response => {
-        const res = response.data
-        console.log("货架数据:", res)
-        if (res.isSuccess) {
-          this.options = res.data
-        }
-        // eslint-disable-next-line no-return-assign
-      }).finally(() => this.loading = false)
-     
-    },
-    // 获取【关联库位】数据
-   	getRelationLocationList(){
-   		equipmentPositionApi.getRelationLocationList().then(res => {
-   			res = res.data
-   			console.log("【关联库位】数据:", res);
-   			if(res.isSuccess){
-   				this.storageList = 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">
+    	<template v-if="type == 'link'">
+    		<el-form-item :label='$t("resource.form.selectLink")+":"' prop="selectLink">
+	          <el-select
+					    v-model="tenant.shelvesId"
+					    multiple
+					    collapse-tags
+					    style="width:100%;"
+					    :placeholder='$t("common.pleaseSelect")'
+					  >
+					    <el-option
+					      v-for="item in options"
+					      :key="item.id"
+					      :label="item.name"
+					      :value="item.id">
+					    </el-option>
+					  </el-select>
+	      </el-form-item>
+      </template>
+      <template v-else="">
+      	<!-- 位置名称 -->
+      	<el-form-item :label='$t("resource.form.positionName")+":"' prop="name">
+	          <el-input v-model="tenant.name" :placeholder='$t("common.pleaseEnter")'/>
+	      </el-form-item>
+	      <!-- 关联库位 -->
+      	<el-form-item :label='$t("resource.form.relationStorage")+":"' prop="relationLocationList">
+	        <el-cascader 
+	        	v-model="tenant.relationLocationList" 
+	        	clearable 
+	        	filterable 
+	        	:props="storgeOpts"
+	        	:options="storageList"
+	        	style="width: 50%;"
+	        ></el-cascader>
+	      </el-form-item>
+	      <!-- 点位ID -->
+      	<el-form-item :label='$t("resource.form.pointId")+":"' prop="pointId">
+	          <el-input v-model="tenant.pointId" :placeholder='$t("common.pleaseEnter")'/>
+	      </el-form-item>
+	      <!-- 是否锁定 -->
+	      <el-form-item :label='$t("resource.form.isLock")+":"' prop="status">
+	        <template>
+					  <el-radio v-model="tenant.status" label="1">{{$t("common.lock")}}</el-radio>
+					  <el-radio v-model="tenant.status" label="0">{{$t("common.unlock")}}</el-radio>
+					</template>
+	      </el-form-item>
+      </template>
+    </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 equipmentPositionApi from "@/api/resourceProductMgr/equipmentPosition"
+// 【货架管理】-API
+import goodsShelvesMgrApi from "@/api/modelingCenter/goodsShelvesMgr"
+	
+export default {
+  name: 'TenantEdit',
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+    	options: [],
+      type: 'add',
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      positionId: null,  // 生产资源位置id
+      width: this.initWidth(),
+      confirmDisabled: false,
+      dicts:{
+        NATION: {}
+      },
+      storgeOpts:{
+      	value: 'id',
+      	label: 'name'
+      },
+      storageList: [], // 关联库位
+      roles: [],
+      rules: {
+        name: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+  created() {
+  	// 调用常量-初始化值
+  	// this.options = this.$constWKS.OPTIONS;
+  	// 获取【货架】下拉-数据
+    this.getShelves()
+    // 获取【关联库位】数据
+   	this.getRelationLocationList()
+	},
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    initTenant () {
+      return {
+        id: '',
+        name: '',
+        pointId: '',
+        relationLocationList: [],
+        // relationLocationList: ["1496439392011550720", "1496439613852483584", "1496717199719530496"],
+        status: '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, rowData) {
+    	console.log("dfsdfdfd ===== ", val);
+    	if(val){
+    		this.tenant = { ...val }
+    		// 生产资源位置id
+    		this.positionId = val.id
+    	}
+    	// 所属生产资源id
+    	this.tenant.resourceId = rowData.id
+      // 字典表
+      this.dicts = dicts
+    },
+    close () {
+      this.$emit('close')
+    },
+    reset () {
+      // 先清除校验,再清除表单,不然有奇怪的bug
+      this.$refs.form.clearValidate()
+      this.$refs.form.resetFields()
+      this.tenant = this.initTenant()
+    },
+    submitForm () {
+    	console.log("form表单数据:", this.tenant)
+    	// return false
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.confirmDisabled = true
+          // 关联边线库-货架
+          if (this.type == 'link') {
+            this.saveShelves()
+          }else if(this.type === 'add'){
+          	this.save()
+          } else {
+            this.update()
+          }
+        } else {
+          return false
+        }
+      })
+    },
+    // 【关联边线库】确定-事件
+    saveShelves () {
+    	let obj= {
+    		positionId: this.positionId,
+				resourceId: this.tenant.resourceId,
+				shelvesId: this.tenant.shelvesId
+    	}
+    	// console.log("【关联边线库】数据:", obj)
+      equipmentPositionApi.saveShelves(obj)
+        .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
+        })
+    },
+    save () {
+      equipmentPositionApi.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 () {
+      equipmentPositionApi.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
+        })
+    },
+    // 获取【货架】下拉-数据
+    getShelves () {
+    	// 参数固定,只查询,货架
+      goodsShelvesMgrApi.list({type: '1'}).then(response => {
+        const res = response.data
+        console.log("货架数据:", res)
+        if (res.isSuccess) {
+          this.options = res.data
+        }
+        // eslint-disable-next-line no-return-assign
+      }).finally(() => this.loading = false)
+     
+    },
+    // 获取【关联库位】数据
+   	getRelationLocationList(){
+   		equipmentPositionApi.getRelationLocationList().then(res => {
+   			res = res.data
+   			console.log("【关联库位】数据:", res);
+   			if(res.isSuccess){
+   				this.storageList = 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>

+ 3 - 3
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/PprogResource.vue

@@ -23,7 +23,7 @@
 		      class="noPaddingTable"
 		      style="width: 100%;"
 		    >
-		    	<el-table-column label="基础信息" align="center" width="310px" fixed>
+		    	<el-table-column label="基础信息" align="center">
 			    	<!-- 序号 -->
 			    	<el-table-column :label='$t("common.serialNo")' width="50px" align="center">
 				      <template slot-scope="scope">
@@ -35,7 +35,7 @@
 			      	<!-- 编号 -->
 			      	<el-table-column prop="code" label='编号' :show-overflow-tooltip="true" width="100px"></el-table-column>
 			      	<!-- 生产资源名称 -->
-			      	<el-table-column prop="name" label='生产资源名称' :show-overflow-tooltip="true" width="160px"></el-table-column>
+			      	<el-table-column prop="name" label='生产资源名称' :show-overflow-tooltip="true" width="200px"></el-table-column>
 			    </el-table-column>
 		      	<el-table-column 
 		      		v-for="item in tableData.titleList" 
@@ -459,7 +459,7 @@ export default {
 			height: 70px;
 		}
 		.tiActive{
-			background: #3CC787;
+			background: #CC9900;
 		}
 	}
 	.timeItemDesc {

+ 9 - 10
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/Index.vue

@@ -4,25 +4,25 @@
     <el-row :gutter="20" class="rowCls">
       <el-col :xs="12" :sm="8" :lg="6">
         <div class="blockDiv blockBg1">
-          <h1><countTo :duration="3000" :end-val="topTongjiData.orderProduceNum" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
+          <h1><countTo :duration="3000" :end-val="topTongjiData.producePlan" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
           <p>生产中计划</p>
         </div>
       </el-col>
       <el-col :xs="12" :sm="8" :lg="6">
       	<div class="blockDiv blockBg2">
-  					<h1><countTo :duration="3000" :end-val="topTongjiData.conductTaskNum" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
+  					<h1><countTo :duration="3000" :end-val="topTongjiData.delayPlan" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
 	          <p>超时计划</p>
       	</div>
       </el-col>
       <el-col :xs="12" :sm="8" :lg="6">
          <div class="blockDiv blockBg3">
-  					<h1><countTo :duration="3000" :end-val="topTongjiData.manualLockTaskNum" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
+  					<h1><countTo :duration="3000" :end-val="topTongjiData.producePart" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
       			<p>生产中零件</p>
         </div>
       </el-col>
       <el-col :xs="12" :sm="8" :lg="6">
         <div class="blockDiv blockBg4">
-  					<h1><countTo :duration="3000" :end-val="topTongjiData.stopTaskNum" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
+  					<h1><countTo :duration="3000" :end-val="topTongjiData.badPart" :start-val="0"/><span class="danweiSpan">{{$t("runCenter.common.lit")}}</span></h1>
       			<p>异常零件</p>
         </div>
       </el-col>
@@ -80,7 +80,7 @@
 	  },
 	  data () {
 	    return {
-	    	topTongjiData: {"orderProduceNum": 0, "conductTaskNum": 0,"manualLockTaskNum": 0,"stopTaskNum": 0,"adaptiveSchedulingNum": 0},
+	    	topTongjiData: {"producePlan": 0, "delayPlan": 0,"producePart": 0,"badPart": 0},
 	    	activeTab: "task",  // 默认选择的tab(任务时间甘特图)
 	    	isShow: true
 	    }
@@ -132,11 +132,10 @@
 	    			res = res.data
 	    			// 赋值
 	    			this.topTongjiData = {
-	    				orderProduceNum: parseInt(res.orderProduceNum), //订单生产中
-							conductTaskNum: parseInt(res.conductTaskNum), //进行任务
-							manualLockTaskNum: parseInt(res.manualLockTaskNum), // 人工锁定任务
-							stopTaskNum: parseInt(res.stopTaskNum), // 暂停任务
-							adaptiveSchedulingNum: parseInt(res.adaptiveSchedulingNum) // 自适应调度
+	    				producePlan: parseInt(res.producePlan), //订单生产中
+							delayPlan: parseInt(res.delayPlan), //超时计划
+							producePart: parseInt(res.manualLockTaskNum), // 生产零件中
+							badPart: parseInt(res.badPart) // 异常零件
 	    			}
 	    		}
 	  		})

+ 2 - 2
imcs-ui/src/views/zuihou/runManageCenter/productionScheduling/components/SchedResource.vue

@@ -22,7 +22,7 @@
 		      class="noPaddingTable"
 		      style="width: 100%;"
 		    >
-		    	<el-table-column label="基础信息" align="center" width="310px" fixed>
+		    	<el-table-column label="基础信息" align="center">
 			    	<!-- 序号 -->
 			    	<el-table-column :label='$t("common.serialNo")' width="50px" align="center">
 				      <template slot-scope="scope">
@@ -34,7 +34,7 @@
 			      	<!-- 编号 -->
 			      	<el-table-column prop="code" label='编号' :show-overflow-tooltip="true" width="100px"></el-table-column>
 			      	<!-- 生产资源名称 -->
-			      	<el-table-column prop="name" label='生产资源名称' :show-overflow-tooltip="true" width="160px"></el-table-column>
+			      	<el-table-column prop="name" label='生产资源名称' :show-overflow-tooltip="true" width="200px"></el-table-column>
 			    </el-table-column>
 		      	<el-table-column 
 		      		v-for="item in tableData.titleList"