zhangqiOMG 2 年之前
父节点
当前提交
3be45d92ec

+ 7 - 0
src/HDrpManagement/invoiceapp/detail/tab/invoiceOrder/components/addorderline.vue

@@ -2,6 +2,13 @@
   <div>
     <el-button v-if="tool.checkAuth($route.name,'InvioceOrder')" :disabled="status !== '新建'" style="margin-bottom:10px" size="small" type="primary" @click="onShow">添加订单行</el-button>
     <el-dialog title="可添加订单" append-to-body :visible.sync="dialogTableVisible">
+      <div class="flex-align-center">
+        <el-input size="small"  
+          style="width:200px;margin-bottom:16px"
+          suffix-icon="el-icon-search" 
+          v-model="param.content.where.condition" 
+          placeholder="订单号、产品编号、产品名称" @keyup.enter.native="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" clearable></el-input>&nbsp;
+      </div>
       <el-table :data="list" size="mini" border>
         <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>
         <el-table-column prop="rowno" label="订单行号" width="150"></el-table-column>

+ 0 - 1
src/HDrpManagement/orderManage/details/index.vue

@@ -38,7 +38,6 @@
               </el-option>
             </el-select>
             <div style="text-align: right; margin: 0">
-              <el-button size="mini" type="text" @click="visible = false">取消</el-button>
               <el-button  type="primary" size="mini" @click="onSubmit('审核')">确定</el-button>
             </div>
             <el-button :disabled="mainData.status !== '提交' && mainData.status !== '交期确认'" class="inline-16" @click="visible=true" v-if="tool.checkAuth($route.name,'examine')"   type="primary" size="mini" slot="reference">审 核</el-button>

+ 24 - 4
src/SDrpManagement/ProductGroup/index.vue

@@ -12,8 +12,11 @@
           @clear="clearData"
           clearable>
       </el-input>
+      <selectPeople ref="people" @selectRow="selectRow">
+        <el-input clearable @clear="selectRow({enterprisename:'',sys_enterpriseid:''})" v-model="enterprisename" placeholder="请选择经销商/客户" @focus="$refs.people.visible=true" slot="input" size="small"></el-input>
+      </selectPeople>
     </div>
-    <selectClass @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickField="clickField" :default="true"></selectClass>
+    <selectClass ref="class" @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickField="clickField" :default="true"></selectClass>
     <div v-if="Object.keys(productGroup).length > 0">
       <div class="group-list content">
         <div class="group-item" v-for="item in productGroup" :key="item.sa_itemgroupid" @click="itemClick(item)">
@@ -47,6 +50,7 @@
 
 <script>
 import selectClass from './modules/Select.vue'
