lilei преди 4 години
родител
ревизия
b4f1b27460

+ 6 - 6
src/api/sales.js

@@ -22,9 +22,9 @@ export const salesDetail = (params) => {
 //  销售 详情bysn
 export const salesDetailBySn = (params) => {
   return axios({
-    url: `/sales/findBySn`,
+    url: `/sales/findBySn/${params.salesBillSn}`,
     data: params,
-    method: 'post'
+    method: 'get'
   })
 }
 //  销售 打印
@@ -93,15 +93,15 @@ export const salesWriteStockOut = (params) => {
 //  销售 提交
 export const salesWriteSubmit = (params) => {
   return axios({
-    url: '/sales/submit',
+    url: `/sales/submit/${params.salesBillSn}`,
     data: params,
-    method: 'post'
+    method: 'get'
   })
 }
 //  销售 新增或编辑
 export const salesSave = (params) => {
   return axios({
-    url: '/sales/save',
+    url: '/sales/insert',
     data: params,
     method: 'post'
   })
@@ -110,7 +110,7 @@ export const salesSave = (params) => {
 //  销售 删除
 export const salesDel = (params) => {
   return axios({
-    url: `/sales/delete/${params.id}`,
+    url: `/sales/delete/${params.salesBillSn}`,
     data: params,
     method: 'post'
   })

+ 4 - 4
src/api/salesDetail.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 //  销售详情 列表  分页
 export const salesDetailList = (params) => {
-  const url = `/salesDetail/queryPage/${params.pageNo}/${params.pageSize}`
+  const url = `/sales/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -14,7 +14,7 @@ export const salesDetailList = (params) => {
 //  销售详情 保存
 export const salesDetailSave = (params) => {
   return axios({
-    url: '/salesDetail/save',
+    url: '/sales/detail/insert',
     data: params,
     method: 'post'
   })
@@ -22,7 +22,7 @@ export const salesDetailSave = (params) => {
 //  销售详情 删除
 export const salesDetailDel = (params) => {
   return axios({
-    url: `/salesDetail/delete/${params.id}`,
+    url: `/sales/detail/delete`,
     data: params,
     method: 'post'
   })
@@ -30,7 +30,7 @@ export const salesDetailDel = (params) => {
 //  销售详情 整单删除
 export const salesDetailDelAll = (params) => {
   return axios({
-    url: `/salesDetail/deleteAll/${params.id}`,
+    url: `/sales/detail/deleteAll`,
     data: params,
     method: 'post'
   })

+ 3 - 3
src/config/router.config.js

@@ -682,7 +682,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'detail/:id/:sn',
+                path: 'detail/:sn',
                 name: 'salesDetail',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/detail.vue'),
                 meta: {
@@ -693,7 +693,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'add',
+                path: 'add/:sn',
                 name: 'salesAdd',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/edit.vue'),
                 meta: {
@@ -704,7 +704,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'edit/:id',
+                path: 'edit/:sn',
                 name: 'salesEdit',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/edit.vue'),
                 meta: {

+ 8 - 122
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -5,7 +5,7 @@
     centered
     :maskClosable="false"
     :confirmLoading="confirmLoading"
-    width="60%"
+    width="600px"
     :footer="null"
     @cancel="cancel"
   >
@@ -39,7 +39,7 @@
       <a-row :gutter="15">
         <a-col :span="24">
           <a-form-model-item label="客户地址">
-            --
+            {{ form.customerAddr }}
           </a-form-model-item>
         </a-col>
       </a-row>
@@ -52,9 +52,9 @@
       </a-row>
       <a-row :gutter="15">
         <a-col :span="24">
-          <a-form-model-item label="选择收货地址" prop="salesManSn">
-            <a-select id="chooseCustom-salesManSn" @change="salesManChange" v-model="form.salesManSn" placeholder="请选择收货地址">
-              <a-select-option v-for="item in userList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+          <a-form-model-item label="选择收货地址" prop="shippingAddr">
+            <a-select id="chooseCustom-shippingAddr" v-model="form.shippingAddr" placeholder="请选择收货地址">
+              <a-select-option v-for="item in addrList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
             </a-select>
           </a-form-model-item>
         </a-col>
@@ -68,10 +68,7 @@
 </template>
 
 <script>
-import { getArea } from '@/api/data'
-import { custFindById } from '@/api/customer'
 import { salesSave } from '@/api/sales'
-import { getUserAllList } from '@/api/power-user'
 import { VSelect } from '@/components'
 import custList from '@/views/common/custList.js'
 import settleStyle from '@/views/common/settleStyle.js'
@@ -146,61 +143,16 @@ export default {
         // ]
       },
       custAllList: [], //  客户 下拉数据
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      userList: [], // 业务员 下拉
+      addrList: [], // 地址列表
       custId: undefined, // 客户id
-      isEdit: false, //  是否编辑状态
-      priceTypeDisabled: false, // 价格类型可编辑
-      isChangeCust: false, // 是否更换客户
-      interId: null,
-      isNewCust: false // 是否新增客户
+      isEdit: false //  是否编辑状态
     }
   },
   methods: {
-    // 业务员
-    salesManChange (id) {
-      this.form.salesManName = this.userList.find(item => item.id == id).name
-    },
     // 客户 change
     custChange (val) {
       console.log(val, 'custChange')
     },
-    //  获取详情
-    getDetail () {
-      custFindById({ id: this.custId }).then(res => {
-        const data = res.data
-        if (res.status == 200 && data) {
-          if (data.provinceSn) { this.getArea('city', data.provinceSn) }
-          if (data.citySn) { this.getArea('district', data.citySn) }
-          this.form = Object.assign(this.form, {
-            buyerName: data.customerName, // 客户名称
-            buyerSn: data.customerSn, // 客户sn
-            consigneeTel: data.contactTel, //  联系电话
-            consigneeName: data.contactName, //  联系人
-            shippingAddressProvinceSn: data.provinceSn, //  省
-            shippingAddressProvinceName: data.provinceName,
-            shippingAddressCitySn: data.citySn, // 市
-            shippingAddressCityName: data.cityName,
-            shippingAddressCountySn: data.countySn, // 区
-            shippingAddressCountyName: data.countyName,
-            shippingAddress: data.customerAddr, //  详细地址
-            fax: data.fax, //  客户传真
-            dispatchType: data.dispatchType, //  配送方式
-            satelliteFlag: data.satelliteFlag, //  是否卫星仓客户
-            priceType: data.priceType, //  价格类型
-            settleStyleSn: data.settleStyleSn //  收款方式
-          })
-          // this.buyerSnBak = this.form.buyerSn
-          // this.priceTypeBak = this.form.priceType
-        } else {
-          this.$message.error('获取客户信息失败')
-          this.$refs.ruleForm.resetFields()
-        }
-        this.$refs.ruleForm.clearValidate()
-      })
-    },
     //  保存
     handleSubmit (e) {
       e.preventDefault()
@@ -224,7 +176,7 @@ export default {
           _this.$message.success(res.message)
           _this.$emit('ok', res.data)
           if (_this.form.id) {
-            _this.$emit('updateData', form.priceType)
+            _this.$emit('updateData')
           }
           _this.cancel()
         }
@@ -234,71 +186,6 @@ export default {
       this.opened = false
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
-    },
-    // 获取业务员列表数据
-    getUserAllList () {
-      getUserAllList({ loginFlag: 1 }).then(res => {
-        if (res.status == 200) {
-          this.userList = res.data || []
-        } else {
-          this.userList = []
-        }
-      })
-    },
-    // 获取城市列表
-    getCityList (val) {
-      console.log(val, '-------------')
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.form.shippingAddressCitySn = undefined
-      this.form.shippingAddressCityName = ''
-      this.form.shippingAddressCountySn = undefined
-      this.form.shippingAddressCountyName = ''
-      this.form.shippingAddress = ''
-      this.form.shippingAddressCountyName = this.addrProvinceList.find(item => item.id == val).name
-      this.getArea('city', val)
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.form.shippingAddressCountySn = undefined
-      this.form.shippingAddressCountyName = ''
-      this.form.shippingAddress = ''
-      this.form.shippingAddressCityName = this.addrCityList.find(item => item.id == val).name
-      this.getArea('district', val)
-    },
-    // 区县变更
-    areaCharged (val) {
-      this.form.shippingAddress = ''
-      this.form.shippingAddressCountyName = this.addrDistrictList.find(item => item.id == val).name
-    },
-    //  省/市/区
-    getArea (type, sn) {
-      let params
-      if (type == 'province') {
-        params = { level: '1' }
-      } else {
-        params = { psn: sn }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (type == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
-            this.addrCityList = res.data || []
-          } else if (type == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (type == 'province') {
-            this.addrProvinceList = []
-          } else if (type == 'city') {
-            this.addrCityList = []
-          } else if (type == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
     }
   },
   watch: {
@@ -306,7 +193,6 @@ export default {
       this.opened = newValue
       if (newValue) {
         this.getArea('province')
-        this.getUserAllList()
       }
     }
   }

+ 14 - 22
src/views/salesManagement/salesQuery/detail.vue

@@ -24,13 +24,12 @@
         <a-collapse-panel key="1" header="基础信息">
           <a-descriptions size="small" :column="3" v-if="detailData">
             <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="客户地址">{{ detailData.shippingAddressProvinceName || '--' }}{{ detailData.shippingAddressCityName || '--' }}{{ detailData.shippingAddressCountyName || '--' }}{{ detailData.shippingAddress || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址">{{ detailData.shippingAddressProvinceName || '--' }}{{ detailData.shippingAddressCityName || '--' }}{{ detailData.shippingAddressCountyName || '--' }}{{ detailData.shippingAddress || '--' }}</a-descriptions-item>
             <a-descriptions-item label="收款方式">{{ detailData.settleStyleEntity.name || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货人">{{ detailData.operatorName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
             <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="制单人">{{ detailData.operatorName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务员">{{ detailData.salesManName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="审核时间">{{ detailData.auditDate || '--' }}</a-descriptions-item>
             <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
             <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
           </a-descriptions>
@@ -41,8 +40,8 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
         <div slot="message">
-          总款数:<strong>{{ detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData.totalQty || 0 }}</strong>;总赠品数量:<strong>{{ detailData.giftQty || 0 }}</strong>;急件总款数:<strong>{{ detailData.oosCategory || 0 }}</strong>;急件总数量:<strong>{{ detailData.oosQty || 0 }}</strong>;<br/>
-          总售价:<strong>{{ detailData.totalAmount || 0 }}</strong>;总成本:<strong>{{ detailData.totalCost || 0 }}</strong>;总毛利:<strong>{{ detailData.grossProfit || 0 }}</strong>;折后总售价:<strong>{{ detailData.discountedAmount || 0 }}</strong>;折扣:<strong>{{ detailData.discountRate || 0 }}%</strong>;折扣金额:<strong>{{ detailData.discountAmount || 0 }}</strong>;
+          总销售数量:<strong>{{ detailData.totalQty || 0 }}</strong>;已取消数量:<strong>{{ detailData.cancelQty || 0 }}</strong>;已下推数量:<strong>{{ detailData.pushedQty || 0 }}</strong>;待下推数量:<strong>{{ detailData.unpushedQty || 0 }}</strong>;<br/>
+          总售价:<strong>{{ detailData.totalAmount || 0 }}</strong>;总成本:<strong>{{ detailData.totalCost || 0 }}</strong>;总毛利:<strong>{{ detailData.grossProfit || 0 }}</strong>;已取消金额:<strong>{{ detailData.totalCancelAmount || 0 }}</strong>;已下推金额:<strong>{{ detailData.totalPushedAmount || 0 }}%</strong>;待下推金额:<strong>{{ detailData.totalUnpushedAmount || 0 }}</strong>;
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -97,17 +96,14 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '折后售价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'realCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '销售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '折后小计', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center' },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
-        { title: '是否急件', dataIndex: 'oosFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '可用库存数量', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '已取消数', dataIndex: 'cancelQty', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '已下推数', dataIndex: 'pushedQty', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '待下推数', dataIndex: 'unpushedQty', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -125,10 +121,6 @@ export default {
             data.list[i].productName = productName || '--'
             data.list[i].productOrigCode = productOrigCode || '--'
             data.list[i].productOrigUnit = productOrigUnit || '--'
-            data.list[i].warehouseName = data.list[i].warehouseEntity && data.list[i].warehouseEntity.name || '--'
-            data.list[i].warehouseLocationName = data.list[i].warehouseLocationEntity && data.list[i].warehouseLocationEntity.name || '--'
-            // 售价小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].salePriceSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
           }
           this.disabled = false
           return data
@@ -146,7 +138,7 @@ export default {
     // 编辑
     handleEdit () {
       const row = this.detailData
-      this.$router.push({ name: 'salesEdit', params: { id: row.id, sn: row.salesBillSn, priceType: row.priceType } })
+      this.$router.push({ name: 'salesEdit', params: { id: row.id, sn: row.salesBillSn } })
     },
     //  详情
     getDetail () {

+ 23 - 12
src/views/salesManagement/salesQuery/list.vue

@@ -80,10 +80,22 @@
     <!-- alert -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
       <div slot="message">
-        总售价:<strong>{{ totalData.totalAmount }}</strong>元;
-        总单数:<strong>{{ totalData.totalRecord }}</strong>;
-        总款数:<strong>{{ totalData.totalCategory }}</strong>;
-        总数量:<strong>{{ totalData.totalQty }}</strong>;
+        <div>
+          总单数:<strong>{{ totalData.totalRecord }}</strong>;
+          总款数:<strong>{{ totalData.totalCategory }}</strong>;
+          总数量:<strong>{{ totalData.totalQty }}</strong>;
+          已下推数量:<strong>{{ totalData.totalPushedQty }}</strong>;
+          已发货数量:<strong>{{ totalData.totalDispatchQty }}</strong>;
+          已取消数量:<strong>{{ totalData.totalCancelQty }}</strong>;
+          待下推数量:<strong>{{ totalData.totalUnpushedQty }}</strong>;
+        </div>
+        <div>
+          总售价:<strong>{{ totalData.totalAmount }}</strong>元;
+          已下推金额::<strong>{{ totalData.totalPushedAmount }}</strong>元;
+          已取消金额::<strong>{{ totalData.totalCancelAmount }}</strong>元;
+          待下推金额::<strong>{{ totalData.totalUnpushedAmount }}</strong>元;
+          已发货金额::<strong>{{ totalData.totalDispatchAmount }}</strong>元;
+        </div>
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -211,16 +223,15 @@ export default {
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已下推数量', dataIndex: 'totalPromoQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已发货数量', dataIndex: 'totalDispatchQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数量', dataIndex: 'totalCancelQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '待下推数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已下推数量', dataIndex: 'pushedQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已发货数量', dataIndex: 'dispatchQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已取消数量', dataIndex: 'cancelQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待下推数量', dataIndex: 'unpushedQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleEntity.name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
-        { title: '财务状态', dataIndex: 'financialStatus', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
+        { title: '财务状态', dataIndex: 'financialStatusDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
         { title: '打印次数', dataIndex: 'detailPrintTimes', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 220, align: 'center', fixed: 'right' }
       ],
@@ -266,7 +277,7 @@ export default {
     },
     // 选择客户成功
     chooseCustomOk (data) {
-      this.$router.push({ name: 'salesAdd', params: { id: data.id, sn: data.salesBillSn, priceType: data.priceType } })
+      this.$router.push({ name: 'salesAdd', params: { sn: data.salesBillSn } })
     },
     //  审核
     handleEexamine (row) {
@@ -326,7 +337,7 @@ export default {
     },
     // 编辑
     handleEdit (row) {
-      this.$router.push({ name: 'salesEdit', params: { id: row.id, sn: row.salesBillSn, priceType: row.priceType } })
+      this.$router.push({ name: 'salesEdit', params: { sn: row.salesBillSn } })
     },
     // 删除
     handleDel (row) {