lilei před 4 roky
rodič
revize
f2c62e5253

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

@@ -146,6 +146,7 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
+        id: null,
         customerName: '', // 客户名称
         contactTel: '', //  联系电话
         contactName: '', //  联系人
@@ -227,7 +228,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = _this.form
-          form.id = this.$route.params.id ? this.$route.params.id : null
+          form.id = this.$route.params.id && this.model == 'page' ? this.$route.params.id : null
           custSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)

+ 1 - 1
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -293,7 +293,7 @@ export default {
     },
     // 新建客户
     newCustFun (data) {
-      console.log(data)
+      console.log(data, this.isEdit)
       this.isNewCust = false
       // 更新客户信息
       this.custAllList.unshift(data)

+ 69 - 22
src/views/salesManagement/salesQuery/edit.vue

@@ -15,7 +15,7 @@
     </a-page-header>
     <a-card size="small" :bordered="false" class="salesEdit-cont">
       <!-- 查询配件列表 -->
-      <queryPart :buyerSn="detailData&&detailData.buyerSn" @add="insterProduct"></queryPart>
+      <queryPart :buyerSn="detailData&&detailData.buyerSn" :newLoading="isInster" @add="insterProduct"></queryPart>
     </a-card>
     <a-card size="small" :bordered="false" class="salesEdit-cont">
       <!-- 总计 -->
@@ -45,21 +45,27 @@
         <a-col :span="18">
           <a-form-model layout="inline" :model="productForm">
             <a-form-model-item label="产品编码">
-              <a-input v-model="productForm.dealerProductEntity.code" allowClear placeholder="输入产品编码" />
+              <a-input v-model="productForm.productCode" allowClear placeholder="输入产品编码" />
             </a-form-model-item>
             <a-form-model-item label="产品名称">
-              <a-input v-model="productForm.dealerProductEntity.name" allowClear placeholder="输入产品名称" />
+              <a-input v-model="productForm.productName" allowClear placeholder="输入产品名称" />
             </a-form-model-item>
             <a-form-model-item>
               <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button>
+              <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesEdit-reset">重置</a-button>
             </a-form-model-item>
           </a-form-model>
         </a-col>
         <a-col :span="6">
           <div style="float:right;overflow: hidden;">
             <a-button size="small" id="salesEdit-dru">导入明细</a-button>
-            <a-button size="small" type="primary" @click="delSalerDetailAll" style="margin-left: 10px" id="salesEdit-del-all">整单删除</a-button>
+            <a-button
+              size="small"
+              type="primary"
+              @click="delSalerDetailAll"
+              :loading="delLoading"
+              style="margin-left: 10px"
+              id="salesEdit-del-all">整单删除</a-button>
           </div>
         </a-col>
       </a-row>
@@ -73,6 +79,13 @@
         :data="loadData"
         :scroll="{ x: 1560, y: 300 }"
         bordered>
+        <!-- 产品编码 -->
+        <template slot="productCode" slot-scope="text, record">
+          <a-badge count="急" v-if="record.oosFlag == 1">
+            <div style="padding-right: 15px;">{{ text }}</div>
+          </a-badge>
+          <span v-else>{{ text }}</span>
+        </template>
         <!-- 售价 -->
         <template slot="price" slot-scope="text, record">
           <editable-cell
@@ -96,7 +109,13 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="productInfoList-Del">删除</a-button>
+          <a-button
+            size="small"
+            type="primary"
+            :loading="delLoading"
+            class="button-error"
+            @click="handleDel(record)"
+            id="productInfoList-Del">删除</a-button>
         </template>
       </s-table>
     </a-card>
@@ -134,18 +153,17 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
       openModal: false, // 客户弹框
+      delLoading: false,
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
       productForm: {
-        dealerProductEntity: {
-          code: '',
-          name: ''
-        }
+        productName: '',
+        productCode: ''
       },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', sorter: true },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', scopedSlots: { customRender: 'productCode' }, width: 140, align: 'center', sorter: true },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center' },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center' },
         { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: 100, align: 'center', sorter: true },
@@ -221,6 +239,14 @@ export default {
       this.$refs.table.refresh(!!flag)
       this.getOrderDetail()
     },
+    // 重置列表
+    resetForm () {
+      this.productForm = {
+        productName: '',
+        productCode: ''
+      }
+      this.$refs.table.refresh()
+    },
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesQueryList' })
@@ -239,25 +265,46 @@ export default {
         if (res.status == 200) {
           this.resetSearchForm()
         }
-        this.$message.info(res.message)
       })
     },
     // 整单删除
     delSalerDetailAll () {
-      salesDetailDelAll({ salesBillSn: this.detailData.salesBillSn }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm()
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要整单删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.delLoading = true
+          salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm()
+            }
+            _this.$message.info(res.message)
+            _this.delLoading = false
+          })
         }
-        this.$message.info(res.message)
       })
     },
     // 删除产品
     handleDel (row) {
-      salesDetailDel({ id: row.id }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm(true)
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.delLoading = true
+          salesDetailDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm(true)
+            }
+            _this.$message.info(res.message)
+            _this.delLoading = false
+          })
         }
-        this.$message.info(res.message)
       })
     },
     // 添加产品
@@ -288,6 +335,7 @@ export default {
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
       salesDetailInsert({
+        buyerSn: this.detailData.buyerSn,
         productSn: row.productSn,
         price: row.dealerProduct.cityPrice,
         qty: row.salesNums,
@@ -308,8 +356,7 @@ export default {
     getOrderDetail () {
       salesDetail({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
-          this.detailData = Object.assign({}, this.detailData, res.data)
-          console.log(this.detailData)
+          this.detailData = res.data
         }
       })
     },

+ 4 - 3
src/views/salesManagement/salesQuery/list.vue

@@ -140,7 +140,7 @@
           size="small"
           type="primary"
           class="button-error"
-          v-if="record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT' || record.billStatus == 'WAIT_OUT_STOCK' || record.billStatus == 'CANCEL'"
+          v-if="record.billStatus !== 'FINISH' && record.financialStatus !== 'FINISH'"
           @click="handleDel(record)"
           id="salesManagementList-del-btn">删除</a-button>
       </template>
@@ -255,12 +255,13 @@ export default {
         okText: '审核通过',
         cancelText: '审核不通过',
         onOk () {
-          _this.auditOrder(row.id, 'AUDIT_PASS')
+          _this.auditOrder(row.id, 'WAIT_OUT_STOCK')
         },
         onCancel (e) {
           if (!e.triggerCancel) {
-            _this.auditOrder(row.id, 'AUDIT_REJECT')
+            _this.auditOrder(row.id, 'CANCEL')
           }
+          _this.$destroyAll()
         }
       })
     },

+ 10 - 3
src/views/salesManagement/salesQuery/queryPart.vue

@@ -74,7 +74,7 @@
           </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-button style="margin: 0 0 18px 8px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin:0 15px 0 8px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -128,7 +128,13 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <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-info"
+          :loading="newLoading"
+          @click="handleAdd(record)"
+          id="productInfoList-edit-btn">添加</a-button>
         <a-button
           size="small"
           type="primary"
@@ -175,7 +181,8 @@ export default {
     buyerSn: {
       type: [Number, String],
       default: ''
-    }
+    },
+    newLoading: Boolean
   },
   data () {
     return {