chenying 3 lat temu
rodzic
commit
fbd99249e1

+ 50 - 0
src/api/cus.js

@@ -0,0 +1,50 @@
+import request from '@/utils/httpRequest'
+
+export function getLevel () {
+  return request({
+    url: request.adornUrl('/biz-service/cusCustomer/level/list'),
+    method: 'get'
+  })
+}
+
+export function getType () {
+  return request({
+    url: request.adornUrl('/biz-service/cusCommunication/type/list'),
+    method: 'get'
+  })
+}
+
+export function getCustomer () {
+  return request({
+    url: request.adornUrl(`/biz-service/cusCustomer/name/list`),
+    method: 'get'
+  })
+}
+
+export function getcoCode () {
+  return request({
+    url: request.adornUrl(`/biz-service/cusCommunication/code/list`),
+    method: 'get'
+  })
+}
+
+export function getReviewType () {
+  return request({
+    url: request.adornUrl(`/biz-service/flow/cusContractReview/type/list`),
+    method: 'get'
+  })
+}
+
+export function getcoDetail (coId) {
+  return request({
+    url: request.adornUrl(`/biz-service/cusCommunication/info/${coId}`),
+    method: 'get'
+  })
+}
+
+export function getreDetail (reId) {
+  return request({
+    url: request.adornUrl(`/biz-service/flow/cusContractReview/info/${reId}`),
+    method: 'get'
+  })
+}

+ 120 - 0
src/views/modules/common/user-component-all.vue

