Jelajahi Sumber

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

# Conflicts:
#	src/benyun/utils/auth.ts
ymy 6 bulan lalu
induk
melakukan
c1690ec116

+ 1 - 1
src/benyun/utils/auth.ts

@@ -6,7 +6,7 @@ const ExpiresInKey = 'AdminOMS-Expires-In'
 
 export function getToken() {
   if(process.env.NODE_ENV === 'development'){
-    return 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjRkMzkxNTI0LWYzYmYtNDQxZS04OTgyLWE2NTcwZWE1OTJkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.ggtNOVHV-mBJ_-8tSi4U_BnKgi0cGFV4a5j6ON9qGV7IxL6qsfl1qV_RY-kEtn_g2QM5yGDF3usPmljbzbkpHQ'
+    return 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6ImI0YjgwZjVjLTI3ODctNDAwZi05MzI2LTgxNzM0MzU3YjdiZSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.lykgqxmyRK8of4KSzR0iAXC4AfVD5ef-GabF_8IkND_8pBFFgn5m09ALqhcyalY3dddhHm2ZUGUAhAnzh96EMA'
   }else{
     return Cookies.get(TokenKey)
   }

+ 17 - 7
src/views/pack/packBatchManage/compoments/addUserModal.vue → src/views/packing/packBatchManage/compoments/addUserModal.vue

@@ -1,8 +1,8 @@
 <template>
-  <vxe-modal v-model="value" id="addQuest" width="60%" v-loading="load" @show="show" @hide="hide" height="500" show-footer :title="type == '1' ? '选择拣货员' : '选择播种员'">
+  <vxe-modal v-model="value" id="addQuest" width="600" v-loading="load" @show="show" @hide="hide" height="300" show-footer :title="type == '1' ? '选择拣货员' : '选择播种员'">
     <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
     <div style="margin: 15px 0;"></div>
-    <el-checkbox-group v-model="checkedList" @change="handleCheckedCitiesChange">
+    <el-checkbox-group v-model="checkedList" @change="handleCheckedCitiesChange" size="medium" class="batchUser">
       <el-checkbox v-for="item in list" :label="item" :key="item">{{item}}</el-checkbox>
     </el-checkbox-group>
     <template #footer>
@@ -25,7 +25,7 @@ export default class AddQuestModel extends Vue {
   checkAll= false
   checkedList:Array<any>= []
   list:Array<any>=[]
-  isIndeterminate= true
+  isIndeterminate= false
   show(){
     
   }
@@ -33,8 +33,9 @@ export default class AddQuestModel extends Vue {
     this.type = v;
   }
   hide(){
-    (this.$refs.form as any).clearValidate();
-    (this.$refs.form as any).clearValue();
+    this.checkedList = []
+    this.checkAll = false;
+    this.isIndeterminate = false
   }
   handleCheckAllChange(val) {
     this.checkedList = val ? this.list : [];
@@ -65,6 +66,11 @@ export default class AddQuestModel extends Vue {
       type: this.type,
       data: this.checkedList
     });
+    this.value = false;
+    this.$message({
+      message:'添加成功!',
+      type:'success'
+    })
     // (this.$refs.form as any).validate().then(()=>{
     //   let data = (this.$refs.form as any).getValue();
     //   this.load = true
@@ -80,6 +86,10 @@ export default class AddQuestModel extends Vue {
 }
 </script>
 
-<style lang="scss" scoped>
-
+<style lang="scss">
+.batchUser{
+  .el-checkbox{
+    padding-bottom: 16px;
+  }
+}
 </style>

+ 73 - 10
src/views/pack/packBatchManage/compoments/batchList.vue → src/views/packing/packBatchManage/compoments/batchList.vue

@@ -3,14 +3,16 @@
     <module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @onRefresh="getList" 
     @resert="queryList" @search="queryList" />
     <addUserModal ref="addUserModalView" @handle="handle" />
+    <UpdateStateModal ref="updateStateModalView" @stateHandle="stateHandle" />
   </div>
 </template>
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-import addUserModal from ".addUserModal.vue"
+import addUserModal from "./addUserModal.vue"
 import Cookies from 'js-cookie'
-@Component({components:{addUserModal}})
+import UpdateStateModal from "./updateStateModal.vue";
+@Component({components:{addUserModal, UpdateStateModal}})
 export default class BatchList extends Vue {
   load=false;
   time:any;
@@ -28,20 +30,41 @@ export default class BatchList extends Vue {
       columns:[
         [{
           label:'拣货员',
-          prop:'shopName',
+          prop:'user01',
           component:'by-input',
           compConfig:{}
         },{
           label:'播种员',
-          prop:'shortName',
+          prop:'user02',
           component:'by-input',
           compConfig:{}
         },
         {
           label:'状态',
-          prop:'shopStatus',
-          component:'by-input',
-          compConfig:{}
+          prop:'state',
+          component: 'by-select',
+          compConfig: {
+            attr: {
+              placeholder: '请选择状态',
+              clearable: true,
+              data: [{
+                value: '等待拣货',
+                label: '等待拣货'
+              }, {
+                value: '正在拣货',
+                label: '正在拣货'
+              }, {
+                value: '正在播种',
+                label: '正在播种'
+              }, {
+                value: '等待出库验货',
+                label: '等待出库验货'
+              }, {
+                value: '终止拣货',
+                label: '终止拣货'
+              }]
+            }
+          }
         }]
       ]
     },
@@ -63,9 +86,9 @@ export default class BatchList extends Vue {
             this.packHandle('2');
           }
         }},
-        { name: '结束任务', event:{
+        { name: '修改状态', event:{
           click:() =>{
-
+            this.stateUpdate()
           }
         }},
         { name: '打印订单', event:{
@@ -158,6 +181,7 @@ export default class BatchList extends Vue {
         }
       }
     }
+    Cookies.set('batchData', JSON.stringify(this.data));
   }
   //安排拣货员/播种员
   packHandle(n:string) {
@@ -169,6 +193,27 @@ export default class BatchList extends Vue {
     (this.$refs.addUserModalView as any).setShow(true);
     (this.$refs.addUserModalView as any).setType(n);
   }
+  stateHandle(v:string) {
+    let data = (this.$refs.view as any).getSelectData();
+    for (const item of data) {
+      for (const it of this.data) {
+        if(item.number == it.number) {
+          it.state = v
+          break
+        }
+      }
+    }
+    Cookies.set('batchData', JSON.stringify(this.data));
+  }
+  //修改状态
+  stateUpdate() {
+    let data = (this.$refs.view as any).getSelectData();
+    if(data.length == 0) {
+      this.$message('请选择数据!');
+      return
+    }
+    (this.$refs.updateStateModalView as any).setShow(true);
+  }
 
   //分页
   pagination(){
@@ -208,8 +253,26 @@ export default class BatchList extends Vue {
   //列表请求(包含分页和搜素条件)
   queryList(){
     this.isSearch = true;
+    // let data = (this.$refs.view as any).getQuery();
+    // this.requestList(data);
+    let newData:Array<any> = []
     let data = (this.$refs.view as any).getQuery();
-    this.requestList(data);
+    for(const item of this.data) {
+      let isa = true
+      if(data.user01 && item.user01.indexOf(data.user01) === -1) {
+        isa = false
+      }
+      if(data.user02 && item.user02.indexOf(data.user02) === -1) {
+        isa = false
+      }
+      if(data.state && item.state.indexOf(data.state) === -1) {
+        isa = false
+      }
+      if(isa) {
+        newData.push(item)
+      }
+    }
+    (this.$refs.view as any).setTableValue(newData);
   }
   requestList(data:any){
     this.load = true;

+ 5 - 4
src/views/pack/packBatchManage/compoments/generateBatch.vue → src/views/packing/packBatchManage/compoments/generateBatch.vue

@@ -110,6 +110,7 @@ export default class GenerateBatch extends Vue {
     this.$nextTick(()=>{
       this.getList()
     })
+    // Cookies.remove('batchData')
   }
   //生成批次
   batchHandle() {
@@ -128,7 +129,7 @@ export default class GenerateBatch extends Vue {
       }
     }
     for(const item of data) {
-      batList.push({
+      batList.unshift({
         number:this.getUuid(9),
         type: '单SKU',
         user01: '',
@@ -136,9 +137,9 @@ export default class GenerateBatch extends Vue {
         orderNum: item.orderNum,
         typeNum: item.num1,
         num1: item.num1,
-        jNum1: '',
-        jNum2: '',
-        num3: item.num3,
+        jNum1: 0,
+        jNum2: item.orderNum,
+        num3: '',
         state:'等待拣货',
         store: '',
         time: Format(new Date(),'yyyy-MM-dd HH:mm:ss'),

+ 87 - 0
src/views/packing/packBatchManage/compoments/updateStateModal.vue

@@ -0,0 +1,87 @@
+<template>
+  <vxe-modal v-model="value" id="updateStateModal" width="400" @hide="hide" height="200" show-footer title="修改状态">
+    <by-form :propConfig="config" ref="form" class="form"></by-form>
+    <template #footer>
+      <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+        <el-button type="primary" size="small" @click="btn">确定</el-button>
+      </div>
+    </template>
+  </vxe-modal>
+</template>
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { setQuestions } from '@/api/omsOrder'
+@Component({components:{}})
+export default class UpdateStateModal extends Vue {
+  value = false;
+  load = false;
+  billValue:Array<any>=[]
+  config:any={
+    attr:{
+      labelWidth:'80px',
+      rules:{
+        state: [
+          { required: true, message: '请选择状态', trigger: 'change' }
+        ]
+      }
+    },
+    columns:[
+      [{
+        label:'状态',
+        prop:'state',
+        component: 'by-select',
+        compConfig: {
+          attr: {
+            placeholder: '请选择状态',
+            clearable: true,
+            data: [{
+              value: '等待拣货',
+              label: '等待拣货'
+            }, {
+              value: '正在拣货',
+              label: '正在拣货'
+            }, {
+              value: '正在播种',
+              label: '正在播种'
+            }, {
+              value: '等待出库验货',
+              label: '等待出库验货'
+            }, {
+              value: '终止拣货',
+              label: '终止拣货'
+            }]
+          }
+        }
+      }]
+    ]
+  }
+  show(){
+    
+  }
+  hide(){
+    (this.$refs.form as any).clearValidate();
+    (this.$refs.form as any).clearValue();
+  }
+  setShow(v:boolean){
+    this.value = v;
+  }
+  btn(){
+    (this.$refs.form as any).validate().then(()=>{
+      let data = (this.$refs.form as any).getValue();
+      this.$emit('stateHandle',data.state);
+      this.value = false;
+      this.$message({
+        message:'修改成功!',
+        type:'success'
+      })
+    })
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.form{
+  padding-top: 30px;
+}
+</style>

+ 0 - 1
src/views/pack/packBatchManage/index.vue → src/views/packing/packBatchManage/index.vue

@@ -20,7 +20,6 @@ export default class PackBatchManage extends Vue {
   activeName:string='first'
 
   handleClick(v){
-    console.log(v)
     if(v.name =='second') {
       (this.$refs.list as any).getList();
     }

+ 121 - 0
src/views/packing/setupPacking/components/openLogModal.vue

@@ -0,0 +1,121 @@
+<template>
+  <vxe-modal
+    v-model="value"
+    id="openLogModal"
+    title="操作日志"
+    width="50%"
+    height="60%"
+    min-width="460"
+    min-height="320"
+    show-zoom
+    resize
+    transfer
+    :show-footer="!hideBtn"
+    v-loading="load"
+  >
+    <by-table :propConfig="config" ref="table">
+      <!-- <template v-slot:num="{row}">
+        <vxe-input v-model="row.num" v-if="row.splitNum > 0" placeholder="请输入" type="integer" @input="onChangeRow(row)"></vxe-input>
+      </template> -->
+    </by-table>
+    <template #footer>
+      <div class="page">
+        <el-pagination
+          v-if="page.total > 0"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="page.pageNo"
+          :page-size="page.pageSize"
+          :layout="'total, sizes, prev, pager, next, jumper'"
+          :total="page.total"
+        ></el-pagination>
+      </div>
+      <!-- <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+      </div> -->
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component({ components: {} })
+export default class openLogModal extends Vue {
+  value = false;
+  load = false;
+  billData: any = null;
+  hideBtn = false;
+  data: Array<any> = [];
+    datas=[];
+  page: any = {
+    pageNo: 1, //当前页
+    pageSize: 10, //每页条数
+    total: 0, //总条数
+  };
+  config: any = {
+    attr: {
+      size: "small",
+      align: "center",
+      seq: true,
+    },
+    columns: [
+      {
+        title: "操作内容",
+        field: "content",
+      },
+      {
+        title: "操作人",
+        field: "userName",
+      },
+      {
+        title: "创建时间",
+        field: "createTime",
+      },
+    ],
+  };
+
+  setShow(v: boolean) {
+    this.hideBtn = false;
+    console.log("数据111111111========", v);
+    this.value = v;
+  }
+  mounted(){
+   
+    
+  }
+  setValue(data: any) {
+    this.$nextTick(() => {
+      // const data = localStorage.getItem("logLsit");
+      // console.log("数据111111111datas========", JSON.parse(data)||null);
+      const datas:string|null = localStorage.getItem("logLsit");
+    if(datas){
+      let data=JSON.parse(datas)
+      this.data=data.reverse();
+      this.page.total=data.length
+      // let height = (document.getElementById('openLogModal') as any).parentNode.offsetHeight;
+      // this.config.attr.height=height - 36;
+      if (this.$refs.table) {
+        (this.$refs.table as any).setConfig(this.config);
+        (this.$refs.table as any).setValue(this.data);
+      }
+    }
+      
+    });
+  }
+  handleSizeChange(v: number) {
+    this.page.pageSize = v;
+  }
+  handleCurrentChange(v: number) {
+    this.page.pageNo = v;
+  }
+}
+</script>
+<style lang="scss" scoped>
+.page {
+  width: 100%;
+  display: flex;
+  justify-content: flex-end;
+  padding: 8px;
+  box-sizing: border-box;
+}
+</style>

+ 83 - 0
src/views/packing/setupPacking/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <div class="print-count">
+    <!-- <el-divider></el-divider> -->
+    <el-form ref="form" :model="form" label-width="80px">
+      <el-form-item>
+        <span>仓位找货优先级 (生成新的仓位后务必重新设定一下优先级)</span>
+        <el-input
+          class="textarea"
+          type="textarea"
+          v-model="form.content"
+          placeholder="请输入内容"
+          maxlength="300"
+          show-word-limit
+        ></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="saveLog()">保存日志</el-button>
+        <el-button @click="lookeLog()">操作日志</el-button>
+      </el-form-item>
+    </el-form>
+    <!-- 操作日志 -->
+    <openLogModal ref="openLogModal" :data="data" />
+  </div>
+</template>
+  
+  <script lang="ts">
+import openLogModal from "./components/openLogModal.vue"; //拆分
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+
+@Component({ components: { openLogModal } })
+export default class packing extends Vue {
+  form = {
+    userName: (this as any).$store.getters.userInfo.userName,
+    content: "",
+    createTime: "",
+  };
+  index = 0;
+  data: Array<any> = [];
+  saveLog() {
+    const now = new Date();
+    this.form.createTime = now.toLocaleString();
+
+    if (this.form.content) {
+      this.$message({
+        message: "保存日志成功!",
+        type: "success",
+      });
+      // const aa=this.form
+      this.index++;
+      console.log("this.index========", this.index);
+      // if()
+      let from = JSON.stringify(this.form);
+      this.data.push(JSON.parse(from));
+      localStorage.setItem('logLsit', JSON.stringify(this.data));
+      console.log("提交的数据========", this.data);
+    } else {
+      this.$message({
+        message: "输入内容不能为空!",
+        type: "warning",
+      });
+    }
+  }
+  lookeLog() {
+    (this.$refs.openLogModal as any).setShow(true);
+    (this.$refs.openLogModal as any).setValue(this.data);
+  }
+}
+</script>
+  
+  <style lang="scss" >
+.print-count {
+  padding: 16px;
+  width: 100%;
+  height: 100%;
+  overflow-y: hidden;
+}
+.textarea textarea {
+  height: 400px !important;
+}
+.el-textarea__inner {
+  height: 400px !important;
+}
+</style>