Browse Source

修复bug

oyq28 2 years ago
parent
commit
9590a24bab

+ 0 - 16
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/EgDto.java

@@ -1,16 +0,0 @@
-package com.github.zuihou.business.productionresource.dto;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Set;
-
-@Data
-public class EgDto implements Serializable {
-    private  Long equId;
-    private List<EquAndGoods> egList;
-    private Set<EquAndGoods> goodsSet;
-
-
-}

+ 0 - 66
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/EquAndGoods.java

@@ -1,66 +0,0 @@
-package com.github.zuihou.business.productionresource.dto;
-
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.github.zuihou.business.goods.entity.Goods;
-import com.github.zuihou.business.spe.entity.Spe;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.*;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.util.List;
-
-@Data
-@NoArgsConstructor
-@ToString(callSuper = true)
-@Accessors(chain = true)
-@TableName("bt_equ_goods")
-@ApiModel(value = "ProductionResource", description = "设备-产品中间表")
-@AllArgsConstructor
-public class EquAndGoods implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "ID")
-    @TableField("id")
-    @Excel(name = "ID")
-    private Long id;
-
-    /**
-     * 设备ID
-     */
-    @ApiModelProperty(value = "设备ID")
-    @TableField("equ_id")
-    @Excel(name = "企业ID")
-    private Long equId;
-    /**
-     * 商品ID
-     */
-    @ApiModelProperty(value = "商品ID")
-    @TableField("goods_id")
-    @Excel(name = "商品ID")
-    private Long goodsId;
-
-    /**
-     * 商品名称
-     */
-    @ApiModelProperty(value = "商品名称")
-    @TableField("goods_name")
-    @Excel(name = "商品名称")
-    private Long goodsName;
-
-    /**
-     * 上下架状态
-     */
-    @ApiModelProperty(value = "上下架状态")
-    @TableField("ud_status")
-    @Excel(name = "上下架状态")
-    private String udStatus;
-    private Goods goods;
-    private List<Spe> goodSpeList;
-
-
-}

+ 13 - 4
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/GoodsEqu.java → imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/EquAndGoodsPageDTO.java

@@ -4,15 +4,26 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.github.zuihou.business.goods.entity.Goods;
 import com.github.zuihou.business.spe.entity.Spe;
+import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.util.List;
 
-public class GoodsEqu implements Serializable {
 
-    private static final long serialVersionUID = 1L;
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@ApiModel(value = "EquAndGoodsPageDTO", description = "生产资源")
+public class EquAndGoodsPageDTO implements Serializable {
 
+    private static final long serialVersionUID = 1L;
 
     /**
      * 设备ID
@@ -27,13 +38,11 @@ public class GoodsEqu implements Serializable {
      * 上下架状态
      */
     @ApiModelProperty(value = "上下架状态")
-    @TableField("ud_status")
     @Excel(name = "上下架状态")
     private String udStatus;
 
     private Goods goods;
 
-
     private List<Spe> goodSpeList;
 
 

+ 30 - 0
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/EquAndGoodsSaveDTO.java

@@ -0,0 +1,30 @@
+package com.github.zuihou.business.productionresource.dto;
+
+import com.github.zuihou.business.productionresource.entity.EquAndGoods;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Set;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@ApiModel(value = "EquAndGoodsSaveDTO", description = "生产资源")
+public class EquAndGoodsSaveDTO implements Serializable {
+    private  Long equId;
+
+    private  Long goodsId;
+
+    private List<EquAndGoods> egList;
+
+    private Set<EquAndGoods> goodsSet;
+
+
+}

+ 5 - 2
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/goods/goodsCate/Edit.vue

@@ -280,8 +280,9 @@ export default {
           vm.$message({
             message: vm.$t("tips.createSuccess"),
             type: "success"
-          });
+          });                 
           vm.$emit("success");
+          vm.$emit("close");
         }
       });
     },
@@ -296,6 +297,7 @@ export default {
             type: "success"
           });
           this.$emit("success");
+          vm.$emit("close");
         }
       });
     },