@@ -0,0 +1,120 @@
+<template>
+    <div>
+      <el-select
+        v-model="value"
+        ref="select"
+        placeholder="请输入姓名"
+        clearable
+        filterable
+        remote
+        :disabled="disabled"
+        :remote-method="remoteMethod"
+        @change="onChange">
+        <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value">
+        </el-option>
+        <el-option v-if="noMore" label="加载更多" disabled style="font-style: italic; color: #8a979e" value="undefined" @click.native="handleClick()"></el-option>
+      </el-select>
+    </div>
+</template>
+
+<script>
+  export default {
+    name: 'user-component',
+    props: {
+      userId: {
+        type: String,
+        default: ''
+      },
+      disabled: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data () {
+      return {
+        value: '',
+        current: 1,
+        size: 10,
+        name: '',
+        options: [],
+        loading: false,
+        noMore: false
+      }
+    },
+    watch: {
+      userId (value) {
+        this.value = value
+      }
+    },
+    mounted () {
+      this.init()
+    },
+    methods: {
+      async init () {
+        this.getList()
+      },
+      remoteMethod (query) {
+        this.options = []
+        this.current = 1
+        this.name = query
+        this.getList()
+      },
+      getList () {
+        this.$http({
+          url: this.$http.adornUrl(`/user-service/user/list`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.current,
+            'size': this.size,
+            'name': this.name
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            if (this.current > data.data.pages) {
+              return
+            }
+            if (data.data.records.length < 10) {
+              this.noMore = false
+            } else {
+              this.noMore = true
+            }
+            data.data.records.forEach(item => {
+              this.options.push({
+                label: item.name + ' (' + item.orgName + ')',
+                value: item.userId,
+                name: item.name,
+                phone: item.mobile
+              })
+            })
+          } else {
+            this.options = []
+          }
+        })
+      },
+      handleClick () {
+        this.loadMore()
+      },
+      loadMore () {
+        this.current ++
+        this.getList()
+      },
+      onChange (item) {
+        this.options.forEach(val => {
+          if (val.value === item) {
+            this.$emit('change', val)
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+.el-select{
+  width: 100%;
+}
+</style>

+ 1 - 1
src/views/modules/common/user-components.vue

@@ -10,7 +10,7 @@
         multiple
         :disabled="disabled"
         :remote-method="remoteMethod"
-        @change = "onChange">
+        @change="onChange">
         <el-option
           v-for="item in options"
           :key="item.value"

+ 272 - 0
src/views/modules/cus/communicate-add-or-update.vue

@@ -0,0 +1,272 @@
+<template>
+<div>
+  <el-dialog
+    :title="!id ? '新增': islook ? '详情' : '修改'"
+    width="70%"
+    :close-on-click-modal="false"
+    :visible.sync="visible">
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+      <el-row class="my-row">
+        <el-col :span="8">
+          <el-form-item label="客户名称" prop="cusId">
+            <el-select
+              v-model="dataForm.cusId"
+              :disabled="isLook"
+              remote
+              placeholder="请选择">
+              <el-option
+                v-for="item in options1"
+                :key="item.value"
+                :label="item.customerName"
+                :value="item.customerId">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" style="padding-left: 20px">
+          <el-form-item label="联系人" prop="name">
+            <el-input v-model="dataForm.name" disabled placeholder="联系人"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" style="padding-left: 20px">
+          <el-form-item label="沟通类别" prop="coType">       
+            <el-select
+              v-model="dataForm.coType"
+              :disabled="isLook"
+              remote
+              placeholder="请选择">
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.code"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-form-item label="备注说明">
+            <el-input v-model="dataForm.code" :disabled="isLook" placeholder="备注说明"></el-input>
+          </el-form-item>
+      </el-row>
+      <el-row class="my-row">
+        <div class="title"><span style="color: red">*</span> 沟通扫描件</div>
+        <el-upload
+          v-show="!islook"
+          class="upload-demo"
+          ref="upload"
+          action="https://jsonplaceholder.typicode.com/posts/"
+          :on-preview="handlePreview"
+          :on-remove="handleRemove"
+          :file-list="fileList"
+          :auto-upload="false">
+          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">开始上传</el-button>
+        </el-upload>
+      </el-row>
+      <div class="title"><span style="color: red">*</span> 订单产品明细</div>
+      <el-row>
+        <el-table
+          :data="dataForm.cusRCommProductVOS"
+          border
+          style="width: 100%;">
+          <el-table-column
+            label="序号"
+            type="index"
+            width="50"
+            align="center">
+          </el-table-column>
+          <el-table-column
+            prop="materialName"
+            header-align="center"
+            align="center"
+            label="产品名称">
+          </el-table-column>
+          <el-table-column
+            prop="-"
+            header-align="center"
+            align="center"
+            label="数量"
+            width="170">
+            <template slot-scope="scope">
+               <el-input-number v-model="scope.row.cnt" :disabled="isLook" :min="1" style="width: 140px;"/>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="price"
+            header-align="center"
+            align="center"
+            label="含税单价">
+          </el-table-column>
+          <el-table-column
+            prop="-"
+            header-align="center"
+            align="center"
+            label="含税总价">
+            <template slot-scope="scope">
+              <span>{{ (scope.row.cnt*scope.row.price).toFixed(2) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="-"
+            header-align="center"
+            align="center"
+            label="税率">
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.rate" :disabled="isLook">
+                <template slot="append">%</template>
+              </el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="notes"
+            header-align="center"
+            align="center"
+            label="备注">
+          </el-table-column>
+        </el-table>
+      </el-row>
+      <el-row v-if="!isLook" style="text-align: center; margin-top: 10px;">
+        <el-button type="primary" icon="el-icon-plus" @click="inBound"></el-button>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="visible = false">取消</el-button>
+      <el-button v-if="!isLook" type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+  </el-dialog>
+   <template-chose v-if="inboundVisible" ref="inbound" @addItem="addItem" />
+</div>
+</template>
+
+<script>
+  import templateChose from '../warehouse/template-chose'
+  import { getType, getCustomer, getcoDetail } from '@/api/cus'
+  export default {
+    name: 'stock-order-inbound',
+    components: {templateChose},
+    data () {
+      return {
+        inboundVisible: false,
+        visible: false,
+        islook: false,
+        dictType: 'material_type',
+        options: [],
+        options1: [],
+        dataList: [],
+        fileList: [],
+        id: 0,
+        dataForm: {
+          notes: '',
+          cusId: '',
+          coType: '',
+          name: '',
+          attachList: [],
+          cusRCommProductVOS: []
+        },
+        dataRule: {
+          cusId: [{ required: true, message: '客户名称不能为空', trigger: 'change' }],
+          coType: [{ required: true, message: '沟通类别不能为空', trigger: 'change' }],
+          name: [{ required: true, message: '联系人不能为空', trigger: 'blur' }]
+        }
+      }
+    },
+    watch: {
+      'dataForm.cusId' (value) {
+        this.options1.forEach(v => {
+          if (v.customerId === value) {
+            this.dataForm.name = v.contact
+          }
+        })
+      }
+    },
+    methods: {
+      async init (id, disabled) {
+        this.visible = true
+        this.id = id || 0
+        this.islook = disabled
+        await getType().then(({data}) => {
+          if (data && data.code === '200') {
+            this.options = data.data
+          }
+        })
+        await getCustomer().then(({data}) => {
+          if (data && data.code === '200') {
+            this.options1 = data.data
+          }
+        })
+        if (!id) return
+        await getcoDetail().then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+          }
+        })
+      },
+      submitUpload () {
+        this.$refs.upload.submit()
+      },
+      handleRemove (file, fileList) {
+        console.log(file, fileList)
+      },
+      handlePreview (file) {
+        console.log(file)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/cusCommunication/save`),
+              method: 'post',
+              data: this.$http.adornData(this.dataForm)
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.visible = false
+                    this.$emit('refreshDataList')
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      inBound () {
+        this.inboundVisible = true
+        this.$nextTick(() => {
+          this.$refs.inbound.init()
+        })
+      },
+      addItem (item) {
+        this.dataForm.cusRCommProductVOS.push({
+          cnt: 1,
+          price: item.price,
+          productId: item.id,
+          rate: 0,
+          materialName: item.materialName,
+          notes: item.materialName
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+.my-line{
+  border-bottom: 1px solid #c0c4cc;
+  margin-bottom: 10px;
+}
+.title{
+  padding: 10px 0 ;
+}
+</style>

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

@@ -0,0 +1,174 @@
+<template>
+  <div class="stock">
+    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
+      <el-form-item label="名称">
+        <el-input v-model="dataForm.cusName" placeholder="客户名称" clearable/>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="getDataList()">查询</el-button>
+        <el-button type="primary" @click="addOrUpdateHandle(0, false)">录入</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+      :data="dataList"
+      border
+      v-loading="dataListLoading"
+      style="width: 100%;">
+      <el-table-column
+        label="序号"
+        type="index"
+        width="50"
+        align="center">
+      </el-table-column>
+      <el-table-column
+        prop="coCode"
+        header-align="center"
+        align="center"
+        label="沟通编码">
+      </el-table-column>
+      <el-table-column
+        prop="customerName"
+        header-align="center"
+        align="center"
+        label="客户名称">
+      </el-table-column>
+      <el-table-column
+        prop="connectName"
+        header-align="center"
+        align="center"
+        label="联系人">
+      </el-table-column>
+      <el-table-column
+        prop="bizManagerName"
+        header-align="center"
+        align="center"
+        label="对接业务员">
+      </el-table-column>
+      <el-table-column
+        prop="coType"
+        header-align="center"
+        align="center"
+        label="沟通类别">
+      </el-table-column>
+      <el-table-column
+        prop="createTime"
+        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
+        prop="-"
+        header-align="center"
+        align="center"
+        label="附件">
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        width="150"
+        label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="details(scope.row.coId, true)">查看</el-button>
+          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.coId, false)">编辑</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>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
+  </div>
+</template>
+
+<script>
+  import AddOrUpdate from './communicate-add-or-update'
+  export default {
+    name: 'communicate',
+    components: {
+      AddOrUpdate
+    },
+    data () {
+      return {
+        addOrUpdateVisible: false,
+        dataForm: {
+          cusName: ''
+        },
+        options: [],
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: []
+      }
+    },
+    created () {
+      this.getDataList()
+    },
+    methods: {
+      // 获取数据列表
+      getDataList () {
+        this.addOrUpdateVisible = false
+        this.dataListLoading = true
+        this.$http({
+          url: this.$http.adornUrl('/biz-service/cusCommunication/list'),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.pageIndex,
+            'size': this.pageSize,
+            'cusName': this.dataForm.cusName
+          })
+        }).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
+      },
+      // 新增 / 修改
+      addOrUpdateHandle (id, disable) {
+        this.addOrUpdateVisible = true
+        this.$nextTick(() => {
+          this.$refs.addOrUpdate.init(id, disable)
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 196 - 0
src/views/modules/cus/contract-add-or-update.vue

@@ -0,0 +1,196 @@
+<template>
+  <el-dialog
+    title="发起评审"
+    width="70%"
+    :close-on-click-modal="false"
+    :visible.sync="visible">
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+      <el-row class="my-row">
+        <el-col :span="12">
+          <el-form-item label="沟通编码" prop="coCode">
+            <el-select
+              v-model="dataForm.coCode"
+              :disabled="isLook"
+              remote
+              placeholder="请选择">
+              <el-option
+                v-for="item in options1"
+                :key="item.value"
+                :label="item.coCode"
+                :value="item.coCode">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12" style="padding-left: 20px">
+          <el-form-item label="评审类别" prop="reType">
+            <el-select
+              v-model="dataForm.reType"
+              :disabled="isLook"
+              remote
+              placeholder="请选择">
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.code"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-col :span="12">
+          <el-form-item label="客户名称" prop="name">
+            <el-input v-model="dataForm.name" disabled placeholder="客户名称"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12" style="padding-left: 20px">
+          <el-form-item label="联系人" prop="cellName">
+            <el-input v-model="dataForm.cellName" disabled placeholder="联系人"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-form-item label="备注说明">
+            <el-input v-model="dataForm.notes" :disabled="isLook" placeholder="备注说明"></el-input>
+          </el-form-item>
+      </el-row>
+      <el-row class="my-row">
+        <div class="title">沟通信息表附件</div>
+      </el-row>
+      <el-row class="my-row">
+        <div class="title"><span style="color: red">*</span> 合同评审表</div>
+        <el-upload
+          v-show="!isLook"
+          class="upload-demo"
+          ref="upload"
+          action="https://jsonplaceholder.typicode.com/posts/"
+          :on-preview="handlePreview"
+          :on-remove="handleRemove"
+          :file-list="fileList"
+          :auto-upload="false">
+          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">开始上传</el-button>
+        </el-upload>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="visible = false">取消</el-button>
+      <el-button v-if="!isLook" type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import { getcoCode, getReviewType, getreDetail } from '@/api/cus'
+  export default {
+    name: 'stock-order-inbound',
+    data () {
+      return {
+        visible: false,
+        dictType: 'material_type',
+        options: [],
+        options1: [],
+        dataList: [],
+        fileList: [],
+        id: 0,
+        dataForm: {
+          coCode: '',
+          name: '',
+          cellName: '',
+          reType: '',
+          notes: '',
+          attachList: []
+        },
+        dataRule: {
+          coCode: [{ required: true, message: '沟通编码不能为空', trigger: 'change' }],
+          reType: [{ required: true, message: '评审类别不能为空', trigger: 'change' }],
+          name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
+          cellName: [{ required: true, message: '联系人不能为空', trigger: 'blur' }]
+        },
+        isLook: false
+      }
+    },
+    watch: {
+      'dataForm.coCode' (value) {
+        this.options1.forEach(v => {
+          if (v.customerId === value) {
+            this.dataForm.name = v.customerName
+            this.dataForm.cellName = v.contact
+          }
+        })
+      }
+    },
+    methods: {
+      async init (id, disabled) {
+        this.visible = true
+        this.id = id || 0
+        await getReviewType().then(({data}) => {
+          if (data && data.code === '200') {
+            this.options = data.data
+          }
+        })
+        await getcoCode().then(({data}) => {
+          if (data && data.code === '200') {
+            this.options1 = data.data
+          }
+        })
+        if (!id) return
+        await getreDetail().then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+          }
+        })
+      },
+      submitUpload () {
+        this.$refs.upload.submit()
+      },
+      handleRemove (file, fileList) {
+        console.log(file, fileList)
+      },
+      handlePreview (file) {
+        console.log(file)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/flow/cusContractReview/submit`),
+              method: 'post',
+              data: this.$http.adornData(this.dataForm)
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.visible = false
+                    this.$emit('refreshDataList')
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      }
+    }
+  }
+</script>
+
+<style scoped>
+.my-line{
+  border-bottom: 1px solid #c0c4cc;
+  margin-bottom: 10px;
+}
+.title{
+  padding: 10px 0 ;
+}
+</style>

+ 180 - 0
src/views/modules/cus/contract.vue

@@ -0,0 +1,180 @@
+<template>
+  <div class="stock">
+    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
+      <el-form-item label="名称">
+        <el-input v-model="dataForm.cusName" placeholder="客户名称" clearable/>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="getDataList()">查询</el-button>
+        <el-button type="primary" @click="addOrUpdateHandle(0, false)">发起评审</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+      :data="dataList"
+      border
+      v-loading="dataListLoading"
+      style="width: 100%;">
+      <el-table-column
+        label="序号"
+        type="index"
+        width="50"
+        align="center">
+      </el-table-column>
+      <el-table-column
+        prop="reCode"
+        header-align="center"
+        align="center"
+        label="评审编码">
+      </el-table-column>
+      <el-table-column
+        prop="coCode"
+        header-align="center"
+        align="center"
+        label="沟通编码">
+      </el-table-column>
+      <el-table-column
+        prop="cusName"
+        header-align="center"
+        align="center"
+        label="客户名称">
+      </el-table-column>
+      <el-table-column
+        prop="approverList"
+        header-align="center"
+        align="center"
+        label="联系人">
+      </el-table-column>
+      <el-table-column
+        prop="bizManagerName"
+        header-align="center"
+        align="center"
+        label="对接业务员">
+      </el-table-column>
+      <el-table-column
+        prop="reType"
+        header-align="center"
+        align="center"
+        label="类别">
+      </el-table-column>
+      <el-table-column
+        prop="createTime"
+        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
+        prop="-"
+        header-align="center"
+        align="center"
+        label="附件">
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        width="150"
+        label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="details(scope.row.reId, true)">查看</el-button>
+          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.reId, false)">编辑</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>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
+  </div>
+</template>
+
+<script>
+  import AddOrUpdate from './contract-add-or-update'
+  export default {
+    name: 'contract',
+    components: {
+      AddOrUpdate
+    },
+    data () {
+      return {
+        addOrUpdateVisible: false,
+        dataForm: {
+          cusName: ''
+        },
+        options: [],
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: []
+      }
+    },
+    created () {
+      this.getDataList()
+    },
+    methods: {
+      // 获取数据列表
+      getDataList () {
+        this.dataListLoading = true
+        this.addOrUpdateVisible = false
+        this.$http({
+          url: this.$http.adornUrl('/biz-service/flow/cusContractReview/mySubmit'),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.pageIndex,
+            'size': this.pageSize,
+            'cusName': this.dataForm.cusName
+          })
+        }).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
+      },
+      // 新增 / 修改
+      addOrUpdateHandle (id, disable) {
+        this.addOrUpdateVisible = true
+        this.$nextTick(() => {
+          this.$refs.addOrUpdate.init(id, disable)
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 45 - 33
src/views/modules/cus/customer-add-or-update.vue

@@ -1,99 +1,100 @@
 <template>
   <el-dialog
-    :title="!id ? '新增' : '修改'"
+    :title="!id ? '新增' : islook ? '详情' : '修改'"
     :close-on-click-modal="false"
     :visible.sync="visible">
     <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
       <h4>基础信息</h4>
       <el-form-item label="客户名称" prop="customerName">
-        <el-input v-model="dataForm.customerName" placeholder="客户名称"></el-input>
+        <el-input v-model="dataForm.customerName" :disabled="islook" placeholder="客户名称"></el-input>
       </el-form-item>
       <el-form-item label="客户级别" prop="level">
         <el-select
           v-model="dataForm.level"
+          :disabled="islook"
           remote
           placeholder="请选择">
           <el-option
             v-for="item in options"
             :key="item.value"
-            :label="item.label"
+            :label="item.code"
             :value="item.value">
           </el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="详细地址" prop="address">
-        <el-input v-model="dataForm.address"  placeholder="详细地址"></el-input>
+        <el-input v-model="dataForm.address" :disabled="islook" placeholder="详细地址"></el-input>
       </el-form-item>
       <el-form-item label="电话" prop="tel">
-        <el-input v-model="dataForm.tel"  placeholder="电话"></el-input>
+        <el-input v-model="dataForm.tel" :disabled="islook" placeholder="电话"></el-input>
       </el-form-item>
       <el-form-item label="邮编">
-        <el-input v-model="dataForm.zipCode" placeholder="邮编"></el-input>
+        <el-input v-model="dataForm.zipCode" :disabled="islook" placeholder="邮编"></el-input>
       </el-form-item>
       <el-form-item label="传真">
-        <el-input v-model="dataForm.fax" placeholder="传真"></el-input>
+        <el-input v-model="dataForm.fax" :disabled="islook" placeholder="传真"></el-input>
       </el-form-item>
       <el-form-item label="网址">
-        <el-input v-model="dataForm.url" placeholder="网址"></el-input>
+        <el-input v-model="dataForm.url" :disabled="islook" placeholder="网址"></el-input>
       </el-form-item>
       <el-form-item label="公司简介">
-        <el-input v-model="dataForm.introduction" type="textarea" placeholder="公司简介"></el-input>
+        <el-input v-model="dataForm.introduction" :disabled="islook" type="textarea" placeholder="公司简介"></el-input>
       </el-form-item>
       <h4>业务联系人</h4>
       <el-form-item label="联系人" prop="contact">
-        <el-input v-model="dataForm.contact"  placeholder="联系人"></el-input>
+        <el-input v-model="dataForm.contact" :disabled="islook" placeholder="联系人"></el-input>
       </el-form-item>
       <el-form-item label="手机号码" prop="contactTel">
-        <el-input v-model="dataForm.contactTel"  placeholder="手机号码"></el-input>
+        <el-input v-model="dataForm.contactTel" :disabled="islook" placeholder="手机号码"></el-input>
       </el-form-item>
       <el-form-item label="职位">
-        <el-input v-model="dataForm.contactPosition"  placeholder="职位"></el-input>
+        <el-input v-model="dataForm.contactPosition" :disabled="islook" placeholder="职位"></el-input>
       </el-form-item>
       <el-form-item label="邮箱">
-        <el-input v-model="dataForm.contactEmail"  placeholder="邮箱"></el-input>
+        <el-input v-model="dataForm.contactEmail" :disabled="islook" placeholder="邮箱"></el-input>
       </el-form-item>
       <el-form-item label="对接业务员" prop="bizManager">
-        <el-input v-model="dataForm.bizManager"  placeholder="对接业务员"></el-input>
+        <user-component-all v-model="dataForm.bizManager" :disabled="islook" :userId="dataForm.bizManager" @change="change"/>
+        <!-- <el-input v-model="dataForm.bizManager"  placeholder="对接业务员"></el-input> -->
       </el-form-item>
       <h4>财务信息</h4>
       <el-form-item label="企业税号" prop="taxNumber">
-        <el-input v-model="dataForm.taxNumber"  placeholder="企业税号"></el-input>
+        <el-input v-model="dataForm.taxNumber" disabled placeholder="企业税号"></el-input>
       </el-form-item>
       <el-form-item label="发票抬头" prop="invoiceTitle">
-        <el-input v-model="dataForm.invoiceTitle"  placeholder="发票抬头"></el-input>
+        <el-input v-model="dataForm.invoiceTitle" disabled placeholder="发票抬头"></el-input>
       </el-form-item>
       <el-form-item label="开户银行" prop="bank">
-        <el-input v-model="dataForm.bank"  placeholder="开户银行"></el-input>
+        <el-input v-model="dataForm.bank" disabled placeholder="开户银行"></el-input>
       </el-form-item>
       <el-form-item label="银行账号" prop="account">
-        <el-input v-model="dataForm.account"  placeholder="银行账号"></el-input>
+        <el-input v-model="dataForm.account" disabled placeholder="银行账号"></el-input>
       </el-form-item>
       <el-form-item label="单位地址" prop="billingAddr">
-        <el-input v-model="dataForm.billingAddr"  placeholder="单位地址"></el-input>
+        <el-input v-model="dataForm.billingAddr" disabled placeholder="单位地址"></el-input>
       </el-form-item>
     </el-form>
     <span slot="footer" class="dialog-footer">
       <el-button @click="visible = false">取消</el-button>
-      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+      <el-button v-if="!isLook" type="primary" @click="dataFormSubmit()">确定</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
+  import UserComponentAll from '../common/user-component-all'
+  import { getLevel } from '@/api/cus'
   export default {
+    components: { UserComponentAll },
+    computed: {
+      orgId: {
+        get () { return this.$store.state.user.orgId }
+      }
+    },
     data () {
       return {
         visible: false,
-        options: [
-          {
-            value: 'A',
-            label: 'A'
-          },
-          {
-            value: 'B',
-            label: 'B'
-          }
-        ],
+        options: [],
         id: 0,
         islook: false,
         dataForm: {
@@ -102,6 +103,7 @@
           bank: '',
           billingAddr: '',
           bizManager: '',
+          bizManagerName: '',
           contact: '',
           contactEmail: '',
           contactPosition: '',
@@ -134,9 +136,15 @@
       }
     },
     methods: {
-      init (id) {
+      async init (id, disabled) {
+        this.islook = disabled
         this.id = id || 0
         this.visible = true
+        await getLevel().then(({data}) => {
+          if (data && data.code === '200') {
+            this.options = data.data
+          }
+        })
         if (this.id) {
           this.$http({
             url: this.$http.adornUrl(`/biz-service/cusCustomer/info/${this.id}`),
@@ -149,14 +157,18 @@
           })
         }
       },
+      change (item) {
+        this.dataForm.bizManager = item.value
+        this.dataForm.bizManagerName = item.name
+      },
       // 表单提交
       dataFormSubmit () {
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
             this.$http({
-              url: this.$http.adornUrl(`/user-service/user/${!this.id ? 'save' : 'update'}`),
+              url: this.$http.adornUrl(`/biz-service/cusCustomer/${!this.id ? 'save' : 'update'}`),
               method: 'post',
-              data: this.$http.adornData(this.dataForm)
+              data: this.$http.adornData({...this.dataForm, orgId: this.orgId})
             }).then(({data}) => {
               if (data && data.code === '200') {
                 this.$message({

+ 18 - 17
src/views/modules/cus/customer.vue

@@ -12,14 +12,14 @@
           <el-option
             v-for="item in options"
             :key="item.value"
-            :label="item.label"
+            :label="item.code"
             :value="item.value">
           </el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
         <el-button @click="getDataList()">查询</el-button>
-        <el-button type="primary" @click="addOrUpdateHandle()">新增客户</el-button>
+        <el-button type="primary" @click="addOrUpdateHandle(0, false)">新增客户</el-button>
       </el-form-item>
     </el-form>
     <el-table
@@ -71,7 +71,7 @@
         label="对接业务员">
       </el-table-column>
       <el-table-column
-        prop="-"
+        prop="notes"
         header-align="center"
         align="center"
         label="备注">
@@ -83,8 +83,8 @@
         width="150"
         label="操作">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="details(scope.row.customerId)">查看</el-button>
-          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.customerId)">编辑</el-button>
+          <el-button type="text" size="small" @click="details(scope.row.customerId, true)">查看</el-button>
+          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.customerId, false)">编辑</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -104,6 +104,7 @@
 
 <script>
   import AddOrUpdate from './customer-add-or-update'
+  import { getLevel } from '@/api/cus'
   export default {
     name: 'customer',
     components: {
@@ -116,16 +117,7 @@
           customerName: '',
           level: ''
         },
-        options: [
-          {
-            value: 'A',
-            label: 'A'
-          },
-          {
-            value: 'B',
-            label: 'B'
-          }
-        ],
+        options: [],
         dataList: [],
         pageIndex: 1,
         pageSize: 10,
@@ -135,11 +127,20 @@
       }
     },
     created () {
+      this.getLevel()
       this.getDataList()
     },
     methods: {
+      getLevel () {
+        getLevel().then(({data}) => {
+          if (data && data.code === '200') {
+            this.options = data.data
+          }
+        })
+      },
       // 获取数据列表
       getDataList () {
+        this.addOrUpdateVisible = false
         this.dataListLoading = true
         this.$http({
           url: this.$http.adornUrl('/biz-service/cusCustomer/list'),
@@ -177,10 +178,10 @@
         this.dataListSelections = val
       },
       // 新增 / 修改
-      addOrUpdateHandle (id) {
+      addOrUpdateHandle (id, disabled) {
         this.addOrUpdateVisible = true
         this.$nextTick(() => {
-          this.$refs.addOrUpdate.init(id)
+          this.$refs.addOrUpdate.init(id, disabled)
         })
       }
     }

+ 0 - 1
src/views/modules/sys/menu-add-or-update.vue

@@ -23,7 +23,6 @@
             node-key="menuId"
             ref="menuListTree"
             @current-change="menuListTreeCurrentChangeHandle"
-            :default-expand-all="true"
             :highlight-current="true"
             :expand-on-click-node="false">
           </el-tree>

+ 14 - 19
src/views/modules/warehouse/template-chose.vue

@@ -27,43 +27,43 @@
           align="center">
         </el-table-column>
         <el-table-column
-          prop="-"
+          prop="materialCode"
           header-align="center"
           align="center"
           label="编码">
         </el-table-column>
         <el-table-column
-          prop="recordType"
+          prop="materialName"
           header-align="center"
           align="center"
           label="名称">
         </el-table-column>
         <el-table-column
-          prop="state"
+          prop="categoryName"
           header-align="center"
           align="center"
           label="类别">
         </el-table-column>
         <el-table-column
-          prop="approver"
+          prop="delFlag"
           header-align="center"
           align="center"
           label="状态">
         </el-table-column>
         <el-table-column
-          prop="-"
+          prop="specifications"
           header-align="center"
           align="center"
           label="规格">
         </el-table-column>
         <el-table-column
-          prop="-"
+          prop="unitName"
           header-align="center"
           align="center"
           label="单位">
         </el-table-column>
         <el-table-column
-          prop="-"
+          prop="notes"
           header-align="center"
           align="center"
           label="备注">
@@ -72,10 +72,10 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="150"
+          width="50"
           label="操作">
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="exportItem(scope.row.id)">添加</el-button>
+            <el-button type="text" size="small" @click="exportItem(scope.row)">添加</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -111,20 +111,18 @@
     methods: {
       init () {
         this.visible = true
+        this.getDataList()
       },
       // 获取数据列表
       getDataList () {
         this.dataListLoading = true
         this.$http({
-          url: this.$http.adornUrl('/biz-service/inbound-record-ctl/list'),
+          url: this.$http.adornUrl('/biz-service/stock-mg-ctl/list'),
           method: 'get',
           params: this.$http.adornParams({
             'current': this.pageIndex,
             'size': this.pageSize,
-            'userId': this.dataForm.userId,
-            'beginTime': this.dataForm.date[0],
-            'endTime': this.dataForm.date[1],
-            'recordType': this.dataForm.recordType
+            'materialName': this.dataForm.name
           })
         }).then(({data}) => {
           if (data && data.code === '200') {
@@ -153,11 +151,8 @@
         this.dataListSelections = val
       },
       // 入库申请
-      inBound () {
-        this.inboundVisible = true
-        this.$nextTick(() => {
-          this.$refs.inbound.init()
-        })
+      exportItem (item) {
+        this.$emit('addItem', item)
       }
     }
   }