소스 검색

代码上传

zhangqiOMG 2 년 전
부모
커밋
8749a39cb2

+ 1 - 1
src/Form/EnterpriseArchives/add.vue

@@ -113,7 +113,7 @@ export default {
           "content":this.form
         })
         this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
+          this.$emit('onSuccess',res)
           this.$refs['form'].resetFields();
           this.form = {
             enterprisename:'',

+ 22 - 9
src/Form/marketing2/agent/add.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-button type="primary" size="small" @click="onShow">新 建</el-button>
-    <el-drawer title="创建经销商" direction="rtl" append-to-body :visible.sync="dialogVisible">
+    <el-drawer title="创建经销商" direction="rtl" append-to-body :visible.sync="dialogVisible" @close="onClose">
       <div class="drawer__panel">
       <el-row :gutter="20">
         <el-form :model="form" ref="form" :rules="rules" :status-icon="false"	 size="small" label-position="right" label-width="100px" class="demo-form-inline">
@@ -10,7 +10,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="企业名称:" prop="enterprisename">
-              <enterprise @rowClick="chooseEnterprise"></enterprise>
+              <enterprise ref="ent" @rowClick="chooseEnterprise"></enterprise>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -151,7 +151,8 @@ export default {
       agent_level:[],
       arealist:[],
       agent_type:[],
-      enterprise:{}
+      enterprise:{},
+      timer:0
     }
   },
   components:{
@@ -233,24 +234,36 @@ export default {
       this.form.sa_saleareaid = value.at(-1)
     },
     debounce (fn, wait) {
-      let timer = 0
       return function () {
-        if (timer !== null) clearTimeout(timer)
-        timer = setTimeout(fn, wait)
+        if (this.timer !== null) clearTimeout(this.timer)
+        this.timer = setTimeout(fn, wait)
       }
     },
     chooseEnterprise (item) {
       this.visible = false
       this.form.enterprisename = item.enterprisename
-      this.form.enterpriseid = item.enterpriseid
-
+      this.form.sys_enterpriseid = item.sys_enterpriseid
       item.province = `${item.province}-${item.city}-${item.county}`
       this.enterprise = item
     },
     selectAgent (data) {
       this.form.parentid = data.sa_agentsid
     },
-   
+    onClose () {
+      this.$refs['ent'].form = {}
+      this.form = {
+        "enterprisename":'',
+        "sa_agentsid": 0,
+        "parentid":"",
+        "agentnum":"",
+        "signdate":"",
+        "grade":'1',
+        "sa_saleareaid":null,
+        "sys_enterpriseid":null,
+        "sa_saleareaids":[]
+      },
+      this.enterprise = {}
+    }
   },
   
 }

+ 17 - 4
src/HDrpManagement/logistics/modules/dispatchTable.vue

