chenrui преди 11 месеца
родител
ревизия
68baa73856

+ 338 - 0
src/views/purchasingManagement/purchaseReceipt/addModal.vue

@@ -0,0 +1,338 @@
+<template>
+  <a-modal
+    centered
+    class="bulkWarehousingOrder-product-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="(itemSn ? '编辑' : '新增') + '产品'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="bulkWarehousingOrder-product-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+        @keyup.enter.native="handleSave">
+        <a-form-model-item label="供应商名称" prop="supplierSn">{{ (nowData&&nowData.supplierName) || '--' }}</a-form-model-item>
+        <a-form-model-item label="产品编码" :prop="!itemSn?'productSn':''">
+          <a-select
+            show-search
+            id="bulkWarehousingOrder-product-productSn"
+            ref="productSn"
+            v-if="!itemSn"
+            v-model="form.productSn"
+            placeholder="请选择"
+            :filter-option="false"
+            :not-found-content="fetching ? undefined : null"
+            :autoFocus="true"
+            @search="fetchUser"
+            @change="handleChange"
+          >
+            <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+            <a-select-option v-for="item in productData" :key="item.product.productSn + item.product.code" :value="item.product.productSn">{{ item.product.code }}</a-select-option>
+          </a-select>
+          <span v-else>{{ form.productCode }}</span>
+        </a-form-model-item>
+        <a-form-model-item label="产品名称" prop="productName">{{ form.productName || '--' }}</a-form-model-item>
+        <a-form-model-item label="原厂编码" prop="productOrigCode">{{ form.productOrigCode || '--' }}</a-form-model-item>
+        <a-form-model-item label="仓库仓位" prop="warehouseLocationSn">
+          {{ (nowData&&nowData.warehouseName) || '--' }} >
+          <a-select
+            id="bulkWarehousingOrder-product-warehouse"
+            @change="changeWarehouseCascade"
+            placeholder="请选择仓位"
+            :allowClear="false"
+            style="width: 50%;"
+            v-model="form.warehouseLocationSn">
+            <a-select-option v-for="item in warehouseCascadeData" :value="item.sn">
+              {{ item.name }}
+            </a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="成本价">
+          <span style="margin-right:20px;">{{ form.productCost ? toThousands(form.productCost) : '--' }}</span>
+          <a-checkbox v-if="productCost||isGift" :disabled="!!itemSn" v-model="isGift">是否为赠品</a-checkbox>
+        </a-form-model-item>
+        <a-form-model-item label="数量" prop="productQty">
+          <a-input-number
+            id="bulkWarehousingOrder-product-productQty"
+            ref="productQty"
+            v-model="form.productQty"
+            :precision="0"
+            :min="1"
+            :max="99999999"
+            placeholder="请输入"
+            style="width: 50%;margin-right:20px;" /><span>个</span>
+        </a-form-model-item>
+        <div class="btn-cont">
+          <a-button id="bulkWarehousingOrder-product-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+          <a-button type="primary" id="bulkWarehousingOrder-product-modal-save" @click="handleSave">{{ itemSn?'保存':'保存并新增' }}</a-button>
+        </div>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import debounce from 'lodash/debounce'
+import { supplierProductList } from '@/api/supplier'
+import { warehouseCascadeList } from '@/api/warehouse'
+import { sparePartsSaveDetail, sparePartsDetailD } from '@/api/spareParts'
+export default {
+  name: 'BulkWarehousingOrderBasicInfoModal',
+  mixins: [commonMixin],
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    }
+  },
+  data () {
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 5 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        supplierSn: '', // 供应商
+        productSn: undefined,
+        productName: '',
+        productCode: '',
+        productOrigCode: '',
+        warehouseSn: '',
+        warehouseLocationSn: undefined,
+        productCost: '',
+        productQty: ''
+      },
+      productCost: '',
+      rules: {
+        productSn: [
+          { required: true, message: '请选择产品编码', trigger: 'change' }
+        ],
+        warehouseLocationSn: [
+          { required: true, message: '请选择仓位', trigger: 'change' }
+        ],
+        productCost: [
+          { required: true, message: '该产品没有设置成本价', trigger: 'blur' }
+        ],
+        productQty: [
+          { required: true, message: '请输入数量', trigger: 'blur' }
+        ]
+      },
+      fetching: false,
+      productData: [],
+      warehouseCascadeData: [], //  仓库仓位  下拉数据
+      warehouseSnBackups: '', //  仓库备份数据
+      warehouseLocationSnBackups: '', //  仓位备份数据
+      isGift: false
+    }
+  },
+  methods: {
+    // 搜索产品
+    fetchUser (value) {
+      console.log('fetching user', value)
+      this.fetching = true
+      const params = {
+        product: {
+          code: value
+        },
+        supplierSn: this.nowData.supplierSn,
+        pageNo: 1,
+        pageSize: 20
+      }
+      supplierProductList(params).then(res => {
+        if (res.status == 200) {
+          this.productData = res.data && res.data.list ? res.data.list : []
+          this.fetching = false
+        } else {
+          this.productData = []
+          this.fetching = false
+        }
+      })
+    },
+    // 产品编码  change
+    handleChange (value) {
+      const ind = this.productData.findIndex(item => item.productSn == value)
+      this.form.productName = this.productData[ind].product.name
+      this.form.productCode = this.productData[ind].product.code
+      this.form.productOrigCode = this.productData[ind].product.origCode
+      this.form.productCost = this.productData[ind].cost
+      this.productCost = this.form.productCost
+      this.form.productQty = ''
+      this.isGift = false
+      this.$refs.productQty.focus()
+      this.$refs.ruleForm.validate()
+    },
+    // 详情
+    getDetail () {
+      this.spinning = true
+      sparePartsDetailD({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          // this.fetchUser(this.form.productCode)
+          this.warehouseSnBackups = this.form.warehouseSn || undefined
+          this.warehouseLocationSnBackups = this.form.warehouseLocationSn || undefined
+          this.isGift = this.form.giftFlag == 1
+        }
+        this.spinning = false
+      })
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.sparePartsSn = this.nowData.sparePartsSn
+          form.sparePartsNo = this.nowData.sparePartsNo
+          form.supplierSn = this.nowData.supplierSn
+          form.giftFlag = this.isGift ? 1 : 0
+          if (!_this.itemSn) {
+            delete form.id
+            delete form.sparePartsDetailSn
+            if (!this.productCost) {
+              _this.$message.warning('该产品没有设置成本价!')
+              return false
+            }
+          }
+          _this.spinning = true
+          sparePartsSaveDetail(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+                if (!_this.itemSn) {
+                  _this.resetData()
+                  _this.$refs.productQty.blur()
+                  _this.$refs.productSn.focus()
+                } else {
+                  _this.isShow = false
+                }
+              })
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    changeWarehouseCascade (val) {
+      this.$refs.productQty.focus()
+      this.$refs.ruleForm.validate()
+    },
+    //  仓库仓位  级联  列表
+    getWarehouseCascade () {
+      const _this = this
+      warehouseCascadeList({}).then(res => {
+        if (res.status == 200) {
+          // 默认仓库
+          const defSn = this.isShowWarehouse ? this.nowData.warehouseSn : this.defWarehouse && this.defWarehouse.warehouseSn
+          _this.form.warehouseSn = defSn
+          _this.warehouseSnBackups = defSn
+          const data = res.data.find(item => item.warehouseSn == defSn)
+          console.log(data.warehouseLocationList)
+          if (data && data.warehouseLocationList) {
+            data.warehouseLocationList.map(subItem => {
+              subItem.sn = subItem.warehouseLocationSn
+              if (subItem.defaultFlag == 1) {
+                _this.form.warehouseLocationSn = subItem.warehouseLocationSn
+                _this.warehouseLocationSnBackups = subItem.warehouseLocationSn
+              }
+            })
+            this.warehouseCascadeData = data.warehouseLocationList
+          } else {
+            this.warehouseCascadeData = []
+          }
+        } else {
+          this.warehouseCascadeData = []
+        }
+      })
+    },
+    resetData () {
+      this.$refs.ruleForm.resetFields()
+      this.form = {
+        supplierSn: '', // 供应商
+        productSn: undefined,
+        productName: '',
+        productCode: '',
+        productOrigCode: '',
+        warehouseSn: this.warehouseSnBackups,
+        warehouseLocationSn: this.warehouseLocationSnBackups,
+        productCost: '',
+        productQty: ''
+      }
+      this.productCost = ''
+      this.isGift = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetData()
+        this.warehouseSnBackups = ''
+        this.warehouseLocationSnBackups = ''
+      } else {
+        this.getWarehouseCascade()
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    },
+    isGift (newValue, oldValue) {
+      if (newValue) {
+        this.form.productCost = 0
+      } else {
+        this.form.productCost = this.productCost
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .bulkWarehousingOrder-product-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+      .ant-form-item{
+        margin-bottom: 10px;
+      }
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 191 - 0
src/views/purchasingManagement/purchaseReceipt/chooseImportModal.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { hdExportExcel } from '@/libs/exportExcel'
+import { sparePartsDetailParseProducts, sparePartsDetailFailExcel } from '@/api/spareParts'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qtyText', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qtyText', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '备注', dataIndex: 'errorDesc', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        sparePartsSn: this.paramsData.sparePartsSn,
+        path: this.paramsData.path
+      }
+      sparePartsDetailParseProducts(params).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.okList && res.data.okList.length > 0) {
+            res.data.okList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.okList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      const params = {
+        list: _this.unLoadData
+      }
+      hdExportExcel(sparePartsDetailFailExcel, params, '产品导入错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 168 - 0
src/views/purchasingManagement/purchaseReceipt/detailModal.vue

@@ -0,0 +1,168 @@
+<template>
+  <a-modal
+    centered
+    class="detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="960">
+    <a-card size="small" :bordered="false" class="detail-basics-info">
+      <!-- 基础信息 -->
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1">
+          <template slot="header">
+            基础信息
+          </template>
+          <a-descriptions :column="3">
+            <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="入库仓库">{{ (basicInfoData&&basicInfoData.warehouseName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="采购单号">{{ (basicInfoData&&basicInfoData.sparePartsTypeDictValue) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="客户名称">{{ (basicInfoData&&basicInfoData.sparePartsNo) || '--' }}</a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+      <!-- 总计 -->
+      <a-alert type="info" style="margin:10px 0">
+        <div slot="message">
+          采购数量 <strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ,
+          <span v-if="$hasPermissions('B_sparePartsDetail_costPrice')">采购金额 <strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(productTotal.totalPrice) : '--' }}</strong></span>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 300 }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_purchaseReturnEdit')"
+            @click="handleCheck(record)"
+            class="button-info"
+            id="detail-edit-btn">查看</a-button>
+        </template>
+      </s-table>
+    </a-card>
+    <div class="btn-cont">
+      <a-button id="detail-basicInfo-modal-back" @click="isShow = false">返回列表</a-button>
+    </div>
+    <uniqueCodeModal v-drag :openModal="openUniqueCodeModal" :itemSn="itemSn" @close="closeUniqueCodeModal" />
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import uniqueCodeModal from './uniqueCodeModal.vue'
+
+// 接口
+import { sparePartsReturnQueryPage, sparePartsPageCount } from '@/api/sparePartsReturn'
+export default {
+  name: 'DetailModal',
+  mixins: [commonMixin],
+  components: { STable, VSelect, uniqueCodeModal },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {// sn
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      basicInfoData: null, //  基础信心数据
+      openUniqueCodeModal: false, // 轮胎唯一码弹窗
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return sparePartsReturnQueryPage(Object.assign(parameter, { sparePartsReturnSn: this.itemSn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', scopedSlots: { customRender: 'productName' }, width: '40%', align: 'left', ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购单价', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '采购金额', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '操作', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+      ]
+      // if (this.$hasPermissions('B_sparePartsDetail_costPrice')) { //  成本价权限
+      //   arr.splice(5, 0, { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      //   arr.splice(6, 0, { title: '小计', dataIndex: 'subtotal', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      // }
+      return arr
+    }
+  },
+  methods: {
+    handleCheck () {
+      this.openUniqueCodeModal = true
+    },
+    closeUniqueCodeModal () {
+      this.openUniqueCodeModal = false
+    },
+    // 合计
+    getDetailCount (params) {
+      sparePartsPageCount(params).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .detail-modal{
+    .ant-modal-body {
+      padding: 10px 10px 20px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 5px 0 10px;
+    }
+  }
+</style>

+ 43 - 20
src/views/purchasingManagement/purchaseReceipt/edit.vue

@@ -52,13 +52,20 @@
             </a-form>
           </div>
         </div>
-        <div>
-          <a-alert style="margin-bottom: 10px;" type="info">
+        <div class="showBtn">
+          <a-button id="bulkWarehousingOrderList-add" type="primary" class="button-warning" @click="handleAdd">新增产品</a-button>
+          <a-button id="bulkWarehousingOrderList-ex" class="button-warning" @click="handleAdd">导入产品</a-button>
+          <a-button
+            v-if="$hasPermissions('B_sparePartsBatchAudit')"
+            id="bulkWarehousingOrderList-batchAudit"
+            type="primary"
+            class="button-warning"
+            :loading="loading"
+            @click="handleBatchAudit">查询库存</a-button>
+          <a-alert type="info">
             <div slot="message" class="total-bar">
-              <div v-if="statisticsObj">
-                <span>申请退货数量:{{ statisticsObj && (statisticsObj.qty || statisticsObj.qty == 0) ? statisticsObj.qty : '--' }};</span>
-                <span v-if="$hasPermissions('B_purchaseReturnEdit_costPrice')">退货金额:{{ statisticsObj && statisticsObj.totalCost || statisticsObj.totalCost == 0 ? statisticsObj.totalCost : '--' }};</span>
-              </div>
+              <span>采购数量:{{ statisticsObj && (statisticsObj.qty || statisticsObj.qty == 0) ? statisticsObj.qty : '--' }};</span>
+              <span v-if="$hasPermissions('B_purchaseReturnEdit_costPrice')">采购金额:{{ statisticsObj && statisticsObj.totalCost || statisticsObj.totalCost == 0 ? statisticsObj.totalCost : '--' }};</span>
             </div>
           </a-alert>
         </div>
@@ -70,7 +77,6 @@
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :scroll="{ y: 300 }"
           bordered>
           <!--申请退货数量 -->
           <template slot="qty" slot-scope="text, record">
@@ -116,6 +122,8 @@
         @click="beforeSubmit"
         id="salesReturn-handleSubmit">提交</a-button>
     </div>
+    <!-- 新增弹窗-->
+    <add-modal v-drag :openModal="openModal" @ok="handleOk" @close="openModal=false" />
     <!-- 选择审核人员 -->
     <chooseDepartUserModal ref="chooseDepart" :openModal="openDepartUserModal" @close="openDepartUserModal = false" @submit="handleSubmit"></chooseDepartUserModal>
     <!-- 编辑基础信息弹窗 -->
@@ -126,6 +134,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
+import addModal from './addModal.vue'
 // import queryPart from './queryPart.vue'
 import basicInfoModal from './basicInfoModal.vue'
 // import chooseDepartUserModal from './chooseDepartUserModal.vue'
@@ -141,7 +150,7 @@ import {
 export default {
   name: 'PurchaseReturnEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, addModal },
   data () {
     return {
       spinning: false,
@@ -186,15 +195,6 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        {
-          title: '入库单号',
-          dataIndex: 'sparePartsNo',
-          width: '18%',
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
         {
           title: '产品编码',
           dataIndex: 'product.code',
@@ -223,8 +223,9 @@ export default {
             return text || '--'
           }
         },
+        { title: '采购数量', align: 'center', width: '13%', scopedSlots: { customRender: 'qty' } },
         {
-          title: '批次号',
+          title: '库存数量',
           dataIndex: 'stockBatchNo',
           align: 'center',
           width: '10%',
@@ -232,7 +233,24 @@ export default {
             return text || '--'
           }
         },
-        { title: '申请退货数量', align: 'center', width: '13%', scopedSlots: { customRender: 'qty' } },
+        {
+          title: '采购单价',
+          dataIndex: 'cost',
+          width: '8%',
+          align: 'right',
+          customRender: function (text) {
+            return text || text == 0 ? _this.toThousands(text, 2) : '--'
+          }
+        },
+        {
+          title: '采购金额',
+          dataIndex: 'totalCost',
+          width: '8%',
+          align: 'right',
+          customRender: function (text) {
+            return text || text == 0 ? _this.toThousands(text, 2) : '--'
+          }
+        },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('B_purchaseReturnEdit_costPrice')) {
@@ -246,7 +264,7 @@ export default {
           }
         })
         arr.splice(8, 0, {
-          title: '退款金额',
+          title: '采购金额',
           dataIndex: 'totalCost',
           width: '8%',
           align: 'right',
@@ -513,6 +531,11 @@ export default {
     overflow-y: scroll;
     height: 100%;
   }
+  .showBtn{
+    display:flex;
+    align-items:center;
+    margin-bottom:10px;
+  }
   .salesReturnEdit-cont {
     margin-top: 6px;
     .ant-divider-horizontal {

+ 191 - 0
src/views/purchasingManagement/purchaseReceipt/importGuideModal.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“成本价”的列,且名称必须相同</li>
+            <li>2) 除了“产品编码”、“数量” 两列,其他列可自定义,不影响数据导入</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/散件入库产品导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          sparePartsSn: this.params.sparePartsSn || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 87 - 100
src/views/purchasingManagement/purchaseReceipt/list.vue

@@ -26,12 +26,17 @@
                   <custList ref="custList" id="purchaseReceiptList-buyerSn" @change="custChange"></custList>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="关联单号">
+                  <a-input id="purchaseReceiptList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入关联单号"/>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="purchaseReceiptList-state"
+                    id="purchaseReceiptList-serviceState"
                     code="SPARE_PARTS_RETURN_STATE"
                     placeholder="请选择审核状态"
                     allowClear
@@ -39,8 +44,15 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="关联单号">
-                  <a-input id="purchaseReceiptList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入关联单号"/>
+                <a-form-item label="供应商状态">
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="purchaseReceiptList-state"
+                    code="SPARE_PARTS_RETURN_STATE"
+                    placeholder="请选择供应商状态"
+                    allowClear
+                  ></v-select>
                 </a-form-item>
               </a-col>
             </template>
@@ -60,16 +72,13 @@
     </a-card>
     <a-card size="small" :bordered="false" class="purchaseReceiptList-wrap">
       <a-spin :spinning="spinning" tip="Loading...">
-        <!-- 操作按钮 -->
-        <div class="table-operator">
-          <a-button v-if="$hasPermissions('B_purchaseReturnAdd')" id="purchaseReceiptList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
-          <div class="tongji-bar">
-            总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
-            总款数:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
-            总采购数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
-            <span>总采购金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;</span>
-            <span>已完结金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;</span>
-          </div>
+        <!-- 统计数据 -->
+        <div class="tongji-bar">
+          总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+          总款数:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+          总采购数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+          <span>总采购金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;</span>
+          <span>已完结金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;</span>
         </div>
         <!-- 列表 -->
         <s-table
@@ -86,12 +95,19 @@
           bordered>
           <!-- 采购退货单号 -->
           <template slot="sparePartsReturnNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_purchaseReturnDetail')" class="link-bule" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
+            <span v-if="$hasPermissions('B_purchaseReturnDetail')" id="purchaseReceiptList-detail-btn" class="link-bule" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
             <span v-else>{{ record.sparePartsReturnNo }}</span>
           </template>
           <!-- 操作 -->
           <!-- state 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 已完结 FINISH 审核不通过 AUDIT_REJECT -->
           <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleCheck(record)"
+              v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
+              id="purchaseReceiptList-examine-btn">审核</a-button>
             <a-button
               size="small"
               type="link"
@@ -106,45 +122,60 @@
               @click="handleDel(record)"
               class="button-error"
               id="purchaseReceiptList-del-btn">取消</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleCheck(record)"
+              v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
+              id="purchaseReceiptList-logistics-btn">物流</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleCheck(record)"
+              v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
+              id="purchaseReceiptList-addVoucher-btn">上传凭证</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleCheck(record)"
+              v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
+              id="purchaseReceiptList-seeVoucher-btn">查看凭证</a-button>
           </template>
         </s-table>
       </a-spin>
-      <!-- 新增、详情弹窗-->
-      <add-modal v-drag :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+      <!-- 详情弹窗 -->
       <detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
-      <!-- 导出提示框 -->
-      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-      <!-- 审核进度弹窗 -->
-      <reviewProgressModal v-drag :itemSn="itemSnSh" :auditTime="auditTime" :openModal="openReviewModal" @close="openReviewModal=false"></reviewProgressModal>
+      <!-- 审核弹窗 -->
+      <reviewModal v-drag :openModal="openReviewModal" @close="openReviewModal=false"></reviewModal>
     </a-card>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
-import reportModal from '@/views/common/reportModal.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
 import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
+import reviewModal from './reviewModal.vue'
+import detailModal from './detailModal.vue'
+// 接口
 import { sparePartsReturnList, sparePartsReturnDelete, sparePartsReturnExportDetail, againSubmit } from '@/api/sparePartsReturn'
 export default {
   name: 'PurchaseReceiptList',
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, reportModal, custList, rangeDate, warehouse },
+  components: { STable, supplier, VSelect, custList, rangeDate, warehouse, reviewModal, detailModal },
   data () {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
-      openModal: false, // 新增弹框是否显示
-      openDetailModal: false, // 详情弹窗
-      openReviewModal: false, // 审核进度弹窗
-      showExport: false,
-      exportLoading: false,
-      advanced: true,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      advanced: true, // 高级搜索 展开/关闭
       // 查询参数
       queryParam: {
         beginDate: undefined,
@@ -155,14 +186,20 @@ export default {
         warehouseSn: undefined, // 仓库
         state: undefined
       },
+      openReviewModal: false, // 审核弹窗
+      openDetailModal: false, // 详情弹窗
+      itemSn: null, // 采购入库sn
+      totalData: null, // 统计数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return sparePartsReturnList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -172,11 +209,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      itemSnSh: null,
-      itemSn: null, // 采购退货SN
-      auditTime: null, // 审核时间
-      totalData: null
+      }
     }
   },
   computed: {
@@ -189,17 +222,18 @@ export default {
         { title: '提交时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '供应商名称', dataIndex: 'supplier.supplierName', align: 'left', width: '14%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '采购数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '采购金额', dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '采购金额', dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
         { title: '入库仓库', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '关联单号', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '业务状态', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '供应商状态', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '备注', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('M_purchaseReturnList_costPrice')) { //  售价权限
-        arr.splice(7, 0, { title: '采购金额', dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
-      }
+      // if (this.$hasPermissions('M_purchaseReturnList_costPrice')) { //  售价权限
+      //   arr.splice(7, 0, { title: '采购金额', dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+      // }
       return arr
     }
   },
@@ -209,75 +243,25 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    //  导出
-    handleExport () {
-      const _this = this
-      _this.$store.state.app.curActionPermission = 'B_purchaseReturnExport'
-      _this.exportLoading = true
-      _this.spinning = true
-      hdExportExcel(sparePartsReturnExportDetail, _this.queryParam, '采购退货', function () {
-        _this.exportLoading = false
-        _this.spinning = false
-        _this.showExport = true
-        _this.$store.state.app.curActionPermission = ''
-      })
-    },
-    //  新增
-    handleAdd () {
-      this.openModal = true
-    },
-    //  基本信息  保存
-    handleOk (row) {
-      this.$router.push({ name: 'purchaseReturnAdd', query: { returnSn: row.sparePartsReturnSn, no: row.sparePartsReturnNo, sn: row.supplierSn } })
-    },
     //  编辑
     handleEdit (row) {
       this.$router.push({ name: 'purchaseReceiptEdit', query: { returnSn: row.sparePartsReturnSn, no: row.sparePartsReturnNo, sn: row.supplierSn } })
     },
-    // 审核进度
-    handleSH (row) {
-      this.itemSnSh = row.sparePartsReturnSn
-      this.auditTime = row.submitDate
+    // 审核
+    handleCheck (row) {
       const _this = this
-      _this.$nextTick(() => {
-        _this.openReviewModal = true
-      })
+      _this.openReviewModal = true
     },
-    // 再次提交
-    handleResubmit (row) {
-      const _this = this
-      this.$confirm({
-        title: '操作提示',
-        content: '系统将自动生成一个新的采购退货单,新单据中的产品申退数量将以最大可用库存为准,最大可用库存为0时,系统将强制删除已选的对应产品。您可以对新单据进行编辑、提交等操作,原单据保持不变,确认操作吗?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          againSubmit({ sparePartsReturnSn: row.sparePartsReturnSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
-      })
-    },
-    //  采购退货详情
+    //  采购单号 打开详情弹窗
     handleDetail (row) {
       this.itemSn = row.sparePartsReturnSn
-      const _this = this
-      _this.$nextTick(() => {
-        _this.openDetailModal = true
-      })
+      this.openDetailModal = true
     },
     // 关闭采购退货详情弹框
     closeDetailModal () {
-      this.itemSn = null
       this.openDetailModal = false
     },
-    //  删除
+    //  取消
     handleDel (row) {
       const _this = this
       this.$confirm({
@@ -298,6 +282,7 @@ export default {
         }
       })
     },
+    // 客户名称 change
     custChange (obj) {
       this.queryParam.buyerSn = obj.key
     },
@@ -316,23 +301,26 @@ export default {
       this.$refs.rangeDate.resetDate()
       this.$refs.table.refresh(true)
     },
+    // 初始化数据
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.openModal = false
-      this.openDetailModal = false
+      // this.openDetailModal = false
       this.itemSn = null
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 240
+      this.tableHeight = window.innerHeight - tableSearchH - 225
     }
   },
   watch: {
+    // 展开关闭 监听页面高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -368,9 +356,8 @@ export default {
 </script>
 <style lang="less" scoped>
   .purchaseReceiptList-wrap{
-    .table-operator{
-      display:flex;
-      align-items:center;
+    .tongji-bar{
+     margin-bottom:13px;
     }
 
   }

+ 117 - 0
src/views/purchasingManagement/purchaseReceipt/reviewModal.vue

@@ -0,0 +1,117 @@
+<template>
+  <a-modal
+    centered
+    class="review-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="416">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="review-content">
+        <a-icon type="question-circle" :style="{fontSize:'20px',color:'#faad14'}"/>
+        <div class="review-tipInfo">
+          <p class="review-words">提示</p>
+          <p>确认要审核吗?</p>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div style="text-align: right;">
+        <a-button
+          id="auditModal-cancel"
+          type="primary"
+          @click="handleAuditModal('AUDIT_REJECT')"
+          style="margin-right: 15px;">审核不通过</a-button>
+        <a-button
+          type="primary"
+          id="auditModal-save"
+          class="button-info"
+          @click="handleAuditModal('PRICED')"
+        >审核通过</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 接口
+import { sparePartsSaveDetail } from '@/api/spareParts'
+export default {
+  name: 'ReviewModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false // 页面加载loading
+    }
+  },
+  methods: {
+    // 审核通过 审核不通过
+    handleAuditModal (val) {
+      const _this = this
+      const productSnList = []
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        productSnList.push(item.productSn)
+      })
+      const ajaxData = {
+        productSnList: productSnList,
+        auditState: type
+      }
+      _this.spinning = true
+      sparePartsSaveDetail(ajaxData).then(res => {
+        if (res.status == 200) {
+          _this.$refs.table.clearSelected() // 清空表格选中项
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+          _this.openAuditModal = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .review-modal{
+    //弹窗主要内容样式
+    .review-content {
+     display:flex;
+     margin:17px 0 10px 20px;
+    }
+    //弹窗提示信息样式
+    .review-tipInfo{
+      margin:-3px 0 0 10px;
+      //弹窗提示  文字样式
+      .review-words{
+        font-size:16px;
+        font-wight:bold;
+      }
+    }
+  }
+</style>

+ 105 - 0
src/views/purchasingManagement/purchaseReceipt/uniqueCodeModal.vue

@@ -0,0 +1,105 @@
+<template>
+  <a-modal
+    centered
+    class="unique-code-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="960">
+    <solt>
+      <div class="unique-code-tit">查看唯一码(产品编码:Y1602GN,唯一码数量:11)</div>
+    </solt>
+    <a-card size="small" :bordered="false" class="unique-code-con">
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 360 }"
+        bordered>
+      </s-table>
+    </a-card>
+    <div class="btn-cont">
+      <a-button id="unique-code-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { sparePartsDetailList } from '@/api/spareParts'
+export default {
+  name: 'BulkWarehousingOrderDetailModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return sparePartsDetailList(Object.assign(parameter, { sparePartsSn: this.itemSn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+          }
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '唯一码', dataIndex: 'productCode', width: '15%', align: 'left', customRender: function (text) { return text || '--' } }
+      ]
+      return arr
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .unique-code-modal{
+    .unique-code-tit{
+      padding-bottom:20px;
+      margin-bottom:20px;
+      border-bottom:1px solid #e8e8e8;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 5px 0 10px;
+    }
+  }
+</style>