@@ -318,6 +320,7 @@ export default {
       if (val) {
         vm.goodsCate = {...val};
       }
+      vm.getTreeData();
       vm.imgFileData.bizId = vm.goodsCate["id"];
       vm.$nextTick(() => {
         vm.$refs.imgFileRef.init({
@@ -327,7 +330,7 @@ export default {
           isSingle: true,
           isDetail: false
         });
-      });
+      });       
     },
 
 

+ 7 - 8
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/order/allOrders.vue

@@ -93,10 +93,10 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderMemberName')" :show-overflow-tooltip="true" align="center"
-                       prop="orderAmount"
+                       prop="orderMemberName"
                        width="">
         <template slot-scope="scope">
-          <span>{{ scope.row.orderAmount }}</span>
+          <span>{{ scope.row.orderMemberName }}</span>
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderAmount')" :show-overflow-tooltip="true" align="center"
@@ -108,15 +108,14 @@
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderStatus')" :show-overflow-tooltip="true" align="center"
                        :filter-multiple="false" column-key="goodsCateStatus"
-
                        :filters="statusFilter"
                        prop="goodsCateStatus" width="80px">
         <template slot-scope="scope">
-          {{ scope.row.goodsCateStatus === '1' ? $t("btOrder.status.dzf") : '' }}
-          {{ scope.row.goodsCateStatus === '2' ? $t("bt.status.dsc") : '' }}
-          {{ scope.row.goodsCateStatus === '3' ? $t("bt.status.dq") : '' }}
-          {{ scope.row.goodsCateStatus === '4' ? $t("bt.status.ywc") : '' }}
-          {{ scope.row.goodsCateStatus === '5' ? $t("bt.status.yqx") : '' }}
+          {{ scope.row.orderStatus === 'INIT' ? $t("btOrder.status.dzf") : '' }}
+          {{ scope.row.orderStatus === 'SUCCESS' ? $t("btOrder.status.dsc") : '' }}
+          {{ scope.row.orderStatus === '3' ? $t("btOrder.status.dq") : '' }}
+          {{ scope.row.orderStatus === '4' ? $t("btOrder.status.ywc") : '' }}
+          {{ scope.row.orderStatus === '5' ? $t("btOrder.status.yqx") : '' }}
         </template>
       </el-table-column>
       <el-table-column

+ 1 - 1
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/automatedProcesses/components/ResourceSelect.vue

@@ -19,7 +19,7 @@
 	    	<span style="margin-left: 15px;">
 	    		<span>{{$t("resource.searchForm.no")}}:</span>
 	    		<el-input v-model="queryParams.model.code" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-	      	</el-select>
+	      
 	    	</span>
 	      <span style="margin-left: 15px;">
 		      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">

+ 20 - 21
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/Index.vue

@@ -16,9 +16,9 @@
                        :placeholder="$t('common.pleaseSelect')" size="medium" style="width: 150px;">
 	        		<el-option
                 v-for="item in inlineStatusList"
-                :key="item.value"
-                :label="item.lable"
-                :value="item.value">
+                :key="item.label"
+                :label="item.value"
+                :value="item.label">
 					    </el-option>
 	          </el-select>
      </span>
@@ -28,9 +28,9 @@
                        size="medium" style="width: 150px;">
 	        		<el-option
                 v-for="item in statusList"
-                :key="item.value"
-                :label="item.lable"
-                :value="item.value">
+                :key="item.label"
+                :label="item.value"
+                :value="item.label">
 					    </el-option>
 	          </el-select>
      </span>
@@ -111,7 +111,7 @@
       </el-col>
     </div>
 
-    <el-table :data="tableData.data" :key="tableKey" @cell-click="cellClick"
+    <el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
               @filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
               border fit row-key="id" ref="table" style="width: 100%;margin-top:30px;" v-loading="loading">
       <el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
@@ -233,7 +233,7 @@
 
 
     <material-mgr :title="$t('productionResource.materialMgr')" :dialog-visible="mtrDialog.isVisible"
-                  :type="mtrDialog.type"
+                  :type="mtrDialog.type" 
                   @close="mtrClose" @success="editSuccess" ref="materialMgr"/>
 
     <order-mgr :title="$t('productionResource.orderMgr')" :dialog-visible="orderDialog.isVisible"
