lilei 4 роки тому
батько
коміт
6ff0b11687

+ 287 - 0
src/views/salesManagement/salesReturn/chooseCustom.vue

@@ -0,0 +1,287 @@
+<template>
+  <a-modal
+    v-model="opened"
+    title="选择客户"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    width="80%"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-form-model
+      id="chooseCustom-form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="formItemLayout.labelCol"
+      :wrapper-col="formItemLayout.wrapperCol"
+    >
+      <a-row :gutter="15">
+        <a-col :span="8">
+          <a-form-model-item label="客户名称" prop="name">
+            <a-input
+              id="chooseCustom-name"
+              :maxLength="30"
+              v-model="form.name"
+              placeholder="请输入客户名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-model-item>
+            (未搜索到客户时为新增客户)
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="15">
+        <a-col :span="16">
+          <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+            <a-row :gutter="15">
+              <!-- 客户地址 -->
+              <a-col span="8">
+                <a-form-model-item prop="provinceCode">
+                  <a-select id="chooseCustom-provinceCode" @change="getCityList" v-model="form.provinceCode" placeholder="请选择省">
+                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col span="8">
+                <a-form-model-item prop="cityCode">
+                  <a-select id="chooseCustom-cityCode" @change="getAreaList" v-model="form.cityCode" placeholder="请选择市">
+                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col span="8">
+                <a-form-model-item prop="districtCode">
+                  <a-select id="chooseCustom-districtCode" @change="areaCharged" v-model="form.districtCode" placeholder="请选择区/县">
+                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-model-item prop="address">
+            <a-input
+              id="chooseCustom-address"
+              :maxLength="60"
+              v-model="form.address"
+              placeholder="请输入详细地址(最多60个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="15">
+        <a-col :span="8">
+          <a-form-model-item label="联系人" prop="contacts">
+            <a-input
+              id="chooseCustom-contacts"
+              :maxLength="30"
+              v-model="form.contacts"
+              placeholder="请输入联系人(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-model-item label="联系电话" prop="customerPhone">
+            <a-input
+              id="chooseCustom-customerPhone"
+              :maxLength="11"
+              v-model="form.customerPhone"
+              placeholder="请输入联系电话(最多11个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="15">
+        <a-col :span="8">
+          <a-form-model-item label="是否抓单" prop="shipping">
+            <v-select
+              v-model="form.iszd"
+              ref="iszd"
+              id="salesReturn-iszd"
+              code="FLAG"
+              placeholder="请选择是否抓单"
+              allowClear></v-select>
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="8">
+          <a-form-model-item label="开单人">
+            王明
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+      <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+        <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+      </a-form-model-item>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+export default {
+  name: 'ChooseCustom',
+  components: {
+    VSelect
+  },
+  props: {
+    show: [Boolean]
+  },
+  data () {
+    return {
+      opened: this.show,
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: { span: 8 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        name: '', // 客户名称
+        provinceCode: undefined, //  省
+        provinceName: '',
+        cityCode: undefined, // 市
+        cityName: '',
+        districtCode: undefined, // 区
+        districtName: '',
+        address: '', //  详细地址
+        contactName: '', //  联系人
+        contactPhone: '', //  联系电话
+        remarks: '', //  备注
+        priceType: '', //  价格类型
+        payType: '', // 支付方式
+        payment: '' // 收款方式
+      },
+      rules: {
+        name: [
+          { required: true, message: '请输入客户名称', trigger: 'blur' }
+        ],
+        provinceCode: [
+          { required: true, message: '请选择省', trigger: 'change' }
+        ],
+        cityCode: [
+          { required: true, message: '请选择市', trigger: 'change' }
+        ],
+        districtCode: [
+          { required: true, message: '请选择区/县', trigger: 'change' }
+        ],
+        address: [
+          { required: true, message: '请输入详细地址', trigger: 'blur' }
+        ],
+        contactName: [
+          { required: true, message: '请输入联系人', trigger: 'blur' }
+        ],
+        contactPhone: [
+          { required: true, message: '请输入联系人电话', trigger: 'blur' }
+        ],
+        priceType: [
+          { required: true, message: '请选择价格类型', trigger: 'change' }
+        ],
+        payType: [
+          { required: true, message: '请选择支付方式', trigger: 'change' }
+        ],
+        payment: [
+          { required: true, message: '请选择收款方式', trigger: 'change' }
+        ]
+      },
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  methods: {
+    // 获取省列表'
+    getProvinceList () {
+      getProvince().then(res => {
+        if (res.status == 200) {
+          this.addrProvinceList = res.data || []
+        } else {
+          this.addrProvinceList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.form.cityCode = undefined
+      this.form.districtCode = undefined
+      this.form.address = ''
+      this.getCityListRequest(val)
+    },
+    getCityListRequest (val) {
+      getCityByPro({
+        id: val
+      }).then(res => {
+        if (res.status == 200) {
+          this.addrCityList = res.data || []
+        } else {
+          this.addrCityList = []
+        }
+      })
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.form.districtCode = undefined
+      this.form.address = ''
+      this.getAreaListRequest(val)
+    },
+    getAreaListRequest (val) {
+      getDistrictByCity({
+        id: val
+      }).then(res => {
+        if (res.status == 200) {
+          this.addrDistrictList = res.data || []
+        } else {
+          this.addrDistrictList = []
+        }
+      })
+    },
+    // 区县变更
+    areaCharged (val) {
+      this.form.address = ''
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$emit('ok', { id: 1000, customName: '车领主常青二路店' })
+      this.cancel()
+      // this.$refs.ruleForm.validate(valid => {
+      //   if (valid) {
+      //     const form = values.form
+      //     form.desc = _this.form.desc
+      //     form.id = this.isEdit ? this.$route.params.id : null
+      //     console.log(form,'-----提交信息')
+      //     // goodsSave(form).then(res => {
+      //     //   if (res.status == 200) {
+      //     //     _this.$message.success(res.message)
+      //     //   }
+      //     // })
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
+    },
+    cancel () {
+      this.opened = false
+      this.$refs.ruleForm.resetFields()
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 199 - 1
src/views/salesManagement/salesReturn/detail.vue

@@ -1,8 +1,206 @@
 <template>
+  <div>
+    <a-affix>
+      <a-page-header
+        :ghost="false"
+        @back="() => $router.go(-1)"
+      >
+        <template slot="subTitle">
+          <a href="javascript:;" @click="() => $router.go(-1)">返回列表</a>
+          <a-button size="small" type="danger" style="margin-left:50px" key="1">
+            销售导出
+          </a-button>
+        </template>
+        <template slot="extra">
+          <a-button key="4">
+            打印预览
+          </a-button>
+          <a-button key="5" type="primary">
+            快速打印
+          </a-button>
+        </template>
+        <a-descriptions size="small" :column="4">
+          <a-descriptions-item label="客户名称">
+            张三的
+          </a-descriptions-item>
+          <a-descriptions-item label="客户地址">
+            山西省太原市阿斯加德法律静安寺水电费
+          </a-descriptions-item>
+          <a-descriptions-item label="支付方式">
+            货到付款
+          </a-descriptions-item>
+          <a-descriptions-item label="收款方式">
+            现金
+          </a-descriptions-item>
+          <a-descriptions-item label="联系手机">
+            13709146191
+          </a-descriptions-item>
+          <a-descriptions-item label="联系电话">
+            13709146191
+          </a-descriptions-item>
+          <a-descriptions-item label="备注">
+            备注备注备注备注备注
+          </a-descriptions-item>
+          <a-descriptions-item label="退货单号">
+            34242sdf234234
+          </a-descriptions-item>
+          <a-descriptions-item label="审核状态">
+            未审核
+          </a-descriptions-item>
+          <a-descriptions-item label="完结状态">
+            未完结
+          </a-descriptions-item>
+        </a-descriptions>
+      </a-page-header>
+    </a-affix>
+
+    <a-card size="small" :bordered="false" class="pages-wrap">
+      <!-- alert -->
+      <a-alert type="info">
+        <div slot="message">
+          <div>
+            <span>总款数:1;</span>
+            <span>总数量:6;</span>
+            <span>废品数量:3;</span>
+          </div>
+          <div>
+            <span>退货总金额:11;</span>
+            <span>折扣金额:8;</span>
+            <span>折扣:0.00%;</span>
+            <span>折后金额:0.00;</span>
+          </div>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1500, y: 300 }"
+        bordered>
+      </s-table>
+    </a-card>
+  </div>
 </template>
 
 <script>
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'SalesDetail',
+  components: {
+    STable,
+    VSelect
+  },
+  data () {
+    return {
+      disabled: false,
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          align: 'center',
+          width: 100
+        },
+        {
+          title: '产品编码',
+          dataIndex: 'salerNo',
+          align: 'center'
+        },
+        {
+          title: '产品名称',
+          dataIndex: 'storeNo',
+          align: 'center'
+        },
+        {
+          title: '原厂编码',
+          dataIndex: 'custName',
+          align: 'center'
+        },
+        {
+          title: '售价',
+          dataIndex: 'totalNums',
+          align: 'center'
+        },
+        {
+          title: '折后售价',
+          dataIndex: 'totalPrice',
+          align: 'center'
+        },
+        {
+          title: '退货数量',
+          dataIndex: 'payType',
+          align: 'center'
+        },
+        {
+          title: '废品数量',
+          dataIndex: 'shDate',
+          align: 'center'
+        },
+        {
+          title: '入库数量',
+          dataIndex: 'status',
+          align: 'center'
+        },
+        {
+          title: '退货金额小计',
+          dataIndex: 'isJj',
+          align: 'center'
+        },
+        {
+          title: '折扣金额',
+          dataIndex: 'status',
+          align: 'center'
+        },
+        {
+          title: '折后退货金额小计',
+          dataIndex: 'status',
+          align: 'center'
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
+        //   const data = res.data
+        //   const no = (data.pageNo - 1) * data.pageSize
+        //   for (var i = 0; i < data.list.length; i++) {
+        //     data.list[i].no = no + i + 1
+        //   }
+        //   this.disabled = false
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+            ],
+            count: 10
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          _this.disabled = false
+          resolve(data)
+        })
+      }
+    }
+  }
+}
 </script>
 
-<style>
+<style lang="less">
+  .pages-wrap{
+    margin-top: 15px;
+    .sTable{
+      margin-top: 15px;
+    }
+  }
 </style>

+ 264 - 2
src/views/salesManagement/salesReturn/list.vue

@@ -1,8 +1,270 @@
 <template>
+  <a-card :bordered="false" class="salesReturn-wrap">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <a-range-picker v-model="queryParam.creatDate" id="salesReturn-creatDate"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="审核时间">
+              <a-range-picker v-model="queryParam.shDate" id="salesReturn-shDate"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-select
+                id="salesReturn-customeName"
+                placeholder="请选择客户"
+                allowClear
+                v-model="queryParam.dataSourceNo"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="退货单号">
+                <a-input id="salesReturn-salesNo" v-model.trim="queryParam.salesNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="salesReturn-billStatus"
+                  code="PAYMENT_TYPE"
+                  placeholder="请选择单据状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <span class="table-page-search-submitButtons">
+              <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+              <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+              <a @click="toggleAdvanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-button type="primary" @click="handleNew()">新建退货单</a-button>
+    </div>
+    <!-- alert -->
+    <a-alert type="warning">
+      <div slot="message">
+        <span>退货总金额:14.00 元;</span>
+        <span>总单数:6;</span>
+        <span>总款数:3;</span>
+        <span>总数量:7;</span>
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1500, y: 300 }"
+      bordered>
+      <!-- 状态 -->
+      <template slot="state" slot-scope="text, record">
+        <span>{{ record.state == 1 ? '已启用' : '已禁用' }}</span>
+      </template>
+      <!-- 操作 -->
+      <span slot="action" slot-scope="text, record">
+        <template>
+          <a href="javascript:;" id="salesReturn-auth-btn">审核</a>
+          <a-divider type="vertical" />
+        </template>
+        <a-dropdown>
+          <a class="ant-dropdown-link">
+            更多 <a-icon type="down" />
+          </a>
+          <a-menu slot="overlay">
+            <a-menu-item >
+              <a id="salesReturn-view-btn" href="javascript:;" @click="handleView(record)">明细</a>
+            </a-menu-item>
+            <a-menu-item>
+              <a id="salesReturn-edit-btn" href="javascript:;" @click="handleEdit(record)">修改</a>
+            </a-menu-item>
+            <a-menu-item>
+              <a id="salesReturn-del-btn" href="javascript:;" @click="handleDel(record)">删除</a>
+            </a-menu-item>
+          </a-menu>
+        </a-dropdown>
+      </span>
+    </s-table>
+    <!-- 选择客户弹框 -->
+    <chooseCustom :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></chooseCustom>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import chooseCustom from './chooseCustom.vue'
+// import { getRoleList, getServiceList } from '@/api/manage'
+export default {
+  name: 'TableList',
+  components: {
+    STable,
+    VSelect,
+    chooseCustom
+  },
+  data () {
+    return {
+      mdl: {},
+      // 高级搜索 展开/关闭
+      advanced: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      openModal: false, // 选择客户弹框是否显示
+      customeList: [],
+      // 查询参数
+      queryParam: {},
+      // 表头
+      columns: [
+        {
+          title: '创建时间',
+          dataIndex: 'creatDate',
+          align: 'center'
+        },
+        {
+          title: '销售退货单号',
+          dataIndex: 'salerNo',
+          align: 'center'
+        },
+        {
+          title: '客户名称',
+          dataIndex: 'custName',
+          align: 'center'
+        },
+        {
+          title: '总款数',
+          dataIndex: 'totalP',
+          align: 'center'
+        },
+        {
+          title: '总数量',
+          dataIndex: 'totalNums',
+          align: 'center'
+        },
+        {
+          title: '退款总金额',
+          dataIndex: 'totalPrice',
+          align: 'center'
+        },
+        {
+          title: '是否抓单',
+          dataIndex: 'mementPay',
+          align: 'center'
+        },
+        {
+          title: '审核时间',
+          dataIndex: 'shDate',
+          align: 'center'
+        },
+        {
+          title: '状态',
+          dataIndex: 'status',
+          align: 'center'
+        },
+        {
+          title: '操作',
+          width: '200px',
+          key: 'operation',
+          fixed: 'right',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
+        //   const data = res.data
+        //   const no = (data.pageNo - 1) * data.pageSize
+        //   for (var i = 0; i < data.list.length; i++) {
+        //     data.list[i].no = no + i + 1
+        //   }
+        //   this.disabled = false
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+            ],
+            count: 10
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          _this.disabled = false
+          resolve(data)
+        })
+      }
+    }
+  },
+  created () {
+  },
+  methods: {
+    handleNew () {
+      this.openModal = true
+    },
+    // 选择客户成功
+    chooseCustomOk (data) {
+      this.$router.push({ name: 'salesReturnNew' })
+    },
+    handleEdit (record) {
+      this.$router.push({ name: 'salesReturnEdit', params: { id: record.id } })
+    },
+    handleView (record) {
+      this.$router.push({ name: 'salesReturnDetail', params: { id: record.id } })
+    },
+    handleDel () {},
+    toggleAdvanced () {
+      this.advanced = !this.advanced
+    },
+    resetSearchForm () {
+      this.queryParam.orderBundleNo = ''
+      this.queryParam.orderBundle.custMobile = ''
+      this.queryParam.bundleName = ''
+      this.queryParam.itemName = ''
+      this.oldTime = undefined
+      this.newTime = undefined
+      this.$refs.table.refresh(true)
+    },
+    filterOption (input, option) {
+    	return (
+    		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    	)
+    }
+  }
+}
 </script>
-
-<style>
+<style lang="less">
+  .salesReturn-wrap{
+    .sTable{
+      margin-top: 15px;
+    }
+  }
 </style>