Explorar el Código

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

lilei hace 8 meses
padre
commit
f8485d73ca

+ 38 - 0
src/api/reportStock.js

@@ -66,3 +66,41 @@ export const reportStockOutList = (params) => {
     }
   })
 }
+
+// 冻结产品报表  列表  有分页
+export const freezeReportPageList = (params) => {
+  const url = `/report/reportStockOut/freezeReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+//  冻结产品报表  统计
+export const freezeReportCount = (params) => {
+  return axios({
+    url: '/report/reportStockOut/freezeReportCount',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('统计')
+    }
+  })
+}
+// 冻结产品报表 导出
+export const freezeReportExport = params => {
+  return axios.request({
+    url: `/report//reportStockOut/freezeReportExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}

+ 6 - 12
src/views/customerManagement/customerInfo/edit.vue

@@ -107,19 +107,13 @@
                 <custType id="customerManagementEdit-customerTypeSn" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型"></custType>
               </a-form-model-item>
             </a-col>
-            <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-col :span="8" v-if="form.relationType=='child' || form.relationType=='dealer'">
+              <a-form-model-item label="采购范围" ref="purchaseScopeType" prop="purchaseScopeType">
+                <v-select code="CUSTOMER_PURCHASE_SCOPE_TYPE" id="customerManagementEdit-purchaseScopeType" v-model="form.purchaseScopeType" allowClear placeholder="请选择采购范围" ></v-select>
               </a-form-model-item>
             </a-col>
           </a-row>
-          <!-- <a-row :gutter="15">
-            <a-col :span="8" v-if="form.relationType=='child'">
-              <a-form-model-item label="采购范围" prop="scope">
-                <a-checkbox v-model="form.scope" :checked="form.scope" id="customerManagementEdit-scope">自建产品</a-checkbox>
-              </a-form-model-item>
-            </a-col>
-          </a-row> -->
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 30px;">
             <a-button type="primary" @click="handleSubmit" size="large" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
           </a-form-model-item>
@@ -174,7 +168,7 @@ export default {
         priceType: '', //  价格类型
         settleStyleSn: undefined, //  收款方式
         dealerSn: undefined, // 关联经销商
-        scope: true // 采购范围
+        purchaseScopeType: 'ALL' // 采购范围
       },
       dealerName: undefined, // 关联经销商名称
       areaVal: [], // 地区值
@@ -184,7 +178,7 @@ export default {
         countySn: [{ required: true, message: '请选择客户地址', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
         settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }],
-        scope: [{ required: true, message: '请选择采购范围', trigger: 'change' }]
+        purchaseScopeType: [{ required: true, message: '请选择采购范围', trigger: 'change' }]
       },
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉

+ 25 - 7
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -568,14 +568,32 @@ export default {
       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
+          if (res.data && res.data.length > 0) {
+            const resTips = res.data.join('、')
+            this.$confirm({
+              title: '提示',
+              content: resTips + '暂不销售,请删除后重新提交采购单',
+              centered: true,
+              okText: '知道了',
+              cancelText: '取消', // 将cancelText设置为空字符串或去掉该属性可以隐藏取消按钮
+              cancelButtonProps: {
+                style: {
+                  display: 'none' // 通过设置样式隐藏取消按钮
+                }
+              },
+              onOk () {
+                console.log('知道了')
+              }
+            })
+          } else {
+            this.$message.success(res.message)
+            setTimeout(() => {
+              _this.handleBack()
+              _this.spinning = false
+            }, 1000)
+          }
         }
+        _this.spinning = false
         _this.subLoading = false
       })
     },

