Jelajahi Sumber

新建退货单

lilei 4 tahun lalu
induk
melakukan
830546d6b2

+ 232 - 0
src/views/salesManagement/salesReturn/queryPart.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="productInfoList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <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="产品编码">
+              <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销售单号">
+                <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin:0 15px 0 8px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1700, y: 300 }"
+      bordered>
+      <!-- 价格 -->
+      <template slot="price" slot-scope="text, record">
+        {{ text }} 元
+      </template>
+      <span slot="customTitle">
+        操作
+        <a-popover>
+          <template slot="content">
+            双击列表配件可快速选中添加
+          </template>
+          <a-icon type="question-circle" theme="twoTone" />
+        </a-popover>
+      </span>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button type="primary" size="small" @click="handleadd(record)" id="productInfoList-edit-btn">添加</a-button>
+      </template>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import moment from 'moment'
+// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'QueryPart',
+  components: { STable, VSelect },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      queryParam: { //  查询条件
+        bundleName: '', //  供应商名称
+        state: undefined //  状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      brandData: [], //  下拉数据
+      typeData: [], //  产品类别  下拉数据
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          align: 'center',
+          width: 100
+        },
+        {
+          title: '产品编码',
+          dataIndex: 'productNo',
+          align: 'center',
+          sorter: true
+        },
+        {
+          title: '产品名称',
+          dataIndex: 'productName',
+          align: 'center'
+        },
+        {
+          title: '原厂编码',
+          dataIndex: 'ycNo',
+          align: 'center'
+        },
+        {
+          title: '销售单号',
+          dataIndex: 'productBrand',
+          align: 'center'
+        },
+        {
+          title: '销售审核时间',
+          dataIndex: 'cangku',
+          align: 'center'
+        },
+        {
+          title: '售价',
+          dataIndex: 'price',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'price' }
+        },
+        {
+          title: '单位',
+          dataIndex: 'dw',
+          align: 'center'
+        },
+        {
+          title: '销售数量',
+          dataIndex: 'salesNums',
+          align: 'center'
+        },
+        {
+          title: '已退数量',
+          dataIndex: 'returnNums',
+          align: 'center'
+        },
+        { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: 100, 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',
+                productNo: 'jgqp11111111111',
+                productName: '产品1',
+                ycNo: 'jgqp111123545',
+                productBrand: '箭冠品牌',
+                productType: '产品分类1',
+                price: 5.6,
+                salesNums: 12,
+                dw: '个'
+              }
+            ],
+            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)
+        })
+      },
+      openModal: false, //  查看客户详情  弹框
+      itemId: '' //  当前产品id
+    }
+  },
+  methods: {
+    //  重置
+    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
+    	)
+    },
+    // 选择配件
+    handleadd (row) {
+      this.$emit('add', row)
+    },
+    // 销售记录
+    handleDetail (row) {
+      this.itemId = row.id
+      this.openModal = true
+    },
+    //  关闭弹框
+    closeModal () {
+      this.itemId = ''
+      this.openModal = false
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .productInfoList-wrap{
+    .sTable{
+      table{
+        width: auto;
+      }
+    }
+  }
+</style>

+ 290 - 1
src/views/salesManagement/salesReturn/salesReturnNew.vue

@@ -1,8 +1,297 @@
 <template>
+  <div>
+    <a-affix :target="() => this.$refs.container">
+      <a-page-header
+        :ghost="false"
+        @back="() => $router.go(-1)"
+      >
+        <template slot="subTitle">
+          <a href="javascript:;" @click="() => $router.go(-1)">客户名称:车领主常青二路店</a>
+          <a-button size="small" @click="handleEditCustom" style="margin-left:50px" key="0">
+            编辑
+          </a-button>
+        </template>
+        <template slot="extra">
+          <a-button key="2">
+            打印预览
+          </a-button>
+          <a-button key="1" type="primary">
+            快速打印
+          </a-button>
+        </template>
+      </a-page-header>
+    </a-affix>
+
+    <a-card :bordered="false" size="small" class="pages-wrap">
+      <!-- 查询配件列表 -->
+      <queryPart></queryPart>
+    </a-card>
+    <a-card :bordered="false" size="small" class="pages-wrap">
+      <!-- alert -->
+      <a-alert style="margin-bottom: 15px;" type="info">
+        <div slot="message">
+          <span>退货总金额:15;</span>
+          <span>总款数:6;</span>
+          <span>总数量:3;</span>
+          <span>废品总数量:7;</span>
+        </div>
+      </a-alert>
+      <!-- 查询条件 -->
+      <a-row :gutter="15">
+        <a-col :span="18">
+          <a-form-model layout="inline" :model="productForm" @submit="handleSearch">
+            <a-form-model-item label="产品编码">
+              <a-input v-model="productForm.productNo" placeholder="输入产品编码" />
+            </a-form-model-item>
+            <a-form-model-item label="产品名称">
+              <a-input v-model="productForm.productName" placeholder="输入产品名称" />
+            </a-form-model-item>
+            <a-form-model-item>
+              <a-button type="primary">
+                查询
+              </a-button>
+              <a-button style="margin-left: 10px;">
+                重置
+              </a-button>
+            </a-form-model-item>
+          </a-form-model>
+        </a-col>
+        <a-col :span="6">
+          <div style="float:right;overflow: hidden;">
+            <a-button id="salesNew-dru">导入明细</a-button>
+            <a-button type="primary" style="margin-left: 15px" id="salesNew-del-all">整单删除</a-button>
+          </div>
+        </a-col>
+      </a-row>
+      <!-- 已选配件列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="default"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1500, y: 300 }"
+        bordered>
+        <!-- 本次退货数量 -->
+        <template slot="returnNums" slot-scope="text, record">
+          <editable-cell :text="text" :step="0.1" @change="onCellChange(record.id, 'returnNums', $event)" />
+        </template>
+        <!-- 废品数量 -->
+        <template slot="fpNums" slot-scope="text, record">
+          <editable-cell :text="text" :precision="0" @change="onCellChange(record.id, 'fpNums', $event)" />
+        </template>
+        <template slot="cangku" slot-scope="text, record">
+          <a-select :value="text" style="width: 100%">
+            <a-select-option value="jack">
+              默认仓库
+            </a-select-option>
+            <a-select-option value="lucy">
+              Lucy
+            </a-select-option>
+          </a-select>
+        </template>
+        <template slot="cangwei" slot-scope="text, record">
+          <a-select :value="text" style="width: 100%">
+            <a-select-option value="jack">
+              默认仓位
+            </a-select-option>
+            <a-select-option value="lucy">
+              Lucy
+            </a-select-option>
+          </a-select>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button type="primary" size="small" @click="handleDel(record)">删除</a-button>
+        </template>
+      </s-table>
+    </a-card>
+    <!-- 选择客户弹框 -->
+    <chooseCustom :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></chooseCustom>
+  </div>
 </template>
 
 <script>
