Browse Source

2022-03-20 15:50

王克恕 3 năm trước cách đây
mục cha
commit
d31b7d92ae

+ 7 - 0
imcs-ui/src/lang/zh/prepare.js

@@ -101,6 +101,7 @@ export default {
 			parts_name: '零件名称',
 			partsAlias: '零件代号',
 			specification: '规格',
+			batchNo: '零件批号',
 			models: '型  号',
 			brand: '品牌',
 			model: '规格',
@@ -113,6 +114,12 @@ export default {
 			pgType: '位置程序类型',
 			auditStatus: '审核状态',
 			qiyongStatus: '启用状态',
+			materialBrandName: '材料牌号',
+			plateName: '托盘名称',
+			keyFlag: '是否关键件',
+			importantFlag: '是否关重件',
+			remark: '备注',
+			productModuleName: '工艺版本名称',
 			auditStatuss: {
 				zero: '新建零件',
 				one: '待审核',

+ 26 - 9
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/Index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <div class="filter-container">
     	<span>
-	    	<el-radio-group v-model="queryParams.model.audit_status" @change="search()">
+	    	<el-radio-group v-model="queryParams.model.auditStatus" @change="search()">
 		      <el-radio-button label="2">{{$t("prepare.searchForm.auditStatuss.two")}}</el-radio-button>
 		      <el-radio-button label="1">{{$t("prepare.searchForm.auditStatuss.one")}}</el-radio-button>
 		      <el-radio-button label="3">{{$t("prepare.searchForm.auditStatuss.three")}}</el-radio-button>
@@ -48,11 +48,11 @@
     	</span>-->
     	<span>
     		<span>{{$t("prepare.searchForm.parts_no")}}:</span>
-    		<el-input v-model="queryParams.model.parts_no" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    		<el-input v-model="queryParams.model.partsNo" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
     	</span>
     	<span style="margin-left: 15px;">
     		<span>{{$t("prepare.searchForm.bomAlias")}}:</span>
-    		<el-input v-model="queryParams.model.bom_alias" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    		<el-input v-model="queryParams.model.bomAlias" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
     	</span>
     	<span style="margin-left: 15px;">
     		<span>{{$t("prepare.searchForm.parts_name")}}:</span>
@@ -60,7 +60,7 @@
     	</span>
       <span style="margin-left: 15px;">
     		<span>{{$t("prepare.searchForm.partsAlias")}}:</span>
-    		<el-input v-model="queryParams.model.parts_alias" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    		<el-input v-model="queryParams.model.partsAlias" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
     	</span>
       <span style="margin-left: 15px;">
 	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
@@ -93,7 +93,7 @@
       :key="tableKey"
       ref="table"
       v-loading="loading"
-      :data="tableData.data"
+      :data="tableData.records"
       border
       fit
       row-key="id"
@@ -106,7 +106,7 @@
       @cell-click="cellClick"
     >
       <el-table-column align="center" type="selection" width="40px" :reserve-selection="true" />
-      <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.field" :label='item.text' :show-overflow-tooltip="true" width="180px"></el-table-column>
+      <el-table-column v-for="item in titleList" :key="item.id" :prop="item.field" :label='item.text' :show-overflow-tooltip="true" width="180px" :formatter="textFormatter"></el-table-column>
       <!--<el-table-column prop="name" label="名称" :show-overflow-tooltip="true" width="250px"></el-table-column>
       <el-table-column prop="status" label="状态" align="center" width="90px">
         <template slot-scope="{ row }">
@@ -217,6 +217,7 @@
 </template>
 
 <script>
+import i18n from '@/lang'
 import Pagination from "@/components/Pagination"
 import TenantEdit from "./components/Edit"
 import TenantView from "./components/View"
@@ -234,6 +235,8 @@ export default {
     	expands: [], // 展开行的key
     	qiyongStatus: [], //状态
     	statusList: [], // 启用状态
+      titleList: [{"field":"partsNo","text":i18n.t("prepare.searchForm.parts_no")},{"field":"bomAlias","text":i18n.t("prepare.searchForm.bomAlias")},{"field":"name","text":i18n.t("prepare.searchForm.name")},{"field":"partsAlias","text":i18n.t("prepare.searchForm.partsAlias")},{"field":"batchNo","text":i18n.t("prepare.searchForm.batchNo")},{"field":"materialBrandName","text":i18n.t("prepare.searchForm.materialBrandName")},{"field":"batchNo","text":i18n.t("prepare.searchForm.batchNo")},
+                   {"field":"keyFlag","text":i18n.t("prepare.searchForm.keyFlag")},{"field":"importantFlag","text":i18n.t("prepare.searchForm.importantFlag")},{"field":"productModuleName","text":i18n.t("prepare.searchForm.productModuleName")},{"field":"remark","text":i18n.t("prepare.searchForm.remark")},{"field":"status","text":i18n.t("prepare.searchForm.status")},{"field":"auditStatus","text":i18n.t("prepare.searchForm.auditStatus")}],
       dialog: {
         isVisible: false,
         title: ""
@@ -400,7 +403,21 @@ export default {
     onSelectChange (selection) {
       this.selection = selection
     },
-    
+    textFormatter(row, column){
+      if (column.property == "keyFlag"){
+         return (row.keyFlag === '1')? "是" : "否"
+      }
+      else if (column.property == "importantFlag"){
+         return (row.importantFlag === '1')? "是" : "否"
+      }else if (column.property == "status"){
+         return (row.status === '1')? "启用" : "冻结"
+      }else if (column.property == "auditStatus"){
+         return (row.auditStatus === '0')? "新增" : (row.auditStatus === '1')? "未审核":(row.auditStatus === '2')? "审核通过" : "审核未通过"
+      }else{
+         return row[column.property]
+      }
+
+    },    
     // 搜索
     search () {
     	// 清空,table的选中函数
@@ -563,9 +580,9 @@ export default {
 			// 分页信息
       this.queryParams.current = params.current ? params.current : this.queryParams.current
       this.queryParams.size = params.size ? params.size : this.queryParams.size
-
+     
 			// 测试数据,真实数据,请使用page
-      bomMgrApi.pageList(this.queryParams).then(response => {
+      bomMgrApi.page(this.queryParams).then(response => {
       	const res = response.data
         console.log("列表的数据:", res)
         if (res.isSuccess) {

+ 346 - 0
imcs-ui/src/views/zuihou/prepareProductMgr/trayMgr/components/Edit.vue

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 <template>
   <el-dialog
   	:close-on-click-modal="false"
@@ -342,3 +343,348 @@ export default {
 	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='$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 {
+      	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>
+>>>>>>> 48233a6a436e90b0398157d87a8be5cb2678db86