+import selectPeople from './modules/selectPeople'
 export default {
   name: 'productgroup',
   data() {
@@ -62,7 +66,6 @@ export default {
           "pageNumber":1,
           "nocache":true,
           "brandids":[],
-
           "where":{
               "condition":"",
             "tradefield":'',
@@ -70,10 +73,17 @@ export default {
         }
       },
       total:0,
-      currentPage:0
+      currentPage:0,
+      sys_enterpriseid:'',
+      enterprisename:''
     };
   },
-  components:{selectClass},
+  provide () {
+    return {
+      sys_enterpriseid:() => this.sys_enterpriseid
+    }
+  },
+  components:{selectClass,selectPeople},
   computed:{
   },
   watch:{
@@ -83,6 +93,15 @@ export default {
     this.tablecols = this.tool.tabelCol(this.$route.name).productGroupTable.tablecols
   },
   methods: {
+    selectRow (data) {
+      this.enterprisename = data.enterprisename
+      this.sys_enterpriseid = data.sys_enterpriseid
+
+      this.$refs.class.queryAgentiInfo()
+      this.$refs.class.queryBrands().then(() => {
+        this.$refs.class.queryClass()
+      })
+    },
     /* 获取品牌数据 */
     async getbrandList() {
       let res = await this.$api.requested({
@@ -132,6 +151,7 @@ export default {
     },
     brandChange(id) {
       this.brandId = id
+      this.$refs.class.clickClass(false)
       this.getProductGroup()
     },
     onClassChange (n) {

+ 28 - 14
src/SDrpManagement/ProductGroup/modules/Select.vue

@@ -38,6 +38,7 @@ export default {
       selectThis:() => this
     }
   },
+  inject:['sys_enterpriseid'],
   props: {
     default: {
       type: Boolean,
@@ -54,32 +55,47 @@ export default {
         "content": {
             "pageNumber": 1,
             "pageSize": 20,
+            "sys_enterpriseid":this.sys_enterpriseid(),
             "where": {
               "condition": ""
             }
         }
       })
       this.fields = res1.data
-      this.field_act = res1.data[0].sys_enterprise_tradefieldid
+      if (this.fields.length) {
+        this.field_act = res1.data[0].sys_enterprise_tradefieldid
+      } else {
+        this.field_act = 0
+      }
     },
     async queryBrands () {
-      const res = await this.$api.requested({
-        "id": "20220924163702",
-        "content": {
-          "pageSize":1000,
-          "where":{
-            "condition":""
+      return new Promise(async (re,rej) => {
+        const res = await this.$api.requested({
+          "id": "20220924163702",
+          "content": {
+            "pageSize":1000,
+            "sys_enterpriseid":this.sys_enterpriseid(),
+            "where":{
+              "condition":""
+            }
           }
+        })
+        this.brands = res.data
+        if (this.brands.length) {
+          this.brand_act = res.data[0].sa_brandid
+          this.clickBrand(res.data[0].sa_brandid)
+        } else {
+          this.brand_act = 0
+          this.clickBrand(this.brand_act)
         }
+        re()
       })
-      this.brands = res.data
-      this.brand_act = res.data[0].sa_brandid
-      this.clickBrand(res.data[0].sa_brandid)
+      
     },
 
     async queryClass () {
       const res = await this.$api.requested({
-        "id":"20220922110403","content":{"sa_brandid":this.brand_act,where:{istool:0}}
+        "id":"20220922110403","content":{"sa_brandid":this.brand_act,"sys_enterpriseid":this.sys_enterpriseid(),where:{istool:0}}
       })
       console.log(res.data,'pop')
       this.itemclass = res.data[0].ttemclass
@@ -87,6 +103,7 @@ export default {
     clickBrand (id) {
       this.brand_act = id ? id : 0
       this.queryClass()
+      this.$emit('brandChange',[this.brand_act])
     },
     clickField (item) {
       this.field_act = item ? item.sys_enterprise_tradefieldid : ''
@@ -102,12 +119,9 @@ export default {
         this.$refs.tree.class_act = 0
         this.$emit('onClassChange',item)
       }
-      console.log('分类单机出发');
-      
       
     },
     change(n) {
-      console.log('分类单机出发2');
       this.$emit('onClassChange',n)
     },
     clearSearch() {

+ 126 - 0
src/SDrpManagement/ProductGroup/modules/selectPeople.vue

@@ -0,0 +1,126 @@
+<template>
+  <div> 
+    <el-dialog :visible.sync="visible" append-to-body width="50%">
+      <el-tabs v-model="param.content.where.type" @tab-click="listData">
+        <el-tab-pane label="客户" name="7"></el-tab-pane>
+        <el-tab-pane label="经销商" name="5"></el-tab-pane>
+      </el-tabs>
+      <div class="flex-align-center mt-10">
+        <el-input 
+          style="width:200px" 
+          size="small"  
+          suffix-icon="el-icon-search" 
+          placeholder="搜索" 
+          v-model="param.content.where.condition"
+          @keyup.enter.native="listData(param.content.pageNumber = 1)" 
+          @clear="listData(param.content.pageNumber = 1)" clearable></el-input>
+      </div>
+      <div>
+        <el-table
+          ref="multipleTable"
+          :data="tableData"
+          style="width: 100%"
+          size="mini"
+          height="50vh"
+          border>
+          <el-table-column
+            prop="enterprisename"
+            label="经销商名称"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            prop="agentnum"
+            label="经销商编号"
+            width="180">
+          </el-table-column>
+          <el-table-column
+            prop="contact"
+            label="联系人">
+          </el-table-column>
+          <el-table-column
+            label="地址">
+            <template slot-scope="scope">
+              {{scope.row.province}}{{scope.row.city}}{{scope.row.county}}{{scope.row.address}}
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="操作">
+            <template slot-scope="scope">
+              <el-button type="text" size="small" @click="selectRow(scope.row)">选 择</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="margin-top:16px;text-align:right">
+          <el-pagination
+            background
+            small
+            @current-change="handleCurrentChange"
+            :current-page="param.content.pageNumber"
+            :page-size="param.content.pageSize"
+            layout="total, prev, pager, next, jumper"
+            :total="total">
+          </el-pagination>
+        </div>
+      </div>
+    </el-dialog>
+    <slot name="input"></slot>
+  </div>
+</template>
+
+<script>
+export default {
+  props:[],
+  data () {
+    return {
+      visible:false,
+      param:{
+        "id":20220920083901,
+        "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "where": {
+                "condition": "",
+                "type":"7"
+            }
+        }
+      },
+      tableData: [],
+      total:0,
+      condition:'',
+      currentPage:0
+    }
+  },
+  watch: {
+  
+  },
+  methods:{
+    radioChange (data) {
+      this.param.content.where.type = data
+      this.listData()
+    },
+    async listData () {
+      const res = await this.$api.requested(this.param)
+      this.tableData = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+      console.log(this.tableData);
+      
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    selectRow (row) {
+      this.$emit('selectRow',row)
+      this.visible = false
+    }
+  },
+  created () {
+    this.listData()
+  },
+}
+
+</script>
+<style>
+</style>

+ 5 - 3
src/SDrpManagement/Products/index.vue

@@ -12,6 +12,7 @@
           @clear="$refs.list.listData($refs.list.params.content.where.condition='',$refs.list.params.content.pageNumber = 1)"
           clearable>
       </el-input>
+      
     </div>
     <select-class ref="class" @onClassChange="onClassChange" @clickField="clickField" :default="true" ></select-class>
     <list ref="list" ></list>
@@ -21,16 +22,17 @@
 <script>
 import list from './modules/list'
 import selectClass from './modules/Select'
-
 export default {
   data () {
     return {
-      search:''
+      search:'',
+      
     }
   },
   components:{
     list,
-    selectClass
+    selectClass,
+    selectPeople
   },
   methods:{
     selectClick (callback) {

+ 9 - 0
src/SDrpManagement/invoiceapp_saler/detail/tab/invoiceOrder/components/addorderline.vue

@@ -2,6 +2,13 @@
   <div>
     <el-button v-if="tool.checkAuth($route.name,'InvioceOrder')" :disabled="status !== '新建'" style="margin-bottom:10px" size="small" type="primary" @click="onShow">添加订单行</el-button>
     <el-dialog title="可添加订单" append-to-body :visible.sync="dialogTableVisible">
+      <div class="flex-align-center">
+        <el-input size="small"  
+          style="width:200px;margin-bottom:16px"
+          suffix-icon="el-icon-search" 
+          v-model="param.content.where.condition" 
+          placeholder="订单号、产品编号、产品名称" @keyup.enter.native="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" clearable></el-input>&nbsp;
+      </div>
       <el-table :data="list" size="mini" border>
         <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>
         <el-table-column prop="enterprisename" show-overflow-tooltip label="企业名称" width="150"></el-table-column>
@@ -51,6 +58,8 @@ export default {
         "content": {
           "sys_enterpriseid":0,
           "sa_invoiceapplyid":0,
+          "pageNumber":1,
+          "pageSize":20,
           "where":{
             "condition":"",
             "sonum":"",

+ 8 - 5
src/SDrpManagement/sinvoiceapp/detail/tab/invoiceOrder/components/addorderline.vue

@@ -8,8 +8,8 @@
           size="small"  
           suffix-icon="el-icon-search" 
           v-model="param.content.where.condition" 
-          placeholder="搜索" 
-          @keyup.enter.native="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" clearable></el-input>
+          placeholder="订单号、产品编号、产品名称" 
+          @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" clearable></el-input>
       </div>
       <el-table :data="list" size="mini" border>
         <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>
@@ -91,9 +91,12 @@ export default {
       this.param.content.sa_invoiceapplyid = this.$route.query.id
       this.param.content.sys_enterpriseid = this.sys_enterpriseid
       const res = await this.$api.requested(this.param)
-      this.list = res.data
-      this.total = res.total
-      this.currentPage = res.pageNumber
+      this.tool.showMessage(res,() => {
+        
+      })
+      this.list = typeof res.data == 'string' ? [] : res.data
+      this.total =  typeof res.data == 'string' ? 0 : res.total
+      this.currentPage = typeof res.data == 'string' ? 1 : res.pageNumber
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);