浏览代码

加载中状态

chenrui 3 年之前
父节点
当前提交
baa1e07e50
共有 44 个文件被更改,包括 3809 次插入3474 次删除
  1. 56 51
      src/views/allocationManagement/chainTransferIn/detail.vue
  2. 44 37
      src/views/allocationManagement/chainTransferOut/basicInfoModal.vue
  3. 62 57
      src/views/allocationManagement/chainTransferOut/detail.vue
  4. 182 169
      src/views/allocationManagement/chainTransferOut/edit.vue
  5. 47 40
      src/views/allocationManagement/storeTransferOut/basicInfoModal.vue
  6. 58 53
      src/views/allocationManagement/storeTransferOut/detail.vue
  7. 180 167
      src/views/allocationManagement/storeTransferOut/edit.vue
  8. 50 44
      src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue
  9. 219 208
      src/views/allocationManagement/warehouseAllocation/edit.vue
  10. 31 24
      src/views/basicData/bulkPartsTypeManagement/editModal.vue
  11. 31 24
      src/views/basicData/customerTypeManagement/editModal.vue
  12. 34 27
      src/views/basicData/expenseType/editModal.vue
  13. 31 24
      src/views/basicData/storeTransferOutTypeManagement/editModal.vue
  14. 25 18
      src/views/bulkManagement/bulkWarehousingOrder/basicInfoModal.vue
  15. 92 87
      src/views/bulkManagement/bulkWarehousingOrder/detail.vue
  16. 238 225
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue
  17. 123 116
      src/views/customerManagement/customerInfo/edit.vue
  18. 132 125
      src/views/financialManagement/companyReceivablePayable/collectionPayment.vue
  19. 30 23
      src/views/financialManagement/expenseManagement/edit.vue
  20. 59 54
      src/views/financialManagement/warehousingAudit/detail.vue
  21. 62 47
      src/views/inventoryManagement/satelliteWarehouseInventory/addModal.vue
  22. 40 35
      src/views/inventoryManagement/warehouse/editModal.vue
  23. 44 39
      src/views/inventoryManagement/warehouse/storingLocation/editModal.vue
  24. 31 24
      src/views/productManagement/productBrand/editModal.vue
  25. 34 27
      src/views/productManagement/productCategory/editModal.vue
  26. 95 88
      src/views/productManagement/productInfo/edit.vue
  27. 41 34
      src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue
  28. 133 128
      src/views/purchasingManagement/purchaseOrder/detail.vue
  29. 207 194
      src/views/purchasingManagement/purchaseOrder/edit.vue
  30. 40 35
      src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue
  31. 67 56
      src/views/purchasingManagement/purchaseOrder/warehousing.vue
  32. 143 132
      src/views/purchasingManagement/purchaseReturn/edit.vue
  33. 34 31
      src/views/salesManagement/quotation/basicInfoModal.vue
  34. 187 180
      src/views/salesManagement/salesQuery/chooseCustomModal.vue
  35. 72 67
      src/views/salesManagement/salesQuery/detail.vue
  36. 141 126
      src/views/salesManagement/salesQuery/edit.vue
  37. 125 118
      src/views/salesManagement/salesReturn/chooseCustomModal.vue
  38. 53 48
      src/views/salesManagement/salesReturn/detail.vue
  39. 153 142
      src/views/salesManagement/salesReturn/salesReturnEdit.vue
  40. 143 132
      src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue
  41. 53 50
      src/views/salesManagement/urgentItemsOffset/detail.vue
  42. 28 21
      src/views/storeManagement/bind/editModal.vue
  43. 61 56
      src/views/storeManagement/userAuthorization/editModal.vue
  44. 98 91
      src/views/supplierManagement/supplierInfo/editModal.vue

+ 56 - 51
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -1,57 +1,59 @@
 <template>
   <div class="chainTransferInDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="chainTransferInDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="chainTransferInDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="isEdit"
-          type="primary"
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="chainTransferInDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="chainTransferInDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="isEdit"
+            type="primary"
+            size="small"
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="chainTransferInDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="chainTransferInDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="chainTransferInDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="调入单号">{{ (basicInfoData&&basicInfoData.allocationLinkagePutNo) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调出对象">{{ (basicInfoData&&basicInfoData.outTenantName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
+        <!-- 总计 -->
+        <a-alert type="info" showIcon style="margin-bottom:15px">
+          <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
           size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="chainTransferInDetail-edit-btn"
-          @click.stop="handleEdit">编辑</a-button>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="chainTransferInDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="chainTransferInDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调入单号">{{ (basicInfoData&&basicInfoData.allocationLinkagePutNo) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="调出对象">{{ (basicInfoData&&basicInfoData.outTenantName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1335 }"
-        bordered>
-      </s-table>
-    </a-card>
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1335 }"
+          bordered>
+        </s-table>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -65,6 +67,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -137,7 +140,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       allocLinkagePutDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 44 - 37
src/views/allocationManagement/chainTransferOut/basicInfoModal.vue

@@ -8,43 +8,45 @@
     v-model="isShow"
     @cancle="isShow = false"
     :width="800">
-    <a-form-model
-      id="chainTransferOut-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol"
-    >
-      <a-form-model-item label="调出产品类型" prop="allocationType">
-        <v-select
-          v-model="form.allocationType"
-          ref="allocationType"
-          id="chainTransferOut-basicInfo-allocationType"
-          code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
-          placeholder="请选择调出产品类型"
-          allowClear
-        ></v-select>
-      </a-form-model-item>
-      <a-form-model-item label="调往对象" prop="putTenantSn">
-        <a-select
-          placeholder="请选择调往对象"
-          allowClear
-          v-model="form.putTenantSn"
-          :showSearch="true"
-          option-filter-prop="children"
-          :filter-option="filterOption">
-          <a-select-option v-for="item in putTenantSnData" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item label="备注" prop="remark">
-        <a-textarea id="chainTransferOut-basicInfo-remark" :maxLength="500" v-model="form.remark" placeholder="请输入备注(最多500个字符)" allowClear />
-      </a-form-model-item>
-    </a-form-model>
-    <div class="btn-cont">
-      <a-button type="primary" id="chainTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
-      <a-button id="chainTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="chainTransferOut-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="调出产品类型" prop="allocationType">
+          <v-select
+            v-model="form.allocationType"
+            ref="allocationType"
+            id="chainTransferOut-basicInfo-allocationType"
+            code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
+            placeholder="请选择调出产品类型"
+            allowClear
+          ></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="调往对象" prop="putTenantSn">
+          <a-select
+            placeholder="请选择调往对象"
+            allowClear
+            v-model="form.putTenantSn"
+            :showSearch="true"
+            option-filter-prop="children"
+            :filter-option="filterOption">
+            <a-select-option v-for="item in putTenantSnData" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="备注" prop="remark">
+          <a-textarea id="chainTransferOut-basicInfo-remark" :maxLength="500" v-model="form.remark" placeholder="请输入备注(最多500个字符)" allowClear />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="chainTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="chainTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -63,6 +65,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
@@ -87,13 +90,17 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          _this.spinning = true
           allocLinkageOutSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
                 _this.isShow = false
                 _this.$emit('ok', res.data)
+                _this.spinning = false
               }, 1000)
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 62 - 57
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -1,63 +1,65 @@
 <template>
   <div class="chainTransferOutDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="chainTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="isEdit"
-          type="primary"
-          size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="chainTransferOutDetail-edit-btn"
-          @click.stop="handleEdit">编辑</a-button>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="chainTransferOutDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="chainTransferOutDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调往对象">{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="调出单号">{{ (basicInfoData&&basicInfoData.allocationLinkageOutNo) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remark) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 产品详情 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="产品详情">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-          </a-alert>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="chainTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="isEdit"
+            type="primary"
             size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1090 }"
-            bordered>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="chainTransferOutDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="chainTransferOutDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="chainTransferOutDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="chainTransferOutDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="调往对象">{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调出单号">{{ (basicInfoData&&basicInfoData.allocationLinkageOutNo) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remark) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 产品详情 -->
+      <a-card size="small" :bordered="false" class="chainTransferOutDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="产品详情">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+            </a-alert>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :scroll="{ x: 1090 }"
+              bordered>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -71,6 +73,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -143,7 +146,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       allocLinkageOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 182 - 169
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -1,188 +1,190 @@
 <template>
   <div class="chainTransferOutEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="chainTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">调往对象:{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="chainTransferOutEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="chainTransferOutEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="选择产品">
-          <!-- 筛选条件 -->
-          <div class="table-page-search-wrapper">
-            <a-form layout="inline" @keyup.enter.native="getProductList(1)">
-              <a-row :gutter="15">
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品编码" prop="productCode">
-                    <a-input id="chainTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品名称" prop="productName">
-                    <a-input id="chainTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="原厂编码" prop="productOrigCode">
-                    <a-input id="chainTransferOutEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="chainTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">调往对象:{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="chainTransferOutEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="chainTransferOutEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="chainTransferOutEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="选择产品">
+            <!-- 筛选条件 -->
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline" @keyup.enter.native="getProductList(1)">
+                <a-row :gutter="15">
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
-                      <a-select
-                        placeholder="请选择"
-                        id="chainTransferOutEdit-brandSn"
-                        allowClear
-                        v-model="queryParam.brandSn"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                      </a-select>
+                    <a-form-item label="产品编码" prop="productCode">
+                      <a-input id="chainTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="产品分类">
-                      <a-cascader
-                        @change="changeProductType"
-                        change-on-select
-                        v-model="productType"
-                        expand-trigger="hover"
-                        :options="productTypeList"
-                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                        id="chainTransferOutEdit-productType"
-                        placeholder="请选择产品分类"
-                        allowClear />
+                    <a-form-item label="产品名称" prop="productName">
+                      <a-input id="chainTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="仓库">
-                      <a-select id="chainTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                        <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                      </a-select>
+                    <a-form-item label="原厂编码" prop="productOrigCode">
+                      <a-input id="chainTransferOutEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
                     </a-form-item>
                   </a-col>
-                </template>
-                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                  <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="chainTransferOutEdit-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutEdit-reset">重置</a-button>
-                  <a @click="advanced=!advanced" style="margin-left: 8px">
-                    {{ advanced ? '收起' : '展开' }}
-                    <a-icon :type="advanced ? 'up' : 'down'"/>
-                  </a>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
-            :columns="columns"
-            :customRow="handleClickRow"
-            :dataSource="loadData"
-            :scroll="{ x: 1680, y: 300 }"
-            bordered>
-            <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
-              <a-input-number
-                id="chainTransferOutEdit-outQty"
-                v-model="record.outQty"
-                :precision="0"
-                :min="1"
-                :max="record.currentQty"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="chainTransferOutEdit-add-btn">添加</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="已选产品">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-          </a-alert>
-          <!-- 筛选条件 -->
-          <a-row :gutter="15" justify="space-between">
-            <a-col :span="17">
-              <div class="table-page-search-wrapper">
-                <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
-                  <a-row :gutter="15">
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品编码" prop="productCode">
-                        <a-input id="chainTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                  <template v-if="advanced">
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品品牌">
+                        <a-select
+                          placeholder="请选择"
+                          id="chainTransferOutEdit-brandSn"
+                          allowClear
+                          v-model="queryParam.brandSn"
+                          :showSearch="true"
+                          option-filter-prop="children"
+                          :filter-option="filterOption">
+                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                        </a-select>
                       </a-form-item>
                     </a-col>
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品名称" prop="productName">
-                        <a-input id="chainTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品分类">
+                        <a-cascader
+                          @change="changeProductType"
+                          change-on-select
+                          v-model="productType"
+                          expand-trigger="hover"
+                          :options="productTypeList"
+                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                          id="chainTransferOutEdit-productType"
+                          placeholder="请选择产品分类"
+                          allowClear />
                       </a-form-item>
                     </a-col>
-                    <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                      <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="chainTransferOutList-refresh">查询</a-button>
-                      <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="chainTransferOutList-reset">重置</a-button>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="仓库">
+                        <a-select id="chainTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                          <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>
-                  </a-row>
-                </a-form>
-              </div>
-            </a-col>
-            <a-col :span="7" style="text-align: right;">
-              <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
-              <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
-            </a-col>
-          </a-row>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="chooseTable"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :data="chooseLoadData"
-            :scroll="{ x: 1695, y: 300 }"
-            bordered>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="chainTransferOutEdit-del-btn">删除</a-button>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="chainTransferOutEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+                  </template>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                    <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="chainTransferOutEdit-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutEdit-reset">重置</a-button>
+                    <a @click="advanced=!advanced" style="margin-left: 8px">
+                      {{ advanced ? '收起' : '展开' }}
+                      <a-icon :type="advanced ? 'up' : 'down'"/>
+                    </a>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
+              :columns="columns"
+              :customRow="handleClickRow"
+              :dataSource="loadData"
+              :scroll="{ x: 1680, y: 300 }"
+              bordered>
+              <!-- 调出数量 -->
+              <template slot="outQty" slot-scope="text, record">
+                <a-input-number
+                  id="chainTransferOutEdit-outQty"
+                  v-model="record.outQty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.currentQty"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="chainTransferOutEdit-add-btn">添加</a-button>
+              </template>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="chainTransferOutEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="已选产品">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+            </a-alert>
+            <!-- 筛选条件 -->
+            <a-row :gutter="15" justify="space-between">
+              <a-col :span="17">
+                <div class="table-page-search-wrapper">
+                  <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                    <a-row :gutter="15">
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品编码" prop="productCode">
+                          <a-input id="chainTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品名称" prop="productName">
+                          <a-input id="chainTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="chainTransferOutList-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="chainTransferOutList-reset">重置</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-form>
+                </div>
+              </a-col>
+              <a-col :span="7" style="text-align: right;">
+                <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
+                <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+              </a-col>
+            </a-row>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :data="chooseLoadData"
+              :scroll="{ x: 1695, y: 300 }"
+              bordered>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="chainTransferOutEdit-del-btn">删除</a-button>
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="chainTransferOutEdit-submit"
+            size="large"
+            class="button-primary"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -200,6 +202,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -344,11 +347,15 @@ export default {
         warehouseSn: row.warehouseSn,
         warehouseLocationSn: row.warehouseLocationSn
       }
+      this.spinning = true
       allocLinkageOutDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.getProductList()
           this.$refs.chooseTable.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -384,12 +391,16 @@ export default {
     //  提交
     handleSubmit () {
       const _this = this
+      _this.spinning = true
       allocLinkageOutSubmit({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
             _this.handleBack()
+            _this.spinning = false
           }, 1000)
+        } else {
+          _this.spinning = false
         }
       })
     },
@@ -481,7 +492,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       allocLinkageOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 47 - 40
src/views/allocationManagement/storeTransferOut/basicInfoModal.vue

@@ -8,46 +8,48 @@
     v-model="isShow"
     @cancle="isShow = false"
     :width="800">
-    <a-form-model
-      id="storeTransferOut-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol"
-    >
-      <a-form-model-item label="调往对象" prop="putPersonType">
-        <a-radio-group v-model="form.putPersonType" @change="putPersonTypeChange">
-          <a-radio v-for="(item,index) in putPersonTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
-        </a-radio-group>
-      </a-form-model-item>
-      <a-form-model-item label="调往对象名称" :prop="isCustomer ? 'putPersonSn' : 'putPersonName'">
-        <a-select
-          v-if="isCustomer"
-          v-model="form.putPersonSn"
-          placeholder="请选择"
-          allowClear
-          :showSearch="true"
-          option-filter-prop="children"
-          :filter-option="filterOption"
-          @change="putPersonChange">
-          <a-select-option v-for="item in custData" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-        </a-select>
-        <a-input v-if="!isCustomer" v-model="form.putPersonName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
-      </a-form-model-item>
-      <a-form-model-item label="调拨类型" prop="callOutType">
-        <a-select v-model="form.callOutType" placeholder="请选择调拨类型" allowClear >
-          <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item label="备注" prop="remark">
-        <a-textarea id="storeTransferOut-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
-      </a-form-model-item>
-    </a-form-model>
-    <div class="btn-cont">
-      <a-button type="primary" id="storeTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
-      <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="storeTransferOut-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="调往对象" prop="putPersonType">
+          <a-radio-group v-model="form.putPersonType" @change="putPersonTypeChange">
+            <a-radio v-for="(item,index) in putPersonTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="调往对象名称" :prop="isCustomer ? 'putPersonSn' : 'putPersonName'">
+          <a-select
+            v-if="isCustomer"
+            v-model="form.putPersonSn"
+            placeholder="请选择"
+            allowClear
+            :showSearch="true"
+            option-filter-prop="children"
+            :filter-option="filterOption"
+            @change="putPersonChange">
+            <a-select-option v-for="item in custData" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
+          </a-select>
+          <a-input v-if="!isCustomer" v-model="form.putPersonName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
+        </a-form-model-item>
+        <a-form-model-item label="调拨类型" prop="callOutType">
+          <a-select v-model="form.callOutType" placeholder="请选择调拨类型" allowClear >
+            <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="备注" prop="remark">
+          <a-textarea id="storeTransferOut-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="storeTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -69,6 +71,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
@@ -105,13 +108,17 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          _this.spinning = true
           storeCallOutSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
                 _this.isShow = false
                 _this.$emit('ok', res.data)
+                _this.spinning = false
               }, 1000)
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 58 - 53
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -1,59 +1,61 @@
 <template>
   <div class="storeTransferOutDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutDetail-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="storeTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="isEdit"
-          type="primary"
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutDetail-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="storeTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="isEdit"
+            type="primary"
+            size="small"
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="storeTransferOutDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="storeTransferOutDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="storeTransferOutDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="调往对象名称">{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="店内调出单号">{{ (basicInfoData&&basicInfoData.storeCallOutNo) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.callOutTypeName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
+        <!-- 总计 -->
+        <a-alert type="info" showIcon style="margin-bottom:15px">
+          <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
           size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="storeTransferOutDetail-edit-btn"
-          @click.stop="handleEdit">编辑</a-button>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="storeTransferOutDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="storeTransferOutDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调往对象名称">{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="店内调出单号">{{ (basicInfoData&&basicInfoData.storeCallOutNo) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.callOutTypeName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 995 }"
-        bordered>
-      </s-table>
-    </a-card>
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 995 }"
+          bordered>
+        </s-table>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -67,6 +69,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -112,7 +115,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       storeCallOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType, costFlag: this.printCostChecked ? '1' : '0' }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 180 - 167
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -1,185 +1,187 @@
 <template>
   <div class="storeTransferOutEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="storeTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="storeTransferOutEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="storeTransferOutEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="选择产品">
-          <!-- 筛选条件 -->
-          <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="产品编码" prop="productCode">
-                    <a-input id="storeTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品名称" prop="productName">
-                    <a-input id="storeTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="仓库">
-                    <a-select id="storeTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                      <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 v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="storeTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="storeTransferOutEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="storeTransferOutEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="选择产品">
+            <!-- 筛选条件 -->
+            <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-cascader
-                        @change="changeProductType"
-                        change-on-select
-                        v-model="productType"
-                        expand-trigger="hover"
-                        :options="productTypeList"
-                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                        id="storeTransferOutEdit-productType"
-                        placeholder="请选择产品分类"
-                        allowClear />
+                    <a-form-item label="产品编码" prop="productCode">
+                      <a-input id="storeTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
-                      <a-select
-                        placeholder="请选择产品品牌"
-                        id="storeTransferOutEdit-brandSn"
-                        allowClear
-                        v-model="queryParam.brandSn"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                    <a-form-item label="产品名称" prop="productName">
+                      <a-input id="storeTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="仓库">
+                      <a-select id="storeTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                        <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>
-                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
-                  <a @click="advanced=!advanced" style="margin-left: 8px">
-                    {{ advanced ? '收起' : '展开' }}
-                    <a-icon :type="advanced ? 'up' : 'down'"/>
-                  </a>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
-            :columns="columns"
-            :customRow="handleClickRow"
-            :data="loadData"
-            :scroll="{ x: 1180, y: 300 }"
-            :defaultLoadData="false"
-            bordered>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="storeTransferOutEdit-add-btn">添加</a-button>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="已选产品">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-          </a-alert>
-          <!-- 筛选条件 -->
-          <a-row :gutter="15">
-            <a-col :span="20">
-              <div class="table-page-search-wrapper">
-                <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
-                  <a-row :gutter="15">
+                  <template v-if="advanced">
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品编码" prop="productCode">
-                        <a-input id="storeTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      <a-form-item label="产品分类">
+                        <a-cascader
+                          @change="changeProductType"
+                          change-on-select
+                          v-model="productType"
+                          expand-trigger="hover"
+                          :options="productTypeList"
+                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                          id="storeTransferOutEdit-productType"
+                          placeholder="请选择产品分类"
+                          allowClear />
                       </a-form-item>
                     </a-col>
                     <a-col :md="6" :sm="24">
-                      <a-form-item label="产品名称" prop="productName">
-                        <a-input id="storeTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                      <a-form-item label="产品品牌">
+                        <a-select
+                          placeholder="请选择产品品牌"
+                          id="storeTransferOutEdit-brandSn"
+                          allowClear
+                          v-model="queryParam.brandSn"
+                          :showSearch="true"
+                          option-filter-prop="children"
+                          :filter-option="filterOption">
+                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                        </a-select>
                       </a-form-item>
                     </a-col>
-                    <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                      <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                      <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
-                    </a-col>
-                  </a-row>
-                </a-form>
-              </div>
-            </a-col>
-            <a-col :span="4" style="text-align: right;">
-              <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
-            </a-col>
-          </a-row>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="chooseTable"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :dataSource="chooseLoadData"
-            :scroll="{ x: 1335, y: 300 }"
-            :pagination="choosePaginationProps"
-            bordered>
-            <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
-              <a-input-number
-                id="storeTransferOutEdit-outQty"
-                v-model="record.outQty"
-                :precision="0"
-                :min="1"
-                :max="999999"
-                placeholder="请输入"
-                @blur="e => outQtyBlur(e.target.value, record)"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="storeTransferOutEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+                  </template>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                    <a @click="advanced=!advanced" style="margin-left: 8px">
+                      {{ advanced ? '收起' : '展开' }}
+                      <a-icon :type="advanced ? 'up' : 'down'"/>
+                    </a>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
+              :columns="columns"
+              :customRow="handleClickRow"
+              :data="loadData"
+              :scroll="{ x: 1180, y: 300 }"
+              :defaultLoadData="false"
+              bordered>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="storeTransferOutEdit-add-btn">添加</a-button>
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="已选产品">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+            </a-alert>
+            <!-- 筛选条件 -->
+            <a-row :gutter="15">
+              <a-col :span="20">
+                <div class="table-page-search-wrapper">
+                  <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
+                    <a-row :gutter="15">
+                      <a-col :md="6" :sm="24">
+                        <a-form-item label="产品编码" prop="productCode">
+                          <a-input id="storeTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="6" :sm="24">
+                        <a-form-item label="产品名称" prop="productName">
+                          <a-input id="storeTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                        <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-form>
+                </div>
+              </a-col>
+              <a-col :span="4" style="text-align: right;">
+                <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
+              </a-col>
+            </a-row>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :dataSource="chooseLoadData"
+              :scroll="{ x: 1335, y: 300 }"
+              :pagination="choosePaginationProps"
+              bordered>
+              <!-- 调出数量 -->
+              <template slot="outQty" slot-scope="text, record">
+                <a-input-number
+                  id="storeTransferOutEdit-outQty"
+                  v-model="record.outQty"
+                  :precision="0"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入"
+                  @blur="e => outQtyBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
+              </template>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="storeTransferOutEdit-submit"
+            size="large"
+            class="button-primary"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -197,6 +199,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -286,7 +289,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       storeCallOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType, costFlag: '0' }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {
@@ -369,11 +374,15 @@ export default {
           return
         }
       }