@@ -296,7 +296,7 @@ export default {
       },
       mtrDialog: {
         isVisible: false,
-        type: "mtrDialog"
+        type: "mtrDialog" 
       },
       orderDialog: {
         isVisible: false,
@@ -346,10 +346,10 @@ export default {
     editClose() {
       this.dialog.isVisible = false;
     },
-    editSuccess() {
-      this.search();
+    editSuccess() {      
+      this.search();      
     },
-    pMgClose() {
+    pMgClose() {      
       this.productDialog.isVisible = false;
     },
     mtrClose() {
@@ -362,14 +362,14 @@ export default {
       this.selection = selection;
     },
     editProductMgr(row) {
-      console.log("editProductMgr按钮的row" + JSON.stringify(row))
-        this.$refs.productMgr.equGoodsMgr({row, enums: this.enums, dicts: this.dicts});
+      //console.log("editProductMgr按钮的row" + JSON.stringify(row))
+      this.$refs.productMgr.equGoodsMgr({row, enums: this.enums, dicts: this.dicts});
       this.productDialog.type = "productMgr"
       this.productDialog.isVisible = true
     },
     editMaterialMgr(row) {
       // this.$refs.materialMgr.equId = row["id"],
-        this.$refs.materialMgr.getEquMtr(row['id']);
+      this.$refs.materialMgr.getEquMtr(row['id']);
       this.mtrDialog.type = "materialMgr"
       this.mtrDialog.isVisible = true
     },
@@ -381,7 +381,7 @@ export default {
       this.orderDialog.type = "orderMgr"
       this.orderDialog.isVisible = true
     },
-    search() {
+    search() {      
       this.fetch({
         ...this.queryParams
       });
@@ -513,9 +513,6 @@ export default {
       })
     },
 
-
-
-
     fetch(params = {}) {
       this.loading = true;
       if (this.queryParams.timeRange) {
@@ -525,8 +522,10 @@ export default {
 
       this.queryParams.current = params.current ? params.current : this.queryParams.current;
       this.queryParams.size = params.size ? params.size : this.queryParams.size;
-
-      productionResourceApi.pageList(this.queryParams).then(response => {
+      if(this.queryParams.model.areaId){
+        this.queryParams.model.areaId = this.queryParams.model.areaId[2]
+      }      
+      productionResourceApi.page(this.queryParams).then(response => {
         const res = response.data;
         if (res.isSuccess) {
           this.tableData = res.data;

+ 6 - 5
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/Edit.vue

@@ -42,14 +42,14 @@
         <el-input disabled v-model="productionResource.latitude" style="width: 93%;"/>
       </el-form-item>
 
-      <el-form-item label="所属企业:" prop="tenantId">
+      <el-form-item label="所属企业:" prop="orgId">
         <template>
           <el-tree :check-strictly="true"
                    :data="enterpriseList"
                    @check-change="selectTreeNode"
                    default-expand-all 
                    highlight-current 
-                   node-key="tenantId" 
+                   node-key="orgId" 
                    ref="orgTree" 
                    show-checkbox />
 				</template>
@@ -205,7 +205,7 @@ export default {
     selectTreeNode(data, checked, children) {
       if (checked) {
         this.$refs.orgTree.setCheckedNodes([data])
-        this.productionResource.tenantId = data
+        this.productionResource.orgId = data       
       }
     },
     submitForm() {
@@ -260,7 +260,8 @@ export default {
     },
     save() {
       const vm = this;
-      vm.confirmDisabled = true;            
+      vm.confirmDisabled = true;    
+      this.productionResource.orgId =  this.productionResource.orgId.id;        
       productionResourceApi.save(this.productionResource).then(response => {
         const res = response.data;
         if (res.isSuccess) {
@@ -276,7 +277,7 @@ export default {
     update() {
       const vm = this;
       vm.confirmDisabled = true;      
-      this.productionResource.tenantId =  this.productionResource.tenantId.id;
+      this.productionResource.orgId =  this.productionResource.orgId.id;
       console.log(this.productionResource);     
       productionResourceApi.update(this.productionResource).then(response => {
         const res = response.data;

+ 22 - 39
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/MaterialMgr.vue

@@ -125,17 +125,8 @@
                          prop="exprStatus"
                          width="">
           <template slot-scope="scope">
-<!--            <span  v-if="daysLater(scope.row.exprTime)">-->
-<!--              -->
-<!--              正常-->
-<!--            </span>-->
-            <span>
-              {{ scope.row.exprStatus }}
-            </span>
-
-<!--            <span  v-if="!daysLater(scope.row.exprTime)">-->
-<!--              过期-->
-<!--            </span>-->
+           <span v-if="daysLater(scope.row.exprTime)">正常</span>
+           <span v-else>过期</span>
           </template>
         </el-table-column>
 <!--        <el-table-column :label="$t('btMaterial.material.mtWeight')" :show-overflow-tooltip="true" align="center"-->
@@ -150,7 +141,7 @@
           :label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width"
           width="100px">
           <template slot-scope="{ row }">
-            <i @click="changeMtrInBar(row)" class="el-icon-edit table-operation" :title="$t('common.edit')"
+            <i @click="changeMtr(row)" class="el-icon-edit table-operation" :title="$t('common.edit')"
                style="color: #2db7f5;"/>
             <i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
                style="color: #f50;"/>
@@ -172,7 +163,7 @@
       @close="addMtrClose"
       @success="editSuccess"
       ref="addMtr"
-    />
+    /> 
     <el-dialog
       :close-on-click-modal="false"
       :close-on-press-escape="true"
@@ -209,17 +200,14 @@ export default {
     type: {
       type: String,
       default: "addEquBarrel",
-    },
-    equId: {
-      type: String,
-      default: ''
     }
   },
   filters: {},
   data() {
     return {
       tenant: this.initTenant(),
-      threeDaysLater:this.daysLater(),
+      equId: '',
+      //threeDaysLater:this.daysLater(),
       // 编辑
       addBarrelDialog: {
         isVisible: false,
@@ -301,8 +289,9 @@ export default {
     },
     daysLater(val){
       let dqTime = new Date(val);
+      let nTime = dqTime.setDate(dqTime.getDate()+3)
       let now = new Date();
-      console.log("开始比较时间"+dqTime+"当前时间"+now)
+      return (nTime>now)? true : false;
     },
     setTenant(val = {}) {
       const vm = this;
@@ -314,11 +303,11 @@ export default {
       }
     },
 
-    getEquMtr(equId) {
+    getEquMtr(equId) {      
       this.loading = true;
       this.queryParams.sort="updateTime";
       this.queryParams.model.equId=equId;
-      EquBarrelApi.query({'equId': equId}).then(response => {
+      EquBarrelApi.query(this.queryParams).then(response => {
 
         let res = response.data
         if (res.isSuccess) {
@@ -348,8 +337,10 @@ export default {
     editClose() {
       this.dialog.isVisible = false;
     },
-    editSuccess() {
-      this.getEquMtr();
+    editSuccess() {      
+      this.selection = []
+      this.clearSelections();
+      this.getEquMtr(this.equId);
     },
 
     addBarrelClose() {
@@ -364,9 +355,7 @@ export default {
       this.selection = selection;
     },
     search() {
-      this.fetch({
-        ...this.queryParams
-      });
+      this.getEquMtr(this.equId)
     },
     close() {
       this.$emit("close");
@@ -440,7 +429,7 @@ export default {
       this.$refs.table.clearSelection();
     },
     delete(ids) {
-      materialApi.delete({ids: ids}).then(response => {
+      EquBarrelApi.delete({ids: ids}).then(response => {
         const res = response.data;
         if (res.isSuccess) {
           this.$message({
@@ -482,10 +471,13 @@ export default {
 
       this.$refs.addMtr.addMtr(this.selection[0]);
     },
-
-
+    changeMtr(row){
+      console.log(row)
+      this.addMtrDialog.type = "changeMtrInBar";
+      this.addMtrDialog.isVisible = true;
+      this.$refs.addMtr.addMtr(row);
+    },
     changeMtrInBar() {
-
       if (!this.selection.length) {
         this.$message({
           message: this.$t("tips.unSelected"),
@@ -501,22 +493,13 @@ export default {
         return
       }
 
-
       this.addMtrDialog.type = "changeMtrInBar";
       this.addMtrDialog.isVisible = true;
 
       this.$refs.addMtr.addMtr(this.selection[0]);
     },
 
-
-
-
-
-
-
-
     rectifyMtr() {
-
       if (!this.selection.length) {
         this.$message({
           message: this.$t("tips.unSelected"),

+ 9 - 10
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/ProductMgr.vue

@@ -125,7 +125,7 @@
         <el-table-column :label="$t('bt.table.goodsSpec')" :show-overflow-tooltip="true" align="center"
                          prop="goodsSpec" width="">
           <template slot-scope="scope">
-            <span v-for="item  in scope.row.goods.goodsSpec">{{ item.specName }} &#32, </span>
+            <span v-for="item  in scope.row.goods.goodsSpec" :key="item.id">{{ item.specName }} &#32, </span>
           </template>
         </el-table-column>
 
@@ -315,9 +315,10 @@ export default {
       this.selection = selection;
     },
     search() {
-      this.fetch({
+      /*this.fetch({
         ...this.queryParams
-      });
+      }); */
+      this.getEquGoods(this.equId);
     },
     add() {
       console.log("添加之前父组件的equid" + this.equId)
@@ -357,6 +358,7 @@ export default {
         downloadFile(response);
       });
     },
+    /*
     setTenant(val = {}) {
       const vm = this;
       vm.dicts = val['dicts'];
@@ -365,14 +367,11 @@ export default {
         vm.tenant = {...val['row']};
         this.fetch()
       }
-    },
+    }, */
 
     equGoodsMgr(val = {}) {
       this.equId = val['row'].id;
-      this.getEquGoods(this.equId);
-      // if (val['row']) {
-      //
-      // }
+      this.getEquGoods(this.equId);      
     },
 
 
@@ -576,8 +575,8 @@ export default {
       this.loading = true;
       ResourceBusinessApi.getEquGoods({'equId': equId}).then(response => {
         let res = response.data
-        if (res.isSuccess) {
-          this.tableData = res.data;
+        if (res.isSuccess) {         
+          this.tableData = res.data;           
         }
       }).finally(() => this.loading = false);
     },

+ 1 - 1
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/addEquGoods.vue

@@ -112,7 +112,7 @@
         <el-table-column :label="$t('bt.table.goodsSpec')" :show-overflow-tooltip="true" align="center"
                          prop="goodsSpec" width="">
           <template slot-scope="scope">
-            <span v-for="item  in   scope.row.goodsSpec">{{ item.specName }} &#32, </span>
+            <span v-for="item in scope.row.goodsSpec" :key="item.id" >{{ item.specName }} &#32, </span>
           </template>
         </el-table-column>
       </el-table>

+ 11 - 8
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/addMtr.vue

@@ -8,7 +8,7 @@
             v-for="item in mtrList"
             :key="item.id"
             :label="item.mtName"
-            :value="item">
+            :value="item.id">
           </el-option>
         </el-select>
       </el-form-item>
@@ -111,12 +111,15 @@ export default {
 
     selectChange(value) {
       console.log("选中的原料" + value)
-      console.log("选中的原料" + JSON.stringify(value))
-      this.equBarrel.mtrId = value.id;
-      this.equBarrel.mtrName = value.mtName;
-      this.equBarrel.mtrType = value.mtType;
-      this.equBarrel.mtrUnit = value.mtUnit;
-      this.equBarrel.mtrCode = value.mtCode
+      let obj = this.mtrList.find(item=>{
+          return (item.id == value)? item : null;
+      });
+      console.log("选中的原料" + JSON.stringify(obj))
+      this.equBarrel.mtrId = value;
+      this.equBarrel.mtrName = obj.mtName;
+      this.equBarrel.mtrType = obj.mtType;
+      this.equBarrel.mtrUnit = obj.mtUnit;
+      this.equBarrel.mtrCode = obj.mtCode;
     },
 
 
@@ -193,7 +196,7 @@ export default {
         vm.update();
       } else {
         vm.save();
-      }
+      }      
     },
     save() {
       const vm = this;