ソースを参照

修改E订单和CRM

qymljy 2 年 前
コミット
ea2daa13a1

+ 21 - 2
src/HDrpManagement/ProductMag/index.vue

@@ -11,7 +11,13 @@
       ownertable="plm_item"
       :apiId="{query:20220923140602,del:20220923152202}"
       :options="options"
+      @onFixedClick="rows"
+      @checkboxCallBack="rows"
       >
+      <div slot="titleRight">
+        <to_examine class="inline-16" style="margin-left: 10px" :rowData="rowData" @examineSuccess="onSuccess"></to_examine>
+        <counter_examine class="inline-16" :rowData="rowData" @examineSuccess="onSuccess"></counter_examine>
+      </div>
       <div slot="custom">
         <label  class="search__label" style="margin: auto;width: 70px;">是否上架:</label>
         <el-select class="inline-24" v-model="selectParam.isonsale" placeholder="请选择是否上架" @change="selectChange" size="small" clearable>
@@ -67,6 +73,8 @@
  */
 import previewImage from '@/components/previewImage/index'
 import editTemp from './modules/edit.vue'
+import to_examine from './modules/toExamine'
+import counter_examine from './modules/counterExamine'
 
 export default {
   data () {
@@ -95,12 +103,15 @@ export default {
       selectParam:{
         isonsale:'',
         status:''
-      }
+      },
+      rowData:{}
     }
   },
   components:{
     previewImage,
-    editTemp
+    editTemp,
+    to_examine,
+    counter_examine
   },
   methods:{
     async isOnSaleChange(val){
@@ -120,6 +131,14 @@ export default {
     selectChange(){
       this.$refs.basicLayout.param.content.where = this.selectParam
       this.$refs.basicLayout.listData()
+    },
+    onSuccess(){
+      this.$refs.basicLayout.listData()
+    },
+    rows(val){
+      console.log("点击")
+      console.log(val)
+      this.rowData = val
     }
   }
 }

+ 78 - 0
src/HDrpManagement/ProductMag/modules/counterExamine.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <el-button  size="small" @click="onshow" >反 审</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:["rowData"],
+  name: "counterExamine",
+  data(){
+    return {
+      flag:false
+    }
+  },
+  methods:{
+    onshow(){
+      this.flag = false
+      this.rowData.forEach(e => {
+        console.log(e)
+        if (e.status === '新建'){
+          this.flag = true
+        }
+      })
+      console.log(this.flag)
+      if (this.flag){
+        this.$alert('所选数据中有数据还未被审核,请检查后再进行操作', '提示', {
+          confirmButtonText: '确定',
+          callback: action => {
+            this.$message({
+              type: 'info',
+              message: `请检查所选数据`
+            });
+          }
+        });
+      }else {
+        this.onCounter()
+      }
+    },
+    onCounter(){
+      this.$confirm('确定反审这些数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        console.log(this.rowData)
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          console.log(index)
+          console.log(item)
+          row[index] = item.itemid
+        })
+        console.log(row)
+        const res = await this.$api.requested({
+          "id": 20220923153902,
+          "content": {
+            "itemids": row,
+            "status": 0 //0:不通过,1:通过
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('examineSuccess')
+        })
+      }).catch(async () => {
+        console.log(err)
+        this.$message({
+          type: 'info',
+          message: '已取消反审'
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 78 - 0
src/HDrpManagement/ProductMag/modules/toExamine.vue

@@ -0,0 +1,78 @@
+<template>
+  <div >
+    <el-button  size="small"  @click="onshow">审 核</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:["rowData"],
+  name: "toExamine",
+  data(){
+    return {
+      flag:false
+    }
+  },
+  methods:{
+    onshow(){
+      this.flag = false
+      this.rowData.forEach(e => {
+        console.log(e)
+        if (e.status === '审核'){
+          this.flag = true
+        }
+      })
+      console.log(this.flag)
+      if (this.flag){
+        this.$alert('所选数据中已有数据被审核,请检查后再进行操作', '提示', {
+          confirmButtonText: '确定',
+          callback: action => {
+            this.$message({
+              type: 'info',
+              message: `请检查所选数据`
+            });
+          }
+        });
+      }else {
+        this.onExamine()
+      }
+    },
+    onExamine(){
+      this.$confirm('确定通过这些数据的审核吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        console.log(this.rowData)
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          console.log(index)
+          console.log(item)
+          row[index] = item.itemid
+        })
+        console.log(row)
+        const res = await this.$api.requested({
+          "id": 20220923153902,
+          "content": {
+            "itemids": row,
+            "status": 1 //0:不通过,1:通过
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('examineSuccess')
+        })
+      }).catch((err) => {
+        console.log(err)
+        this.$message({
+          type: 'info',
+          message: '已取消审核'
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 57 - 3
src/HManagement/personalTarget/target/index.vue

@@ -1,6 +1,42 @@
 <template>
   <div>
-    <list ref="list">
+    <basicLayout
+        ref="list"
+        :oldFormPath="{
+        add:'HManagement/personalTarget/target/modules'
+        }"
+        tableName="targetTable"
+        idName="sa_salestargetbillid"
+        :apiId="{query:20220901132502,del:''}"
+        :options="options"
+        :detailPath="{
+        path:'/personalTarget_edit'
+        }"
+        >
+      <div slot="custom" style="display:flex">
+        <label class="search__label " style="margin: auto;width: 35px;">状态:</label>
+        <el-select  class="inline-24" @change="selectChange" v-model="selectParam.status" placeholder="请选择状态" size="small" clearable>
+          <el-option v-for="(item,index) in statusData" :key="item.value" :value="item.value" :label="item.label"></el-option>
+        </el-select>
+      </div>
+      <template v-slot:tbList="scope">
+        <div>
+          <div v-if="scope.data.column.columnname === 'status'">
+            <span v-if="scope.data.column.data.status === '已下达'" style="color:#52C41A">{{scope.data.column.data.status}}</span>
+            <span v-else>{{scope.data.column.data.status}}</span>
+          </div>
+          <div v-else>
+            {{scope.data.column.data[[scope.data.column.columnname]]}}
+          </div>
+        </div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+<!--        <el-button :disabled="scope.data.status === '已下达'" v-if="tool.checkAuth($route.name,'update')" class="inline-16" type="text" size="small" @click="$store.dispatch('DrawerShowChange',true),$router.push({path:'/personalTarget_edit',query:{id:scope.data.sa_salestargetbillid}})">编 辑</el-button>-->
+        <onissue v-if="tool.checkAuth($route.name,'issue')" :data="scope.data" @onSuccess="onSuccess"></onissue>
+        <adjustment v-if="tool.checkAuth($route.name,'adjust')" :data="scope.data" @onSuccess="onSuccess"></adjustment>
+      </template>
+    </basicLayout>
+<!--    <list ref="list">
       <template #add>
         <add v-if="tool.checkAuth($route.name,'insert')" @onSuccess="onSuccess"></add>
       </template>
@@ -16,8 +52,8 @@
       <template v-slot:adjustment="scope">
         <adjustment v-if="tool.checkAuth($route.name,'adjust')" :data="scope.data" @onSuccess="onSuccess"></adjustment>
       </template>
-    </list>
-    <!--抽屉面板-->
+    </list>-->
+
     <el-drawer
       title="我是标题"
       :visible.sync="drawer"
@@ -45,6 +81,20 @@ export default {
   data () {
     return {
       drawer:false,
+      options:[],
+      statusData:[
+        {
+          value:'新建',
+          label:'新建'
+        },
+        {
+          value:'已下达',
+          label:'已下达'
+        }
+      ],
+      selectParam:{
+        status:''
+      }
     }
   },
   components:{
@@ -75,6 +125,10 @@ export default {
     },
     onSuccess () {
       this.$refs['list'].listData()
+    },
+    selectChange(){
+      this.$refs.list.param.content.where = this.selectParam
+      this.$refs.list.listData()
     }
   }
 }

+ 83 - 0
src/HManagement/personalTarget/target/indexCopy.vue

@@ -0,0 +1,83 @@
+<template>
+  <div>
+    <list ref="list">
+      <template #add>
+        <add v-if="tool.checkAuth($route.name,'insert')" @onSuccess="onSuccess"></add>
+      </template>
+      <template v-slot:detail="scope">
+        <el-button type="text" size="small" @click="$store.dispatch('DrawerShowChange',true),$router.push({path:'/personalTarget_edit',query:{id:scope.data.sa_salestargetbillid,type:'onlyread'}})">详 情</el-button>
+      </template>
+      <template v-slot:edit="scope">
+        <el-button :disabled="scope.data.status === '已下达'" v-if="tool.checkAuth($route.name,'update')" class="inline-16" type="text" size="small" @click="$store.dispatch('DrawerShowChange',true),$router.push({path:'/personalTarget_edit',query:{id:scope.data.sa_salestargetbillid}})">编 辑</el-button>
+      </template>
+      <template v-slot:issue="scope">
+        <onissue v-if="tool.checkAuth($route.name,'issue')" :data="scope.data" @onSuccess="onSuccess"></onissue>
+      </template>
+      <template v-slot:adjustment="scope">
+        <adjustment v-if="tool.checkAuth($route.name,'adjust')" :data="scope.data" @onSuccess="onSuccess"></adjustment>
+      </template>
+    </list>
+    <!--抽屉面板-->
+    <el-drawer
+      title="我是标题"
+      :visible.sync="drawer"
+      :with-header="false"
+      direction="rtl"
+      size="90%"
+      append-to-body
+      @close="closeDrawer">
+      <div class="detail__panel">
+        <router-view/>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from 'vuex'
+
+import list from './modules/list.vue'
+import add from './modules/add.vue'
+import onissue from './modules/issue.vue'
+import adjustment from './modules/adjustment.vue'
+
+export default {
+  data () {
+    return {
+      drawer:false,
+    }
+  },
+  components:{
+    list,
+    add,
+    onissue,
+    adjustment
+  },
+  watch: {
+  $route (val) {
+    if (val.path == '/personalTarget') {
+      this.$refs.list.listData()
+    }
+  },
+  DrawerShow (val) {
+    val ? this.drawer = true : this.drawer = false
+  }
+  },
+  computed: {
+    ...mapGetters({
+      DrawerShow:'DrawerShow'
+    })
+  },
+  methods:{
+    closeDrawer () {
+      this.$router.push('/personalTarget')
+      this.$store.dispatch('DrawerShowChange',false)
+    },
+    onSuccess () {
+      this.$refs['list'].listData()
+    }
+  }
+}
+</script>
+<style>
+</style>

+ 32 - 4
src/HManagement/salesForecastTemplate/index.vue

@@ -13,9 +13,17 @@
       :detailPath="{
         path:'/salesForecastDetail'
       }">
-      <div slot="custom"></div>
+      <div slot="custom">
+        <label class="search__label " style="margin: auto;width: 35px;">状态:</label>
+        <el-select  class="inline-24" @change="selectChange" v-model="selectParam.status" placeholder="请选择状态" size="small" clearable>
+          <el-option v-for="(item,index) in statusData" :key="item.value" :value="item.value" :label="item.label"></el-option>
+        </el-select>
+      </div>
       <template v-slot:tbList="scope">
-        <div>
+        <div v-if="scope.data.column.columnname == 'status'">
+          <span :style="scope.data.column.data[scope.data.column.columnname] == '发布' ? 'color: rgb(82, 196, 26)' : ''">{{scope.data.column.data[scope.data.column.columnname]}}</span>
+        </div>
+        <div v-else>
           {{scope.data.column.data[[scope.data.column.columnname]]}}
         </div>
       </template>
@@ -35,11 +43,31 @@
 export default {
   data () {
     return {
-      options:[]
-      
+      options:[],
+      statusData:[
+        {
+          label:'新建',
+          value:'新建'
+        },
+        {
+          label:'发布',
+          value:'发布'
+        },
+        {
+          label:'结束',
+          value:'结束'
+        }
+      ],
+      selectParam: {
+        status:''
+      },
     }
   },
   methods:{
+    selectChange(){
+      this.$refs.basicLayout.param.content.where = this.selectParam
+      this.$refs.basicLayout.listData()
+    }
   }
 }
 

+ 1 - 1
src/HManagement/salesForecastTemplate/modules/add.vue

@@ -135,7 +135,7 @@ export default {
           { validator:this.validateEndDate, required: true, trigger: 'change' }
         ],
         taskdays:[
-          { required: true, message: '请输提醒天数', trigger: 'blur' },
+          { required: false, message: '请输提醒天数', trigger: 'blur' },
         ],
         periodpoint:[
           { validator: this.checkPeriodpoint, trigger: 'blur' }

+ 2 - 1
src/SManagement/personal_target/index.vue

@@ -1,10 +1,11 @@
 <template>
   <div class="personal-target">
     <Header>
+
       <el-button size="small" @click="export1" v-if="tool.checkAuth($route.name,'export')">导出</el-button>
     </Header>
     <div class="container normal-panel">
-      <select-panel 
+      <select-panel
         @yearChange="yearChange" 
         @targetChange="targetChange" 
         @clearTarget="targetClear" 

+ 1 - 0
src/SManagement/sales_forecast/modules/modelDetail.vue

@@ -21,6 +21,7 @@
           v-if="tool.checkAuth($route.name,'create_sales')" 
           :disabled="mainData.status == '结束' || new Date().valueOf() > new Date(mainData.enddate).valueOf()"
         >创建提报</el-button>
+
       </div>
       <div slot="slot0" >
         <salesHistory v-if="mainData" ref="salesHistory" :mainData="mainData">