+ 23 - 4
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -493,10 +493,29 @@ export default {
       this.subLoading = true
       purchaseWriteSubmit({ id: this.detail.id }).then(res => {
         if (res.status == 200) {
-          this.$message.success(res.message)
-          setTimeout(() => {
-            _this.handleBack()
-          }, 1000)
+          if (res.data && res.data.length > 0) {
+            const resTips = res.data.join('、')
+            this.$confirm({
+              title: '提示',
+              content: resTips + '暂不销售,请删除后重新提交采购单',
+              centered: true,
+              okText: '知道了',
+              cancelText: '取消', // 将cancelText设置为空字符串或去掉该属性可以隐藏取消按钮
+              cancelButtonProps: {
+                style: {
+                  display: 'none' // 通过设置样式隐藏取消按钮
+                }
+              },
+              onOk () {
+                console.log('知道了')
+              }
+            })
+          } else {
+            this.$message.success(res.message)
+            setTimeout(() => {
+              _this.handleBack()
+            }, 1000)
+          }
         }
         _this.subLoading = false
       })

+ 90 - 56
src/views/reportData/frozenProductReport/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="frozenProductReportList-wrap">
     <!-- 搜索条件 -->
     <a-spin :spinning="spinning" tip="Loading...">
-      <div class="table-page-search-wrapper">
+      <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
           id="frozenProductReportList-form"
           ref="ruleForm"
@@ -15,41 +15,46 @@
           @keyup.enter.native="handleSearch" >
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="冻结生成时间">
+              <a-form-model-item label="冻结生成时间" prop="time">
                 <rangeDate id="frozenProductReportList-time" ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品编码">
-                <a-input id="frozenProductReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+                <a-input id="frozenProductReportList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品名称">
-                <a-input id="frozenProductReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+                <a-input id="frozenProductReportList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="批次号">
+                <a-input id="frozenProductReportList-name" v-model.trim="queryParam.stockBatchNo" allowClear placeholder="请输入批次号"/>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="关联单据号">
-                  <a-input id="frozenProductReportList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单据号"/>
+                  <a-input id="frozenProductReportList-bizNo" v-model.trim="queryParam.outBizNo" allowClear placeholder="请输入关联单据号"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="单据类型">
                   <v-select
-                    v-model="queryParam.bizType"
-                    ref="bizType"
+                    v-model="queryParam.outBizType"
+                    ref="outBizType"
                     :isEnable="true"
-                    id="frozenProductReportList-bizType"
-                    code="SETTLE_FLOW_BIZ_TYPE"
+                    id="frozenProductReportList-outBizType"
+                    code="OUT_STOCK_TYPE"
                     placeholder="请选择单据类型"
                     allowClear></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="单位名称">
-                  <a-input id="frozenProductReportList-burName" v-model.trim="queryParam.burName" allowClear placeholder="请输入单位名称"/>
+                  <a-input id="frozenProductReportList-demanderName" v-model.trim="queryParam.demanderName" allowClear placeholder="请输入单位名称"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -67,7 +72,7 @@
                 </a-form-model-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="frozenProductReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="frozenProductReportList-reset">重置</a-button>
               <a-button
@@ -90,10 +95,8 @@
       <!-- 列表 -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
-          冻结数量:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
-          总成本:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
-          总售价:<strong>{{ totalData&&(totalData.discountAmount || totalData.discountAmount==0) ? toThousands(totalData.discountAmount) : '--' }}</strong>;
-          折后总售价:<strong>{{ totalData&&(totalData.discountedAmount || totalData.discountedAmount==0) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
+          冻结数量:<strong>{{ totalData&&(totalData.outQty || totalData.outQty==0) ? totalData.outQty : '--' }}</strong>;
+          总成本:<strong>{{ totalData&&(totalData.totalOutPrice || totalData.totalOutPrice==0) ? toThousands(totalData.totalOutPrice) : '--' }}</strong>;
         </div>
       </a-alert>
       <s-table
@@ -103,7 +106,8 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1500 }"
+        :style="{ height: tableHeight+84+'px' }"
+        :scroll="{ y: tableHeight}"
         :defaultLoadData="false"
         bordered>
       </s-table>
@@ -113,15 +117,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
-import moment from 'moment'
+// 接口
 import { warehouseCascadeList } from '@/api/warehouse'
-import { reportPageList, reportStockPutOutCount, reportStockPutOutExport } from '@/api/reportData'
+import { freezeReportPageList, freezeReportExport, freezeReportCount } from '@/api/reportStock'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
   mixins: [commonMixin],
@@ -130,44 +134,42 @@ export default {
     return {
       advanced: true, // 高级搜索 展开/关闭
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出加载loading
       queryParam: { //  查询条件
-        time: [ // 时间
-          getDate.getMonthDays(3).starttime,
-          getDate.getMonthDays(3).endtime
-        ],
-        beginDate: getDate.getMonthDays(3).starttime, // 开始时间
-        endDate: getDate.getMonthDays(3).endtime, // 结束时间
-        productEntity: {
-          code: '', //  产品编码
-          name: '' //  产品名称
-        },
+        time: [],
+        beginDate: undefined, // 开始时间
+        endDate: undefined, // 结束时间
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        stockBatchNo: '', // 批次号
+        outBizNo: '', // 关联单据号
         warehouseCascade: [], // 仓库仓位列表
         warehouseSn: undefined, //  仓库
         warehouseLocationSn: undefined // 仓位
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
+      // 必填项验证
       rules: {
-        'time': [{ required: true, message: '请选择日期(最多查看一年)', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择冻结生成时间', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: 150, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 120, align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '关联单据号', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据审核时间', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'productEntity.unit', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '冻结数量', dataIndex: 'freezeQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本(¥)', dataIndex: 'freezePrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '总售价(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折后总售价(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单据号', dataIndex: 'outBizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'outBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'demanderName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '冻结数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本单价', dataIndex: 'outPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总成本', dataIndex: 'totalOutPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '冻结生成时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -175,7 +177,7 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         delete params.warehouseCascade
-        return reportPageList(params).then(res => {
+        return freezeReportPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -193,6 +195,15 @@ export default {
       },
       totalData: {}, // 合计
       warehouseCascadeData: [] //  仓库仓位
+
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
     }
   },
   methods: {
@@ -204,11 +215,18 @@ export default {
     },
     //  查询
     handleSearch () {
-      this.$refs.table.refresh(true)
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
     },
     // 查询总计
     getCount (params) {
-      reportStockPutOutCount(params).then(res => {
+      freezeReportCount(params).then(res => {
         if (res.status == 200 && res.data) {
           this.totalData = res.data
         } else {
@@ -218,21 +236,24 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.queryParam.time = []
       this.$refs.rangeDate.resetDate(this.queryParam.time)
-      this.queryParam.beginDate = getDate.getMonthDays(3).starttime
-      this.queryParam.endDate = getDate.getMonthDays(3).endtime
+      this.queryParam.beginDate = undefined
+      this.queryParam.endDate = undefined
       this.$refs.rangeDate.resetDate()
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.productEntity.code = ''
-      this.queryParam.productEntity.name = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.stockBatchNo = ''
+      this.queryParam.outBizNo = ''
+      this.queryParam.stockBatchNo = ''
       this.queryParam.warehouseSn = undefined
       this.queryParam.warehouseLocationSn = undefined
       this.queryParam.warehouseCascade = []
       this.totalData = null
       this.$refs.table.clearTable()
       this.$refs.ruleForm.resetFields()
-      this.$refs.table.refresh(true)
     },
     //  导出
     handleExport () {
@@ -242,8 +263,8 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportStockPutOutExport(params).then(res => {
-            downloadExcel(res, '收发存报表')
+          freezeReportExport(params).then(res => {
+            downloadExcel(res, '冻结产品报表')
             _this.exportLoading = false
             _this.spinning = false
           })
@@ -279,17 +300,30 @@ export default {
         this.queryParam.warehouseSn = ''
         this.queryParam.warehouseLocationSn = ''
       }
+    },
+    // 表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.resetSearchForm()
+      this.getWarehouseCascade()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.resetSearchForm()
+      this.getWarehouseCascade()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
     }
   },
   beforeRouteEnter (to, from, next) {

+ 0 - 19
src/views/salesManagement/salesQueryNew/edit.vue

@@ -873,26 +873,7 @@ export default {
       this.spinning = true
       const submitTypes = this.tbForm.join(',')
       salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes, ...params }).then(res => {
-        console.log(res)
         if (res.status == 200) {
-          if (res.data.errorMsg && res.data.errorMsg.length > 0) {
-            this.$confirm({
-              title: '提示',
-              content: res.data.errorMsg.map((item, i) => { return <p>{i * 1 + 1}、{item}</p> }),
-              centered: true,
-              okText: '知道了',
-              cancelText: '取消', // 将cancelText设置为空字符串或去掉该属性可以隐藏取消按钮
-              cancelButtonProps: {
-                style: {
-                  display: 'none' // 通过设置样式隐藏取消按钮
-                }
-              },
-              onOk () {
-                console.log('知道了')
-              }
-            })
-            return
-          }
           this.handleBack()
           this.$message.success(res.message)
           this.spinning = false