+import { STable, VSelect } from '@/components'
+import queryPart from './queryPart.vue'
+import EditableCell from '@/views/common/editInput.js'
+import chooseCustom from './chooseCustom.vue'
+export default {
+  name: 'SalesDetail',
+  components: {
+    STable,
+    VSelect,
+    queryPart,
+    EditableCell,
+    chooseCustom
+  },
+  data () {
+    return {
+      disabled: false,
+      openModal: false,
+      dataSource: [],
+      productForm: {
+        productNo: '',
+        productName: ''
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          align: 'center',
+          width: 100
+        },
+        {
+          title: '产品编码',
+          dataIndex: 'productNo',
+          align: 'center',
+        },
+        {
+          title: '产品名称',
+          dataIndex: 'productName',
+          align: 'center'
+        },
+        {
+          title: '原厂编码',
+          dataIndex: 'ycNo',
+          align: 'center'
+        },
+        {
+          title: '销售单号',
+          dataIndex: 'productBrand',
+          align: 'center',
+        },
+        {
+          title: '售价',
+          dataIndex: 'price',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'price' }
+        },
+        {
+          title: '单位',
+          dataIndex: 'dw',
+          align: 'center'
+        },
+        {
+          title: '销售数量',
+          dataIndex: 'salesNums',
+          align: 'center'
+        },
+        {
+          title: '本次退货数量',
+          dataIndex: 'returnNums',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'returnNums' }
+        },
+        {
+          title: '废品数量',
+          dataIndex: 'returnNums',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'fpNums' }
+        },
+        {
+          title: '退货存放仓库',
+          dataIndex: 'cangku',
+          align: 'center',
+          scopedSlots: { customRender: 'cangku' },
+          width: 150
+        },
+        {
+          title: '退货存放仓位',
+          dataIndex: 'cangwei',
+          align: 'center',
+          scopedSlots: { customRender: 'cangwei' },
+          width: 150
+        },
+        {
+          title: '退货金额小计',
+          dataIndex: 'xj',
+          align: 'center'
+        },
+        {
+          title: '折后金额小计',
+          dataIndex: 'zhxj',
+          align: 'center'
+        },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, 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',
+                productNo: 'jgqp11111111111',
+                productName: '产品1',
+                ycNo: 'jgqp111123545',
+                productBrand: '箭冠品牌',
+                productType: '产品分类1',
+                price: 5.6,
+                salesNums: 12
+              }
+            ],
+            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
+          _this.dataSource = data.list
+          resolve(data)
+        })
+      }
+    }
+  },
+  methods: {
+    onCellChange (key, dataIndex, value) {
+      console.log(key, dataIndex, value)
+      console.log(this.dataSource)
+      const dataSource = [...this.dataSource]
+      const target = dataSource.find(item => item.id === key)
+      if (target) {
+        target[dataIndex] = Number(value)
+        this.dataSource = dataSource
+      }
+    },
+    handleSearch () {
+
+    },
+    // 选择客户成功
+    chooseCustomOk (data) {
+
+    },
+    handleEditCustom () {
+      this.openModal = true
+    }
+  }
+}
 </script>
 
-<style>
+<style lang="less">
+  .pages-wrap{
+    margin-top: 15px;
+    .sTable{
+      margin-top: 15px;
+    }
+  }
 </style>