+      this.spinning = true
       storeCallOutDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.table.refresh()
           this.getChooseProductList()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -398,12 +407,16 @@ export default {
     //  提交
     handleSubmit () {
       const _this = this
+      _this.spinning = true
       storeCallOutSubmit({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
             _this.handleBack()
+            _this.spinning = false
           }, 1000)
+        } else {
+          _this.spinning = false
         }
       })
     },

+ 50 - 44
src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue

@@ -8,38 +8,40 @@
     v-model="isShow"
     @cancle="isShow = false"
     :width="800">
-    <a-form-model
-      id="warehouseAllocation-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol" >
-      <a-form-model-item required label="调出仓库" prop="outWarehouseSn">
-        <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="form.outWarehouseSn" >
-          <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
-            {{ item.name }}
-          </a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item required label="调入仓库" prop="putWarehouseSn">
-        <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="form.putWarehouseSn" >
-          <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
-            {{ item.name }}
-          </a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item label="关联单号" prop="relevanceNo">
-        <a-input id="warehouseAllocation-basicInfo-relevanceNo" :maxLength="50" v-model="form.relevanceNo" placeholder="请输入关联单号(最多50个字符)" allowClear />
-      </a-form-model-item>
-      <a-form-model-item label="备注" prop="remark">
-        <a-textarea id="warehouseAllocation-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
-      </a-form-model-item>
-    </a-form-model>
-    <div class="btn-cont">
-      <a-button type="primary" id="warehouseAllocation-basicInfo-modal-save" @click="handleSave">保存</a-button>
-      <a-button id="warehouseAllocation-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="warehouseAllocation-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item required label="调出仓库" prop="outWarehouseSn">
+          <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="form.outWarehouseSn" >
+            <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
+              {{ item.name }}
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item required label="调入仓库" prop="putWarehouseSn">
+          <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="form.putWarehouseSn" >
+            <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
+              {{ item.name }}
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="关联单号" prop="relevanceNo">
+          <a-input id="warehouseAllocation-basicInfo-relevanceNo" :maxLength="50" v-model="form.relevanceNo" placeholder="请输入关联单号(最多50个字符)" allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="备注" prop="remark">
+          <a-textarea id="warehouseAllocation-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="warehouseAllocation-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="warehouseAllocation-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -73,6 +75,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
@@ -88,7 +91,7 @@ export default {
         putWarehouseSn: [{ required: true, message: '请选择调入仓库', trigger: 'blur' }],
         outWarehouseSn: [{ required: true, message: '请选择调出仓库', trigger: 'blur' }]
       },
-	  warehouseList: [], // 仓库列表
+      warehouseList: [], // 仓库列表
       brandData: [] //  供应商  下拉数据
     }
   },
