瀏覽代碼

沟通列表

chris 3 年之前
父節點
當前提交
21acd358c6

+ 24 - 16
src/views/modules/cus/communicate-add-or-update.vue

@@ -83,13 +83,13 @@
             align="center">
           </el-table-column>
           <el-table-column
-            prop="materialName"
+            prop="productName"
             header-align="center"
             align="center"
             label="产品名称">
           </el-table-column>
           <el-table-column
-            prop="-"
+            prop="cnt"
             header-align="center"
             align="center"
             label="数量"
@@ -103,9 +103,12 @@
             header-align="center"
             align="center"
             label="含税单价">
+            <template slot-scope="scope">
+              <el-input-number v-model="scope.row.price" :disabled="display" :precision="2" :step="0.1" :min="0" style="width: 140px;"/>
+            </template>
           </el-table-column>
           <el-table-column
-            prop="-"
+            prop="amount"
             header-align="center"
             align="center"
             label="含税总价">
@@ -114,7 +117,7 @@
             </template>
           </el-table-column>
           <el-table-column
-            prop="-"
+            prop="rate"
             header-align="center"
             align="center"
             label="税率">
@@ -150,7 +153,7 @@
 </template>
 
 <script>
-  import templateChose from '../warehouse/template-chose'
+  import templateChose from '../product/template-chose'
   import { getCustomer, getCoDetail } from '@/api/cus'
   import { uploadUrl, downloadUrl, uploadFiles } from '@/api/file'
   import { getDictList } from '@/api/dict'
@@ -198,6 +201,7 @@
     methods: {
       async init (id, display) {
         this.dataForm = {}
+        this.cusRCommProductVOS = []
         this.visible = true
         this.id = id || 0
         this.display = display
@@ -207,11 +211,6 @@
             this.options = data
           }
         })
-        // await getType().then(({data}) => {
-        //   if (data && data.code === '200') {
-        //     this.options = data.data
-        //   }
-        // })
         await getCustomer().then(({data}) => {
           if (data && data.code === '200') {
             this.optionsCus = data.data
@@ -230,7 +229,16 @@
                 id: item.url
               })
             })
-            // console.log('this.fileList = ' + JSON.stringify(this.fileList))
+            data.data.cusRCommProductVOS.forEach((item) => {
+              this.cusRCommProductVOS.push({
+                cnt: item.cnt,
+                price: item.price,
+                productId: item.productId,
+                rate: item.rate,
+                productName: item.productName,
+                notes: item.notes
+              })
+            })
           }
         })
       },
@@ -277,7 +285,7 @@
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
             let fList = this.fileList
-            console.log('fileList = ' + fList)
+            // console.log('fileList = ' + fList)
             if (fList.length > 0) {
               this.dataForm.attachList = []
               for (let i = 0; i < fList.length; i++) {
@@ -322,11 +330,11 @@
       addItem (item) {
         this.cusRCommProductVOS.push({
           cnt: 1,
-          price: item.price,
-          productId: item.id,
+          price: 0,
+          productId: item.productId,
           rate: 0,
-          materialName: item.materialName,
-          notes: item.materialName
+          productName: item.productName,
+          notes: item.notes
         })
       }
     }

+ 1 - 0
src/views/modules/cus/communicate.vue

@@ -24,6 +24,7 @@
         prop="coCode"
         header-align="center"
         align="center"
+        min-width="100"
         label="沟通编码">
       </el-table-column>
       <el-table-column

+ 160 - 0
src/views/modules/product/template-chose.vue

@@ -0,0 +1,160 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    width="70%"
+    :close-on-click-modal="false"
+    :visible.sync="visible">
+    <div class="stock-order">
+      <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
+        <el-form-item label="产品名称">
+          <el-input v-model="dataForm.name" placeholder="名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="search()">查询</el-button>
+          <el-button @click="visible = false" type="primary">返回</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table
+        :data="dataList"
+        border
+        v-loading="dataListLoading"
+        @selection-change="selectionChangeHandle"
+        style="width: 100%;">
+        <el-table-column
+          label="序号"
+          type="index"
+          width="50"
+          align="center">
+        </el-table-column>
+        <el-table-column
+          prop="productCode"
+          header-align="center"
+          align="center"
+          label="产品编码">
+        </el-table-column>
+        <el-table-column
+          prop="productName"
+          header-align="center"
+          align="center"
+          label="产品名称">
+        </el-table-column>
+        <el-table-column
+          prop="productType"
+          header-align="center"
+          align="center"
+          label="产品类别">
+        </el-table-column>
+<!--        <el-table-column-->
+<!--          prop="delFlag"-->
+<!--          header-align="center"-->
+<!--          align="center"-->
+<!--          label="状态">-->
+<!--        </el-table-column>-->
+        <el-table-column
+          prop="productSpec"
+          header-align="center"
+          align="center"
+          label="产品规格">
+        </el-table-column>
+        <el-table-column
+          prop="notes"
+          header-align="center"
+          align="center"
+          label="备注">
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="50"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="exportItem(scope.row)">添加</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="sizeChangeHandle"
+        @current-change="currentChangeHandle"
+        :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        :total="totalPage"
+        layout="total, sizes, prev, pager, next, jumper">
+      </el-pagination>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        visible: false,
+        dataForm: {},
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: []
+      }
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.getDataList()
+      },
+      search () {
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 获取数据列表
+      getDataList () {
+        this.dataListLoading = true
+        this.$http({
+          url: this.$http.adornUrl('/biz-service/product/list'),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.pageIndex,
+            'size': this.pageSize,
+            'productName': this.dataForm.name ? this.dataForm.name : null,
+            'productType': this.dataForm.type ? this.dataForm.type : null
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data.records
+            this.totalPage = Number(data.data.total)
+          } else {
+            this.dataList = []
+            this.totalPage = 0
+          }
+          this.dataListLoading = false
+        })
+      },
+      // 每页数
+      sizeChangeHandle (val) {
+        this.pageSize = val
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 当前页
+      currentChangeHandle (val) {
+        this.pageIndex = val
+        this.getDataList()
+      },
+      // 多选
+      selectionChangeHandle (val) {
+        this.dataListSelections = val
+      },
+      // 添加
+      exportItem (item) {
+        this.$emit('addItem', item)
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>