Przeglądaj źródła

新建销售单

lilei 4 lat temu
rodzic
commit
4690c5ab3d

+ 26 - 12
src/views/common/editInput.js

@@ -1,20 +1,35 @@
 const EditableCell = {
   template: `
-      <div class="editable-cell">
+      <div style="display:flex;align-items: center;">
         <div class="editable-cell-input-wrapper">
-          <a-input :value="value" @change="handleChange" @pressEnter="check">
-            <a-icon
-              type="check"
-              slot="suffix"
-              :style="{color: editable?'#08c':'#666' }"
-              @click="check"
-            />
-          </a-input>
+          <a-input-number 
+          size="small" 
+          :min="0.1" 
+          :max="100000" 
+          :value="value" 
+          :precision="precision"
+          :step="step"
+          @change="handleChange" 
+          @pressEnter="check"/>
         </div>
+        <a-icon
+          type="check"
+          slot="suffix"
+          :style="{color: editable?'#08c':'#666', marginLeft: '10px' }"
+          @click="check"
+        />
       </div>
     `,
   props: {
-    text: String,
+    text: Number,
+    precision: {
+      type: [Number],
+      default: 2
+    },
+    step: {
+      type: [Number],
+      default: 1
+    }
   },
   data() {
     return {
@@ -23,8 +38,7 @@ const EditableCell = {
     };
   },
   methods: {
-    handleChange(e) {
-      const value = e.target.value;
+    handleChange(value) {
       this.value = value;
       this.editable = true
     },

+ 146 - 0
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -0,0 +1,146 @@
+<template>
+  <a-modal
+    centered
+    class="productInfoDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <!-- 产品详情 -->
+    <div>
+    <!-- <div v-if="detailsData"> -->
+      <a-row :gutter="35">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">产品名称:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">产品编码:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">原厂编码:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+      </a-row>
+      <a-row :gutter="35">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">基本单位:</p>
+          <p class="item-main">陕西省西安市未央区凤城八路</p>
+          <!-- <p class="item-main">{{ detailsData.provinceName }}{{ detailsData.cityName }}{{ detailsData.districtName }}{{ detailsData.address }}</p> -->
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">产品品牌:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">产品类别:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+      </a-row>
+      <a-row :gutter="35">
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">经销批发价:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">终端价:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+        <a-col :span="8" class="item-cont">
+          <p class="item-label">车主价:</p>
+          <p class="item-main">名称思密达</p>
+          <!-- <p class="item-main">{{ detailsData.name }}</p> -->
+        </a-col>
+      </a-row>
+      <div class="btn-cont"><a-button id="product-management-detail-modal-back" @click="isShow = false">返回列表</a-button></div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+export default {
+  name: 'productInfoDetailModal',
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      return '产品详情'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      detailsData: null, //  网点数据
+    }
+  },
+  methods: {
+    //  获取详情
+    getDetail(){
+      
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .productInfoDetail-modal{
+    .ant-modal-body {
+    	padding: 40px 40px 24px;
+    }
+    .item-cont {
+    	margin-bottom: 15px;
+    	display: flex;
+    	.item-label {
+    		width: 115px;
+    		font-size: 14px;
+    		color: rgba(0, 0, 0, 0.85);
+    		flex-shrink: 0;
+    	}
+    	.item-main {
+    		flex-grow: 1;
+        word-break: break-all;
+    	}
+    }
+    .btn-cont {
+    	text-align: center;
+    	margin: 35px 0 10px;
+    }
+  }
+</style>

+ 262 - 2
src/views/salesManagement/salesQuery/queryPart.vue

@@ -1,8 +1,268 @@
 <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-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>
+          <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="车架号(VIN)">
+                <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入车架号(VIN)"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+            <a-form-item label="产品品牌">
+              <a-select placeholder="请选择产品品牌" id="productInfoList-state" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
+                <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+              </a-select>
+            </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+            <a-form-item label="产品类别">
+              <a-cascader :options="typeData" id="productInfoList-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+            </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+            <a-form-item label="车型">
+              <v-select code="CHECK_ENABLE_STATE" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择车型"></v-select>
+            </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+            <a-form-item label="仓库">
+              <v-select code="CHECK_ENABLE_STATE" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择仓库"></v-select>
+            </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 8px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+            <a-popover>
+              <template slot="content">
+                双击列表配件可快速选中添加
+              </template>
+              <a-icon type="question-circle" theme="twoTone" />
+            </a-popover>
+            <a-icon style="margin:0 8px" type="setting" theme="twoTone" />
+          </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">
+        <a-input-number v-model="text" :min="0.1" :step="0.1" :max="999999" />
+      </template>
+      <!-- 数量 -->
+      <template slot="salesNums" slot-scope="text, record">
+        <a-input-number v-model="text" :min="1" :precision="0" :max="999999" />
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button type="primary" size="small" @click="handleadd(record)" id="productInfoList-edit-btn">添加</a-button>
+        <a-button size="small" @click="handleDetail(record)" id="productInfoList-detail-btn" style="margin-left: 15px;">销售记录</a-button>
+      </template>
+    </s-table>
+    <!-- 销售记录 -->
+    <product-salesRecord-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+  </div>
 </template>
 
 <script>
+import moment from 'moment'
+// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
+import productSalesRecordModal from './productSalesRecordModal.vue'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'queryPart',
+  components: { STable, VSelect, productSalesRecordModal },
+  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',
+          sorter: true
+        },
+        {
+          title: '仓库',
+          dataIndex: 'cangku',
+          align: 'center',
+          sorter: true
+        },
+        {
+          title: '仓位',
+          dataIndex: 'cangwei',
+          align: 'center'
+        },
+        {
+          title: '辅助单位',
+          dataIndex: 'pzdw',
+          align: 'center'
+        },
+        {
+          title: '售价',
+          dataIndex: 'price',
+          align: 'center',
+          width:150,
+          scopedSlots: { customRender: 'price' },
+        },
+        {
+          title: '销售数量',
+          dataIndex: 'salesNums',
+          align: 'center',
+          width:150,
+          scopedSlots: { customRender: 'salesNums' },
+        },
+        {
+          title: '单位',
+          dataIndex: 'dw',
+          align: 'center',
+        },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center',fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 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: '个'
+                }
+            ]
+          }
+          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>
-</style>
+<style lang="less">
+  .productInfoList-wrap{
+    .sTable{
+      table{
+        width: auto;
+      }
+    }
+  }
+</style>

+ 31 - 13
src/views/salesManagement/salesQuery/salesNew.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <a-affix>
+    <a-affix :target="() => this.$refs.container">
         <a-page-header
           :ghost="false"
           @back="() => $router.go(-1)"
@@ -39,7 +39,7 @@
       <!-- 查询条件 -->
       <a-row :gutter="15">
         <a-col :span="18">
-          <a-form-model layout="inline" :model="productForm" @submit="handleSearch" @submit.native.prevent>
+          <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>
@@ -75,11 +75,11 @@
         bordered>
         <!-- 价格 -->
         <template slot="price" slot-scope="text, record">
-          <editable-cell :text="text" @change="onCellChange(record.key, 'price', $event)" />
+          <editable-cell :text="text" :step="0.1" @change="onCellChange(record.id, 'price', $event)" />
         </template>
         <!-- 数量 -->
         <template slot="salesNums" slot-scope="text, record">
-          <editable-cell :text="text" @change="onCellChange(record.key, 'salesNums', $event)" />
+          <editable-cell :text="text" :precision="0" @change="onCellChange(record.id, 'salesNums', $event)" />
         </template>
       </s-table>
     </a-card>
@@ -101,6 +101,7 @@
     data(){
       return {
         disabled: false,
+        dataSource:[],
         productForm:{
           productNo: '',
           productName: ''
@@ -131,7 +132,7 @@
           },
           {
             title: '品牌',
-            dataIndex: 'brand',
+            dataIndex: 'productBrand',
             align: 'center',
             sorter: true
           },
@@ -148,34 +149,36 @@
           },
           {
             title: '辅助单位',
-            dataIndex: 'cangwei',
+            dataIndex: 'pzdw',
             align: 'center'
           },
           {
             title: '售价',
             dataIndex: 'price',
             align: 'center',
+            width:150,
             scopedSlots: { customRender: 'price' },
           },
           {
             title: '销售数量',
-            dataIndex: 'salseNums',
+            dataIndex: 'salesNums',
             align: 'center',
+            width:150,
             scopedSlots: { customRender: 'salesNums' },
           },
           {
             title: '单位',
-            dataIndex: 'mementPay',
+            dataIndex: 'dw',
             align: 'center'
           },
           {
             title: '售价小计',
-            dataIndex: 'isJj',
+            dataIndex: 'xj',
             align: 'center'
           },
           {
             title: '折后小计',
-            dataIndex: 'status',
+            dataIndex: 'zhxj',
             align: 'center'
           },
         ],
@@ -197,7 +200,16 @@
               pageNo: 1,
               pageSize: 10,
               list: [
-                { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+                { 
+                  id: '1', 
+                  productNo: 'jgqp11111111111', 
+                  productName: '产品1', 
+                  ycNo: 'jgqp111123545', 
+                  productBrand: '箭冠品牌', 
+                  productType: '产品分类1', 
+                  price: 5.6, 
+                  salesNums: 12 ,
+                  }
               ],
               count: 10
             }
@@ -206,6 +218,7 @@
               data.list[i].no = no + i + 1
             }
             _this.disabled = false
+            _this.dataSource = data.list
             resolve(data)
           })
         },
@@ -213,13 +226,18 @@
     },
     methods: {
       onCellChange(key, dataIndex, value) {
+        console.log(key, dataIndex, value)
+        console.log(this.dataSource)
         const dataSource = [...this.dataSource];
-        const target = dataSource.find(item => item.key === key);
+        const target = dataSource.find(item => item.id === key);
         if (target) {
-          target[dataIndex] = value;
+          target[dataIndex] = Number(value);
           this.dataSource = dataSource;
         }
       },
+      handleSearch(){
+        
+      }
     },
   }
 </script>