@@ -96,7 +99,6 @@ export default {
     // 获取仓库列表
     getWarehouseList () {
       warehouseAllList({}).then(res => {
-		  console.log(res, '-----仓库----')
         if (res.status == 200) {
           this.warehouseList = res.data || []
         } else {
@@ -106,19 +108,23 @@ export default {
     },
     //  保存
     handleSave () {
-	  this.$refs['ruleForm'].validate(valid => {
+      this.$refs['ruleForm'].validate(valid => {
         if (valid) {
-		  allocWarehouseSave(this.form).then(res => {
-		    if (res.status == 200) {
-		      this.isShow = false
-		      this.$emit('ok', res.data)
-		    }
-		  })
+          this.spinning = true
+          allocWarehouseSave(this.form).then(res => {
+            if (res.status == 200) {
+              this.isShow = false
+              this.$emit('ok', res.data)
+              this.spinning = false
+            } else {
+              this.spinning = false
+            }
+          })
         } else {
-		  console.log('error submit!!')
-		  return false
+          console.log('error submit!!')
+          return false
         }
-	  })
+      })
     },
     filterOption (input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 219 - 208
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -1,227 +1,229 @@
 <template>
   <div class="warehouseAllocationEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">调出仓库:{{ (basicInfoData&&basicInfoData.outWarehouseName) || '--' }}</span>
-        <span style="margin: 0 15px;color: #666;">调入仓库:{{ (basicInfoData&&basicInfoData.putWarehouseName) || '--' }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <!-- <template slot="extra">
-        <a-button key="2" id="warehouseAllocationEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="warehouseAllocationEdit-print-btn">快速打印</a-button>
-      </template> -->
-    </a-page-header>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="选择产品">
-          <!-- 筛选条件 -->
-          <div class="table-page-search-wrapper">
-            <a-form layout="inline" @keyup.enter.native="getProductList(1)">
-              <a-row :gutter="15">
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品编码" prop="productCode">
-                    <a-input id="warehouseAllocationEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品名称" prop="productName">
-                    <a-input id="warehouseAllocationEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="原厂编码" prop="productOrigCode">
-                    <a-input id="warehouseAllocationEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">调出仓库:{{ (basicInfoData&&basicInfoData.outWarehouseName) || '--' }}</span>
+          <span style="margin: 0 15px;color: #666;">调入仓库:{{ (basicInfoData&&basicInfoData.putWarehouseName) || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <!-- <template slot="extra">
+          <a-button key="2" id="warehouseAllocationEdit-preview-btn">打印预览</a-button>
+          <a-button key="1" type="primary" id="warehouseAllocationEdit-print-btn">快速打印</a-button>
+        </template> -->
+      </a-page-header>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="选择产品">
+            <!-- 筛选条件 -->
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline" @keyup.enter.native="getProductList(1)">
+                <a-row :gutter="15">
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
-                      <a-select
-                        placeholder="请选择产品品牌"
-                        id="warehouseAllocationEdit-brandSn"
-                        allowClear
-                        v-model="queryParam.brandSn"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                      </a-select>
+                    <a-form-item label="产品编码" prop="productCode">
+                      <a-input id="warehouseAllocationEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="产品分类">
-                      <a-cascader
-                        @change="changeProductType"
-                        change-on-select
-                        v-model="productType"
-                        expand-trigger="hover"
-                        :options="productTypeList"
-                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                        id="warehouseAllocationEdit-productType"
-                        placeholder="请选择产品分类"
-                        allowClear />
+                    <a-form-item label="产品名称" prop="productName">
+                      <a-input id="warehouseAllocationEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="调出仓位" prop="warehouseLocationSn">
-                      <a-select id="warehouseAllocationEdit-warehouseLocationSn" placeholder="请选择" allowClear v-model="queryParam.warehouseLocationSn" style="width: 100%;">
-                        <a-select-option v-for="item in warehouseOutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
-                      </a-select>
+                    <a-form-item label="原厂编码" prop="productOrigCode">
+                      <a-input id="warehouseAllocationEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
                     </a-form-item>
                   </a-col>
-                </template>
-                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                  <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
-                  <a @click="advanced=!advanced" style="margin-left: 8px">
-                    {{ advanced ? '收起' : '展开' }}
-                    <a-icon :type="advanced ? 'up' : 'down'"/>
-                  </a>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
-            :columns="columns"
-            :customRow="handleClickRow"
-            :dataSource="loadData"
-            :scroll="{ x: 1880, y: 300 }"
-            :pagination="paginationProps"
-            bordered>
-            <!-- 产品分类 -->
-            <template slot="productType" slot-scope="text, record">
-              <span v-if="record.dealerProduct.productTypeName2 || record.dealerProduct.productTypeName3">{{ record.dealerProduct.productTypeName2 }} {{ record.dealerProduct.productTypeName3 ? '>' : '' }} {{ record.dealerProduct.productTypeName3 }}</span>
-              <span v-else>--</span>
-            </template>
-            <!-- 调入仓位 -->
-            <template slot="putWarehouseLocationSn" slot-scope="text, record">
-              <a-select id="warehouseAllocationEdit-putWarehouseLocationSn" placeholder="请选择" v-model="record.putWarehouseLocationSn" style="width: 100%;">
-                <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </template>
-            <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
-              <a-input-number
-                id="warehouseAllocationEdit-outQty"
-                v-model="record.outQty"
-                :precision="0"
-                :min="1"
-                :max="record.currentQty"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
-            </template>
-            </s-table>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="已选产品">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-          </a-alert>
-          <!-- 筛选条件 -->
-          <a-row :gutter="15" justify="space-between">
-            <a-col :span="17">
-              <div class="table-page-search-wrapper">
-                <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
-                  <a-row :gutter="15">
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品编码" prop="productCode">
-                        <a-input id="warehouseAllocationEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                  <template v-if="advanced">
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品品牌">
+                        <a-select
+                          placeholder="请选择产品品牌"
+                          id="warehouseAllocationEdit-brandSn"
+                          allowClear
+                          v-model="queryParam.brandSn"
+                          :showSearch="true"
+                          option-filter-prop="children"
+                          :filter-option="filterOption">
+                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                        </a-select>
                       </a-form-item>
                     </a-col>
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品名称" prop="productName">
-                        <a-input id="warehouseAllocationEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品分类">
+                        <a-cascader
+                          @change="changeProductType"
+                          change-on-select
+                          v-model="productType"
+                          expand-trigger="hover"
+                          :options="productTypeList"
+                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                          id="warehouseAllocationEdit-productType"
+                          placeholder="请选择产品分类"
+                          allowClear />
                       </a-form-item>
                     </a-col>
-                    <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                      <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="warehouseAllocationList-refresh">查询</a-button>
-                      <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="warehouseAllocationList-reset">重置</a-button>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="调出仓位" prop="warehouseLocationSn">
+                        <a-select id="warehouseAllocationEdit-warehouseLocationSn" placeholder="请选择" allowClear v-model="queryParam.warehouseLocationSn" style="width: 100%;">
+                          <a-select-option v-for="item in warehouseOutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-item>
                     </a-col>
-                  </a-row>
-                </a-form>
-              </div>
-            </a-col>
-            <a-col :span="7">
-              <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button>
-              <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
-            </a-col>
-          </a-row>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="chooseTable"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :dataSource="chooseLoadData"
-            :scroll="{ x: 1680, y: 300 }"
-            :pagination="choosePaginationProps"
-            bordered>
-            <!-- 产品分类 -->
-            <template slot="productType" slot-scope="text, record">
-              <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-              <span v-else>--</span>
-            </template>
-            <!-- 调入仓位 -->
-            <template slot="putWarehouseLocationSn" slot-scope="text, record">
-              <a-select
-                id="warehouseAllocationEdit-putWarehouseLocationSn"
-                @change="chooseWarehouseLocChange(record)"
-                placeholder="请选择"
-                v-model="record.putWarehouseLocationSn"
-                style="width: 100%;">
-                <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.outWarehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </template>
-            <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
-              <a-input-number
-                id="warehouseAllocationEdit-outQty"
-                v-model="record.outQty"
-                :precision="0"
-                :min="1"
-                :max="999999"
-                placeholder="请输入"
-                @blur="e => outQtyBlur(e.target.value, record)"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="warehouseAllocationEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+                  </template>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                    <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
+                    <a @click="advanced=!advanced" style="margin-left: 8px">
+                      {{ advanced ? '收起' : '展开' }}
+                      <a-icon :type="advanced ? 'up' : 'down'"/>
+                    </a>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
+              :columns="columns"
+              :customRow="handleClickRow"
+              :dataSource="loadData"
+              :scroll="{ x: 1880, y: 300 }"
+              :pagination="paginationProps"
+              bordered>
+              <!-- 产品分类 -->
+              <template slot="productType" slot-scope="text, record">
+                <span v-if="record.dealerProduct.productTypeName2 || record.dealerProduct.productTypeName3">{{ record.dealerProduct.productTypeName2 }} {{ record.dealerProduct.productTypeName3 ? '>' : '' }} {{ record.dealerProduct.productTypeName3 }}</span>
+                <span v-else>--</span>
+              </template>
+              <!-- 调入仓位 -->
+              <template slot="putWarehouseLocationSn" slot-scope="text, record">
+                <a-select id="warehouseAllocationEdit-putWarehouseLocationSn" placeholder="请选择" v-model="record.putWarehouseLocationSn" style="width: 100%;">
+                  <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </template>
+              <!-- 调出数量 -->
+              <template slot="outQty" slot-scope="text, record">
+                <a-input-number
+                  id="warehouseAllocationEdit-outQty"
+                  v-model="record.outQty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.currentQty"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
+              </template>
+              </s-table>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="已选产品">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+            </a-alert>
+            <!-- 筛选条件 -->
+            <a-row :gutter="15" justify="space-between">
+              <a-col :span="17">
+                <div class="table-page-search-wrapper">
+                  <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
+                    <a-row :gutter="15">
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品编码" prop="productCode">
+                          <a-input id="warehouseAllocationEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="9" :sm="24">
+                        <a-form-item label="产品名称" prop="productName">
+                          <a-input id="warehouseAllocationEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                        </a-form-item>
+                      </a-col>
+                      <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                        <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="warehouseAllocationList-refresh">查询</a-button>
+                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="warehouseAllocationList-reset">重置</a-button>
+                      </a-col>
+                    </a-row>
+                  </a-form>
+                </div>
+              </a-col>
+              <a-col :span="7">
+                <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button>
+                <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
+              </a-col>
+            </a-row>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :dataSource="chooseLoadData"
+              :scroll="{ x: 1680, y: 300 }"
+              :pagination="choosePaginationProps"
+              bordered>
+              <!-- 产品分类 -->
+              <template slot="productType" slot-scope="text, record">
+                <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+                <span v-else>--</span>
+              </template>
+              <!-- 调入仓位 -->
+              <template slot="putWarehouseLocationSn" slot-scope="text, record">
+                <a-select
+                  id="warehouseAllocationEdit-putWarehouseLocationSn"
+                  @change="chooseWarehouseLocChange(record)"
+                  placeholder="请选择"
+                  v-model="record.putWarehouseLocationSn"
+                  style="width: 100%;">
+                  <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.outWarehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </template>
+              <!-- 调出数量 -->
+              <template slot="outQty" slot-scope="text, record">
+                <a-input-number
+                  id="warehouseAllocationEdit-outQty"
+                  v-model="record.outQty"
+                  :precision="0"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入"
+                  @blur="e => outQtyBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
+              </template>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="warehouseAllocationEdit-submit"
+            size="large"
+            class="button-primary"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
   </div>
 </template>
 
@@ -236,6 +238,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -395,11 +398,15 @@ export default {
           return
         }
       }
+      this.spinning = true
       allocWarehouseDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.getProductList()
           this.getChooseProductList()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -431,12 +438,16 @@ export default {
     //  提交
     handleSubmit () {
       const _this = this
+      _this.spinning = true
       allocWarehouseSubmit({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
             _this.handleBack()
+            _this.spinning = false
           }, 1000)
+        } else {
+          _this.spinning = false
         }
       })
     },

+ 31 - 24
src/views/basicData/bulkPartsTypeManagement/editModal.vue

@@ -8,31 +8,33 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="bulkPartsTypeEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="散件类型名称" prop="name">
-          <a-input
-            id="bulkPartsTypeEdit-name"
-            :maxLength="30"
-            v-model.trim="form.name"
-            @change="filterEmpty"
-            placeholder="请输入散件类型名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="bulkParts-type-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="bulkParts-type-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="bulkPartsTypeEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="散件类型名称" prop="name">
+            <a-input
+              id="bulkPartsTypeEdit-name"
+              :maxLength="30"
+              v-model.trim="form.name"
+              @change="filterEmpty"
+              placeholder="请输入散件类型名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="bulkParts-type-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="bulkParts-type-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -63,6 +65,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  品牌数据
       formItemLayout: {
@@ -94,10 +97,14 @@ export default {
         if (valid) {
           const form = _this.form
           form.id = _this.itemId ? _this.itemId : null
+          _this.spinning = true
           sparePartsPutTypeSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 31 - 24
src/views/basicData/customerTypeManagement/editModal.vue

@@ -8,31 +8,33 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="customerTypeEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="客户类型名称" prop="name">
-          <a-input
-            id="customerTypeEdit-name"
-            :maxLength="30"
-            v-model.trim="form.name"
-            @change="filterEmpty"
-            placeholder="请输入客户类型名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="customer-type-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="customer-type-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="customerTypeEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="客户类型名称" prop="name">
+            <a-input
+              id="customerTypeEdit-name"
+              :maxLength="30"
+              v-model.trim="form.name"
+              @change="filterEmpty"
+              placeholder="请输入客户类型名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="customer-type-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="customer-type-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -63,6 +65,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  品牌数据
       formItemLayout: {
@@ -94,10 +97,14 @@ export default {
         if (valid) {
           const form = _this.form
           form.id = _this.itemId ? _this.itemId : null
+          _this.spinning = true
           custTypeSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 34 - 27
src/views/basicData/expenseType/editModal.vue

@@ -8,34 +8,36 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="expenseTypeEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="所属类别" v-if="parentType">
-          {{ parentType }}
-        </a-form-model-item>
-        <a-form-model-item label="费用类型名称" prop="name">
-          <a-input
-            v-model.trim="form.name"
-            @change="filterEmpty"
-            id="expenseTypeEdit-name"
-            :maxLength="30"
-            allowClear
-            placeholder="请输入费用类型名称(最多30个字符)" />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="product-category-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="product-category-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="expenseTypeEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="所属类别" v-if="parentType">
+            {{ parentType }}
+          </a-form-model-item>
+          <a-form-model-item label="费用类型名称" prop="name">
+            <a-input
+              v-model.trim="form.name"
+              @change="filterEmpty"
+              id="expenseTypeEdit-name"
+              :maxLength="30"
+              allowClear
+              placeholder="请输入费用类型名称(最多30个字符)" />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="product-category-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="product-category-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -66,6 +68,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -99,11 +102,15 @@ export default {
           const formData = JSON.parse(JSON.stringify(_this.form))
           formData.id = _this.itemId ? _this.itemId : undefined
           formData.psn = _this.nowData && _this.nowData.psn ? _this.nowData.psn : undefined
+          _this.spinning = true
           costTypeSave(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 31 - 24
src/views/basicData/storeTransferOutTypeManagement/editModal.vue

@@ -8,31 +8,33 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="storeTransferOutTypeEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="店内调出类型名称" prop="name">
-          <a-input
-            id="storeTransferOutTypeEdit-name"
-            :maxLength="30"
-            v-model.trim="form.name"
-            @change="filterEmpty"
-            placeholder="请输入店内调出类型名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="storeTransferOut-type-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="storeTransferOut-type-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="storeTransferOutTypeEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="店内调出类型名称" prop="name">
+            <a-input
+              id="storeTransferOutTypeEdit-name"
+              :maxLength="30"
+              v-model.trim="form.name"
+              @change="filterEmpty"
+              placeholder="请输入店内调出类型名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="storeTransferOut-type-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="storeTransferOut-type-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -63,6 +65,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  品牌数据
       formItemLayout: {
@@ -94,10 +97,14 @@ export default {
         if (valid) {
           const form = _this.form
           form.id = _this.itemId ? _this.itemId : null
+          _this.spinning = true
           storeCallOutTypeSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 25 - 18
src/views/bulkManagement/bulkWarehousingOrder/basicInfoModal.vue

@@ -8,14 +8,15 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <a-form-model
-      id="bulkWarehousingOrder-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol" >
-      <a-form-model-item label="供应商" prop="supplierSn">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="bulkWarehousingOrder-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="供应商" prop="supplierSn">
         <a-select
           placeholder="请输入名称查询,如果没有请点击 '+' 新增"
           allowClear
@@ -27,25 +28,26 @@
           <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn" :disabled="item.enabledFlag==0">{{ item.supplierName }}</a-select-option>
         </a-select>
         <a-button icon="plus" size="small" @click="openSupplierModal=true" id="bulkWarehousingOrder-basicInfo-add-btn" style="margin-left: 10px;"></a-button>
-      </a-form-model-item>
-      <a-form-model-item label="散件入库类型" prop="sparePartsType">
+        </a-form-model-item>
+        <a-form-model-item label="散件入库类型" prop="sparePartsType">
         <a-select id="bulkWarehousingOrder-basicInfo-sparePartsType" placeholder="请选择散件入库类型" allowClear v-model="form.sparePartsType">
           <a-select-option v-for="item in sparePartsPutTypeList" :key="item.sparePartsPutTypeSn" :value="item.sparePartsPutTypeSn">{{ item.name }}</a-select-option>
         </a-select>
-      </a-form-model-item>
-      <a-form-model-item label="备注" prop="remarks">
+        </a-form-model-item>
+        <a-form-model-item label="备注" prop="remarks">
         <a-textarea
           id="bulkWarehousingOrder-remarks"
           :maxLength="200"
           v-model="form.remarks"
           placeholder="请输入备注(最多200个字符)"
           allowClear />
-      </a-form-model-item>
-    </a-form-model>
-    <div class="btn-cont">
-      <a-button type="primary" id="bulkWarehousingOrder-basicInfo-modal-save" @click="handleSave">保存</a-button>
-      <a-button id="bulkWarehousingOrder-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="bulkWarehousingOrder-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="bulkWarehousingOrder-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
     <!-- 供应商 -->
     <supplier-info-edit-modal :openModal="openSupplierModal" @close="closeSupplierModal" @ok="handleOk" :isState="false" />
   </a-modal>
@@ -68,6 +70,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
@@ -98,13 +101,17 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          _this.spinning = true
           sparePartsPurSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
                 _this.isShow = false
                 _this.$emit('ok', res.data)
+                _this.spinning = false
               }, 1000)
+            }else{
+              _this.spinning = false
             }
           })
         } else {

+ 92 - 87
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -1,93 +1,95 @@
 <template>
   <div class="bulkWarehousingOrderDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="bulkWarehousingOrderDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="isEdit"
-          type="primary"
-          size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="bulkWarehousingOrderDetail-edit-btn"
-          @click.stop="handleEdit">编辑</a-button>
-        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '--' }}</p>
-      </template>
-      <template slot="tags">
-        <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 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="bulkWarehousingOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="bulkWarehousingOrderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系人">
-              {{ (basicInfoData&&basicInfoData.supplierContactPerson) || '--' }}
-              <span v-if="basicInfoData&&basicInfoData.supplierContactTel">({{ basicInfoData.supplierContactTel }})</span>
-            </a-descriptions-item>
-            <a-descriptions-item label="联系地址">
-              {{ (basicInfoData&&basicInfoData.supplierProvinceName) || '' }}
-              {{ (basicInfoData&&basicInfoData.supplierCityName) || '' }}
-              {{ (basicInfoData&&basicInfoData.supplierCountyName) || '' }}
-              {{ (basicInfoData&&basicInfoData.supplierAddress) || '' }}
-            </a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 产品详情 -->
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="产品详情">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-          </a-alert>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="bulkWarehousingOrderDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a-button
+            v-if="isEdit"
+            type="primary"
             size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1180 }"
-            bordered>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 单据记录  二期 -->
-    <!-- <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="单据记录">
-          <a-timeline class="timeline-box">
-            <a-timeline-item>2021-02-01 15:22:38   王凯   审核通过</a-timeline-item>
-            <a-timeline-item>
-              <p>2021-02-01 15:22:38   王凯   审核通过</p>
-              <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
-              <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
-            </a-timeline-item>
-            <a-timeline-item>Technical testing 2015-09-01</a-timeline-item>
-            <a-timeline-item>Network problems being solved 2015-09-01</a-timeline-item>
-          </a-timeline>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card> -->
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="bulkWarehousingOrderDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+          <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '--' }}</p>
+        </template>
+        <template slot="tags">
+          <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 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="bulkWarehousingOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="bulkWarehousingOrderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系人">
+                {{ (basicInfoData&&basicInfoData.supplierContactPerson) || '--' }}
+                <span v-if="basicInfoData&&basicInfoData.supplierContactTel">({{ basicInfoData.supplierContactTel }})</span>
+              </a-descriptions-item>
+              <a-descriptions-item label="联系地址">
+                {{ (basicInfoData&&basicInfoData.supplierProvinceName) || '' }}
+                {{ (basicInfoData&&basicInfoData.supplierCityName) || '' }}
+                {{ (basicInfoData&&basicInfoData.supplierCountyName) || '' }}
+                {{ (basicInfoData&&basicInfoData.supplierAddress) || '' }}
+              </a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 产品详情 -->
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="产品详情">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+            </a-alert>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :scroll="{ x: 1180 }"
+              bordered>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 单据记录  二期 -->
+      <!-- <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="单据记录">
+            <a-timeline class="timeline-box">
+              <a-timeline-item>2021-02-01 15:22:38   王凯   审核通过</a-timeline-item>
+              <a-timeline-item>
+                <p>2021-02-01 15:22:38   王凯   审核通过</p>
+                <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
+                <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
+              </a-timeline-item>
+              <a-timeline-item>Technical testing 2015-09-01</a-timeline-item>
+              <a-timeline-item>Network problems being solved 2015-09-01</a-timeline-item>
+            </a-timeline>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card> -->
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -101,6 +103,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -148,7 +151,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       sparePartsPurDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 238 - 225
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -1,231 +1,233 @@
 <template>
   <div class="bulkWarehousingOrderEdit-wrap">
-    <!-- 内容 -->
-    <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderEdit-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '' }}</p>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            基础信息
-            <!-- <a-button type="primary" shape="circle" size="small" icon="edit" class="edit-circle-btn" id="bulkWarehousingOrderEdit-edit-circle-btn" @click.stop="handleEditInfo" /> -->
-          </template>
-          <a-descriptions :column="3">
-            <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            选择产品<span class="sub-title">①输入查询条件--->②查找到需要入库的配件--->③录入成本价、数量、仓库、仓位--->④点击“添加”</span>
-          </template>
-          <!-- 选择产品 -->
-          <div>
-            <!-- 搜索条件 -->
-            <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="bulkWarehousingOrderEdit-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码"/>
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
-                      <a-select
-                        placeholder="请选择产品品牌"
-                        id="bulkWarehousingOrderEdit-productBrandSn"
-                        allowClear
-                        v-model="queryParam.productBrandSn"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                      </a-select>
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品分类">
-                      <a-cascader
-                        @change="changeProductType"
-                        change-on-select
-                        v-model="productType"
-                        expand-trigger="hover"
-                        :options="productTypeList"
-                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                        id="productInfoList-productType"
-                        placeholder="请选择产品分类"
-                        allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-button style="margin-bottom: 18px;" type="primary" @click="getDealerProductList(1)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
-                    <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="bulkWarehousingOrderEdit-reset">重置</a-button>
-                  </a-col>
-                </a-row>
-              </a-form>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 内容 -->
+      <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderEdit-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '' }}</p>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              基础信息
+              <!-- <a-button type="primary" shape="circle" size="small" icon="edit" class="edit-circle-btn" id="bulkWarehousingOrderEdit-edit-circle-btn" @click.stop="handleEditInfo" /> -->
+            </template>
+            <a-descriptions :column="3">
+              <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              选择产品<span class="sub-title">①输入查询条件--->②查找到需要入库的配件--->③录入成本价、数量、仓库、仓位--->④点击“添加”</span>
+            </template>
+            <!-- 选择产品 -->
+            <div>
+              <!-- 搜索条件 -->
+              <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="bulkWarehousingOrderEdit-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码"/>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品品牌">
+                        <a-select
+                          placeholder="请选择产品品牌"
+                          id="bulkWarehousingOrderEdit-productBrandSn"
+                          allowClear
+                          v-model="queryParam.productBrandSn"
+                          :showSearch="true"
+                          option-filter-prop="children"
+                          :filter-option="filterOption">
+                          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                        </a-select>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品分类">
+                        <a-cascader
+                          @change="changeProductType"
+                          change-on-select
+                          v-model="productType"
+                          expand-trigger="hover"
+                          :options="productTypeList"
+                          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                          id="productInfoList-productType"
+                          placeholder="请选择产品分类"
+                          allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-button style="margin-bottom: 18px;" type="primary" @click="getDealerProductList(1)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
+                      <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="bulkWarehousingOrderEdit-reset">重置</a-button>
+                    </a-col>
+                  </a-row>
+                </a-form>
+              </div>
+              <!-- 列表 -->
+              <a-table
+                class="sTable"
+                ref="table"
+                size="small"
+                :rowKey="(record) => record.id"
+                :columns="columns"
+                :customRow="handleClickRow"
+                :dataSource="loadData"
+                :scroll="{ x: 1600, y: 300 }"
+                :pagination="paginationProps"
+                @change="onTableChange"
+                bordered>
+                <!-- 成本价 -->
+                <template slot="putCost" slot-scope="text, record">
+                  <a-input-number
+                    id="bulkWarehousingOrderEdit-putCost"
+                    v-model="record.putCost"
+                    :precision="2"
+                    :min="1"
+                    :max="999999"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                </template>
+                <!-- 数量 -->
+                <template slot="putQty" slot-scope="text, record">
+                  <a-input-number
+                    id="bulkWarehousingOrderEdit-putQty"
+                    v-model="record.putQty"
+                    :precision="0"
+                    :min="1"
+                    :max="999999"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                </template>
+                <!-- 仓库仓位 -->
+                <template slot="warehouse" slot-scope="text, record, index">
+                  <a-cascader
+                    @change="e => changeWarehouseCascade(e, record, index, 'dealerProduct')"
+                    v-model="record.warehouseCascade"
+                    expand-trigger="hover"
+                    :allowClear="false"
+                    :options="warehouseCascadeData"
+                    :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                    id="bulkWarehousingOrderEdit-warehouseCascade"
+                    placeholder="请选择仓库仓位"
+                    style="width: 100%;" />
+                </template>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record">
+                  <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
+                </template>
+              </a-table>
             </div>
-            <!-- 列表 -->
-            <a-table
-              class="sTable"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="columns"
-              :customRow="handleClickRow"
-              :dataSource="loadData"
-              :scroll="{ x: 1600, y: 300 }"
-              :pagination="paginationProps"
-              @change="onTableChange"
-              bordered>
-              <!-- 成本价 -->
-              <template slot="putCost" slot-scope="text, record">
-                <a-input-number
-                  id="bulkWarehousingOrderEdit-putCost"
-                  v-model="record.putCost"
-                  :precision="2"
-                  :min="1"
-                  :max="999999"
-                  placeholder="请输入"
-                  style="width: 100%;" />
-              </template>
-              <!-- 数量 -->
-              <template slot="putQty" slot-scope="text, record">
-                <a-input-number
-                  id="bulkWarehousingOrderEdit-putQty"
-                  v-model="record.putQty"
-                  :precision="0"
-                  :min="1"
-                  :max="999999"
-                  placeholder="请输入"
-                  style="width: 100%;" />
-              </template>
-              <!-- 仓库仓位 -->
-              <template slot="warehouse" slot-scope="text, record, index">
-                <a-cascader
-                  @change="e => changeWarehouseCascade(e, record, index, 'dealerProduct')"
-                  v-model="record.warehouseCascade"
-                  expand-trigger="hover"
-                  :allowClear="false"
-                  :options="warehouseCascadeData"
-                  :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-                  id="bulkWarehousingOrderEdit-warehouseCascade"
-                  placeholder="请选择仓库仓位"
-                  style="width: 100%;" />
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
-              </template>
-            </a-table>
-          </div>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            已选产品
-            <a-button size="small" class="import-btn" id="bulkWarehousingOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
-          </template>
-          <!-- 已选产品 -->
-          <div>
-            <!-- 总计 -->
-            <a-alert type="info" showIcon style="margin-bottom:15px">
-              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
-            </a-alert>
-            <!-- 列表 -->
-            <a-table
-              class="sTable"
-              ref="chooseTable"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="chooseColumns"
-              :dataSource="chooseLoadData"
-              :scroll="{ x: 1700, y: 300 }"
-              :pagination="choosePaginationProps"
-              @change="onChooseTableChange"
-              bordered>
-              <!-- 成本价 -->
-              <template slot="putCost" slot-scope="text, record">
-                <a-input-number
-                  id="bulkWarehousingOrderEdit-choose-putCost"
-                  v-model="record.putCost"
-                  :precision="2"
-                  :min="1"
-                  :max="999999"
-                  placeholder="请输入"
-                  @blur="e => putCostBlur(e.target.value, record)"
-                  style="width: 100%;" />
-              </template>
-              <!-- 数量 -->
-              <template slot="putQty" slot-scope="text, record">
-                <a-input-number
-                  id="bulkWarehousingOrderEdit-choose-putQty"
-                  v-model="record.putQty"
-                  :precision="0"
-                  :min="1"
-                  :max="999999"
-                  placeholder="请输入"
-                  @blur="e => putQtyBlur(e.target.value, record)"
-                  style="width: 100%;" />
-              </template>
-              <!-- 仓库仓位 -->
-              <template slot="warehouse" slot-scope="text, record, index">
-                <a-cascader
-                  @change="e => changeWarehouseCascade(e, record, index, 'sparePartsPurDetail')"
-                  v-model="record.warehouseCascade"
-                  expand-trigger="hover"
-                  :allowClear="false"
-                  :options="warehouseCascadeData"
-                  :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-                  id="bulkWarehousingOrderEdit-choose-warehouseCascade"
-                  placeholder="请选择仓库仓位"
-                  style="width: 100%;" />
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkWarehousingOrderEdit-del-btn">删除</a-button>
-              </template>
-            </a-table>
-          </div>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="bulkWarehousingOrderEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              已选产品
+              <a-button size="small" class="import-btn" id="bulkWarehousingOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+            </template>
+            <!-- 已选产品 -->
+            <div>
+              <!-- 总计 -->
+              <a-alert type="info" showIcon style="margin-bottom:15px">
+                <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+              </a-alert>
+              <!-- 列表 -->
+              <a-table
+                class="sTable"
+                ref="chooseTable"
+                size="small"
+                :rowKey="(record) => record.id"
+                :columns="chooseColumns"
+                :dataSource="chooseLoadData"
+                :scroll="{ x: 1700, y: 300 }"
+                :pagination="choosePaginationProps"
+                @change="onChooseTableChange"
+                bordered>
+                <!-- 成本价 -->
+                <template slot="putCost" slot-scope="text, record">
+                  <a-input-number
+                    id="bulkWarehousingOrderEdit-choose-putCost"
+                    v-model="record.putCost"
+                    :precision="2"
+                    :min="1"
+                    :max="999999"
+                    placeholder="请输入"
+                    @blur="e => putCostBlur(e.target.value, record)"
+                    style="width: 100%;" />
+                </template>
+                <!-- 数量 -->
+                <template slot="putQty" slot-scope="text, record">
+                  <a-input-number
+                    id="bulkWarehousingOrderEdit-choose-putQty"
+                    v-model="record.putQty"
+                    :precision="0"
+                    :min="1"
+                    :max="999999"
+                    placeholder="请输入"
+                    @blur="e => putQtyBlur(e.target.value, record)"
+                    style="width: 100%;" />
+                </template>
+                <!-- 仓库仓位 -->
+                <template slot="warehouse" slot-scope="text, record, index">
+                  <a-cascader
+                    @change="e => changeWarehouseCascade(e, record, index, 'sparePartsPurDetail')"
+                    v-model="record.warehouseCascade"
+                    expand-trigger="hover"
+                    :allowClear="false"
+                    :options="warehouseCascadeData"
+                    :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                    id="bulkWarehousingOrderEdit-choose-warehouseCascade"
+                    placeholder="请选择仓库仓位"
+                    style="width: 100%;" />
+                </template>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record">
+                  <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkWarehousingOrderEdit-del-btn">删除</a-button>
+                </template>
+              </a-table>
+            </div>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="bulkWarehousingOrderEdit-submit"
+            size="large"
+            class="button-primary"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 选择基本信息弹框 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
     <!-- 打印 -->
@@ -246,6 +248,7 @@ export default {
   components: { STable, VSelect, basicInfoModal },
   data () {
     return {
+      spinning: false,
       queryParam: {
         queryWord: '',
         productBrandSn: undefined,
@@ -334,7 +337,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       sparePartsPurDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {
@@ -449,22 +454,30 @@ export default {
           return
         }
       }
+      this.spinning = true
       sparePartsPurDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.getChooseDealerProductList()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
     //  提交
     handleSubmit () {
       const _this = this
+      _this.spinning = true
       sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
             _this.handleBack()
+            _this.spinning = false
           }, 1000)
+        } else {
+          _this.spinning = false
         }
       })
     },

+ 123 - 116
src/views/customerManagement/customerInfo/edit.vue

@@ -6,122 +6,124 @@
         <a id="customerManagementEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
     </a-page-header>
-    <a-card size="small" :bordered="false" class="customerManagementEdit-table-page-wrapper">
-      <a-form-model
-        id="customerManagementEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="客户名称" prop="customerName">
-              <a-input
-                id="customerManagementEdit-customerName"
-                :maxLength="30"
-                v-model.trim="form.customerName"
-                @change="filterEmpty"
-                placeholder="请输入客户名称(最多30个字符)"
-                allowClear />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="联系电话" prop="contactTel">
-              <a-input id="customerManagementEdit-contactTel" :maxLength="11" v-model.trim="form.contactTel" placeholder="请输入联系电话(最多11个字符)" allowClear />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="联系人" prop="contactName">
-              <a-input id="customerManagementEdit-contactName" :maxLength="30" v-model.trim="form.contactName" placeholder="请输入联系人(最多30个字符)" allowClear />
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="15">
-          <a-col :span="16">
-            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
-              <a-row :gutter="15">
-                <!-- 客户地址 -->
-                <a-col span="8">
-                  <a-form-model-item prop="provinceSn">
-                    <a-select id="customerManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-model-item>
-                </a-col>
-                <a-col span="8">
-                  <a-form-model-item prop="citySn">
-                    <a-select id="customerManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-model-item>
-                </a-col>
-                <a-col span="8">
-                  <a-form-model-item prop="countySn">
-                    <a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                      <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-model-item>
-                </a-col>
-              </a-row>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="" prop="customerAddr">
-              <a-input id="customerManagementEdit-customerAddr" :maxLength="60" v-model.trim="form.customerAddr" placeholder="请输入详细地址(最多60个字符)" allowClear />
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="客户传真" prop="fax">
-              <a-input id="customerManagementEdit-fax" :maxLength="30" v-model.trim="form.fax" placeholder="请输入客户传真(最多30个字符)" allowClear />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="配送方式" prop="dispatchType">
-              <v-select
-                code="DISPATCH_TYPE"
-                id="customerManagementEdit-dispatchType"
-                v-model="form.dispatchType"
-                allowClear
-                placeholder="请选择配送方式"
-              ></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="是否卫星仓客户" prop="satelliteFlag">
-              <span style="padding-left: 11px;">{{ form.satelliteFlag == 1 ? '是' : '否' }}</span>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="价格类型" ref="priceType" prop="priceType">
-              <v-select code="PRICE_TYPE" id="customerManagementEdit-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型" ></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="收款方式" prop="settleStyleSn">
-              <a-select id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式">
-                <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="客户类型" prop="customerTypeSn">
-              <a-select id="customerManagementEdit-customerTypeSn" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
-                <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-          <a-button type="primary" @click="handleSubmit" size="large" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
-        </a-form-model-item>
-      </a-form-model>
-    </a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card size="small" :bordered="false" class="customerManagementEdit-table-page-wrapper">
+        <a-form-model
+          id="customerManagementEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="客户名称" prop="customerName">
+                <a-input
+                  id="customerManagementEdit-customerName"
+                  :maxLength="30"
+                  v-model.trim="form.customerName"
+                  @change="filterEmpty"
+                  placeholder="请输入客户名称(最多30个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="联系电话" prop="contactTel">
+                <a-input id="customerManagementEdit-contactTel" :maxLength="11" v-model.trim="form.contactTel" placeholder="请输入联系电话(最多11个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="联系人" prop="contactName">
+                <a-input id="customerManagementEdit-contactName" :maxLength="30" v-model.trim="form.contactName" placeholder="请输入联系人(最多30个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="16">
+              <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+                <a-row :gutter="15">
+                  <!-- 客户地址 -->
+                  <a-col span="8">
+                    <a-form-model-item prop="provinceSn">
+                      <a-select id="customerManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
+                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="8">
+                    <a-form-model-item prop="citySn">
+                      <a-select id="customerManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="8">
+                    <a-form-model-item prop="countySn">
+                      <a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="" prop="customerAddr">
+                <a-input id="customerManagementEdit-customerAddr" :maxLength="60" v-model.trim="form.customerAddr" placeholder="请输入详细地址(最多60个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="客户传真" prop="fax">
+                <a-input id="customerManagementEdit-fax" :maxLength="30" v-model.trim="form.fax" placeholder="请输入客户传真(最多30个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="配送方式" prop="dispatchType">
+                <v-select
+                  code="DISPATCH_TYPE"
+                  id="customerManagementEdit-dispatchType"
+                  v-model="form.dispatchType"
+                  allowClear
+                  placeholder="请选择配送方式"
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="是否卫星仓客户" prop="satelliteFlag">
+                <span style="padding-left: 11px;">{{ form.satelliteFlag == 1 ? '是' : '否' }}</span>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="价格类型" ref="priceType" prop="priceType">
+                <v-select code="PRICE_TYPE" id="customerManagementEdit-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型" ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="收款方式" prop="settleStyleSn">
+                <a-select id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式">
+                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="客户类型" prop="customerTypeSn">
+                <a-select id="customerManagementEdit-customerTypeSn" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
+                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+            <a-button type="primary" @click="handleSubmit" size="large" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
+          </a-form-model-item>
+        </a-form-model>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -141,6 +143,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       formItemLayout: {
         labelCol: { span: 9 },
         wrapperCol: { span: 15 }
@@ -229,6 +232,7 @@ export default {
         if (valid) {
           const form = _this.form
           form.id = this.$route.params.id && this.model == 'page' ? this.$route.params.id : null
+          _this.spinning = true
           custSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -239,6 +243,9 @@ export default {
               } else {
                 _this.$emit('ok', res.data)
               }
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 132 - 125
src/views/financialManagement/companyReceivablePayable/collectionPayment.vue

@@ -7,132 +7,134 @@
         <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
       </template>
     </a-page-header>
-    <!-- 已选单据 -->
-    <a-card size="small" :bordered="false" class="collectionPayment-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            已选单据
-            <a-button type="primary" size="small" class="button-error" id="collectionPayment-circle-btn" @click.stop="handleChoose">选择单据</a-button>
-          </template>
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">共 <strong>{{ chooseLoadData.length }}</strong>条明细 ,金额合计¥<strong>{{ totalAmount }}</strong> ,余额合计¥<strong>{{ totalBalance }}</strong> ,本次结算金额合计¥<strong>{{ currentTotalBalance }}</strong></div>
-          </a-alert>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="chooseTable"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :dataSource="chooseLoadData"
-            :scroll="{ x: 1040, y: 300 }"
-            :pagination="false"
-            bordered>
-            <!-- 序号 -->
-            <template slot="no" slot-scope="text, record, index">
-              {{ index+1 }}
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 已选单据 -->
+      <a-card size="small" :bordered="false" class="collectionPayment-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              已选单据
+              <a-button type="primary" size="small" class="button-error" id="collectionPayment-circle-btn" @click.stop="handleChoose">选择单据</a-button>
             </template>
-            <!-- 本次结算金额 -->
-            <template slot="settleAmount" slot-scope="text, record">
-              <a-input-number
-                id="collectionPayment-settleAmount"
-                v-model="record.settleAmount"
-                :precision="2"
-                :min="record.unsettleAmount<0 ? record.unsettleAmount : 0.01"
-                :max="record.unsettleAmount<0 ? -0.01 : record.unsettleAmount"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="collectionPayment-del-btn">移除</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="collectionPayment-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="收付款信息">
-          <a-form-model
-            id="collectionPayment-form"
-            ref="ruleForm"
-            :model="form"
-            :rules="rules"
-            :label-col="formItemLayout.labelCol"
-            :wrapper-col="formItemLayout.wrapperCol">
-            <a-row :gutter="20">
-              <a-col span="12">
-                <a-form-model-item prop="amountSettled">
-                  <template slot="label">
-                    应结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
-                  </template>
-                  <a-input-number
-                    id="collectionPayment-amountSettled"
-                    v-model="amountSettled"
-                    disabled
-                    :precision="2"
-                    placeholder=""
-                    style="width: 100%;" />
-                </a-form-model-item>
-              </a-col>
-              <a-col span="12">
-                <a-form-model-item label="折让金额" prop="discountAmount">
-                  <a-input-number
-                    id="collectionPayment-discountAmount"
-                    v-model="form.discountAmount"
-                    :precision="2"
-                    :min="0"
-                    :max="amountSettled"
-                    placeholder="请输入"
-                    style="width: 100%;"
-                    allowClear />
-                </a-form-model-item>
-              </a-col>
-              <a-col span="12">
-                <a-form-model-item prop="actualSettlementAmount">
-                  <template slot="label">
-                    实结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
-                  </template>
-                  <a-input-number
-                    id="collectionPayment-actualSettlementAmount"
-                    v-model="actualSettlementAmount"
-                    disabled
-                    :precision="2"
-                    placeholder=""
-                    style="width: 100%;" />
-                </a-form-model-item>
-              </a-col>
-              <a-col span="12">
-                <a-form-model-item label="结算方式" prop="settleStyleSn">
-                  <a-select id="collectionPayment-settleStyleSn" v-model="form.settleStyleSn" placeholder="请选择结算方式" allowClear>
-                    <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col span="24">
-                <a-form-model-item label="备注" prop="remark" :label-col="{ span: 3 }" :wrapper-col="{ span: 20 }">
-                  <a-textarea id="collectionPayment-remark" :maxLength="100" v-model="form.remark" placeholder="请输入备注(最多100个字符)" allowClear />
-                </a-form-model-item>
-              </a-col>
-            </a-row>
-          </a-form-model>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="collectionPayment-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">共 <strong>{{ chooseLoadData.length }}</strong>条明细 ,金额合计¥<strong>{{ totalAmount }}</strong> ,余额合计¥<strong>{{ totalBalance }}</strong> ,本次结算金额合计¥<strong>{{ currentTotalBalance }}</strong></div>
+            </a-alert>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :dataSource="chooseLoadData"
+              :scroll="{ x: 1040, y: 300 }"
+              :pagination="false"
+              bordered>
+              <!-- 序号 -->
+              <template slot="no" slot-scope="text, record, index">
+                {{ index+1 }}
+              </template>
+              <!-- 本次结算金额 -->
+              <template slot="settleAmount" slot-scope="text, record">
+                <a-input-number
+                  id="collectionPayment-settleAmount"
+                  v-model="record.settleAmount"
+                  :precision="2"
+                  :min="record.unsettleAmount<0 ? record.unsettleAmount : 0.01"
+                  :max="record.unsettleAmount<0 ? -0.01 : record.unsettleAmount"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="collectionPayment-del-btn">移除</a-button>
+              </template>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="collectionPayment-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="收付款信息">
+            <a-form-model
+              id="collectionPayment-form"
+              ref="ruleForm"
+              :model="form"
+              :rules="rules"
+              :label-col="formItemLayout.labelCol"
+              :wrapper-col="formItemLayout.wrapperCol">
+              <a-row :gutter="20">
+                <a-col span="12">
+                  <a-form-model-item prop="amountSettled">
+                    <template slot="label">
+                      应结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
+                    </template>
+                    <a-input-number
+                      id="collectionPayment-amountSettled"
+                      v-model="amountSettled"
+                      disabled
+                      :precision="2"
+                      placeholder=""
+                      style="width: 100%;" />
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="12">
+                  <a-form-model-item label="折让金额" prop="discountAmount">
+                    <a-input-number
+                      id="collectionPayment-discountAmount"
+                      v-model="form.discountAmount"
+                      :precision="2"
+                      :min="0"
+                      :max="amountSettled"
+                      placeholder="请输入"
+                      style="width: 100%;"
+                      allowClear />
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="12">
+                  <a-form-model-item prop="actualSettlementAmount">
+                    <template slot="label">
+                      实结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
+                    </template>
+                    <a-input-number
+                      id="collectionPayment-actualSettlementAmount"
+                      v-model="actualSettlementAmount"
+                      disabled
+                      :precision="2"
+                      placeholder=""
+                      style="width: 100%;" />
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="12">
+                  <a-form-model-item label="结算方式" prop="settleStyleSn">
+                    <a-select id="collectionPayment-settleStyleSn" v-model="form.settleStyleSn" placeholder="请选择结算方式" allowClear>
+                      <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="24">
+                  <a-form-model-item label="备注" prop="remark" :label-col="{ span: 3 }" :wrapper-col="{ span: 20 }">
+                    <a-textarea id="collectionPayment-remark" :maxLength="100" v-model="form.remark" placeholder="请输入备注(最多100个字符)" allowClear />
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+            </a-form-model>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="collectionPayment-submit"
+            size="large"
+            class="button-primary"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <choose-bill-modal :openModal="openModal" :nowChoose="chooseLoadData" :settleClientSn="$route.params.sn" @ok="handleOk" @close="handleClose" />
   </div>
 </template>
@@ -146,6 +148,7 @@ export default {
   components: { STable, VSelect, chooseBillModal },
   data () {
     return {
+      spinning: false,
       chooseQueryParam: {
         productCode: '',
         productName: ''
@@ -258,10 +261,14 @@ export default {
               prFlag: item.prFlag
             })
           })
+          _this.spinning = true
           settleUnitSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.handleBack()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 30 - 23
src/views/financialManagement/expenseManagement/edit.vue

@@ -9,8 +9,9 @@
         </a>
       </template>
     </a-page-header>
-    <a-card size="small" :bordered="false" class="expenseManagementEdit-table-page-wrapper">
-      <a-form-model
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card size="small" :bordered="false" class="expenseManagementEdit-table-page-wrapper">
+        <a-form-model
         id="expenseManagementEdit-form"
         ref="ruleForm"
         :model="form"
@@ -19,34 +20,34 @@
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="费用类型" prop="costType">
           <a-cascader
-            @change="changeCostType"
-            v-model="form.costType"
-            expand-trigger="hover"
-            :options="costTypeList"
-            :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
-            id="productInfoList-costType"
-            placeholder="请选择费用类型"
-            allowClear
+          @change="changeCostType"
+          v-model="form.costType"
+          expand-trigger="hover"
+          :options="costTypeList"
+          :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
+          id="productInfoList-costType"
+          placeholder="请选择费用类型"
+          allowClear
           />
         </a-form-model-item>
         <a-form-model-item label="费用金额" prop="settleAmount">
           <a-input-number
-            id="expenseManagementEdit-name"
-            v-model="form.settleAmount"
-            :precision="2"
-            :min="0"
-            :max="999999"
-            placeholder="请输入费用金额(0~999999)"
-            allowClear
-            style="width: 90%;"
+          id="expenseManagementEdit-name"
+          v-model="form.settleAmount"
+          :precision="2"
+          :min="0"
+          :max="999999"
+          placeholder="请输入费用金额(0~999999)"
+          allowClear
+          style="width: 90%;"
           />
         </a-form-model-item>
         <a-form-model-item label="结算方式" prop="settleStyleSn">
           <a-select placeholder="请选择结算方式" v-model="form.settleStyleSn" @change="settleStyleChange">
-            <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-              {{ item.name }}
-            </a-select-option>
+          <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+            {{ item.name }}
+          </a-select-option>
           </a-select>
         </a-form-model-item>
         <a-form-model-item label="关联单号" prop="bizNo">
@@ -58,8 +59,9 @@
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
           <a-button type="primary" size="large" @click="handleSubmit" id="expenseManagementEdit-btn-save" style="margin: 0 30px;">保存</a-button>
         </a-form-model-item>
-      </a-form-model>
-    </a-card>
+        </a-form-model>
+      </a-card>
+		</a-spin>
   </div>
 </template>
 
@@ -73,6 +75,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
@@ -165,12 +168,16 @@ export default {
             form.id = this.$route.params.id
           }
           delete form.costType
+          _this.spinning = true
           settleExpenseSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
                 _this.handleBack()
+                _this.spinning = false
               }, 1000)
+            }else{
+              _this.spinning = false
             }
           })
         } else {

+ 59 - 54
src/views/financialManagement/warehousingAudit/detail.vue

@@ -1,59 +1,61 @@
 <template>
   <div class="warehousingAuditDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="warehousingAuditDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="warehousingAuditDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.receivingBillNo) || '--' }}</p>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="warehousingAuditDetail-preview-btn" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="warehousingAuditDetail-print-btn" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3" v-if="basicInfoData">
-            <a-descriptions-item label="供应商">{{ basicInfoData&&basicInfoData.dealerName ? basicInfoData.dealerName : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="入库时间">{{ basicInfoData&&basicInfoData.stockPutTime ? basicInfoData.stockPutTime : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="采购单号">{{ basicInfoData&&basicInfoData.purchaseBillNo ? basicInfoData.purchaseBillNo : '--' }}</a-descriptions-item>
-          </a-descriptions>
-          <a-descriptions :column="3" bordered v-if="basicInfoData">
-            <a-descriptions-item label="采购总款数">{{ (basicInfoData.totalCategory&&basicInfoData.totalCategory!=0) ? basicInfoData.totalCategory : 0 }}</a-descriptions-item>
-            <a-descriptions-item label="采购总数量">{{ (basicInfoData.totalQty&&basicInfoData.totalQty!=0) ? basicInfoData.totalQty : 0 }}</a-descriptions-item>
-            <a-descriptions-item label="采购总成本">¥{{ (basicInfoData.totalAmount&&basicInfoData.totalAmount!=0) ? basicInfoData.totalAmount : 0 }}</a-descriptions-item>
-            <a-descriptions-item label="入库总款数">{{ (basicInfoData.totalPutCategory&&basicInfoData.totalPutCategory!=0) ? basicInfoData.totalPutCategory : 0 }}</a-descriptions-item>
-            <a-descriptions-item label="入库总数量">{{ (basicInfoData.totalPutQty&&basicInfoData.totalPutQty!=0) ? basicInfoData.totalPutQty : 0 }}</a-descriptions-item>
-            <a-descriptions-item label="入库总成本">¥{{ (basicInfoData.totalPutAmount&&basicInfoData.totalPutAmount!=0) ? basicInfoData.totalPutAmount : 0 }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 入库明细 -->
-    <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="入库明细">
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1520 }"
-            bordered>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
+	  <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="warehousingAuditDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="warehousingAuditDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.receivingBillNo) || '--' }}</p>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="warehousingAuditDetail-preview-btn" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="warehousingAuditDetail-print-btn" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3" v-if="basicInfoData">
+              <a-descriptions-item label="供应商">{{ basicInfoData&&basicInfoData.dealerName ? basicInfoData.dealerName : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="入库时间">{{ basicInfoData&&basicInfoData.stockPutTime ? basicInfoData.stockPutTime : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="采购单号">{{ basicInfoData&&basicInfoData.purchaseBillNo ? basicInfoData.purchaseBillNo : '--' }}</a-descriptions-item>
+            </a-descriptions>
+            <a-descriptions :column="3" bordered v-if="basicInfoData">
+              <a-descriptions-item label="采购总款数">{{ (basicInfoData.totalCategory&&basicInfoData.totalCategory!=0) ? basicInfoData.totalCategory : 0 }}</a-descriptions-item>
+              <a-descriptions-item label="采购总数量">{{ (basicInfoData.totalQty&&basicInfoData.totalQty!=0) ? basicInfoData.totalQty : 0 }}</a-descriptions-item>
+              <a-descriptions-item label="采购总成本">¥{{ (basicInfoData.totalAmount&&basicInfoData.totalAmount!=0) ? basicInfoData.totalAmount : 0 }}</a-descriptions-item>
+              <a-descriptions-item label="入库总款数">{{ (basicInfoData.totalPutCategory&&basicInfoData.totalPutCategory!=0) ? basicInfoData.totalPutCategory : 0 }}</a-descriptions-item>
+              <a-descriptions-item label="入库总数量">{{ (basicInfoData.totalPutQty&&basicInfoData.totalPutQty!=0) ? basicInfoData.totalPutQty : 0 }}</a-descriptions-item>
+              <a-descriptions-item label="入库总成本">¥{{ (basicInfoData.totalPutAmount&&basicInfoData.totalPutAmount!=0) ? basicInfoData.totalPutAmount : 0 }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 入库明细 -->
+      <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="入库明细">
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :scroll="{ x: 1520 }"
+              bordered>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -66,6 +68,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -105,7 +108,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       receivingDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 62 - 47
src/views/inventoryManagement/satelliteWarehouseInventory/addModal.vue

@@ -8,54 +8,56 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="960">
-    <!-- 补货清单 -->
-    <div>
-      <h4 style="font-weight: bold;font-size: 16px;">{{ (nowData&&nowData.customerName) || '--' }}</h4>
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1260 }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 补货数量 -->
-        <template slot="productQty" slot-scope="text, record">
-          <a-button
-            type="primary"
-            @click="handleNumSubtract(record)"
-            shape="circle"
-            icon="minus"
-            size="small"
-            id="satelliteWarehouseInventoryList-num-add-btn"></a-button>
-          <a-input-number
-            v-model="record.productQty"
-            :min="0"
-            :max="999999"
-            :precision="0"
-            :step="1"
-            @change="e => onChange(e, record)"
-            class="stepper" />
-          <a-button
-            type="primary"
-            @click="handleNumAdd(record)"
-            shape="circle"
-            icon="plus"
-            size="small"
-            id="satelliteWarehouseInventoryList-num-subtract-btn"></a-button>
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button type="link" @click="handleRemove(record)" id="satelliteWarehouseInventoryList-remove-btn">移除</a-button>
-        </template>
-      </s-table>
-      <div class="btn-cont">
-        <a-button type="primary" id="satellite-warehouse-inventory-add-modal-add" @click="handleAdd">创建销售单</a-button>
-        <a-button id="satellite-warehouse-inventory-add-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 补货清单 -->
+      <div>
+        <h4 style="font-weight: bold;font-size: 16px;">{{ (nowData&&nowData.customerName) || '--' }}</h4>
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1260 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 补货数量 -->
+          <template slot="productQty" slot-scope="text, record">
+            <a-button
+              type="primary"
+              @click="handleNumSubtract(record)"
+              shape="circle"
+              icon="minus"
+              size="small"
+              id="satelliteWarehouseInventoryList-num-add-btn"></a-button>
+            <a-input-number
+              v-model="record.productQty"
+              :min="0"
+              :max="999999"
+              :precision="0"
+              :step="1"
+              @change="e => onChange(e, record)"
+              class="stepper" />
+            <a-button
+              type="primary"
+              @click="handleNumAdd(record)"
+              shape="circle"
+              icon="plus"
+              size="small"
+              id="satelliteWarehouseInventoryList-num-subtract-btn"></a-button>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button type="link" @click="handleRemove(record)" id="satelliteWarehouseInventoryList-remove-btn">移除</a-button>
+          </template>
+        </s-table>
+        <div class="btn-cont">
+          <a-button type="primary" id="satellite-warehouse-inventory-add-modal-add" @click="handleAdd">创建销售单</a-button>
+          <a-button id="satellite-warehouse-inventory-add-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -77,6 +79,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -128,9 +131,13 @@ export default {
     },
     // 创建销售单
     createSalesFun () {
+      this.spinning = true
       satelliteWHSupplyAddSales({ sn: this.nowData.customerSn }).then(res => {
         if (res.status == 200) {
           this.$router.push({ name: 'salesEdit', params: { id: res.data.id, sn: res.data.salesBillSn, priceType: res.data.priceType } })
+          this.spinning = false
+        }else{
+          this.spinning = false
         }
       })
     },
@@ -144,9 +151,13 @@ export default {
     },
     //  删除配件信息
     handleRemove (row) {
+      this.spinning = true
       satelliteWHSupplyDel({ sn: row.satelliteWarehouseSupplySn }).then(res => {
         if (res.status == 200) {
           this.$refs.table.refresh(true)
+          this.spinning = false
+        }else{
+          this.spinning = false
         }
       })
     },
@@ -160,9 +171,13 @@ export default {
         productSn: row.productSn,
         productQty: val
       }
+      this.spinning = true
       satelliteWHSupplyUpdate(params).then(res => {
         if (res.status == 200) {
           this.$refs.table.refresh(true)
+          this.spinning = false
+        }else{
+          this.spinning = false
         }
       })
     }

+ 40 - 35
src/views/inventoryManagement/warehouse/editModal.vue

@@ -8,41 +8,43 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="warehouseEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="仓库名称" prop="name">
-          <a-input
-            id="warehouseEdit-name"
-            :maxLength="30"
-            v-model.trim="form.name"
-            @change="filterEmpty"
-            placeholder="请输入仓库名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="排序" prop="sort">
-          <a-input-number
-            v-model="form.sort"
-            :min="0"
-            :max="999999"
-            :precision="0"
-            :step="1"
-            placeholder="请输入排序(0~999999)"
-            style="width: 100%;" />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="warehouse-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="warehouse-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="warehouseEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="仓库名称" prop="name">
+            <a-input
+              id="warehouseEdit-name"
+              :maxLength="30"
+              v-model.trim="form.name"
+              @change="filterEmpty"
+              placeholder="请输入仓库名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="排序" prop="sort">
+            <a-input-number
+              v-model="form.sort"
+              :min="0"
+              :max="999999"
+              :precision="0"
+              :step="1"
+              placeholder="请输入排序(0~999999)"
+              style="width: 100%;" />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="warehouse-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="warehouse-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -73,6 +75,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -114,6 +117,7 @@ export default {
             name: this.form.name, //  仓库名称
             sort: this.form.sort //  排序
           }
+          _this.spinning = true
           warehouseSave(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -121,9 +125,10 @@ export default {
               setTimeout(function () {
                 _this.isShow = false
                 _this.$refs.ruleForm.resetFields()
+                _this.spinning = false
               }, 300)
             } else {
-
+              _this.spinning = false
             }
           })
         } else {

+ 44 - 39
src/views/inventoryManagement/warehouse/storingLocation/editModal.vue

@@ -8,45 +8,47 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="storingLocationEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="仓位名称" prop="name">
-          <a-input
-            id="storingLocationEdit-name"
-            :maxLength="30"
-            v-model="form.name"
-            placeholder="请输入仓位名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="所属仓库" prop="warehouseSn">
-          <a-select id="storingLocationEdit-warehouseSn" disabled placeholder="请选择所属仓库" allowClear v-model="form.warehouseSn">
-            <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item label="排序" prop="sort">
-          <a-input-number
-            v-model="form.sort"
-            :min="0"
-            :max="999999"
-            :precision="0"
-            :step="1"
-            placeholder="请输入排序(0~999999)"
-            style="width: 100%;" />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="storingLocation-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="storingLocation-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="storingLocationEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="仓位名称" prop="name">
+            <a-input
+              id="storingLocationEdit-name"
+              :maxLength="30"
+              v-model="form.name"
+              placeholder="请输入仓位名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="所属仓库" prop="warehouseSn">
+            <a-select id="storingLocationEdit-warehouseSn" disabled placeholder="请选择所属仓库" allowClear v-model="form.warehouseSn">
+              <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
+          <a-form-model-item label="排序" prop="sort">
+            <a-input-number
+              v-model="form.sort"
+              :min="0"
+              :max="999999"
+              :precision="0"
+              :step="1"
+              placeholder="请输入排序(0~999999)"
+              style="width: 100%;" />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="storingLocation-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="storingLocation-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -77,6 +79,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -128,6 +131,7 @@ export default {
             name: this.form.name, //  仓库名称
             sort: this.form.sort //  排序
           }
+          _this.spinning = true
           warehouseLocSave(params).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -135,9 +139,10 @@ export default {
               setTimeout(function () {
                 _this.isShow = false
                 _this.$refs.ruleForm.resetFields()
+                _this.spinning = false
               }, 300)
             } else {
-
+              _this.spinning = false
             }
           })
         } else {

+ 31 - 24
src/views/productManagement/productBrand/editModal.vue

@@ -8,31 +8,33 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="productBrandEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="产品品牌名称" prop="brandName">
-          <a-input
-            id="productBrandEdit-brandName"
-            :maxLength="30"
-            v-model.trim="form.brandName"
-            @change="filterEmpty"
-            placeholder="请输入产品品牌名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="productBrandEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="产品品牌名称" prop="brandName">
+            <a-input
+              id="productBrandEdit-brandName"
+              :maxLength="30"
+              v-model.trim="form.brandName"
+              @change="filterEmpty"
+              placeholder="请输入产品品牌名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -63,6 +65,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -98,11 +101,15 @@ export default {
             this.$message.error('品牌名称只能以汉字或字母开头')
             return false
           }
+          _this.spinning = true
           dealerProductBrandSave(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               _this.isShow = false
+              _this.spinning = false
+            }else{
+              _this.spinning = false
             }
           })
         } else {

+ 34 - 27
src/views/productManagement/productCategory/editModal.vue

@@ -8,34 +8,36 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="productCategoryEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="所属分类" v-if="parentType">
-          {{ parentType }}
-        </a-form-model-item>
-        <a-form-model-item label="产品分类名称" prop="productTypeName">
-          <a-input
-            v-model.trim="form.productTypeName"
-            @change="filterEmpty"
-            id="productCategoryEdit-name"
-            :maxLength="30"
-            allowClear
-            placeholder="请输入产品分类名称(最多30个字符)" />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="product-category-edit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="product-category-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="productCategoryEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="所属分类" v-if="parentType">
+            {{ parentType }}
+          </a-form-model-item>
+          <a-form-model-item label="产品分类名称" prop="productTypeName">
+            <a-input
+              v-model.trim="form.productTypeName"
+              @change="filterEmpty"
+              id="productCategoryEdit-name"
+              :maxLength="30"
+              allowClear
+              placeholder="请输入产品分类名称(最多30个字符)" />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="product-category-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="product-category-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -66,6 +68,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -98,11 +101,15 @@ export default {
           const formData = JSON.parse(JSON.stringify(_this.form))
           formData.id = _this.itemId ? _this.itemId : undefined
           formData.psn = _this.nowData && _this.nowData.psn ? _this.nowData.psn : undefined
+          _this.spinning = true
           dealerProductTypeSave(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 95 - 88
src/views/productManagement/productInfo/edit.vue

@@ -6,136 +6,138 @@
         <a id="productInfoEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
     </a-page-header>
-    <a-card size="small" :bordered="false" class="productInfoEdit-table-page-wrapper">
-      <a-form-model
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card size="small" :bordered="false" class="productInfoEdit-table-page-wrapper">
+        <a-form-model
         id="productInfoEdit-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
-      >
+        >
         <a-form-model-item label="产品名称" prop="name">
           <a-input
-            id="productInfoEdit-name"
-            :maxLength="100"
-            v-model.trim="form.name"
-            @change="filterEmpty"
-            placeholder="请输入产品名称(最多100个字符)"
-            allowClear />
+          id="productInfoEdit-name"
+          :maxLength="100"
+          v-model.trim="form.name"
+          @change="filterEmpty"
+          placeholder="请输入产品名称(最多100个字符)"
+          allowClear />
         </a-form-model-item>
         <a-form-model-item label="产品编码" prop="code">
           <a-input
-            id="productInfoEdit-code"
-            :maxLength="100"
-            :disabled="!!$route.params.id"
-            v-model="form.code"
-            placeholder="请输入产品编码(最多100个字符)"
-            allowClear />
+          id="productInfoEdit-code"
+          :maxLength="100"
+          :disabled="!!$route.params.id"
+          v-model="form.code"
+          placeholder="请输入产品编码(最多100个字符)"
+          allowClear />
         </a-form-model-item>
         <a-form-model-item label="原厂编码" prop="origCode">
           <a-input
-            id="productInfoEdit-origCode"
-            :maxLength="200"
-            :disabled="!!$route.params.id"
-            v-model="form.origCode"
-            placeholder="请输入原厂编码(最多200个字符,多个编码用逗号隔开)"
-            allowClear />
+          id="productInfoEdit-origCode"
+          :maxLength="200"
+          :disabled="!!$route.params.id"
+          v-model="form.origCode"
+          placeholder="请输入原厂编码(最多200个字符,多个编码用逗号隔开)"
+          allowClear />
         </a-form-model-item>
         <a-form-model-item label="基本单位" prop="unit">
           <a-input-group compact>
-            <a-input style="width: 80%" v-model="form.unit" id="productInfoEdit-unit-input" placeholder="请输入基本单位" allowClear/>
-            <v-select style="width: 20%" code="UNIT" @change="unitChange" id="productInfoEdit-unit" placeholder="快速选择单位"></v-select>
+          <a-input style="width: 80%" v-model="form.unit" id="productInfoEdit-unit-input" placeholder="请输入基本单位" allowClear/>
+          <v-select style="width: 20%" code="UNIT" @change="unitChange" id="productInfoEdit-unit" placeholder="快速选择单位"></v-select>
           </a-input-group>
         </a-form-model-item>
         <a-form-model-item label="产品品牌" prop="productBrandSn">
           <!-- <a-select
-            id="productInfoEdit-productBrand"
-            placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
-            :disabled="!!$route.params.id"
-            allowClear
-            v-model="form.productBrandSn"
-            :showSearch="true"
-            option-filter-prop="children"
-            :filter-option="filterOption"
-            style="width: 90%;">
-            <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
+          id="productInfoEdit-productBrand"
+          placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
+          :disabled="!!$route.params.id"
+          allowClear
+          v-model="form.productBrandSn"
+          :showSearch="true"
+          option-filter-prop="children"
+          :filter-option="filterOption"
+          style="width: 90%;">
+          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
           </a-select> -->
           <a-select
-            show-search
-            id="productInfoEdit-productBrand"
-            v-model="form.productBrandSn"
-            placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
-            :disabled="!!$route.params.id"
-            :filter-option="false"
-            :not-found-content="fetching ? undefined : null"
-            @search="fetchUser"
-            @change="handleChange"
-            style="width: 90%;"
+          show-search
+          id="productInfoEdit-productBrand"
+          v-model="form.productBrandSn"
+          placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
+          :disabled="!!$route.params.id"
+          :filter-option="false"
+          :not-found-content="fetching ? undefined : null"
+          @search="fetchUser"
+          @change="handleChange"
+          style="width: 90%;"
           >
-            <a-spin v-if="fetching" slot="notFoundContent" size="small" />
-            <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
+          <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+          <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
           </a-select>
           <a-button
-            @click="openModal=true"
-            :disabled="!!$route.params.id"
-            icon="plus"
-            size="small"
-            id="productInfoEdit-add-btn"
-            style="margin-left: 5px;"></a-button>
+          @click="openModal=true"
+          :disabled="!!$route.params.id"
+          icon="plus"
+          size="small"
+          id="productInfoEdit-add-btn"
+          style="margin-left: 5px;"></a-button>
         </a-form-model-item>
         <a-form-model-item label="产品分类" prop="productType">
           <a-cascader
-            :disabled="!!$route.params.id"
-            @change="changeProductType"
-            expand-trigger="hover"
-            :options="productTypeList"
-            :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-            id="productInfoEdit-productType"
-            placeholder="请选择产品分类"
-            allowClear
-            v-model="form.productType" />
+          :disabled="!!$route.params.id"
+          @change="changeProductType"
+          expand-trigger="hover"
+          :options="productTypeList"
+          :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+          id="productInfoEdit-productType"
+          placeholder="请选择产品分类"
+          allowClear
+          v-model="form.productType" />
         </a-form-model-item>
         <a-form-model-item label="经销批发价" prop="specialPrice">
           <a-input-number
-            id="productInfoEdit-specialPrice"
-            v-model="form.specialPrice"
-            :min="1"
-            :max="999999"
-            :precision="2"
-            style="width: 90%;margin-right: 5px;"
-            placeholder="请输入经销批发价(1~999999)"
-            allowClear /><span>元</span>
+          id="productInfoEdit-specialPrice"
+          v-model="form.specialPrice"
+          :min="1"
+          :max="999999"
+          :precision="2"
+          style="width: 90%;margin-right: 5px;"
+          placeholder="请输入经销批发价(1~999999)"
+          allowClear /><span>元</span>
         </a-form-model-item>
         <a-form-model-item label="终端价" prop="terminalPrice">
           <a-input-number
-            id="productInfoEdit-terminalPrice"
-            v-model="form.terminalPrice"
-            :min="1"
-            :max="999999"
-            :precision="2"
-            style="width: 90%;margin-right: 5px;"
-            placeholder="请输入终端价(1~999999)"
-            allowClear /><span>元</span>
+          id="productInfoEdit-terminalPrice"
+          v-model="form.terminalPrice"
+          :min="1"
+          :max="999999"
+          :precision="2"
+          style="width: 90%;margin-right: 5px;"
+          placeholder="请输入终端价(1~999999)"
+          allowClear /><span>元</span>
         </a-form-model-item>
         <a-form-model-item label="车主价" prop="carOwnersPrice">
           <a-input-number
-            id="productInfoEdit-carOwnersPrice"
-            v-model="form.carOwnersPrice"
-            :min="1"
-            :max="999999"
-            :precision="2"
-            style="width: 90%;margin-right: 5px;"
-            placeholder="请输入车主价(1~999999)"
-            allowClear /><span>元</span>
+          id="productInfoEdit-carOwnersPrice"
+          v-model="form.carOwnersPrice"
+          :min="1"
+          :max="999999"
+          :precision="2"
+          style="width: 90%;margin-right: 5px;"
+          placeholder="请输入车主价(1~999999)"
+          allowClear /><span>元</span>
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
           <a-button type="primary" @click="handleSubmit" size="large" id="productInfoEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
         </a-form-model-item>
-      </a-form-model>
-      <!-- 新增/编辑产品品牌 -->
-      <product-brand-edit-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
-    </a-card>
+        </a-form-model>
+        <!-- 新增/编辑产品品牌 -->
+        <product-brand-edit-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -150,6 +152,7 @@ export default {
   components: { STable, VSelect, productBrandEditModal },
   data () {
     return {
+      spinning: false,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
@@ -244,12 +247,16 @@ export default {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.id = _this.$route.params.id ? _this.$route.params.id : undefined
           delete form.productType
+          _this.spinning = true
           dealerProductSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
                 _this.$router.push({ path: '/productManagement/productInfo/list' })
+                _this.spinning = false
               }, 1000)
+            }else{
+              _this.spinning = false
             }
           })
         } else {

+ 41 - 34
src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue

@@ -8,40 +8,42 @@
     v-model="isShow"
     @cancel="cancel"
     :width="800">
-    <a-form-model
-      id="purchaseOrder-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol" >
-      <a-form-model-item label="供应商" prop="purchaseTragetType">
-        <a-radio-group
-          name="radioGroup"
-          v-model="form.purchaseTragetType"
-          @change="tragetTypeChange"
-          id="purchaseOrder-basicInfo-purchaseTragetType" >
-          <a-radio value="HQ" class="radio-s">箭冠营销中心</a-radio>
-          <a-radio value="HU" class="radio-s" v-if="purchaseTragetType&&purchaseTragetType.dealerSn">{{ purchaseTragetType.dealerName }}</a-radio>
-        </a-radio-group>
-      </a-form-model-item>
-      <a-form-model-item label="支付方式" prop="settleStyleSn">
-        <a-select placeholder="请选择支付方式" v-model="form.settleStyleSn">
-          <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-            {{ item.name }}
-          </a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item>
-        <span slot="label"><i style="color: red;">*</i> 收货地址</span>
-        {{ chooseAddr }}
-        <a-button type="link" id="purchaseOrder-basicInfo-chooseAddr" @click="handleChoose">{{ addressVal }} >></a-button>
-      </a-form-model-item>
-      <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
-        <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
-      </a-form-model-item>
-    </a-form-model>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="purchaseOrder-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="供应商" prop="purchaseTragetType">
+          <a-radio-group
+            name="radioGroup"
+            v-model="form.purchaseTragetType"
+            @change="tragetTypeChange"
+            id="purchaseOrder-basicInfo-purchaseTragetType" >
+            <a-radio value="HQ" class="radio-s">箭冠营销中心</a-radio>
+            <a-radio value="HU" class="radio-s" v-if="purchaseTragetType&&purchaseTragetType.dealerSn">{{ purchaseTragetType.dealerName }}</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="支付方式" prop="settleStyleSn">
+          <a-select placeholder="请选择支付方式" v-model="form.settleStyleSn">
+            <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+              {{ item.name }}
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item>
+          <span slot="label"><i style="color: red;">*</i> 收货地址</span>
+          {{ chooseAddr }}
+          <a-button type="link" id="purchaseOrder-basicInfo-chooseAddr" @click="handleChoose">{{ addressVal }} >></a-button>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
     <!-- 选择地址 -->
     <choose-address-modal :openModal="openAddrModal" @ok="handleOk" @close="openAddrModal=false" />
   </a-modal>
@@ -64,6 +66,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       confirmLoading: false,
       isShow: this.openModal, //  是否打开弹框
       settleStyleList: [], // 支付方式
@@ -133,10 +136,14 @@ export default {
             _this.$message.info('请选择收货地址')
             return false
           }
+          _this.spinning = true
           purchaseSave(_this.form).then(res => {
             if (res.status == 200) {
               _this.isShow = false
               _this.$emit('ok', res.data)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
             _this.$message.info(res.message)
           })

+ 133 - 128
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -1,133 +1,135 @@
 <template>
   <div class="purchaseOrderDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="purchaseOrderDetail-cont" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="purchaseOrderDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span class="billno">单号:{{ detail&&detail.purchaseBillNo }}</span>
-        <a-tag color="blue">{{ detail&&detail.billStatusDictValue }}</a-tag>
-        <a-tag color="orange">{{ detail&&detail.financialStatusDictValue }}</a-tag>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="purchaseOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="purchaseOrderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="供应商">{{ (detail&&detail.dealerName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyleEntity.name }}</a-descriptions-item>
-            <a-descriptions-item label="采购员工">{{ detail&&detail.operatorName }}</a-descriptions-item>
-            <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName }}<span v-if="detail&&detail.consigneeTel">({{ detail&&detail.consigneeTel }})</span></a-descriptions-item>
-            <a-descriptions-item label="收货地址">
-              {{ detail&&detail.shippingAddressProvinceName }}
-              {{ detail&&detail.shippingAddressCityName }}
-              {{ detail&&detail.shippingAddressCountyName }}
-              {{ detail&&detail.shippingAddress }}
-            </a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 产品详情 -->
-    <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="产品详情">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">
-              产品款数:<strong>{{ detail ? ((detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--') : '--' }}</strong>,
-              采购数量合计:<strong>{{ detail ? ((detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--') : '--' }}</strong>,
-              已收货数量:<strong>{{ detail ? ((detail.totalPutQty || detail.totalPutQty==0) ? detail.totalPutQty : '--') : '--' }}</strong>,
-              待收货数量:<strong>{{ detail ? ((detail.totalWaitPutQty || detail.totalWaitPutQty==0) ? detail.totalWaitPutQty : '--') : '--' }}</strong>,
-              取消数量:<strong>{{ detail ? ((detail.totalCancelQty || detail.totalCancelQty==0) ? detail.totalCancelQty : '--') : '--' }}</strong>,
-              采购金额合计:¥<strong>{{ detail ? ((detail.discountedAmount || detail.discountedAmount==0) ? detail.discountedAmount : '--') : '--' }}</strong>,
-              已收货金额:¥<strong>{{ detail ? ((detail.totalPutAmount || detail.totalPutAmount==0) ? detail.totalPutAmount : '--') : '--' }}</strong>,
-              待收货金额:¥<strong>{{ detail ? ((detail.totalWaitPutAmount || detail.totalWaitPutAmount==0) ? detail.totalWaitPutAmount : '--') : '--' }}</strong>,
-              取消金额:¥<strong>{{ detail ? ((detail.totalCancelAmount || detail.totalCancelAmount==0) ? detail.totalCancelAmount : '--') : '--' }}</strong>
-            </div>
-          </a-alert>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1480 }"
-            bordered>
-            <!-- 采购数量 -->
-            <template slot="origqty" slot-scope="text, record">
-              <div>{{ text }}</div>
-              <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
-            </template>
-            <!-- 缺货数量 -->
-            <template slot="outOfStockNum" slot-scope="text, record">
-              <span>{{ record.outOfStockNum }}</span>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 促销品详情 -->
-    <a-card size="small" v-if="false" :bordered="false" class="purchaseOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="促销品详情">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">产品款数 <strong>{{ detail&&detail.totalCategory }}</strong> ,
-              采购数量合计 <strong>{{ detail&&detail.totalQty }}</strong> ,
-              采购金额合计¥<strong>{{ detail&&detail.totalAmount }}</strong></div>
-          </a-alert>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table-1"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1060 }"
-            bordered>
-            <!-- 采购数量 -->
-            <template slot="origqty" slot-scope="text, record">
-              <div>{{ text }}</div>
-              <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
-            </template>
-            <!-- 缺货数量 -->
-            <template slot="outOfStockNum" slot-scope="text, record">
-              <span>{{ record.outOfStockNum }}</span>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 单据记录 -->
-    <a-card size="small" v-show="false" :bordered="false" class="purchaseOrderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="单据记录">
-          <a-timeline class="timeline-box">
-            <a-timeline-item>2021-02-01 15:22:38   王凯   审核通过</a-timeline-item>
-            <a-timeline-item>
-              <p>2021-02-01 15:22:38   王凯   审核通过</p>
-              <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
-              <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
-            </a-timeline-item>
-            <a-timeline-item>Technical testing 2015-09-01</a-timeline-item>
-            <a-timeline-item>Network problems being solved 2015-09-01</a-timeline-item>
-          </a-timeline>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="purchaseOrderDetail-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseOrderDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span class="billno">单号:{{ detail&&detail.purchaseBillNo }}</span>
+          <a-tag color="blue">{{ detail&&detail.billStatusDictValue }}</a-tag>
+          <a-tag color="orange">{{ detail&&detail.financialStatusDictValue }}</a-tag>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="purchaseOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="purchaseOrderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="供应商">{{ (detail&&detail.dealerName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyleEntity.name }}</a-descriptions-item>
+              <a-descriptions-item label="采购员工">{{ detail&&detail.operatorName }}</a-descriptions-item>
+              <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName }}<span v-if="detail&&detail.consigneeTel">({{ detail&&detail.consigneeTel }})</span></a-descriptions-item>
+              <a-descriptions-item label="收货地址">
+                {{ detail&&detail.shippingAddressProvinceName }}
+                {{ detail&&detail.shippingAddressCityName }}
+                {{ detail&&detail.shippingAddressCountyName }}
+                {{ detail&&detail.shippingAddress }}
+              </a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 产品详情 -->
+      <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="产品详情">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">
+                产品款数:<strong>{{ detail ? ((detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--') : '--' }}</strong>,
+                采购数量合计:<strong>{{ detail ? ((detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--') : '--' }}</strong>,
+                已收货数量:<strong>{{ detail ? ((detail.totalPutQty || detail.totalPutQty==0) ? detail.totalPutQty : '--') : '--' }}</strong>,
+                待收货数量:<strong>{{ detail ? ((detail.totalWaitPutQty || detail.totalWaitPutQty==0) ? detail.totalWaitPutQty : '--') : '--' }}</strong>,
+                取消数量:<strong>{{ detail ? ((detail.totalCancelQty || detail.totalCancelQty==0) ? detail.totalCancelQty : '--') : '--' }}</strong>,
+                采购金额合计:¥<strong>{{ detail ? ((detail.discountedAmount || detail.discountedAmount==0) ? detail.discountedAmount : '--') : '--' }}</strong>,
+                已收货金额:¥<strong>{{ detail ? ((detail.totalPutAmount || detail.totalPutAmount==0) ? detail.totalPutAmount : '--') : '--' }}</strong>,
+                待收货金额:¥<strong>{{ detail ? ((detail.totalWaitPutAmount || detail.totalWaitPutAmount==0) ? detail.totalWaitPutAmount : '--') : '--' }}</strong>,
+                取消金额:¥<strong>{{ detail ? ((detail.totalCancelAmount || detail.totalCancelAmount==0) ? detail.totalCancelAmount : '--') : '--' }}</strong>
+              </div>
+            </a-alert>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :scroll="{ x: 1480 }"
+              bordered>
+              <!-- 采购数量 -->
+              <template slot="origqty" slot-scope="text, record">
+                <div>{{ text }}</div>
+                <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
+              </template>
+              <!-- 缺货数量 -->
+              <template slot="outOfStockNum" slot-scope="text, record">
+                <span>{{ record.outOfStockNum }}</span>
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 促销品详情 -->
+      <a-card size="small" v-if="false" :bordered="false" class="purchaseOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="促销品详情">
+            <!-- 总计 -->
+            <a-alert type="info" showIcon style="margin-bottom:15px">
+              <div slot="message">产品款数 <strong>{{ detail&&detail.totalCategory }}</strong> ,
+                采购数量合计 <strong>{{ detail&&detail.totalQty }}</strong> ,
+                采购金额合计¥<strong>{{ detail&&detail.totalAmount }}</strong></div>
+            </a-alert>
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table-1"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data="loadData"
+              :scroll="{ x: 1060 }"
+              bordered>
+              <!-- 采购数量 -->
+              <template slot="origqty" slot-scope="text, record">
+                <div>{{ text }}</div>
+                <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
+              </template>
+              <!-- 缺货数量 -->
+              <template slot="outOfStockNum" slot-scope="text, record">
+                <span>{{ record.outOfStockNum }}</span>
+              </template>
+            </s-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 单据记录 -->
+      <a-card size="small" v-show="false" :bordered="false" class="purchaseOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="单据记录">
+            <a-timeline class="timeline-box">
+              <a-timeline-item>2021-02-01 15:22:38   王凯   审核通过</a-timeline-item>
+              <a-timeline-item>
+                <p>2021-02-01 15:22:38   王凯   审核通过</p>
+                <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
+                <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
+              </a-timeline-item>
+              <a-timeline-item>Technical testing 2015-09-01</a-timeline-item>
+              <a-timeline-item>Network problems being solved 2015-09-01</a-timeline-item>
+            </a-timeline>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -141,6 +143,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -192,7 +195,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       purchaseDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 207 - 194
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -1,203 +1,205 @@
 <template>
   <div class="purchaseOrderEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="purchaseOrderEdit-cont">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="purchaseOrderEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="purchaseOrderEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            基础信息
-            <a-button
-              type="primary"
-              shape="circle"
-              size="small"
-              icon="edit"
-              class="edit-circle-btn"
-              id="purchaseOrderEdit-edit-circle-btn"
-              @click.stop="handleEditInfo" />
-          </template>
-          <a-descriptions :column="2">
-            <a-descriptions-item label="供应商">{{ detail&&detail.dealerName }}</a-descriptions-item>
-            <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyleEntity.name }}</a-descriptions-item>
-            <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName }}({{ detail&&detail.consigneeTel }})</a-descriptions-item>
-            <a-descriptions-item label="收货地址">
-              {{ detail&&detail.shippingAddressProvinceName }} -
-              {{ detail&&detail.shippingAddressCityName }} -
-              {{ detail&&detail.shippingAddressCountyName }} -
-              {{ detail&&detail.shippingAddress }}
-            </a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            选择产品<span class="sub-title">①输入查询条件--->②查找到需要采购的产品--->③录入采购数量--->④点击“添加”</span>
-            <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
-          </template>
-          <!-- 选择产品 -->
-          <div>
-            <!-- 搜索条件 -->
-            <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="purchaseOrderEdit-bundleName" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码/适用车型"/>
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
-                      <ProductBrand id="purchaseOrderEdit-productBrand" v-model="queryParam.productBrandSn"></ProductBrand>
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品类别">
-                      <ProductType id="purchaseOrderEdit-productType" @change="changeProductType" v-model="productType"></ProductType>
-                    </a-form-item>
-                  </a-col>
-                  <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="purchaseOrderEdit-cont">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="purchaseOrderEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="purchaseOrderEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              基础信息
+              <a-button
+                type="primary"
+                shape="circle"
+                size="small"
+                icon="edit"
+                class="edit-circle-btn"
+                id="purchaseOrderEdit-edit-circle-btn"
+                @click.stop="handleEditInfo" />
+            </template>
+            <a-descriptions :column="2">
+              <a-descriptions-item label="供应商">{{ detail&&detail.dealerName }}</a-descriptions-item>
+              <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyleEntity.name }}</a-descriptions-item>
+              <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName }}({{ detail&&detail.consigneeTel }})</a-descriptions-item>
+              <a-descriptions-item label="收货地址">
+                {{ detail&&detail.shippingAddressProvinceName }} -
+                {{ detail&&detail.shippingAddressCityName }} -
+                {{ detail&&detail.shippingAddressCountyName }} -
+                {{ detail&&detail.shippingAddress }}
+              </a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              选择产品<span class="sub-title">①输入查询条件--->②查找到需要采购的产品--->③录入采购数量--->④点击“添加”</span>
+              <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
+            </template>
+            <!-- 选择产品 -->
+            <div>
+              <!-- 搜索条件 -->
+              <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-cascader
-                          :options="typeData"
-                          expand-trigger="hover"
-                          id="purchaseOrderEdit-state"
-                          placeholder="请选择适用车型"
-                          allowClear
-                          v-model="queryParam.brand" />
+                      <a-form-item label="关键词">
+                        <a-input id="purchaseOrderEdit-bundleName" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码/适用车型"/>
                       </a-form-item>
                     </a-col>
-                  </template>
-                  <a-col :md="6" :sm="24">
-                    <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderEdit-refresh">查询</a-button>
-                    <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderEdit-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 8px">
-                      {{ advanced ? '收起' : '展开' }}
-                      <a-icon :type="advanced ? 'up' : 'down'"/>
-                    </a>
-                  </a-col>
-                </a-row>
-              </a-form>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品品牌">
+                        <ProductBrand id="purchaseOrderEdit-productBrand" v-model="queryParam.productBrandSn"></ProductBrand>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品类别">
+                        <ProductType id="purchaseOrderEdit-productType" @change="changeProductType" v-model="productType"></ProductType>
+                      </a-form-item>
+                    </a-col>
+                    <template v-if="advanced">
+                      <a-col :md="6" :sm="24">
+                        <a-form-item label="适用车型">
+                          <a-cascader
+                            :options="typeData"
+                            expand-trigger="hover"
+                            id="purchaseOrderEdit-state"
+                            placeholder="请选择适用车型"
+                            allowClear
+                            v-model="queryParam.brand" />
+                        </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="purchaseOrderEdit-refresh">查询</a-button>
+                      <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderEdit-reset">重置</a-button>
+                      <a @click="advanced=!advanced" style="margin-left: 8px">
+                        {{ advanced ? '收起' : '展开' }}
+                        <a-icon :type="advanced ? 'up' : 'down'"/>
+                      </a>
+                    </a-col>
+                  </a-row>
+                </a-form>
+              </div>
+              <!-- 列表 -->
+              <s-table
+                class="sTable"
+                ref="table"
+                size="small"
+                :rowKey="(record) => record.id"
+                :columns="columns"
+                :data="loadData"
+                :scroll="{ x: 1190, y:300 }"
+                :defaultLoadData="false"
+                bordered>
+                <!-- 采购数量 -->
+                <template slot="storageQuantity" slot-scope="text, record">
+                  <a-input-number
+                    v-model="record.qty"
+                    :precision="0"
+                    :min="0"
+                    :max="999999"
+                    placeholder="请输入数量" />
+                </template>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record">
+                  <a-button
+                    size="small"
+                    type="primary"
+                    class="button-info"
+                    :loading="addLoading"
+                    @click="handleAdd(record,0)"
+                    :disabled="record.purchasePrice<=0"
+                    id="purchaseOrderEdit-add-btn">添加</a-button>
+                </template>
+              </s-table>
+            </div>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              已选产品
+              <!-- <a-button size="small" class="import-btn" id="purchaseOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
+            </template>
+            <!-- 已选产品 -->
+            <div>
+              <!-- 总计 -->
+              <a-alert type="info" showIcon style="margin-bottom:15px">
+                <div slot="message">产品款数 <strong>{{ detail ? ((detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--') : '--' }}</strong> ,
+                  采购数量合计 <strong>{{ detail ? ((detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--') : '--' }}</strong> ,
+                  采购金额合计¥<strong>{{ detail ? ((detail.discountedAmount || detail.discountedAmount==0) ? detail.discountedAmount : '--') : '--' }}</strong></div>
+              </a-alert>
+              <!-- 列表 -->
+              <s-table
+                class="sTable"
+                ref="purchaseTable"
+                size="small"
+                :rowKey="(record) => record.id"
+                :columns="chooseColumns"
+                :data="chooseLoadData"
+                :scroll="{ x: 1070, y: 300 }"
+                bordered>
+                <!-- 采购数量 -->
+                <template slot="storageQuantity" slot-scope="text, record">
+                  <a-input-number
+                    id="purchaseOrderEdit-qty"
+                    v-model="record.qty"
+                    :precision="0"
+                    :min="1"
+                    :max="999999"
+                    @blur="e => qtyBlur(e.target.value, record)"
+                    placeholder="请输入" />
+                </template>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record">
+                  <a-button
+                    size="small"
+                    type="primary"
+                    class="button-error"
+                    :loading="delLoading"
+                    @click="handleDel(record)"
+                    id="purchaseOrderEdit-del-btn">删除</a-button>
+                </template>
+              </s-table>
             </div>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="columns"
-              :data="loadData"
-              :scroll="{ x: 1190, y:300 }"
-              :defaultLoadData="false"
-              bordered>
-              <!-- 采购数量 -->
-              <template slot="storageQuantity" slot-scope="text, record">
-                <a-input-number
-                  v-model="record.qty"
-                  :precision="0"
-                  :min="0"
-                  :max="999999"
-                  placeholder="请输入数量" />
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button
-                  size="small"
-                  type="primary"
-                  class="button-info"
-                  :loading="addLoading"
-                  @click="handleAdd(record,0)"
-                  :disabled="record.purchasePrice<=0"
-                  id="purchaseOrderEdit-add-btn">添加</a-button>
-              </template>
-            </s-table>
-          </div>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            已选产品
-            <!-- <a-button size="small" class="import-btn" id="purchaseOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
-          </template>
-          <!-- 已选产品 -->
-          <div>
-            <!-- 总计 -->
-            <a-alert type="info" showIcon style="margin-bottom:15px">
-              <div slot="message">产品款数 <strong>{{ detail ? ((detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--') : '--' }}</strong> ,
-                采购数量合计 <strong>{{ detail ? ((detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--') : '--' }}</strong> ,
-                采购金额合计¥<strong>{{ detail ? ((detail.discountedAmount || detail.discountedAmount==0) ? detail.discountedAmount : '--') : '--' }}</strong></div>
-            </a-alert>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="purchaseTable"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="chooseColumns"
-              :data="chooseLoadData"
-              :scroll="{ x: 1070, y: 300 }"
-              bordered>
-              <!-- 采购数量 -->
-              <template slot="storageQuantity" slot-scope="text, record">
-                <a-input-number
-                  id="purchaseOrderEdit-qty"
-                  v-model="record.qty"
-                  :precision="0"
-                  :min="1"
-                  :max="999999"
-                  @blur="e => qtyBlur(e.target.value, record)"
-                  placeholder="请输入" />
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button
-                  size="small"
-                  type="primary"
-                  class="button-error"
-                  :loading="delLoading"
-                  @click="handleDel(record)"
-                  id="purchaseOrderEdit-del-btn">删除</a-button>
-              </template>
-            </s-table>
-          </div>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0" v-if="detail">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="purchaseOrderEdit-submit-btn"
-          size="large"
-          class="button-primary"
-          :loading="subLoading"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0" v-if="detail">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="purchaseOrderEdit-submit-btn"
+            size="large"
+            class="button-primary"
+            :loading="subLoading"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 选择基本信息弹框 -->
     <basic-info-modal ref="baseInfo" :openModal="openModal" @ok="handleOk" @cancel="openModal=false" />
     <!-- 打印 -->
@@ -217,6 +219,7 @@ export default {
   components: { STable, VSelect, basicInfoModal, ProductType, ProductBrand },
   data () {
     return {
+      spinning: false,
       openModal: false, // 选择基本信息弹框是否显示
       detail: null, // 详细信息
       subLoading: false,
@@ -394,10 +397,14 @@ export default {
         params = row
       }
       this.addLoading = true
+      this.spinning = true
       purchaseDetailSave(params).then(res => {
         if (res.status == 200) {
           this.resetPurchaseDetail()
           this.$message.success(res.message)
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
         this.addLoading = false
       })
@@ -407,12 +414,16 @@ export default {
     handleSubmit () {
       const _this = this
       this.subLoading = true
+      this.spinning = true
       purchaseWriteSubmit({ id: this.detail.id }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
             _this.handleBack()
+            _this.spinning = false
           }, 1000)
+        } else {
+          _this.spinning = false
         }
         _this.subLoading = false
       })
@@ -420,7 +431,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       purchaseDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 40 - 35
src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue

@@ -8,69 +8,71 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <a-form-model
-      id="editAddress-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol"
-    >
-      <a-form-model-item label="收货人" prop="consigneeName">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="editAddress-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="收货人" prop="consigneeName">
         <a-input
           id="editAddress-name"
           :maxLength="30"
           v-model="form.consigneeName"
           placeholder="请输入收货人(最多30个字符)"
           allowClear />
-      </a-form-model-item>
-      <a-form-model-item label="手机号码" prop="consigneeTel">
+        </a-form-model-item>
+        <a-form-model-item label="手机号码" prop="consigneeTel">
         <a-input
           id="editAddress-phone"
           :maxLength="11"
           v-model="form.consigneeTel"
           placeholder="请输入手机号码(最多11个字符)"
           allowClear />
-      </a-form-model-item>
-      <a-form-model-item label="所在地区" required style="margin: 0;">
+        </a-form-model-item>
+        <a-form-model-item label="所在地区" required style="margin: 0;">
         <a-row :gutter="20">
           <!-- 所在地区 -->
           <a-col span="8">
-            <a-form-model-item prop="provinceSn">
-              <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
+          <a-form-model-item prop="provinceSn">
+            <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
+            <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
           </a-col>
           <a-col span="8">
-            <a-form-model-item prop="citySn">
-              <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
+          <a-form-model-item prop="citySn">
+            <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+            <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
           </a-col>
           <a-col span="8">
-            <a-form-model-item prop="countySn">
-              <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
+          <a-form-model-item prop="countySn">
+            <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+            <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
           </a-col>
         </a-row>
-      </a-form-model-item>
-      <a-form-model-item label="详细地址" prop="addr">
+        </a-form-model-item>
+        <a-form-model-item label="详细地址" prop="addr">
         <a-input
           id="editAddress-address"
           :maxLength="60"
           v-model="form.addr"
           placeholder="请输入详细地址(最多60个字符)"
           allowClear />
-      </a-form-model-item>
-      <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
         <a-button type="primary" @click="handleSubmit" id="editAddress-btn-submit">保存</a-button>
         <a-button @click="isShow=false" style="margin-left: 15px" id="editAddress-btn-back">返回</a-button>
-      </a-form-model-item>
-    </a-form-model>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -87,6 +89,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       isEdit: false,
       formItemLayout: {
@@ -135,13 +138,15 @@ export default {
     handleSubmit () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          this.spinning = true
           shippingAddressSave(this.form).then(res => {
             if (res.status == 200) {
               this.isShow = false
               this.$emit('ok')
               this.$message.success(res.message)
+              this.spinning = false
             } else {
-              this.$message.error(res.message)
+              this.spinning = false
             }
           })
         } else {

+ 67 - 56
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -1,62 +1,64 @@
 <template>
   <div class="purchaseOrderWarehousing-wrap">
-    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="purchaseOrderWarehousing-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span class="billno">单号:{{ detail&&detail[0].purchaseBillNo }}</span>
-      </template>
-    </a-page-header>
-    <!-- 内容 -->
-    <a-card size="small" v-for="(item,bindex) in detail" :key="item.id" :bordered="false" class="purchaseOrderWarehousing-cont">
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message" >
-          <div>产品款数 <strong>{{ item.totalPutCategory }}</strong> ,采购数量合计 <strong>{{ item.totalPutQty }}</strong> ,采购金额合计¥<strong>{{ item.totalPutAmount }}</strong></div>
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        :ref="'table-'+bindex"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :tableId="item.receivingBillSn"
-        :index="bindex"
-        :scroll="{ x: 1630 }"
-        bordered>
-        <!-- 采购数量 -->
-        <template slot="origqty" slot-scope="text, record, index">
-          <div>{{ text }}</div>
-          <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
-        </template>
-        <!-- 仓库仓位 -->
-        <template slot="warehousePosition" slot-scope="text, record, index">
-          <a-cascader
-            @change="e => changeWarehouseCascade(e, record, index, bindex)"
-            v-model="record.warehouseCascade"
-            :disabled="!(item.auditState=='WAIT_PUT_WAREHOUSE' || item.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT')"
-            expand-trigger="hover"
-            :options="warehouseCascadeData"
-            :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-            id="purchaseOrderWarehousing-warehouseCascade"
-            placeholder="请选择仓库仓位"
-            :allowClear="false"
-            style="width: 100%;" />
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseOrderWarehousing-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span class="billno">单号:{{ detail&&detail[0].purchaseBillNo }}</span>
         </template>
-      </s-table>
-      <div style="text-align: center;">
-        <a-button
-          type="primary"
-          class="button-warning"
-          :id="'purchaseOrderWarehousing-warehousing-'+bindex"
-          @click="handleWarehousing(item,bindex)"
-          v-if="item.auditState=='WAIT_PUT_WAREHOUSE' || item.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT'"
-        >确认入库</a-button>
-      </div>
-    </a-card>
+      </a-page-header>
+      <!-- 内容 -->
+      <a-card size="small" v-for="(item,bindex) in detail" :key="item.id" :bordered="false" class="purchaseOrderWarehousing-cont">
+        <!-- 总计 -->
+        <a-alert type="info" showIcon style="margin-bottom:15px">
+          <div slot="message" >
+            <div>产品款数 <strong>{{ item.totalPutCategory }}</strong> ,采购数量合计 <strong>{{ item.totalPutQty }}</strong> ,采购金额合计¥<strong>{{ item.totalPutAmount }}</strong></div>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          :ref="'table-'+bindex"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :tableId="item.receivingBillSn"
+          :index="bindex"
+          :scroll="{ x: 1630 }"
+          bordered>
+          <!-- 采购数量 -->
+          <template slot="origqty" slot-scope="text, record, index">
+            <div>{{ text }}</div>
+            <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
+          </template>
+          <!-- 仓库仓位 -->
+          <template slot="warehousePosition" slot-scope="text, record, index">
+            <a-cascader
+              @change="e => changeWarehouseCascade(e, record, index, bindex)"
+              v-model="record.warehouseCascade"
+              :disabled="!(item.auditState=='WAIT_PUT_WAREHOUSE' || item.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT')"
+              expand-trigger="hover"
+              :options="warehouseCascadeData"
+              :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+              id="purchaseOrderWarehousing-warehouseCascade"
+              placeholder="请选择仓库仓位"
+              :allowClear="false"
+              style="width: 100%;" />
+          </template>
+        </s-table>
+        <div style="text-align: center;">
+          <a-button
+            type="primary"
+            class="button-warning"
+            :id="'purchaseOrderWarehousing-warehousing-'+bindex"
+            @click="handleWarehousing(item,bindex)"
+            v-if="item.auditState=='WAIT_PUT_WAREHOUSE' || item.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT'"
+          >确认入库</a-button>
+        </div>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -71,6 +73,7 @@ export default {
   components: { STable, VSelect, ProductType, ProductBrand },
   data () {
     return {
+      spinning: false,
       detail: null, //  详情数据
       productType: [],
       queryParam: {
@@ -156,10 +159,14 @@ export default {
         this.$message.warning('请选择仓库仓位!')
         return
       }
+      this.spinning = true
       purchaseWriteStockIn({ id: row.id }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.getDetail()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -226,6 +233,7 @@ export default {
     },
     // 修改仓库
     updateWarehouse (row, bindex) {
+      this.spinning = true
       purchaseUpdateWarehouse({
         id: row.id,
         warehouseSn: row.warehouseSn,
@@ -235,6 +243,9 @@ export default {
           this.$message.success(res.message)
           console.log(bindex, this.$refs)
           this.$refs['table-' + bindex][0].refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     }

+ 143 - 132
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -1,139 +1,141 @@
 <template>
   <div class="purchaseReturnEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销总部</span>
-      </template>
-    </a-page-header>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="选择产品">
-          <!-- 筛选条件 -->
-          <div class="table-page-search-wrapper">
-            <a-form layout="inline" @keyup.enter.native="getPurchaseBillDetailList(1)">
-              <a-row :gutter="15">
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="采购单号" prop="purchaseBillNo">
-                    <a-input id="purchaseReturnEdit-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" placeholder="请输入采购单号" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品编码" prop="productCode">
-                    <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品名称" prop="productName">
-                    <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                  <a-button type="primary" @click="getPurchaseBillDetailList(1)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :dataSource="loadData"
-            :scroll="{ x: 1320, y: 300 }"
-            :pagination="paginationProps"
-            bordered>
-            <!-- 数量 -->
-            <template slot="returnQty" slot-scope="text, record">
-              <a-input-number
-                id="purchaseReturnEdit-returnQty"
-                v-model="record.returnQty"
-                :precision="0"
-                :min="1"
-                :max="record.refundableQty"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="purchaseReturnEdit-add-btn">添加</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1">
-          <template slot="header">
-            已选产品
-            <a-button size="small" class="import-btn" id="purchaseReturnEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
-            <a-button
+	  <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销总部</span>
+        </template>
+      </a-page-header>
+      <!-- 选择产品 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="选择产品">
+            <!-- 筛选条件 -->
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline" @keyup.enter.native="getPurchaseBillDetailList(1)">
+                <a-row :gutter="15">
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="采购单号" prop="purchaseBillNo">
+                      <a-input id="purchaseReturnEdit-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" placeholder="请输入采购单号" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品编码" prop="productCode">
+                      <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品名称" prop="productName">
+                      <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                    <a-button type="primary" @click="getPurchaseBillDetailList(1)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="table"
               size="small"
-              type="primary"
-              class="import-btn"
-              id="purchaseReturnEdit-delAll-btn"
-              @click.stop="handleDel('', 'all')"
-              style="margin-left: 10px;">整单删除</a-button>
-          </template>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="chooseTable"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :dataSource="chooseLoadData"
-            :scroll="{ x: 1420, y: 300 }"
-            :pagination="choosePaginationProps"
-            bordered>
-            <!-- 退货数量 -->
-            <template slot="qty" slot-scope="text, record">
-              <a-input-number
-                id="purchaseReturnEdit-qty"
-                v-model="record.qty"
-                :precision="0"
-                :min="1"
-                :max="record.refundableQty"
-                placeholder="请输入"
-                @blur="e => qtyBlur(e.target.value, record)"
-                style="width: 100%;" />
-            </template>
-            <!-- 退货原因 -->
-            <template slot="remarks" slot-scope="text, record">
-              <a-input
-                id="purchaseReturnEdit-remarks"
-                v-model="record.remarks"
-                :maxLength="30"
-                placeholder="退货原因(最多30个字符)"
-                @blur="e => remarksBlur(e.target.value, record)"
-                style="width: 100%;" />
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :dataSource="loadData"
+              :scroll="{ x: 1320, y: 300 }"
+              :pagination="paginationProps"
+              bordered>
+              <!-- 数量 -->
+              <template slot="returnQty" slot-scope="text, record">
+                <a-input-number
+                  id="purchaseReturnEdit-returnQty"
+                  v-model="record.returnQty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.refundableQty"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="purchaseReturnEdit-add-btn">添加</a-button>
+              </template>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 已选产品 -->
+      <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              已选产品
+              <a-button size="small" class="import-btn" id="purchaseReturnEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+              <a-button
+                size="small"
+                type="primary"
+                class="import-btn"
+                id="purchaseReturnEdit-delAll-btn"
+                @click.stop="handleDel('', 'all')"
+                style="margin-left: 10px;">整单删除</a-button>
             </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="purchaseReturnEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :dataSource="chooseLoadData"
+              :scroll="{ x: 1420, y: 300 }"
+              :pagination="choosePaginationProps"
+              bordered>
+              <!-- 退货数量 -->
+              <template slot="qty" slot-scope="text, record">
+                <a-input-number
+                  id="purchaseReturnEdit-qty"
+                  v-model="record.qty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.refundableQty"
+                  placeholder="请输入"
+                  @blur="e => qtyBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 退货原因 -->
+              <template slot="remarks" slot-scope="text, record">
+                <a-input
+                  id="purchaseReturnEdit-remarks"
+                  v-model="record.remarks"
+                  :maxLength="30"
+                  placeholder="退货原因(最多30个字符)"
+                  @blur="e => remarksBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
+              </template>
+            </a-table>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+          <a-button
+            type="primary"
+            id="purchaseReturnEdit-submit"
+            size="large"
+            class="button-primary"
+            @click="handleSubmit"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
   </div>
 </template>
 
@@ -144,6 +146,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       queryParam: {
         purchaseBillNo: '',
         productCode: '',
@@ -238,11 +241,15 @@ export default {
           return
         }
       }
+      this.spinning = true
       purchaseReturnDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.getPurchaseBillDetailList()
           this.getChooseProductList()
+          this.spinning = false
+        }else{
+          this.spinning = false
         }
       })
     },
@@ -290,12 +297,16 @@ export default {
     //  提交
     handleSubmit () {
       const _this = this
+      _this.spinning = true
       purchaseReturnSubmit({ id: this.$route.params.id }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
             _this.handleBack()
+            _this.spinning = false
           }, 1000)
+        }else{
+          _this.spinning = false
         }
       })
     },

+ 34 - 31
src/views/salesManagement/quotation/basicInfoModal.vue

@@ -8,37 +8,39 @@
     v-model="isShow"
     @cancle="isShow=false"
     width="80%">
-    <a-form-model
-      id="quotation-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol" >
-      <a-form-model-item label="客户名称" prop="name" extra="(未搜索到客户时可直接录入,但客户信息不保存于客户资料)">
-        <a-auto-complete id="quotation-basicInfo-bundleName" allowClear v-model="form.name" placeholder="请输入客户名称">
-          <template slot="dataSource">
-            <a-select-option v-for="item in optData" :key="item">{{ item }}</a-select-option>
-          </template>
-        </a-auto-complete>
-      </a-form-model-item>
-      <a-form-model-item label="价格类型" prop="priceType">
-        <v-select code="PRICE_TYPE" id="quotation-basicInfo-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型" ></v-select>
-      </a-form-model-item>
-      <a-form-model-item label="电话" prop="phone">
-        <a-input id="quotation-basicInfo-bundleName" v-model="form.bundleName" allowClear :maxLength="30" placeholder="请输入电话(最多30个字符)"/>
-      </a-form-model-item>
-      <a-form-model-item label="联系人" prop="phone">
-        <a-input id="quotation-basicInfo-bundleName" v-model="form.bundleName" allowClear :maxLength="30" placeholder="请输入联系人(最多30个字符)"/>
-      </a-form-model-item>
-      <a-form-model-item label="备注" prop="phone">
-        <a-textarea id="quotation-basicInfo-bundleName" v-model="form.bundleName" allowClear :maxLength="120" placeholder="请输入备注(最多120个字符)"/>
-      </a-form-model-item>
-    </a-form-model>
-    <div class="btn-cont">
-      <a-button type="primary" id="quotation-basicInfo-modal-submit" @click="handleSubmit">提交</a-button>
-      <a-button id="quotation-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="quotation-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="客户名称" prop="name" extra="(未搜索到客户时可直接录入,但客户信息不保存于客户资料)">
+          <a-auto-complete id="quotation-basicInfo-bundleName" allowClear v-model="form.name" placeholder="请输入客户名称">
+            <template slot="dataSource">
+              <a-select-option v-for="item in optData" :key="item">{{ item }}</a-select-option>
+            </template>
+          </a-auto-complete>
+        </a-form-model-item>
+        <a-form-model-item label="价格类型" prop="priceType">
+          <v-select code="PRICE_TYPE" id="quotation-basicInfo-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型" ></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="电话" prop="phone">
+          <a-input id="quotation-basicInfo-bundleName" v-model="form.bundleName" allowClear :maxLength="30" placeholder="请输入电话(最多30个字符)"/>
+        </a-form-model-item>
+        <a-form-model-item label="联系人" prop="phone">
+          <a-input id="quotation-basicInfo-bundleName" v-model="form.bundleName" allowClear :maxLength="30" placeholder="请输入联系人(最多30个字符)"/>
+        </a-form-model-item>
+        <a-form-model-item label="备注" prop="phone">
+          <a-textarea id="quotation-basicInfo-bundleName" v-model="form.bundleName" allowClear :maxLength="120" placeholder="请输入备注(最多120个字符)"/>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="quotation-basicInfo-modal-submit" @click="handleSubmit">提交</a-button>
+        <a-button id="quotation-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -55,6 +57,7 @@
     },
     data(){
       return{
+        spinning: false,
         isShow: this.openModal, //  是否打开弹框
         formItemLayout: {
           labelCol: { span: 6 },

+ 187 - 180
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -9,186 +9,188 @@
     :footer="null"
     @cancel="cancel"
   >
-    <a-form-model
-      id="chooseCustom-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol"
-    >
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="客户名称" prop="buyerSn">
-            <a-select
-              id="chooseCustom-buyerSn"
-              show-search
-              placeholder="请选择客户"
-              v-model="form.buyerSn"
-              :filter-option="filterOption"
-              @change="custChange">
-              <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-            </a-select>
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="16">
-          <a-form-model-item>
-            <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
-            (点击新增按钮新增客户)
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="16">
-          <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
-            <a-row :gutter="15">
-              <!-- 客户地址 -->
-              <a-col span="8">
-                <a-form-model-item prop="shippingAddressProvinceSn">
-                  <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.shippingAddressProvinceSn" placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col span="8">
-                <a-form-model-item prop="shippingAddressCitySn">
-                  <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.shippingAddressCitySn" placeholder="请选择市">
-                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col span="8">
-                <a-form-model-item prop="shippingAddressCountySn">
-                  <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.shippingAddressCountySn" placeholder="请选择区/县">
-                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-            </a-row>
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="" prop="shippingAddress">
-            <a-input
-              id="chooseCustom-shippingAddress"
-              :maxLength="60"
-              v-model="form.shippingAddress"
-              placeholder="请输入详细地址(最多60个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="联系人" prop="consigneeName">
-            <a-input
-              id="chooseCustom-consigneeName"
-              :maxLength="30"
-              v-model="form.consigneeName"
-              placeholder="请输入联系人(最多30个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="联系电话" prop="consigneeTel">
-            <a-input
-              id="chooseCustom-consigneeTel"
-              :maxLength="11"
-              v-model="form.consigneeTel"
-              placeholder="请输入联系电话(最多11个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="价格类型" prop="priceType">
-            <a-row :gutter="15">
-              <a-col :span="20">
-                <v-select
-                  code="PRICE_TYPE"
-                  :disabled="priceTypeDisabled"
-                  id="chooseCustom-priceType"
-                  v-model="form.priceType"
-                  allowClear
-                  placeholder="请选择价格类型" ></v-select>
-              </a-col>
-              <a-col :span="4">
-                <a-popover>
-                  <template slot="content">(选择后在当前工单不可修改)</template>
-                  <a-icon type="question-circle" />
-                </a-popover>
-              </a-col>
-            </a-row>
-          </a-form-model-item>
-        </a-col>
-        <!-- <a-col :span="8">
-          <a-form-model-item label="支付方式" prop="payType">
-            <v-select code="PAY_TYPE" id="chooseCustom-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
-          </a-form-model-item>
-        </a-col> -->
-        <a-col :span="8">
-          <a-form-model-item label="收款方式" prop="settleStyleSn">
-            <a-select placeholder="请选择收款方式" v-model="form.settleStyleSn">
-              <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                {{ item.name }}
-              </a-select-option>
-            </a-select>
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="配送方式" prop="dispatchType">
-            <v-select code="DISPATCH_TYPE" id="chooseCustom-dispatchType" v-model="form.dispatchType" allowClear placeholder="请选择配送方式"></v-select>
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <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-select>
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="铺货出库" prop="distributionFlag">
-            <v-select code="FLAG" id="chooseCustom-distributionFlag" v-model="form.distributionFlag" allowClear placeholder="请选择"></v-select>
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="备注" prop="remarks">
-            <a-input
-              id="chooseCustom-remarks"
-              type="textarea"
-              :maxLength="100"
-              v-model="form.remarks"
-              placeholder="请输入联系电话(最多100个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
-        <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
-      </a-form-model-item>
-    </a-form-model>
-    <!-- 新增客户 -->
-    <a-modal
-      v-model="isNewCust"
-      title="新增客户"
-      centered
-      :width="960"
-      :maskClosable="false"
-      @cancel="cancelNewCust"
-      :footer="null"
-    >
-      <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
-    </a-modal>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="客户名称" prop="buyerSn">
+              <a-select
+                id="chooseCustom-buyerSn"
+                show-search
+                placeholder="请选择客户"
+                v-model="form.buyerSn"
+                :filter-option="filterOption"
+                @change="custChange">
+                <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="16">
+            <a-form-model-item>
+              <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
+              (点击新增按钮新增客户)
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="16">
+            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+              <a-row :gutter="15">
+                <!-- 客户地址 -->
+                <a-col span="8">
+                  <a-form-model-item prop="shippingAddressProvinceSn">
+                    <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.shippingAddressProvinceSn" placeholder="请选择省">
+                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="8">
+                  <a-form-model-item prop="shippingAddressCitySn">
+                    <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.shippingAddressCitySn" placeholder="请选择市">
+                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="8">
+                  <a-form-model-item prop="shippingAddressCountySn">
+                    <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.shippingAddressCountySn" placeholder="请选择区/县">
+                      <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="" prop="shippingAddress">
+              <a-input
+                id="chooseCustom-shippingAddress"
+                :maxLength="60"
+                v-model="form.shippingAddress"
+                placeholder="请输入详细地址(最多60个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="联系人" prop="consigneeName">
+              <a-input
+                id="chooseCustom-consigneeName"
+                :maxLength="30"
+                v-model="form.consigneeName"
+                placeholder="请输入联系人(最多30个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系电话" prop="consigneeTel">
+              <a-input
+                id="chooseCustom-consigneeTel"
+                :maxLength="11"
+                v-model="form.consigneeTel"
+                placeholder="请输入联系电话(最多11个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="价格类型" prop="priceType">
+              <a-row :gutter="15">
+                <a-col :span="20">
+                  <v-select
+                    code="PRICE_TYPE"
+                    :disabled="priceTypeDisabled"
+                    id="chooseCustom-priceType"
+                    v-model="form.priceType"
+                    allowClear
+                    placeholder="请选择价格类型" ></v-select>
+                </a-col>
+                <a-col :span="4">
+                  <a-popover>
+                    <template slot="content">(选择后在当前工单不可修改)</template>
+                    <a-icon type="question-circle" />
+                  </a-popover>
+                </a-col>
+              </a-row>
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="8">
+            <a-form-model-item label="支付方式" prop="payType">
+              <v-select code="PAY_TYPE" id="chooseCustom-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
+            </a-form-model-item>
+          </a-col> -->
+          <a-col :span="8">
+            <a-form-model-item label="收款方式" prop="settleStyleSn">
+              <a-select placeholder="请选择收款方式" v-model="form.settleStyleSn">
+                <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="配送方式" prop="dispatchType">
+              <v-select code="DISPATCH_TYPE" id="chooseCustom-dispatchType" v-model="form.dispatchType" allowClear placeholder="请选择配送方式"></v-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <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-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="铺货出库" prop="distributionFlag">
+              <v-select code="FLAG" id="chooseCustom-distributionFlag" v-model="form.distributionFlag" allowClear placeholder="请选择"></v-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="备注" prop="remarks">
+              <a-input
+                id="chooseCustom-remarks"
+                type="textarea"
+                :maxLength="100"
+                v-model="form.remarks"
+                placeholder="请输入联系电话(最多100个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+      <!-- 新增客户 -->
+      <a-modal
+        v-model="isNewCust"
+        title="新增客户"
+        centered
+        :width="960"
+        :maskClosable="false"
+        @cancel="cancelNewCust"
+        :footer="null"
+      >
+        <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
+      </a-modal>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -208,6 +210,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       opened: this.show,
       title: '选择客户',
       confirmLoading: false,
@@ -443,6 +446,7 @@ export default {
       const _this = this
       const form = this.form
       console.log(form, 'save data')
+      _this.spinning = true
       salesSave(form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
@@ -451,6 +455,9 @@ export default {
             _this.$emit('updateData', form.priceType)
           }
           _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
         }
       })
     },

+ 72 - 67
src/views/salesManagement/salesQuery/detail.vue

@@ -1,73 +1,75 @@
 <template>
   <div class="salesDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
-      <template slot="subTitle">
-        <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
-        <a-button
-          v-if="detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE'"
-          type="primary"
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+          <a-button
+            v-if="detailData&&detailData.billStatus !== 'CANCEL' && detailData.billStatus !== 'FINISH' && detailData.billStatus != 'WAIT_OUT_WAREHOUSE'"
+            type="primary"
+            size="small"
+            style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+            id="salesDetail-edit-btn"
+            @click.stop="handleEdit">编辑</a-button>
+        </template>
+        <template slot="extra">
+          <!-- <span>打印字段:</span>
+          <a-select key="1" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印字段" allowClear>
+            <a-select-option v-for="item in pritKey" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+          </a-select>
+          <span><i style="color: red;">*</i>打印模板:</span>
+          <a-select key="2" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印模板" allowClear>
+            <a-select-option v-for="item in pritModal" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+          </a-select> -->
+          <!-- <a-button key="5" id="salesDetail-export-btn">导出</a-button> -->
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="salesDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="salesDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="salesDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <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.settleStyleEntity.name || '--' }}</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.billStatusDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- 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>;
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
           size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="salesDetail-edit-btn"
-          @click.stop="handleEdit">编辑</a-button>
-      </template>
-      <template slot="extra">
-        <!-- <span>打印字段:</span>
-        <a-select key="1" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印字段" allowClear>
-          <a-select-option v-for="item in pritKey" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select>
-        <span><i style="color: red;">*</i>打印模板:</span>
-        <a-select key="2" style="width:150px" id="salesDetail-pritKey" placeholder="请选择打印模板" allowClear>
-          <a-select-option v-for="item in pritModal" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select> -->
-        <!-- <a-button key="5" id="salesDetail-export-btn">导出</a-button> -->
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="salesDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="salesDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="salesDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <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.settleStyleEntity.name || '--' }}</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.billStatusDictValue || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- 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>;
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1660 }"
-        bordered>
-      </s-table>
-    </a-card>
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1660 }"
+          bordered>
+        </s-table>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -83,6 +85,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       disabled: false,
       pritKey: [
         { id: 0, name: '打印促销' },
@@ -167,7 +170,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       salesDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 141 - 126
src/views/salesManagement/salesQuery/edit.vue

@@ -1,142 +1,144 @@
 <template>
   <div class="salesEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="salesEdit-preview-btn" :disabled="dataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="salesEdit-print-btn" :disabled="dataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="salesEdit-cont">
-      <!-- 查询配件列表 -->
-      <queryPart ref="partQuery" :buyerSn="detailData&&detailData.buyerSn" :priceType="$route.params.priceType" :newLoading="isInster" @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" class="total-bar">
-          <div>
-            总售价:<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>
-          <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="salesEdit-preview-btn" :disabled="dataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="salesEdit-print-btn" :disabled="dataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="salesEdit-cont">
+        <!-- 查询配件列表 -->
+        <queryPart ref="partQuery" :buyerSn="detailData&&detailData.buyerSn" :priceType="$route.params.priceType" :newLoading="isInster" @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" class="total-bar">
             <div>
-              折扣金额:
-              <a-input-number id="discount" v-model="detailData.discountAmount" :min="0" :precision="2" :max="999999"/>
-              <a-button type="primary" @click="salesDiscount" class="button-info">打折</a-button>
+              总售价:<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>
             <div>
-              折扣:<strong>{{ detailData&&detailData.discountRate || 0 }}%</strong>;
-              折后总售价:<strong>¥{{ detailData&&detailData.discountedAmount || 0 }}</strong>;
+              <div>
+                折扣金额:
+                <a-input-number id="discount" v-model="detailData.discountAmount" :min="0" :precision="2" :max="999999"/>
+                <a-button type="primary" @click="salesDiscount" class="button-info">打折</a-button>
+              </div>
+              <div>
+                折扣:<strong>{{ detailData&&detailData.discountRate || 0 }}%</strong>;
+                折后总售价:<strong>¥{{ detailData&&detailData.discountedAmount || 0 }}</strong>;
+              </div>
             </div>
           </div>
-        </div>
-      </a-alert>
-      <!-- 查询条件 -->
-      <a-row :gutter="15">
-        <a-col :span="18">
-          <a-form-model layout="inline" :model="productForm">
-            <a-form-model-item label="产品编码">
-              <a-input v-model="productForm.productCode" allowClear placeholder="输入产品编码" />
-            </a-form-model-item>
-            <a-form-model-item label="产品名称">
-              <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="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-alert>
+        <!-- 查询条件 -->
+        <a-row :gutter="15">
+          <a-col :span="18">
+            <a-form-model layout="inline" :model="productForm">
+              <a-form-model-item label="产品编码">
+                <a-input v-model="productForm.productCode" allowClear placeholder="输入产品编码" />
+              </a-form-model-item>
+              <a-form-model-item label="产品名称">
+                <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="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"
+                :loading="delLoading"
+                style="margin-left: 10px"
+                id="salesEdit-del-all">整单删除</a-button>
+            </div>
+          </a-col>
+        </a-row>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1940, y: 300 }"
+          :rowClassName="(record, index) => record.cost > record.price ? 'redBg-row':''"
+          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
+              size="small"
+              :text="text"
+              id="salesEdit-price"
+              :max="999999"
+              :min="0"
+              :precision="2"
+              punit="¥"
+              @change="onCellChange(record.id, 'price', $event)" />
+          </template>
+          <!-- 销售数量 -->
+          <template slot="salesNums" slot-scope="text, record">
+            <editable-cell
+              size="small"
+              :text="record.qty"
+              id="salesEdit-salesNums"
+              :max="999999"
+              :min="1"
+              :precision="0"
+              @change="onCellChange(record.id, 'qty', $event)" />
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
             <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>
-      <!-- 已选配件列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1940, y: 300 }"
-        :rowClassName="(record, index) => record.cost > record.price ? 'redBg-row':''"
-        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
-            size="small"
-            :text="text"
-            id="salesEdit-price"
-            :max="999999"
-            :min="0"
-            :precision="2"
-            punit="¥"
-            @change="onCellChange(record.id, 'price', $event)" />
-        </template>
-        <!-- 销售数量 -->
-        <template slot="salesNums" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="record.qty"
-            id="salesEdit-salesNums"
-            :max="999999"
-            :min="1"
-            :precision="0"
-            @change="onCellChange(record.id, 'qty', $event)" />
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
+              class="button-error"
+              @click="handleDel(record)"
+              id="productInfoList-Del">删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div
+          style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
           <a-button
-            size="small"
+            size="large"
+            style="width: 150px;"
             type="primary"
-            :loading="delLoading"
-            class="button-error"
-            @click="handleDel(record)"
-            id="productInfoList-Del">删除</a-button>
-        </template>
-      </s-table>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div
-        style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          size="large"
-          style="width: 150px;"
-          type="primary"
-          class="button-primary"
-          @click="handleSubmit()"
-          id="productInfoList-handleSubmit">提交</a-button>
-      </div>
-    </a-affix>
+            class="button-primary"
+            @click="handleSubmit()"
+            id="productInfoList-handleSubmit">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
     <!-- 打印 -->
@@ -156,6 +158,7 @@ export default {
   components: { STable, VSelect, queryPart, chooseCustomModal, EditableCell },
   data () {
     return {
+      spinning: false,
       orderId: null, // 销售单id
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
@@ -238,7 +241,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       salesDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {
@@ -306,6 +311,7 @@ export default {
         return
       }
       console.log(this.detailData)
+      this.spinning = true
       salesWriteDiscount({
         discountAmount: this.detailData.discountAmount,
         salesBillSn: this.detailData.salesBillSn,
@@ -313,6 +319,9 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.resetSearchForm()
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
@@ -399,6 +408,7 @@ export default {
     saveNewProduct (row) {
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
+      this.spinning = true
       salesDetailInsert({
         buyerSn: this.detailData.buyerSn,
         productSn: row.productSn,
@@ -419,6 +429,7 @@ export default {
           this.$message.success('产品添加成功', 2.5)
         }
         this.isInster = false
+        this.spinning = false
       })
     },
     //  销售单详情
@@ -433,10 +444,14 @@ export default {
     },
     // 提交销售单
     handleSubmit () {
+      this.spinning = true
       salesWriteSubmit({ id: this.orderId }).then(res => {
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     }

+ 125 - 118
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -9,124 +9,126 @@
     :footer="null"
     @cancel="cancel"
   >
-    <a-form-model
-      id="chooseCustom-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol"
-    >
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="客户名称" prop="buyerSn">
-            <a-select
-              id="chooseCustom-buyerSn"
-              show-search
-              placeholder="请选择客户"
-              v-model="form.buyerSn"
-              :filter-option="filterOption"
-              @change="custChange">
-              <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-            </a-select>
-          </a-form-model-item>
-        </a-col>
-        <!-- <a-col :span="16">
-          <a-form-model-item>
-            <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
-            (点击新增按钮新增客户)
-          </a-form-model-item>
-        </a-col> -->
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="16">
-          <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
-            <a-row :gutter="15">
-              <!-- 客户地址 -->
-              <a-col span="8">
-                <a-form-model-item prop="provinceSn">
-                  <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col span="8">
-                <a-form-model-item prop="citySn">
-                  <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col span="8">
-                <a-form-model-item prop="countySn">
-                  <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </a-form-model-item>
-              </a-col>
-            </a-row>
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="" prop="customerAddr">
-            <a-input
-              id="chooseCustom-customerAddr"
-              :maxLength="60"
-              v-model="form.customerAddr"
-              placeholder="请输入详细地址(最多60个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="联系人" prop="consigneeName">
-            <a-input
-              id="chooseCustom-consigneeName"
-              :maxLength="30"
-              v-model="form.consigneeName"
-              placeholder="请输入联系人(最多30个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="联系电话" prop="consigneeTel">
-            <a-input
-              id="chooseCustom-consigneeTel"
-              :maxLength="30"
-              v-model="form.consigneeTel"
-              placeholder="请输入联系电话(最多30个字符)"
-              allowClear />
-          </a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="15">
-        <a-col :span="8">
-          <a-form-model-item label="是否抓单" prop="grabFlag">
-            <v-select code="FLAG" id="chooseCustom-grabFlag" v-model="form.grabFlag" allowClear placeholder="请选择"></v-select>
-          </a-form-model-item>
-        </a-col>
-        <a-col :span="8">
-          <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
-        </a-col>
-      </a-row>
-      <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
-        <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
-      </a-form-model-item>
-    </a-form-model>
-    <!-- 新增客户 -->
-    <a-modal
-      v-model="isNewCust"
-      title="新增客户"
-      centered
-      width="60%"
-      :maskClosable="false"
-      @cancel="cancelNewCust"
-      :footer="null"
-    >
-      <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
-    </a-modal>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="客户名称" prop="buyerSn">
+              <a-select
+                id="chooseCustom-buyerSn"
+                show-search
+                placeholder="请选择客户"
+                v-model="form.buyerSn"
+                :filter-option="filterOption"
+                @change="custChange">
+                <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="16">
+            <a-form-model-item>
+              <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
+              (点击新增按钮新增客户)
+            </a-form-model-item>
+          </a-col> -->
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="16">
+            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+              <a-row :gutter="15">
+                <!-- 客户地址 -->
+                <a-col span="8">
+                  <a-form-model-item prop="provinceSn">
+                    <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
+                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="8">
+                  <a-form-model-item prop="citySn">
+                    <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="8">
+                  <a-form-model-item prop="countySn">
+                    <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                      <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="" prop="customerAddr">
+              <a-input
+                id="chooseCustom-customerAddr"
+                :maxLength="60"
+                v-model="form.customerAddr"
+                placeholder="请输入详细地址(最多60个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="联系人" prop="consigneeName">
+              <a-input
+                id="chooseCustom-consigneeName"
+                :maxLength="30"
+                v-model="form.consigneeName"
+                placeholder="请输入联系人(最多30个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系电话" prop="consigneeTel">
+              <a-input
+                id="chooseCustom-consigneeTel"
+                :maxLength="30"
+                v-model="form.consigneeTel"
+                placeholder="请输入联系电话(最多30个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="是否抓单" prop="grabFlag">
+              <v-select code="FLAG" id="chooseCustom-grabFlag" v-model="form.grabFlag" allowClear placeholder="请选择"></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+      <!-- 新增客户 -->
+      <a-modal
+        v-model="isNewCust"
+        title="新增客户"
+        centered
+        width="60%"
+        :maskClosable="false"
+        @cancel="cancelNewCust"
+        :footer="null"
+      >
+        <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
+      </a-modal>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -144,6 +146,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       opened: this.show,
       title: '选择客户',
       confirmLoading: false,
@@ -332,11 +335,15 @@ export default {
       const _this = this
       const form = this.form
       console.log(form, 'save data')
+      _this.spinning = true
       salesReturnSave(form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$emit('ok', res.data)
           _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
         }
       })
     },

+ 53 - 48
src/views/salesManagement/salesReturn/detail.vue

@@ -1,53 +1,55 @@
 <template>
   <div class="salesReturnDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="salesReturnDetail-cont">
-      <template slot="subTitle">
-        <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
-      </template>
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="salesReturnDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="salesReturnDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="salesReturnDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <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.provinceName || '--' }}{{ detailData.cityName || '--' }}{{ detailData.countyName || '--' }}{{ detailData.customerAddr || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系电话">{{ detailData.contactTel || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="退货单号">{{ detailData.salesReturnNo || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务状态">{{ detailData.stateDictValue || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
-        <div slot="message">
-          总款数:<strong>{{ countData.totalCategory || 0 }}</strong>;总数量:<strong>{{ countData.totalQty || 0 }}</strong>;废品数量:<strong>{{ countData.totalCelQty || 0 }}</strong>;<br/>
-          退货总金额:<strong>{{ countData.totalAmount || 0 }}</strong>;折扣金额:<strong>{{ countData.discountAmount || 0 }}</strong>;折扣:<strong>{{ countData.discountRate || 0 }}%</strong>;折后金额:<strong>{{ countData.discountedAmount || 0 }}</strong>;
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1430 }"
-        bordered>
-      </s-table>
-    </a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnDetail-cont">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+        </template>
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="salesReturnDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="salesReturnDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="salesReturnDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <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.provinceName || '--' }}{{ detailData.cityName || '--' }}{{ detailData.countyName || '--' }}{{ detailData.customerAddr || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系电话">{{ detailData.contactTel || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货单号">{{ detailData.salesReturnNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData.stateDictValue || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- alert -->
+        <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
+          <div slot="message">
+            总款数:<strong>{{ countData.totalCategory || 0 }}</strong>;总数量:<strong>{{ countData.totalQty || 0 }}</strong>;废品数量:<strong>{{ countData.totalCelQty || 0 }}</strong>;<br/>
+            退货总金额:<strong>{{ countData.totalAmount || 0 }}</strong>;折扣金额:<strong>{{ countData.discountAmount || 0 }}</strong>;折扣:<strong>{{ countData.discountRate || 0 }}%</strong>;折后金额:<strong>{{ countData.discountedAmount || 0 }}</strong>;
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="default"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1430 }"
+          bordered>
+        </s-table>
+      </a-card>
+    </a-spin>
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -62,6 +64,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       disabled: false,
       countData: null,
       // 表头
@@ -134,7 +137,9 @@ export default {
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       salesReturnDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 153 - 142
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -1,158 +1,160 @@
 <template>
   <div>
-    <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">客户名称:{{ (ordeDetail&&ordeDetail.buyerName) || '--' }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="salesReturnEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="salesReturnEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- 查询配件列表 -->
-      <queryPart :buyerSn="$route.params.buyerSn" :priceType="ordeDetail.priceType" grabFlag="0" :newLoading="isInster" @add="saveProduct"></queryPart>
-    </a-card>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- alert -->
-      <a-alert style="margin-bottom: 15px;" type="info">
-        <div slot="message" class="total-bar">
-          <div>
-            <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span>
-            <span>总款数:{{ countData&&countData.totalCategory }};</span>
-            <span>总数量:{{ countData&&countData.totalQty }};</span>
-            <span>废品总数量:{{ countData&&countData.totalCelQty }};</span>
-          </div>
-          <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ (ordeDetail&&ordeDetail.buyerName) || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="salesReturnEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="salesReturnEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- 查询配件列表 -->
+        <queryPart :buyerSn="$route.params.buyerSn" :priceType="ordeDetail.priceType" grabFlag="0" :newLoading="isInster" @add="saveProduct"></queryPart>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- alert -->
+        <a-alert style="margin-bottom: 15px;" type="info">
+          <div slot="message" class="total-bar">
             <div>
-              折扣金额:
-              <a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/>
-              <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
+              <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span>
+              <span>总款数:{{ countData&&countData.totalCategory }};</span>
+              <span>总数量:{{ countData&&countData.totalQty }};</span>
+              <span>废品总数量:{{ countData&&countData.totalCelQty }};</span>
             </div>
             <div>
-              折扣:<strong>{{ ordeDetail&&ordeDetail.discountRate || 0 }}%</strong>;
-              折后总售价:<strong>¥{{ ordeDetail&&ordeDetail.discountedAmount || 0 }}</strong>;
+              <div>
+                折扣金额:
+                <a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/>
+                <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
+              </div>
+              <div>
+                折扣:<strong>{{ ordeDetail&&ordeDetail.discountRate || 0 }}%</strong>;
+                折后总售价:<strong>¥{{ ordeDetail&&ordeDetail.discountedAmount || 0 }}</strong>;
+              </div>
             </div>
           </div>
-        </div>
-      </a-alert>
-      <!-- 查询条件 -->
-      <a-row :gutter="15">
-        <a-col :span="18">
-          <a-form-model layout="inline" :model="productForm" @keyup.enter.native="$refs.table.refresh(true)">
-            <a-form-model-item label="产品编码">
-              <a-input v-model="productForm.productCode" placeholder="输入产品编码" />
-            </a-form-model-item>
-            <a-form-model-item label="产品名称">
-              <a-input v-model="productForm.productName" placeholder="输入产品名称" />
-            </a-form-model-item>
-            <a-form-model-item>
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesReturn-reset">重置</a-button>
-            </a-form-model-item>
-          </a-form-model>
-        </a-col>
-        <a-col :span="6">
-          <div style="float:right;overflow: hidden;">
-            <!-- <a-button id="salesReturn-dru">导入明细</a-button> -->
+        </a-alert>
+        <!-- 查询条件 -->
+        <a-row :gutter="15">
+          <a-col :span="18">
+            <a-form-model layout="inline" :model="productForm" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-form-model-item label="产品编码">
+                <a-input v-model="productForm.productCode" placeholder="输入产品编码" />
+              </a-form-model-item>
+              <a-form-model-item label="产品名称">
+                <a-input v-model="productForm.productName" placeholder="输入产品名称" />
+              </a-form-model-item>
+              <a-form-model-item>
+                <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-refresh">查询</a-button>
+                <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesReturn-reset">重置</a-button>
+              </a-form-model-item>
+            </a-form-model>
+          </a-col>
+          <a-col :span="6">
+            <div style="float:right;overflow: hidden;">
+              <!-- <a-button id="salesReturn-dru">导入明细</a-button> -->
+              <a-button
+                size="small"
+                type="primary"
+                @click="salesReturnDelAll"
+                :loading="delLoading"
+                style="margin-left: 10px"
+                id="salesReturn-del-all">整单删除</a-button>
+            </div>
+          </a-col>
+        </a-row>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1830, y: 300 }"
+          bordered>
+          <!-- 本次退货数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <editable-cell
+              size="small"
+              :text="record.qty"
+              :max="999999"
+              :min="0"
+              :precision="0"
+              @change="onCellChange(record.id, 'qty', $event)" />
+          </template>
+          <!-- 废品数量 -->
+          <template slot="celQty" slot-scope="text, record">
+            <editable-cell
+              size="small"
+              :text="record.celQty"
+              :max="999999"
+              :min="0"
+              :precision="0"
+              @change="onCellChange(record.id, 'celQty', $event)" />
+          </template>
+          <!-- 价格 -->
+          <template slot="price" slot-scope="text, record">
+            <editable-cell
+              size="small"
+              :text="text"
+              :max="999999"
+              :min="0"
+              :precision="2"
+              punit="¥"
+              @change="onCellChange(record.id, 'price', $event)" />
+          </template>
+          <!-- 退货金额小计 -->
+          <template slot="returnAmount" slot-scope="text, record">
+            ¥{{ (record.price * record.qty).toFixed(2) }}
+          </template>
+          <!-- 仓库仓位 -->
+          <template slot="warehouse" slot-scope="text, record, index">
+            <a-cascader
+              @change="e => changeWarehouseCascade(e, record, index)"
+              v-model="record.warehouseCascade"
+              expand-trigger="hover"
+              :options="warehouseCascadeData"
+              :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+              id="bulkWarehousingOrderEdit-warehouseCascade"
+              placeholder="请选择仓库仓位"
+              style="width: 100%;" />
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
             <a-button
               size="small"
               type="primary"
-              @click="salesReturnDelAll"
               :loading="delLoading"
-              style="margin-left: 10px"
-              id="salesReturn-del-all">整单删除</a-button>
-          </div>
-        </a-col>
-      </a-row>
-      <!-- 已选配件列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1830, y: 300 }"
-        bordered>
-        <!-- 本次退货数量 -->
-        <template slot="qty" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="record.qty"
-            :max="999999"
-            :min="0"
-            :precision="0"
-            @change="onCellChange(record.id, 'qty', $event)" />
-        </template>
-        <!-- 废品数量 -->
-        <template slot="celQty" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="record.celQty"
-            :max="999999"
-            :min="0"
-            :precision="0"
-            @change="onCellChange(record.id, 'celQty', $event)" />
-        </template>
-        <!-- 价格 -->
-        <template slot="price" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="text"
-            :max="999999"
-            :min="0"
-            :precision="2"
-            punit="¥"
-            @change="onCellChange(record.id, 'price', $event)" />
-        </template>
-        <!-- 退货金额小计 -->
-        <template slot="returnAmount" slot-scope="text, record">
-          ¥{{ (record.price * record.qty).toFixed(2) }}
-        </template>
-        <!-- 仓库仓位 -->
-        <template slot="warehouse" slot-scope="text, record, index">
-          <a-cascader
-            @change="e => changeWarehouseCascade(e, record, index)"
-            v-model="record.warehouseCascade"
-            expand-trigger="hover"
-            :options="warehouseCascadeData"
-            :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-            id="bulkWarehousingOrderEdit-warehouseCascade"
-            placeholder="请选择仓库仓位"
-            style="width: 100%;" />
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-Del">删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div
+          style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
           <a-button
-            size="small"
+            size="large"
+            style="width: 150px;"
             type="primary"
-            :loading="delLoading"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-Del">删除</a-button>
-        </template>
-      </s-table>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div
-        style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          size="large"
-          style="width: 150px;"
-          type="primary"
-          class="button-primary"
-          @click="handleSubmit()"
-          id="salesReturn-handleSubmit">提交</a-button>
-      </div>
-    </a-affix>
+            class="button-primary"
+            @click="handleSubmit()"
+            id="salesReturn-handleSubmit">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
     <!-- 打印 -->
@@ -178,6 +180,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       orderId: null,
       orderSn: null,
       buyerSn: null,
@@ -415,24 +418,32 @@ export default {
       } else {
         params.salesQty = row.qty
       }
+      this.spinning = true
       salesReturnSaveProduct(params).then(res => {
         this.resetSearchForm(true)
         this.isInster = false
+        this.spinning = false
       })
     },
     // 提交销售单
     handleSubmit () {
+      this.spinning = true
       salesReturnSubmit({ sn: this.orderSn }).then(res => {
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       salesReturnDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 143 - 132
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -1,148 +1,150 @@
 <template>
   <div>
-    <a-page-header :ghost="false" :backIcon="false" class="salesReturnGrabEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="salesReturnGrabEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">客户名称:{{ (ordeDetail&&ordeDetail.buyerName) || '--' }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-radio-group key="3" v-model="printerType">
-          <a-radio value="NEEDLE">针式</a-radio>
-          <a-radio value="INK">喷墨</a-radio>
-        </a-radio-group>
-        <a-button key="2" id="salesReturnEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
-        <a-button key="1" type="primary" id="salesReturnEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- 查询配件列表 -->
-      <queryPart :buyerSn="$route.params.buyerSn" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
-    </a-card>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- alert -->
-      <a-alert style="margin-bottom: 15px;" type="info">
-        <div slot="message" class="total-bar">
-          <div>
-            <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span>
-            <span>总款数:{{ countData&&countData.totalCategory }};</span>
-            <span>总数量:{{ countData&&countData.totalQty }};</span>
-            <span>废品总数量:{{ countData&&countData.totalCelQty }};</span>
-          </div>
-          <div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesReturnGrabEdit-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="salesReturnGrabEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin: 0 15px;color: #666;">客户名称:{{ (ordeDetail&&ordeDetail.buyerName) || '--' }}</span>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-radio-group key="3" v-model="printerType">
+            <a-radio value="NEEDLE">针式</a-radio>
+            <a-radio value="INK">喷墨</a-radio>
+          </a-radio-group>
+          <a-button key="2" id="salesReturnEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="salesReturnEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- 查询配件列表 -->
+        <queryPart :buyerSn="$route.params.buyerSn" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- alert -->
+        <a-alert style="margin-bottom: 15px;" type="info">
+          <div slot="message" class="total-bar">
             <div>
-              折扣金额:
-              <a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/>
-              <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
+              <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span>
+              <span>总款数:{{ countData&&countData.totalCategory }};</span>
+              <span>总数量:{{ countData&&countData.totalQty }};</span>
+              <span>废品总数量:{{ countData&&countData.totalCelQty }};</span>
             </div>
             <div>
-              折扣:<strong>{{ ordeDetail&&ordeDetail.discountRate || 0 }}%</strong>;
-              折后总售价:<strong>¥{{ ordeDetail&&ordeDetail.discountedAmount || 0 }}</strong>;
+              <div>
+                折扣金额:
+                <a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/>
+                <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
+              </div>
+              <div>
+                折扣:<strong>{{ ordeDetail&&ordeDetail.discountRate || 0 }}%</strong>;
+                折后总售价:<strong>¥{{ ordeDetail&&ordeDetail.discountedAmount || 0 }}</strong>;
+              </div>
             </div>
           </div>
-        </div>
-      </a-alert>
-      <!-- 查询条件 -->
-      <a-row :gutter="15">
-        <a-col :span="18">
-          <a-form-model layout="inline" :model="productForm" @keyup.enter.native="$refs.table.refresh(true)">
-            <a-form-model-item label="产品编码">
-              <a-input v-model="productForm.productCode" placeholder="输入产品编码" />
-            </a-form-model-item>
-            <a-form-model-item label="产品名称">
-              <a-input v-model="productForm.productName" placeholder="输入产品名称" />
-            </a-form-model-item>
-            <a-form-model-item>
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesReturn-reset">重置</a-button>
-            </a-form-model-item>
-          </a-form-model>
-        </a-col>
-        <a-col :span="6">
-          <div style="float:right;overflow: hidden;">
-            <!-- <a-button id="salesReturn-dru">导入明细</a-button> -->
+        </a-alert>
+        <!-- 查询条件 -->
+        <a-row :gutter="15">
+          <a-col :span="18">
+            <a-form-model layout="inline" :model="productForm" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-form-model-item label="产品编码">
+                <a-input v-model="productForm.productCode" placeholder="输入产品编码" />
+              </a-form-model-item>
+              <a-form-model-item label="产品名称">
+                <a-input v-model="productForm.productName" placeholder="输入产品名称" />
+              </a-form-model-item>
+              <a-form-model-item>
+                <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-refresh">查询</a-button>
+                <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesReturn-reset">重置</a-button>
+              </a-form-model-item>
+            </a-form-model>
+          </a-col>
+          <a-col :span="6">
+            <div style="float:right;overflow: hidden;">
+              <!-- <a-button id="salesReturn-dru">导入明细</a-button> -->
+              <a-button
+                size="small"
+                type="primary"
+                @click="salesReturnDelAll"
+                :loading="delLoading"
+                style="margin-left: 10px"
+                id="salesReturn-del-all">整单删除</a-button>
+            </div>
+          </a-col>
+        </a-row>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 2070, y: 300 }"
+          bordered>
+          <!-- 本次退货数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <editable-cell
+              size="small"
+              :text="record.qty"
+              :max="999999"
+              :min="0"
+              :precision="0"
+              @change="onCellChange(record.id, 'qty', $event)" />
+          </template>
+          <!-- 废品数量 -->
+          <template slot="celQty" slot-scope="text, record">
+            <editable-cell
+              size="small"
+              :text="record.celQty"
+              :max="999999"
+              :min="0"
+              :precision="0"
+              @change="onCellChange(record.id, 'celQty', $event)" />
+          </template>
+          <!-- 退货金额小计 -->
+          <template slot="returnAmount" slot-scope="text, record">
+            ¥{{ (record.price * record.qty).toFixed(2) }}
+          </template>
+          <!-- 仓库仓位 -->
+          <template slot="warehouse" slot-scope="text, record, index">
+            <a-cascader
+              @change="e => changeWarehouseCascade(e, record, index)"
+              v-model="record.warehouseCascade"
+              expand-trigger="hover"
+              :options="warehouseCascadeData"
+              :allowClear="false"
+              :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+              id="bulkWarehousingOrderEdit-warehouseCascade"
+              placeholder="请选择仓库仓位"
+              style="width: 100%;" />
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
             <a-button
               size="small"
               type="primary"
-              @click="salesReturnDelAll"
               :loading="delLoading"
-              style="margin-left: 10px"
-              id="salesReturn-del-all">整单删除</a-button>
-          </div>
-        </a-col>
-      </a-row>
-      <!-- 已选配件列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 2070, y: 300 }"
-        bordered>
-        <!-- 本次退货数量 -->
-        <template slot="qty" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="record.qty"
-            :max="999999"
-            :min="0"
-            :precision="0"
-            @change="onCellChange(record.id, 'qty', $event)" />
-        </template>
-        <!-- 废品数量 -->
-        <template slot="celQty" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="record.celQty"
-            :max="999999"
-            :min="0"
-            :precision="0"
-            @change="onCellChange(record.id, 'celQty', $event)" />
-        </template>
-        <!-- 退货金额小计 -->
-        <template slot="returnAmount" slot-scope="text, record">
-          ¥{{ (record.price * record.qty).toFixed(2) }}
-        </template>
-        <!-- 仓库仓位 -->
-        <template slot="warehouse" slot-scope="text, record, index">
-          <a-cascader
-            @change="e => changeWarehouseCascade(e, record, index)"
-            v-model="record.warehouseCascade"
-            expand-trigger="hover"
-            :options="warehouseCascadeData"
-            :allowClear="false"
-            :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-            id="bulkWarehousingOrderEdit-warehouseCascade"
-            placeholder="请选择仓库仓位"
-            style="width: 100%;" />
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-Del">删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+      <a-affix :offset-bottom="0">
+        <div
+          style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
           <a-button
-            size="small"
+            size="large"
+            style="width: 150px;"
             type="primary"
-            :loading="delLoading"
-            class="button-error"
-            @click="handleDel(record)"
-            id="salesReturn-Del">删除</a-button>
-        </template>
-      </s-table>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div
-        style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          size="large"
-          style="width: 150px;"
-          type="primary"
-          class="button-primary"
-          @click="handleSubmit()"
-          id="salesReturn-handleSubmit">提交</a-button>
-      </div>
-    </a-affix>
+            class="button-primary"
+            @click="handleSubmit()"
+            id="salesReturn-handleSubmit">提交</a-button>
+        </div>
+      </a-affix>
+    </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
     <!-- 打印 -->
@@ -168,6 +170,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       orderId: null,
       orderSn: null,
       buyerSn: null,
@@ -409,24 +412,32 @@ export default {
       } else {
         params.salesQty = row.qty
       }
+      this.spinning = true
       salesReturnSaveProduct(params).then(res => {
         this.resetSearchForm(true)
         this.isInster = false
+        this.spinning = false
       })
     },
     // 提交销售单
     handleSubmit () {
+      this.spinning = true
       salesReturnSubmit({ sn: this.orderSn }).then(res => {
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
+          this.spinning = false
+        } else {
+          this.spinning = false
         }
       })
     },
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
+      _this.spinning = true
       salesReturnDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        _this.spinning = false
         if (res.type == 'application/json') {
           var reader = new FileReader()
           reader.addEventListener('loadend', function () {

+ 53 - 50
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -1,56 +1,58 @@
 <template>
   <div class="urgentItemsOffsetDetail-page-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-icon type="left" /> 返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="3" type="danger" v-if="!isWriteDown" @click="handleSubmit" id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
-        <!-- <a-button key="2" @click="handlePreview" id="urgentItemsOffsetDetail-btn-preview">打印预览</a-button>
-        <a-button key="1" type="primary" @click="handlePrint" id="urgentItemsOffsetDetail-btn-print">快速打印</a-button> -->
-      </template>
-    </a-page-header>
-    <!-- 急件单信息 -->
-    <a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-info-wrapper">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :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.buyerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="联系电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收款方式">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="急件单号">{{ detailData.urgentBillNo || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="状态">{{ detailData.statusDictValue || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 表格 -->
-    <a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-table-wrapper">
-      <!-- 合计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px" v-if="detailData">
-        <div class="ftext" slot="message">总款数:<strong>{{ detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData.totalQty || 0 }}</strong>。</div>
-      </a-alert>
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="isWriteDown ? columns : unColumns"
-        :data="loadData"
-        :scroll="{ x: isWriteDown ? 1570 : '100%' }"
-        bordered>
-        <!-- 库存数量 -->
-        <template slot="inventoryQuantity" slot-scope="text, record">
-          <span v-if="record.stockEntity&&(record.stockEntity.currentStockQty||record.stockEntity.currentStockQty==0)" :class="[record.stockEntity.currentStockQty < record.qty ? 'red' : '']" :style="{fontWeight: record.stockEntity.currentStockQty < record.qty?'bold':''}">{{ record.stockEntity.currentStockQty }}</span>
-          <span v-else>--</span>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 操作 -->
+      <a-page-header :ghost="false" :backIcon="false" class="urgentItemsOffsetDetail-operation-wrapper" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
-      </s-table>
-    </a-card>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-button key="3" type="danger" v-if="!isWriteDown" @click="handleSubmit" id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
+          <!-- <a-button key="2" @click="handlePreview" id="urgentItemsOffsetDetail-btn-preview">打印预览</a-button>
+          <a-button key="1" type="primary" @click="handlePrint" id="urgentItemsOffsetDetail-btn-print">快速打印</a-button> -->
+        </template>
+      </a-page-header>
+      <!-- 急件单信息 -->
+      <a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-info-wrapper">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :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.buyerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="联系电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ detailData.buyerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="急件单号">{{ detailData.urgentBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="状态">{{ detailData.statusDictValue || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <!-- 表格 -->
+      <a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-table-wrapper">
+        <!-- 合计 -->
+        <a-alert type="info" showIcon style="margin-bottom:15px" v-if="detailData">
+          <div class="ftext" slot="message">总款数:<strong>{{ detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData.totalQty || 0 }}</strong>。</div>
+        </a-alert>
+        <s-table
+          class="sTable"
+          ref="table"
+          size="default"
+          :rowKey="(record) => record.id"
+          :columns="isWriteDown ? columns : unColumns"
+          :data="loadData"
+          :scroll="{ x: isWriteDown ? 1570 : '100%' }"
+          bordered>
+          <!-- 库存数量 -->
+          <template slot="inventoryQuantity" slot-scope="text, record">
+            <span v-if="record.stockEntity&&(record.stockEntity.currentStockQty||record.stockEntity.currentStockQty==0)" :class="[record.stockEntity.currentStockQty < record.qty ? 'red' : '']" :style="{fontWeight: record.stockEntity.currentStockQty < record.qty?'bold':''}">{{ record.stockEntity.currentStockQty }}</span>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
   </div>
 
 </template>
@@ -62,6 +64,7 @@ export default {
   components: { STable, VSelect },
   data () {
     return {
+      spinning: false,
       unColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center' },

+ 28 - 21
src/views/storeManagement/bind/editModal.vue

@@ -8,28 +8,30 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="bindEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="选择中心店" prop="orgSn">
-          <orgList ref="orgList" :disabled="itemSn?itemSn:''" @change="orgChange" />
-        </a-form-model-item>
-        <a-form-model-item label="选择配送店" prop="childSnList">
-          <orgMultipleList ref="orgMultipleList" :disabled="itemSn?itemSn:form.orgSn" :params="{ sn: form.orgSn }" @change="orgMultipleChange" />
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="bindEdit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="bindEdit-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="bindEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="选择中心店" prop="orgSn">
+            <orgList ref="orgList" :disabled="itemSn?itemSn:''" @change="orgChange" />
+          </a-form-model-item>
+          <a-form-model-item label="选择配送店" prop="childSnList">
+            <orgMultipleList ref="orgMultipleList" :disabled="itemSn?itemSn:form.orgSn" :params="{ sn: form.orgSn }" @change="orgMultipleChange" />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="bindEdit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="bindEdit-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -57,6 +59,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -98,13 +101,17 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          _this.spinning = true
           jxsorgRelationSave(_this.form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               setTimeout(function () {
                 _this.isShow = false
+                _this.spinning = false
               }, 300)
+            } else {
+              _this.spinning = false
             }
           })
         } else {

+ 61 - 56
src/views/storeManagement/userAuthorization/editModal.vue

@@ -8,62 +8,64 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="bindEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="选择中心店" prop="ownerOrgSn">
-          <a-select
-            placeholder="请选择中心店"
-            id="productInfoList-ownerOrgSn"
-            allowClear
-            v-model="form.ownerOrgSn"
-            :disabled="itemSn?true:false"
-            :showSearch="true"
-            option-filter-prop="children"
-            :filter-option="filterOption"
-            @change="orgChange">
-            <a-select-option v-for="item in orgList" :key="item.orgSn" :value="item.orgSn">{{ item.orgName }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item label="选择授权账号" prop="userSn">
-          <a-select
-            placeholder="请选择授权账号"
-            id="productInfoList-userSn"
-            allowClear
-            v-model="form.userSn"
-            :disabled="itemSn?true:false"
-            :showSearch="true"
-            option-filter-prop="children"
-            :filter-option="filterOption">
-            <a-select-option v-for="item in userList" :key="item.sn" :value="item.sn" :disabled="item.status=='0'">{{ item.name }} - {{ item.loginName }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item label="选择配送店" prop="orgSnList">
-          <a-select
-            placeholder="请选择配送店"
-            id="productInfoList-orgSnList"
-            allowClear
-            v-model="form.orgSnList"
-            mode="multiple"
-            :showSearch="true"
-            option-filter-prop="children"
-            :filter-option="filterOption">
-            <a-select-option v-for="item in childList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="bindEdit-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="bindEdit-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="bindEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="选择中心店" prop="ownerOrgSn">
+            <a-select
+              placeholder="请选择中心店"
+              id="productInfoList-ownerOrgSn"
+              allowClear
+              v-model="form.ownerOrgSn"
+              :disabled="itemSn?true:false"
+              :showSearch="true"
+              option-filter-prop="children"
+              :filter-option="filterOption"
+              @change="orgChange">
+              <a-select-option v-for="item in orgList" :key="item.orgSn" :value="item.orgSn">{{ item.orgName }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
+          <a-form-model-item label="选择授权账号" prop="userSn">
+            <a-select
+              placeholder="请选择授权账号"
+              id="productInfoList-userSn"
+              allowClear
+              v-model="form.userSn"
+              :disabled="itemSn?true:false"
+              :showSearch="true"
+              option-filter-prop="children"
+              :filter-option="filterOption">
+              <a-select-option v-for="item in userList" :key="item.sn" :value="item.sn" :disabled="item.status=='0'">{{ item.name }} - {{ item.loginName }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
+          <a-form-model-item label="选择配送店" prop="orgSnList">
+            <a-select
+              placeholder="请选择配送店"
+              id="productInfoList-orgSnList"
+              allowClear
+              v-model="form.orgSnList"
+              mode="multiple"
+              :showSearch="true"
+              option-filter-prop="children"
+              :filter-option="filterOption">
+              <a-select-option v-for="item in childList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+            </a-select>
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="bindEdit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="bindEdit-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -84,6 +86,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -138,15 +141,17 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          _this.spinning = true
           userOrgSave(_this.form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               setTimeout(function () {
                 _this.isShow = false
+                _this.spinning = false
               }, 300)
             } else {
-
+              _this.spinning = false
             }
           })
         } else {

+ 98 - 91
src/views/supplierManagement/supplierInfo/editModal.vue

@@ -8,98 +8,100 @@
     v-model="isShow"
     @cancle="isShow=false"
     :width="800">
-    <!-- 表单 -->
-    <div>
-      <a-form-model
-        id="supplierInfoEdit-form"
-        ref="ruleForm"
-        :model="form"
-        :rules="rules"
-        :label-col="formItemLayout.labelCol"
-        :wrapper-col="formItemLayout.wrapperCol"
-      >
-        <a-form-model-item label="供应商名称" prop="supplierName">
-          <a-input
-            id="supplierInfoEdit-supplierName"
-            :maxLength="30"
-            v-model.trim="form.supplierName"
-            @change="filterEmpty"
-            placeholder="请输入供应商名称(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="所在地区" required style="margin: 0;">
-          <a-row :gutter="20">
-            <!-- 所在地区 -->
-            <a-col span="8">
-              <a-form-model-item prop="provinceSn">
-                <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-            <a-col span="8">
-              <a-form-model-item prop="citySn">
-                <a-select id="supplierInfoEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                  <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-            <a-col span="8">
-              <a-form-model-item prop="countySn">
-                <a-select id="supplierInfoEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                  <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-model-item>
-            </a-col>
-          </a-row>
-        </a-form-model-item>
-        <a-form-model-item label="详细地址" prop="supplierAddress">
-          <a-input
-            id="supplierInfoEdit-supplierAddress"
-            :maxLength="60"
-            v-model="form.supplierAddress"
-            placeholder="请输入详细地址(最多60个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="联系人" prop="contactPerson">
-          <a-input
-            id="supplierInfoEdit-contactPerson"
-            :maxLength="30"
-            v-model="form.contactPerson"
-            placeholder="请输入联系人(最多30个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="联系电话" prop="contactTel">
-          <a-input
-            id="supplierInfoEdit-contactTel"
-            :maxLength="20"
-            v-model="form.contactTel"
-            placeholder="请输入联系电话(最多20个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="主营内容" prop="businessScope">
-          <a-textarea
-            id="supplierInfoEdit-businessScope"
-            :maxLength="200"
-            v-model="form.businessScope"
-            placeholder="请输入主营内容(最多200个字符)"
-            allowClear />
-        </a-form-model-item>
-        <a-form-model-item label="状态" prop="enabledFlag" v-if="isState">
-          <a-radio-group
-            name="radioGroup"
-            v-model="form.enabledFlag"
-            id="supplierInfoEdit-enabledFlag" >
-            <a-radio :value="1">启用</a-radio>
-            <a-radio :value="0">禁用</a-radio>
-          </a-radio-group>
-        </a-form-model-item>
-      </a-form-model>
-      <div class="btn-cont">
-        <a-button type="primary" id="supplierInfoEdit-btn-submit" @click="handleSubmit">保存</a-button>
-        <a-button id="supplierInfoEdit-btn-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div>
+        <a-form-model
+          id="supplierInfoEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="供应商名称" prop="supplierName">
+            <a-input
+              id="supplierInfoEdit-supplierName"
+              :maxLength="30"
+              v-model.trim="form.supplierName"
+              @change="filterEmpty"
+              placeholder="请输入供应商名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="所在地区" required style="margin: 0;">
+            <a-row :gutter="20">
+              <!-- 所在地区 -->
+              <a-col span="8">
+                <a-form-model-item prop="provinceSn">
+                  <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
+                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col span="8">
+                <a-form-model-item prop="citySn">
+                  <a-select id="supplierInfoEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col span="8">
+                <a-form-model-item prop="countySn">
+                  <a-select id="supplierInfoEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </a-form-model-item>
+          <a-form-model-item label="详细地址" prop="supplierAddress">
+            <a-input
+              id="supplierInfoEdit-supplierAddress"
+              :maxLength="60"
+              v-model="form.supplierAddress"
+              placeholder="请输入详细地址(最多60个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="联系人" prop="contactPerson">
+            <a-input
+              id="supplierInfoEdit-contactPerson"
+              :maxLength="30"
+              v-model="form.contactPerson"
+              placeholder="请输入联系人(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="联系电话" prop="contactTel">
+            <a-input
+              id="supplierInfoEdit-contactTel"
+              :maxLength="20"
+              v-model="form.contactTel"
+              placeholder="请输入联系电话(最多20个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="主营内容" prop="businessScope">
+            <a-textarea
+              id="supplierInfoEdit-businessScope"
+              :maxLength="200"
+              v-model="form.businessScope"
+              placeholder="请输入主营内容(最多200个字符)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="状态" prop="enabledFlag" v-if="isState">
+            <a-radio-group
+              name="radioGroup"
+              v-model="form.enabledFlag"
+              id="supplierInfoEdit-enabledFlag" >
+              <a-radio :value="1">启用</a-radio>
+              <a-radio :value="0">禁用</a-radio>
+            </a-radio-group>
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" id="supplierInfoEdit-btn-submit" @click="handleSubmit">保存</a-button>
+          <a-button id="supplierInfoEdit-btn-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        </div>
       </div>
-    </div>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -129,6 +131,7 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 6 },
@@ -207,11 +210,15 @@ export default {
         if (valid) {
           const form = _this.form
           form.id = this.itemId ? this.itemId : null
+          _this.spinning = true
           supplierSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
             }
           })
         } else {