@@ -44,10 +44,23 @@
         this.needQuery?this.listData():''
       },
 			methods:{
-				deleteDisBill (row) {
-					this.tableData = this.tableData.filter(e=>{
-						return e.sa_dispatchid !== row.sa_dispatchid
-					})
+				async deleteDisBill (row) {
+          if (this.needQuery) {
+            const res = await this.$api.requested({
+              "id": "20221122133404",
+              "content": {
+                  "sa_logisticsid":this.$route.query.id,
+                  "sa_logistics_itemsids":[row.sa_logistics_itemsid]
+              }
+            })
+            this.tool.showMessage(res,()=>{
+              this.listData()
+            })
+          } else {
+            this.tableData = this.tableData.filter(e=>{
+              return e.sa_dispatchid !== row.sa_dispatchid
+            })
+          }
 				},
         async listData(){
           const res = await this.$api.requested({

+ 15 - 5
src/HDrpManagement/logistics/modules/edit.vue

@@ -1,6 +1,6 @@
 ed<template>
   <div>
-    <el-button :disabled="data.status !=='新建'" type="primary" size="mini" @click="drawer = true">编 辑</el-button>
+    <el-button :disabled="data.status !=='新建'" type="primary" size="mini" @click="onShow(drawer = true)">编 辑</el-button>
     <el-drawer
     title="创建物流单"
     :visible.sync="drawer"
@@ -10,7 +10,7 @@ ed<template>
     @close="onClose">
     <div class="drawer__panel">
       <p class="normal-title normal-margin">基础信息</p>
-      <el-form :inline="true" :model="form" class="demo-form-inline" size="small">
+      <el-form :inline="true" :model="form" class="demo-form-inline" size="small" v-if="drawer">
         <el-form-item label="企业名称">
           <enterprise ref="ent" @rowClick="entRowClick"></enterprise>
         </el-form-item>
@@ -35,13 +35,13 @@ ed<template>
         </el-form-item>
       </el-form>
       <div class="mt-10">
-        <div>
+        <div class="normal-margin">
           <p class="normal-title inline-16">添加发货单</p>
           <el-button type="text" size="mini" @click="addMoreBill">{{setcol === 12?'关闭选择':'添加发货单'}}</el-button>
         </div>
         <el-row :gutter="10">
           <el-col :span="setcol">
-            <dispatch-table ref="dislist"></dispatch-table>
+            <dispatch-table :needQuery="true" ref="dislist"></dispatch-table>
           </el-col>
           <el-col :span="24 - setcol">
             <add-disbill ref="addbill" :data="enterpriseInfo" @onConfirm="onConfirm"></add-disbill>
@@ -100,7 +100,17 @@ export default {
     }
   },
   methods:{
+    onShow () {
+      this.form = Object.assign({},this.form,this.data)
+      this.enterpriseInfo = this.data
+      this.$nextTick(()=>{
+        this.$refs['ent'].form.enterprisename = this.data.enterprisename
+        this.$refs['logis'].form.abbreviation = this.data.logiscomp_enterprisename
+      })
+     
+    },
     addMoreBill () {
+      console.log(this.data)
       if (this.enterpriseInfo === null) return this.$message({
         message:'请先选择企业信息',
         type:'error'
@@ -126,7 +136,7 @@ export default {
       const res = await this.$api.requested({
         "id": "202212004124804",
         "content": {
-          "sa_logisticsid": 0,
+          "sa_logisticsid": this.$route.query.id,
           "sys_enterpriseid": this.enterpriseInfo.sys_enterpriseid,
           "sa_logiscompid": this.form.sa_logiscompid,
           "remarks": "",

+ 1 - 0
src/api/request.js

@@ -68,6 +68,7 @@ service.interceptors.response.use(response => {
         //在这里对返回的数据进行处理
         if (response.data.code === -1) {
             router.push({path:'/'})
+            location.reload(true);
         }
         return response.data;
     }, error => {

+ 0 - 1
src/components/newLayout/modules/header.vue

@@ -97,7 +97,6 @@ export default {
       }).then(() => {
         sessionStorage.clear()
         this.$router.push('/')
-        location.reload(true);
       }).catch((err) => {
         console.log(err)
         this.$message({

+ 1 - 1
src/components/normal-basic-layout/details/index.vue

@@ -93,7 +93,7 @@ export default {
       const res = await this.$api.requested(this.param)
       this.total = res.total
       this.$emit('pageChange',res.data[0][this.idname],res.data[0].rowindex)
-      this.$refs['tag'].queryTag()
+      this.$refs['tag']?this.$refs['tag'].queryTag():''
       
     },
     next () {

+ 17 - 4
src/template/enterprise/index.vue

@@ -7,7 +7,7 @@
       <div>
         <div class="flex-align-center flex-between" style="margin-bottom:10px">
           <el-input style="width:200px" suffix-icon="el-icon-search" size="small" v-model="params.content.where.condition" placeholder="输入企业信息" @keyup.enter.native="queryEnterpriseArchives(params.content.pageNumber = 1)" @clear="queryEnterpriseArchives(params.content.pageNumber = 1)" clearable></el-input>
-          <addTemp @onSuccess="queryEnterpriseArchives"></addTemp>
+          <addTemp @onSuccess="onSuccess"></addTemp>
         </div>
         <el-table
           :data="ENlist"
@@ -65,15 +65,23 @@ export default {
       ENlist:[],
       total:0,
       currentPage:0,
-      form:{},
+      form:{
+        enterprisename:''
+      },
       params:{
         "id": 20220920083901,
         "content": {
           "pageNumber": 1,
           "pageSize": 10,
           "where": {
-            "condition": ''
-          }
+            "condition": '',
+          },
+          "sort":[{
+            "sortname":"默认",
+            "sorted":1,
+            "sortid":56,
+            "reversed":1
+          }],
         }
       },
       visible:false
@@ -98,6 +106,11 @@ export default {
       this.visible = false
       this.form.enterprisename = row.enterprisename
       this.$emit('rowClick',row)
+    },
+    onSuccess () {
+      this.queryEnterpriseArchives()
+      this.form.enterprisename = this.ENlist[0].enterprisename
+      this.$emit('rowClick',this.ENlist[0])
     }
   },
   mounted () {

+ 3 - 1
src/template/selectLogisticcom/index.vue

@@ -60,7 +60,9 @@ export default {
       logisticcomlist:[],
       total:0,
       currentPage:0,
-      form:{},
+      form:{
+        abbreviation:''
+      },
       params:{
         "id": 20221121135804,
         "content": {

+ 0 - 4
src/views/login/login.vue

@@ -98,10 +98,6 @@ export default {
       this.loginForm.phonenumber = localStorage.getItem('phonenumber')
       this.checked = true
     }
-    // 通过microapp访问时用到,其他情况下无效
-    if (window.microApp) {
-      this.$router.push('/accounts')
-    }
   },
   methods:{
     //验证码请求