瀏覽代碼

Merge branch 'deploy' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into deploy

1004749546@qq.com 4 年之前
父節點
當前提交
77884e7275

+ 9 - 0
src/api/sales.js

@@ -108,3 +108,12 @@ export const salesDel = (params) => {
     method: 'post'
   })
 }
+
+// 销售 统计
+export const salesCount = (params) => {
+  return axios({
+    url: `/sales/count`,
+    data: params,
+    method: 'post'
+  })
+}

+ 12 - 0
src/api/salesDetail.js

@@ -50,3 +50,15 @@ export const salesDetailDelAll = (params) => {
     method: 'post'
   })
 }
+
+// 销售记录
+export const salesRecordlList = (params) => {
+  const url = `/salesDetail/querySalesRecord/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -7,7 +7,7 @@
         <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseSn) || '' }}</p>
       </template>
       <template slot="tags">
-        <a-tag color="purple" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>
+        <a-tag color="red" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>
         <a-tag color="orange" v-if="basicInfoData&&basicInfoData.settleStateDictValue">{{ basicInfoData.settleStateDictValue }}</a-tag>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->

+ 3 - 3
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -533,8 +533,8 @@ export default {
       }
     },
     // 合计
-    getDetailCount () {
-      sparePartsPurDetailCount({ sparePartsPurchaseSn: this.$route.params.sn }).then(res => {
+    getDetailCount (params) {
+      sparePartsPurDetailCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -604,6 +604,7 @@ export default {
       }
       sparePartsPurDetailList(params).then(res => {
         if (res.status == 200) {
+          this.getDetailCount(params)
           const data = res.data
           this.choosePaginationProps.total = Number(res.data.count) || 0
           this.choosePaginationProps.current = data.pageNo
@@ -654,7 +655,6 @@ export default {
       vm.openModal = false
       vm.getDetail()
       vm.getDealerProductList()
-      vm.getDetailCount()
       vm.getChooseDealerProductList()
       vm.getProductBrand()
       vm.getProductType()

+ 0 - 2
src/views/customerManagement/customerInfo/edit.vue

@@ -155,7 +155,6 @@ export default {
         satelliteFlag: 0, //  是否卫星仓客户
         customerTypeSn: undefined, //  客户类型
         priceType: '', //  价格类型
-        payType: '', //  支付方式
         settleStyleSn: undefined //  收款方式
       },
       rules: {
@@ -165,7 +164,6 @@ export default {
         citySn: [{ required: true, message: '请选择市', trigger: 'change' }],
         countySn: [{ required: true, message: '请选择区/县', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
-        payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
         settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
       },
       addrProvinceList: [], //  省下拉

+ 1 - 1
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -16,7 +16,7 @@
     <s-table
       class="sTable"
       ref="table"
-      size="default"
+      size="small"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"

+ 2 - 7
src/views/salesManagement/giftRecord/list.vue

@@ -74,7 +74,6 @@
 
 <script>
 import moment from 'moment'
-import { getOperationalPrecision } from '@/libs/tools.js'
 import { custAllList } from '@/api/customer'
 import { giftsDetailList } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
@@ -96,13 +95,13 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
-        { title: '赠品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '赠品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '赠送数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '关联销售单号', dataIndex: 'salesBillNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '赠送客户', dataIndex: 'customerName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '成本价(¥)', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 120, align: 'center' }
+        { title: '成本小计(¥)', dataIndex: 'totalCost', width: 120, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -120,10 +119,6 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
-            //  赠品名称
-            data.list[i].name = (data.list[i].productEntity && data.list[i].productEntity.name) ? data.list[i].productEntity.name : data.list[i].dealerProductEntity.name
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
           }
           this.disabled = false
           return data

+ 54 - 25
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -19,7 +19,15 @@
     >
       <a-row :gutter="15">
         <a-col :span="8">
-          <a-form-model-item label="客户名称" prop="buyerSn">
+          <a-form-model-item v-if="isNew" label="客户名称" prop="buyerName">
+            <a-input
+              id="chooseCustom-buyerName"
+              :maxLength="60"
+              v-model="form.buyerName"
+              placeholder="请输入客户名称"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item v-else label="客户名称" prop="buyerSn">
             <a-select
               id="chooseCustom-buyerSn"
               show-search
@@ -33,9 +41,10 @@
           </a-form-model-item>
         </a-col>
         <a-col :span="16">
-          <a-form-model-item><a-button type="dashed" icon="plus">
-            新增
-          </a-button>(未搜索到客户时点击新增按钮)</a-form-model-item>
+          <a-form-model-item>
+            <a-button type="dashed" @click="custModeChange" :icon="!isNew?'plus':'check'">{{ !isNew?'新增':'选择' }}</a-button>
+            ({{ !isNew?'点击新增按钮直接输入客户名称':'点击选择按钮直接选择客户' }})
+          </a-form-model-item>
         </a-col>
       </a-row>
       <a-row :gutter="15">
@@ -192,6 +201,7 @@ export default {
     return {
       opened: this.show,
       title: '选择客户',
+      isNew: false,
       confirmLoading: false,
       formItemLayout: {
         labelCol: { span: 8 },
@@ -212,9 +222,7 @@ export default {
         fax: '', //  客户传真
         dispatchType: undefined, //  配送方式
         satelliteFlag: 0, //  是否卫星仓客户
-        customerTypeSn: undefined, //  客户类型
-        priceType: '', //  价格类型
-        // payType: '', //  支付方式
+        priceType: undefined, //  价格类型
         settleStyle: '', //  收款方式
         salesManSn: undefined, //  业务员
         salesManName: '',
@@ -223,9 +231,12 @@ export default {
         remarks: '' //  备注
       },
       rules: {
-        buyerSn: [
+        buyerName: [
           { required: true, message: '请输入客户名称', trigger: ['change', 'blur'] }
         ],
+        buyerSn: [
+          { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
+        ],
         consigneeTel: [
           { required: true, message: '请输入联系电话', trigger: 'blur' }
         ],
@@ -242,13 +253,10 @@ export default {
           { required: true, message: '请输入详细地址', trigger: 'blur' }
         ],
         priceType: [
-          { required: true, message: '请选择价格类型', trigger: 'change' }
+          { required: true, message: '请选择价格类型', trigger: ['change', 'blur'] }
         ],
-        // payType: [
-        //   { required: true, message: '请选择支付方式', trigger: 'change' }
-        // ],
         settleStyle: [
-          { required: true, message: '请选择收款方式', trigger: 'change' }
+          { required: true, message: '请选择收款方式', trigger: ['change', 'blur'] }
         ],
         distributionFlag: [
           { required: true, message: '请选择是否铺货出库', trigger: 'change' }
@@ -269,6 +277,13 @@ export default {
     }
   },
   methods: {
+    custModeChange () {
+      this.isNew = !this.isNew
+      this.isEdit = false
+      this.form.buyerName = ''
+      this.$refs.ruleForm.resetFields()
+      this.custId = undefined
+    },
     // 业务员
     salesManChange (id) {
       this.form.salesManName = this.userList.find(item => item.id == id).name
@@ -291,7 +306,6 @@ export default {
               _this.form.buyerName = cust.customerName
               _this.isEdit = false
               _this.getDetail()
-              _this.$emit('updateData')
             }
           })
           return
@@ -303,7 +317,6 @@ export default {
     },
     // 客户 change
     custChange (val) {
-      console.log(val, 'custChange')
       this.$refs.ruleForm.resetFields()
       this.custId = undefined
     },
@@ -338,7 +351,6 @@ export default {
             fax: data.fax, //  客户传真
             dispatchType: data.dispatchType, //  配送方式
             satelliteFlag: data.satelliteFlag, //  是否卫星仓客户
-            customerTypeSn: data.customerTypeSn, //  客户类型
             priceType: data.priceType, //  价格类型
             settleStyle: data.settleStyleSn //  收款方式
           })
@@ -351,8 +363,7 @@ export default {
     },
     // 保存客户信息
     handleSaveCust () {
-      updateByCustomerSn({
-        customerSn: this.form.buyerSn,
+      const params = {
         customerName: this.form.buyerName,
         contactTel: this.form.consigneeTel, //  联系电话
         contactName: this.form.consigneeName, //  联系人
@@ -364,14 +375,27 @@ export default {
         countyName: this.form.shippingAddressCountyName,
         customerAddr: this.form.shippingAddress, //  详细地址
         dispatchType: this.form.dispatchType, //  配送方式
-        customerTypeSn: this.form.customerTypeSn, //  客户类型
         priceType: this.form.priceType, //  价格类型
         settleStyleSn: this.form.settleStyle //  收款方式
-      }).then(res => {
-        if (res.status != 200) {
-          this.$message.error(res.message)
-        }
-      })
+      }
+      // 更新
+      if (this.form.buyerSn) {
+        params.customerSn = this.form.buyerSn
+        updateByCustomerSn(params).then(res => {
+          if (res.status != 200) {
+            this.$message.error(res.message)
+          }
+        })
+      } else {
+        // 新建
+        params.id = null
+        params.satelliteFlag = 0 //  是否卫星仓客户
+        custSave(params).then(res => {
+          if (res.status != 200) {
+            this.$message.error(res.message)
+          }
+        })
+      }
     },
     //  保存
     handleSubmit (e) {
@@ -382,7 +406,9 @@ export default {
           // 保存客户信息
           _this.handleSaveCust()
           // 保存销售单
-          _this.salesSaveFun()
+          if (_this.form.buyerSn) {
+            _this.salesSaveFun()
+          }
         } else {
           console.log('error submit!!')
           return false
@@ -398,6 +424,9 @@ export default {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$emit('ok', res.data)
+          if (_this.form.id) {
+            _this.$emit('updateData')
+          }
           _this.cancel()
         }
       })

+ 5 - 5
src/views/salesManagement/salesQuery/detail.vue

@@ -32,8 +32,8 @@
             <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.auditStatus || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ detailData.financialStatus || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
@@ -88,13 +88,13 @@ 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: 'costPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '折后售价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'salePriceSubtotal', width: 100, align: 'center' },
-        { title: '折后小计', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center' },
+        { title: '折后小计', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '折扣金额', dataIndex: 'discountAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center' },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },

+ 48 - 16
src/views/salesManagement/salesQuery/edit.vue

@@ -15,12 +15,12 @@
     </a-page-header>
     <a-card size="small" :bordered="false" class="salesEdit-cont">
       <!-- 查询配件列表 -->
-      <queryPart @add="insterProduct"></queryPart>
+      <queryPart :buyerSn="detailData&&detailData.buyerSn" @add="insterProduct"></queryPart>
     </a-card>
     <a-card size="small" :bordered="false" class="salesEdit-cont">
       <!-- 总计 -->
       <a-alert style="margin-bottom: 15px;" type="info">
-        <div slot="message">总售价:<strong>6</strong>;总款数:<strong>6</strong>;总数量:<strong>6</strong>;赠品总数量:<strong>6</strong>;</div>
+        <div slot="message">总售价:<strong>{{ detailData&&detailData.totalAmount || 0 }}</strong>;总款数:<strong>{{ detailData&&detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData&&detailData.totalQty || 0 }}</strong>;赠品总数量:<strong>{{ detailData&&detailData.giftQty || 0 }}</strong>;</div>
       </a-alert>
       <!-- 查询条件 -->
       <a-row :gutter="15">
@@ -77,10 +77,22 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button size="small" type="link" @click="handleDel(record)" id="productInfoList-Del">删除</a-button>
+          <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="productInfoList-Del">删除</a-button>
         </template>
       </s-table>
     </a-card>
+    <a-card size="small" :bordered="false" class="salesEdit-cont">
+      <!-- 提交按钮 -->
+      <div style="text-align: center;">
+        <a-button
+          size="large"
+          style="width: 150px;"
+          type="primary"
+          class="button-primary"
+          @click="handleSubmit()"
+          id="productInfoList-handleSubmit">提交</a-button>
+      </div>
+    </a-card>
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="getOrderDetail" @cancel="openModal=false" />
   </div>
@@ -90,7 +102,7 @@
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
-import { salesDetail } from '@/api/sales'
+import { salesDetail, salesWriteSubmit } from '@/api/sales'
 import EditableCell from '@/views/common/editInput.js'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
 export default {
@@ -101,6 +113,7 @@ export default {
       orderId: null, // 销售单id
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
+      isInster: false, // 是否正在添加产品
       openModal: false, // 客户弹框
       detailData: null, // 订单基础数据
       dataSource: [],
@@ -119,15 +132,15 @@ export default {
         { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: 100, align: 'center' },
         { title: '售价', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center' },
-        { title: '售价小计', dataIndex: 'xj', width: 100, align: 'center' },
-        { title: '折后小计', dataIndex: 'zhxj', width: 100, align: 'center' },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', 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: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        this.productForm.id = this.$route.params.id
+        this.productForm.salesBillSn = this.$route.params.sn
         return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -158,7 +171,7 @@ export default {
           price: row.price
         }).then(res => {
           if (res.status == 200) {
-            this.$refs.table.refresh(true)
+            this.resetSearchForm(true)
           }
           this.$message.info(res.message)
         })
@@ -169,7 +182,7 @@ export default {
           qty: row.qty
         }).then(res => {
           if (res.status == 200) {
-            this.$refs.table.refresh(true)
+            this.resetSearchForm(true)
           }
           this.$message.info(res.message)
         })
@@ -178,15 +191,18 @@ export default {
     // 编辑客户信息
     handleEdit () {
       this.openModal = true
-      this.$refs.custModal.editCust(this.detailData)
+      setTimeout(() => {
+        this.$refs.custModal.editCust(this.detailData)
+      }, 500)
     },
     //  重置
-    resetSearchForm () {
-      this.$refs.table.refresh()
+    resetSearchForm (flag) {
+      this.$refs.table.refresh(!!flag)
+      this.getOrderDetail()
     },
     //  返回
     handleBack () {
-      this.$router.push({ path: '/salesManagement/salesQuery/list' })
+      this.$router.push({ name: 'salesQueryList' })
     },
     // 整单删除
     delSalerDetailAll () {
@@ -201,7 +217,7 @@ export default {
     handleDel (row) {
       salesDetailDel({ id: row.id }).then(res => {
         if (res.status == 200) {
-          this.resetSearchForm()
+          this.resetSearchForm(true)
         }
         this.$message.info(res.message)
       })
@@ -209,6 +225,11 @@ export default {
     // 添加产品
     insterProduct (row) {
       console.log(row)
+      if (this.isInster) {
+        return
+      }
+      this.$message.loading('正在添加产品...')
+      this.isInster = true
       salesDetailInsert({
         productSn: row.productSn,
         price: row.dealerProduct.cityPrice,
@@ -219,10 +240,11 @@ export default {
         warehouseLocationSn: row.warehouseLocationSn,
         stockSn: row.stockSn
       }).then(res => {
-        console.log(res)
         if (res.status == 200) {
           this.resetSearchForm()
+          this.$message.success('产品添加成功', 2.5)
         }
+        this.isInster = false
       })
     },
     //  销售单详情
@@ -234,6 +256,15 @@ export default {
           this.detailData = null
         }
       })
+    },
+    // 提交销售单
+    handleSubmit () {
+      salesWriteSubmit({ id: this.orderId }).then(res => {
+        if (res.status == 200) {
+          this.handleBack()
+          this.$message.success(res.message)
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -241,6 +272,7 @@ export default {
       // 获取销售单详情
       vm.getOrderDetail()
       vm.orderId = vm.$route.params.id
+      vm.salesBillSn = vm.$route.params.sn
     })
   }
 }

+ 46 - 19
src/views/salesManagement/salesQuery/list.vue

@@ -104,7 +104,12 @@
     </div>
     <!-- alert -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">总售价:<strong>13.00</strong>元;总单数:<strong>13.00</strong>;总款数:<strong>13.00</strong>;总数量:<strong>13.00</strong>;</div>
+      <div slot="message">
+        总售价:<strong>{{ totalData.totalAmount }}</strong>元;
+        总单数:<strong>{{ totalData.totalRecord }}</strong>;
+        总款数:<strong>{{ totalData.totalCategory }}</strong>;
+        总数量:<strong>{{ totalData.totalQty }}</strong>;
+      </div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -118,11 +123,11 @@
       bordered>
       <!-- 业务/审核状态 -->
       <template slot="billStatus" slot-scope="text, record">
-        <a-tag :color="record.state=='FINISH'?'green':'red'" >{{ record.state=='FINISH'? '待备货审核': '待单据审核' }}</a-tag>
+        <a-tag :color="record.state=='FINISH'?'green':'red'" >{{ record.billStatus }}</a-tag>
       </template>
       <!-- 财务状态 -->
       <template slot="financialStatus" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待单据审核' }}</a-tag>
+        <a-tag :color="record.state==1?'green':'red'" >{{ record.financialStatus }}</a-tag>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
@@ -143,7 +148,7 @@ import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import { custAllList } from '@/api/customer'
-import { salesList, salesDel, salesWriteAudit, salesWriteStockOut } from '@/api/sales'
+import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
 export default {
   name: 'TableList',
   components: { STable, VSelect, chooseCustomModal },
@@ -165,6 +170,12 @@ export default {
         billStatus: undefined, //  业务状态
         financialStatus: undefined //  财务状态
       },
+      totalData: {
+        totalAmount: 0,
+        totalCategory: 0,
+        totalQty: 0,
+        totalRecord: 0
+      },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -175,11 +186,10 @@ export default {
         { title: '总款数', dataIndex: 'totalCategory', 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: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '支付方式', dataIndex: 'payType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款方式', dataIndex: 'settleStyle', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '急件', dataIndex: 'urgentFlag', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', scopedSlots: { customRender: 'auditStatus' }, width: 110, align: 'center' },
+        { title: '急件', dataIndex: 'oosFlag', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', scopedSlots: { customRender: 'billStatus' }, width: 110, align: 'center' },
         { title: '财务状态', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center', fixed: 'right' }
       ],
@@ -194,6 +204,11 @@ export default {
           this.queryParam.beginDate = undefined
           this.queryParam.endDate = undefined
         }
+        // 查询总计
+        salesCount(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res)
+          this.totalData = Object.assign(this.totalData, res.data || {})
+        })
         return salesList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -217,7 +232,7 @@ export default {
     },
     // 选择客户成功
     chooseCustomOk (data) {
-      this.$router.push({ name: 'salesAdd', params: { id: data.id, salesBillSn: data.salesBillSn } })
+      this.$router.push({ name: 'salesAdd', params: { id: data.id, sn: data.salesBillSn } })
     },
     //  审核
     handleEexamine (row) {
@@ -226,17 +241,27 @@ export default {
         title: '提示',
         content: '请点击下方按钮确认操作?',
         centered: true,
+        closable: true,
         okText: '审核通过',
-        canselText: '审核不通过',
+        cancelText: '审核不通过',
         onOk () {
-          salesWriteAudit({
-            id: row.id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-            }
-          })
+          _this.auditOrder(row.id, 'AUDIT_PASS')
+        },
+        onCancel (e) {
+          if (!e.triggerCancel) {
+            _this.auditOrder(row.id, 'AUDIT_REJECT')
+          }
+        }
+      })
+    },
+    auditOrder (id, billStatus) {
+      salesWriteAudit({
+        id,
+        billStatus
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
         }
       })
     },
@@ -247,6 +272,7 @@ export default {
         title: '提示',
         content: '确认要出库吗?',
         centered: true,
+        closable: true,
         onOk () {
           salesWriteStockOut({
             id: row.id,
@@ -266,7 +292,7 @@ export default {
     },
     // 编辑
     handleEdit (row) {
-      this.$router.push({ name: 'salesEdit', params: { id: row.id, salesBillSn: row.salesBillSn } })
+      this.$router.push({ name: 'salesEdit', params: { id: row.id, sn: row.salesBillSn } })
     },
     // 删除
     handleDel (row) {
@@ -275,6 +301,7 @@ export default {
         title: '提示',
         content: '确认要删除吗?',
         centered: true,
+        closable: true,
         onOk () {
           salesDel({ id: row.id }).then(res => {
             if (res.status == 200) {
@@ -303,7 +330,7 @@ export default {
       this.queryParam.purchaseBillNo = ''
       this.queryParam.payType = undefined
       this.queryParam.settleStyle = undefined
-      this.queryParam.auditStatus = undefined
+      this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
       this.time = []
       this.$refs.table.refresh(true)

+ 63 - 59
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -9,30 +9,34 @@
     @cancle="isShow=false"
     width="80%">
     <div>
-      <a-tabs type="card" default-active-key="1" @change="callback">
+      <a-tabs type="card" v-model="curTab" @change="callback">
         <a-tab-pane key="1" tab="当前客户">
         </a-tab-pane>
         <a-tab-pane key="2" tab="全部客户">
         </a-tab-pane>
       </a-tabs>
       <!-- 表格 -->
-      <s-table
+      <a-table
         class="sTable"
         ref="table"
         size="default"
-        :rowKey="(record) => record.id"
+        :data-source="list"
+        :pagination="pagination"
+        :loading="loading"
+        :row-key="(record) => record.id"
         :columns="columns"
-        :data="loadData"
+        @change="handleTableChange"
         bordered>
-      </s-table>
+      </a-table>
     </div>
   </a-modal>
 </template>
 
 <script>
+import { salesRecordlList } from '@/api/salesDetail.js'
 import { STable } from '@/components'
 export default {
-  name: 'salesRecordModal',
+  name: 'SalesRecordModal',
   components: { STable },
   props: {
     openModal: { //  弹框显示状态
@@ -52,11 +56,17 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      buyerSn: null,
+      queryParam: {
+        productSn: null,
+        pageNo: 1,
+        pageSize: 10
+      },
       // 表头
       columns: [
         {
           title: '销售时间',
-          dataIndex: 'salesTime',
+          dataIndex: 'putTime',
           align: 'center',
           width: 250
         },
@@ -68,65 +78,63 @@ export default {
         },
         {
           title: '销售数量',
-          dataIndex: 'salesNums',
+          dataIndex: 'qty',
           align: 'center',
           width: 150
         },
         {
           title: '客户名称',
-          dataIndex: 'productBrand',
+          dataIndex: 'buyerName',
           align: 'center'
-        },
+        }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function(resolve, reject){
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { 
-                id: '1', 
-                salesTime: '2020-12-23 15:23:15', 
-                price: 56, 
-                salesNums: 12, 
-                productBrand: '箭冠品牌', 
-              },
-              {
-                id: '23', 
-                salesTime: '2020-12-23 15:23:15', 
-                price: 56, 
-                salesNums: 12, 
-                productBrand: '箭冠品牌', 
-              },
-              {
-                id: '44', 
-                salesTime: '2020-12-23 15:23:15', 
-                price: 56, 
-                salesNums: 12, 
-                productBrand: '箭冠品牌', 
-              }
-            ],
-            count: 100
-          }
-          resolve(data)
-        })
-      },
+      list: [],
+      pagination: {},
+      loading: false,
+      curTab: '1'
     }
   },
   methods: {
+    handleTableChange (pagination, filters, sorter) {
+      console.log(pagination)
+      const pager = { ...this.pagination }
+      pager.current = pagination.current
+      this.pagination = pager
+      this.loading = true
+      this.queryParam = Object.assign(this.queryParam, {
+        results: pagination.pageSize,
+        page: pagination.current,
+        sortField: sorter.field,
+        sortOrder: sorter.order,
+        ...filters
+      })
+
+      salesRecordlList(this.queryParam).then(res => {
+        this.list = res.data.list || []
+        this.loading = false
+      })
+    },
     //  获取详情
-    getDetail(){
-      
+    getDetail (productSn, buyerSn) {
+      this.buyerSn = buyerSn
+      if (this.curTab == 1) {
+        this.queryParam.buyerSn = buyerSn
+      } else {
+        delete this.queryParam.buyerSn
+      }
+      this.queryParam.productSn = productSn
+      this.queryParam.pageNo = 1
+      this.queryParam.pageSize = 10
+      this.loading = true
+      salesRecordlList(this.queryParam).then(res => {
+        this.list = res.data.list || []
+        this.loading = false
+      })
     },
-    callback(key){
-      console.log(key);
+    callback (key) {
+      console.log(key)
+      this.curTab = key
+      this.getDetail(this.queryParam.productSn, this.buyerSn)
     }
   },
   watch: {
@@ -138,11 +146,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-      }
-    },
-    itemId (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.getDetail()
+        this.curTab = '1'
       }
     }
   }

+ 70 - 29
src/views/salesManagement/salesQuery/queryPart.vue

@@ -59,7 +59,16 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="仓库">
-                <v-select code="CHECK_ENABLE_STATE" id="productInfoList-state" v-model="queryParam.warehouseSn" allowClear placeholder="请选择仓库"></v-select>
+                <a-select
+                  placeholder="请选择仓库"
+                  id="productInfoList-warehouseSn"
+                  allowClear
+                  v-model="queryParam.warehouseSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
           </template>
@@ -89,36 +98,45 @@
       :data="loadData"
       :customRow="handleClickRow"
       :scroll="{ x: 1530, y: 150 }"
+      :pageSize="30"
       bordered>
       <!-- 售价 -->
       <template slot="price" slot-scope="text, record">
-        <a-input-number
-          id="productInfoList-price"
-          :value="record.dealerProduct.cityPrice||0"
-          :precision="0"
-          :min="0"
-          :max="999999"
-          placeholder="请输入" />
+        <div @dblclick.stop>
+          ¥
+          <a-input-number
+            v-model="record.dealerProduct.cityPrice"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入" />
+        </div>
       </template>
       <!-- 销售数量 -->
       <template slot="nums" slot-scope="text, record">
-        <a-input-number
-          id="productInfoList-nums"
-          :value="record.salesNums"
-          :precision="0"
-          :min="0"
-          :max="999999"
-          placeholder="请输入" />
+        <div @dblclick.stop>
+          <a-input-number
+            v-model="record.salesNums"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            placeholder="请输入" />
+        </div>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleAdd(record)" id="productInfoList-edit-btn">添加</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="productInfoList-detail-btn" style="margin-left: 15px;">销售记录</a-button>
+        <a-button size="small" type="primary" class="button-info" @click="handleAdd(record)" id="productInfoList-edit-btn">添加</a-button>
+        <a-button
+          size="small"
+          type="primary"
+          class="button-success"
+          @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" />
+    <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="closeModal" />
   </div>
 </template>
 
@@ -126,11 +144,18 @@
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { querySumByProductLocation } from '@/api/stock'
+import { warehouseAllList } from '@/api/warehouse'
 import productSalesRecordModal from './productSalesRecordModal.vue'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
   components: { STable, VSelect, productSalesRecordModal },
+  props: {
+    buyerSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -139,7 +164,6 @@ export default {
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productOrigCode: '', //  原厂编码
-        sysFlag: '1',
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
@@ -150,18 +174,19 @@ export default {
       exportLoading: false, // 导出loading
       productBrandList: [], //  下拉数据
       productTypeList: [], //  产品类别  下拉数据
+      warehouseList: [], // 仓库列表
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true },
         { title: '产品名称', dataIndex: 'productName', align: 'center' },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center' },
         { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true },
-        { title: '仓库', dataIndex: 'warehouseSn', width: 100, align: 'center', sorter: true },
-        { title: '仓位', dataIndex: 'warehouseLocationSn', width: 100, align: 'center' },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
         { title: '售价', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
         { title: '销售数量', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
-        { title: '单位', dataIndex: 'unit', width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
+        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -174,26 +199,33 @@ export default {
             data.list[i].salesNums = 1
           }
           this.disabled = false
+          // 产品品牌
           if (this.productBrandList.length == 0) {
             this.getProductBrand()
           }
+          // 产品分类
           if (this.productTypeList.length == 0) {
             this.getProductType()
           }
+          // 仓库
+          if (this.warehouseList.length == 0) {
+            this.getWarehouse()
+          }
           return data
         })
       },
-      openModal: false, //  查看客户详情  弹框
-      itemId: '' //  当前产品id
+      openModal: false //  查看客户详情  弹框
     }
   },
   methods: {
     // 双击列表
     handleClickRow (record) {
+      const _this = this
       return {
         on: {
           dblclick: (event) => {
-            console.log(record)
+            event.stopPropagation()
+            _this.$emit('add', record)
           }
         }
       }
@@ -221,14 +253,23 @@ export default {
     },
     // 销售记录
     handleDetail (row) {
-      this.itemId = row.id
       this.openModal = true
+      this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn)
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
       this.openModal = false
     },
+    // 仓库
+    getWarehouse () {
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
     //  产品品牌  列表
     getProductBrand () {
       productBrandQuery({}).then(res => {

+ 23 - 36
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="urgentItemsOffsetDetail-page-wrapper">
     <!-- 操作 -->
-    <a-page-header :ghost="false" @back="handleBack" class="urgentItemsOffsetDetail-operation-wrapper">
+    <a-page-header :ghost="false" :backIcon="false" class="urgentItemsOffsetDetail-operation-wrapper" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
@@ -42,7 +42,7 @@
         :rowKey="(record) => record.id"
         :columns="isWriteDown ? columns : unColumns"
         :data="loadData"
-        :scroll="{ x: isWriteDown ? 1330 : '100%' }"
+        :scroll="{ x: isWriteDown ? 1570 : '100%' }"
         bordered>
         <!-- 库存数量 -->
         <template slot="inventoryQuantity" slot-scope="text, record">
@@ -55,35 +55,34 @@
 </template>
 
 <script>
-import { getOperationalPrecision } from '@/libs/tools.js'
-import { urgentDetail } from '@/api/urgent'
-import { urgentDetailList } from '@/api/urgentDetail'
 import { STable, VSelect } from '@/components'
+import { urgentDetail, urgentWriteDown } from '@/api/urgent'
+import { urgentDetailList } from '@/api/urgentDetail'
 export default {
   components: { STable, VSelect },
   data () {
     return {
       unColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 160, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 200, align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 200, align: 'center' },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 200, align: 'center' },
         { title: '库存数量', scopedSlots: { customRender: 'inventoryQuantity' }, width: 100, align: 'center' },
         { title: '未冲减数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' }
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 200, align: 'center' },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'stockInDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '成本价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已冲减数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' },
-        { title: '成本小计', dataIndex: 'costSubtotal', width: 100, align: 'center' }
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本小计', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -93,18 +92,8 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
-            const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
-            const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
-            const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
-            const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
-            data.list[i].productCode = productCode || '--'
-            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].costSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
           }
           this.disabled = false
           return data
@@ -141,15 +130,13 @@ export default {
         content: '确定要进行冲减吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          urgentWriteDown({ id: _this.$route.params.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getDetail()
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },

+ 2 - 6
src/views/salesManagement/urgentItemsOffset/list.vue

@@ -74,13 +74,9 @@
       :data="loadData"
       :scroll="{ x: 1280, y: 300 }"
       bordered>
-      <!-- 状态 -->
-      <template slot="status" slot-scope="text, record">
-        <a-tag :color="record.status=='FINISH'?'green':record.status=='WAIT'?'red':''">{{ record.statusDictValue }}</a-tag>
-      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleDetail(record)" id="urgentItemsOffsetList-detail-btn">详情</a-button>
+        <a-button size="small" type="primary" class="button-success" @click="handleDetail(record)" id="urgentItemsOffsetList-detail-btn">详情</a-button>
       </template>
     </s-table>
   </a-card>
@@ -115,7 +111,7 @@ export default {
         { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '冲减时间', dataIndex: 'offSetTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', scopedSlots: { customRender: 'status' }, width: 100, align: 'center' },
+        { title: '状态', dataIndex: 'statusDictValue', width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象