lilei 2 年之前
父节点
当前提交
b0ffb4ec61

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
 {
   "message": "发现有新版本发布,确定更新系统?",
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
   "vendorJsVersion": "",
-  "version": 1675821326258
+  "version": 1675824803501
 }
 }

+ 81 - 0
src/views/common/shopingCatModal.vue

@@ -0,0 +1,81 @@
+<template>
+  <a-drawer
+    :zIndex="zIndex"
+    :title="title"
+    placement="right"
+    :visible="visible"
+    :width="width"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="onClose"
+    wrapClassName="shopingCat-drawer">
+     <shopingCat ref="shopingCat" modes="modals" @add="handleAdd"></shopingCat>
+  </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import shopingCat from '@/views/shoppingCarManagement/shoppingCar/list.vue'
+export default {
+  name:"shopingCatModal",
+  mixins: [commonMixin],
+  components: {
+    shopingCat
+  },
+  props: {
+    showModal: {
+      type: Boolean,
+      default: false
+    },
+    width: {
+      type: [String, Number],
+      default: '70%'
+    },
+    zIndex: {
+      type: Number,
+      default: 1050
+    },
+  },
+  watch: {
+    showModal (newValue, oldValue) {
+      this.visible = newValue
+      if (newValue) {
+         this.$refs.shopingCat.pageInit()
+      }
+    },
+  },
+  data () {
+    return {
+      visible: this.showModal,
+      title: '购物车',
+    }
+  },
+  methods: {
+    onClose () {
+      this.$emit('close')
+    },
+    handleAdd (record) {
+      this.spinning = true
+      this.$emit('add', record, 0)
+    },
+  }
+}
+</script>
+
+<style lang="less">
+.shopingCat-drawer {
+  .ant-drawer-header{
+    padding: 13px 20px;
+  }
+  .ant-drawer-body {
+    padding: 10px;
+    height: calc(100% - 50px);
+    display: flex;
+    flex-direction: column;
+    overflow: auto;
+    > div {
+      height: 100%;
+    }
+  }
+}
+</style>

+ 5 - 2
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -53,6 +53,7 @@
       <!-- 上次缺货 -->
       <!-- 上次缺货 -->
       <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
       <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
       <!-- 购物车 -->
       <!-- 购物车 -->
+      <shopingCatModal :showModal="openShopCatModal" @close="openShopCatModal=false"></shopingCatModal>
       <!-- 已选产品 -->
       <!-- 已选产品 -->
       <div>
       <div>
         <div class="chooseBox-title">
         <div class="chooseBox-title">
@@ -64,7 +65,7 @@
             <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="danger" @click="openChooseProduct=true"><a-icon type="plus-circle" />添加产品</a-button>
             <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="danger" @click="openChooseProduct=true"><a-icon type="plus-circle" />添加产品</a-button>
             <a-button id="purchaseNewOrderEdit-import-btn" type="danger" ghost @click="openGuideModal=true"><a-icon type="import" />产品导入</a-button>
             <a-button id="purchaseNewOrderEdit-import-btn" type="danger" ghost @click="openGuideModal=true"><a-icon type="import" />产品导入</a-button>
             <a-button id="purchaseNewOrderEdit-outStock-btn" type="danger" ghost @click="handleOutStock"><a-icon type="funnel-plot" />上次缺货</a-button>
             <a-button id="purchaseNewOrderEdit-outStock-btn" type="danger" ghost @click="handleOutStock"><a-icon type="funnel-plot" />上次缺货</a-button>
-            <a-button id="purchaseNewOrderEdit-cart-btn" type="danger" ghost><a-icon type="shopping" />购物车</a-button>
+            <a-button id="purchaseNewOrderEdit-cart-btn" type="danger" ghost @click="openShopCatModal=true"><a-icon type="shopping" />购物车</a-button>
           </div>
           </div>
         </div>
         </div>
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
@@ -186,6 +187,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import outStockModal from './outStockModal.vue'
 import outStockModal from './outStockModal.vue'
+const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue');
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCount, purchaseDetailCancelList } from '@/api/purchaseDetail'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCount, purchaseDetailCancelList } from '@/api/purchaseDetail'
@@ -196,7 +198,7 @@ import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
 export default {
   name: 'PurchaseEdit',
   name: 'PurchaseEdit',
-  components: { STable, VSelect, ImportGuideModal, outStockModal, Print, chooseAddressModal, chooseProductModal },
+  components: { STable, VSelect, ImportGuideModal, outStockModal, Print, chooseAddressModal, chooseProductModal, shopingCatModal },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
     return {
     return {
@@ -205,6 +207,7 @@ export default {
       spinning: false,
       spinning: false,
       detail: null, // 详细信息
       detail: null, // 详细信息
       openChooseProduct: false,
       openChooseProduct: false,
+      openShopCatModal: false,
       tableHeight: 0,
       tableHeight: 0,
       simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       // -------已选产品-------------
       // -------已选产品-------------

+ 52 - 120
src/views/shoppingCarManagement/shoppingCar/list.vue

@@ -31,20 +31,20 @@
           </a-col>
           </a-col>
         </a-row>
         </a-row>
       </a-form>
       </a-form>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator" v-if="$hasPermissions('B_JgProduct_enable')">
-      <a-row :gutter="16">
-        <a-col class="gutter-row" :span="12">
-          <a-button type="primary" ghost v-if="type=='globalBtn'" @click="deleteMore">
-            批量删除
-          </a-button>
-          <a-button type="primary" ghost v-else>
-            批量添加
-          </a-button>
-          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
-        </a-col>
-      </a-row>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-row :gutter="16">
+          <a-col class="gutter-row" :span="24">
+            <a-button type="primary" ghost v-if="modes=='pages'" @click="deleteMore">
+              批量删除
+            </a-button>
+            <a-button type="primary" ghost v-if="modes=='modals'" @click="addMore">
+              批量添加
+            </a-button>
+            <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
+          </a-col>
+        </a-row>
+      </div>
     </div>
     </div>
     <!-- 列表 -->
     <!-- 列表 -->
     <s-table
     <s-table
@@ -52,7 +52,7 @@
       ref="table"
       ref="table"
       :style="{ height: tableHeight+84.5+'px' }"
       :style="{ height: tableHeight+84.5+'px' }"
       size="small"
       size="small"
-      :row-selection="$hasPermissions('B_JgProduct_enable')?rowSelection:null"
+      :row-selection="{ columnWidth: 40 }"
       @rowSelection="rowSelectionFun"
       @rowSelection="rowSelectionFun"
       rowKeyName="productSn"
       rowKeyName="productSn"
       :rowKey="(record) => record.productSn"
       :rowKey="(record) => record.productSn"
@@ -79,6 +79,12 @@ export default {
   name: 'ShoppingCarList',
   name: 'ShoppingCarList',
   components: { STable, ProductType, ProductBrand },
   components: { STable, ProductType, ProductBrand },
   mixins: [commonMixin],
   mixins: [commonMixin],
+  props:{
+    modes:{
+      type: String,
+      default: 'pages'
+    }
+  },
   data () {
   data () {
     return {
     return {
       tableHeight: 0,
       tableHeight: 0,
@@ -120,50 +126,9 @@ export default {
       itemId: '', //  当前产品id
       itemId: '', //  当前产品id
       productTypeList: [], //  分类下拉数据
       productTypeList: [], //  分类下拉数据
       rowSelectionInfo: null,
       rowSelectionInfo: null,
-      type: 'globalBtn'
-    }
-  },
-  computed: {
-    rowSelection () {
-      return {
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.enabledFlag == undefined // Column configuration not to be checked
-          }
-        })
-      }
     }
     }
   },
   },
   methods: {
   methods: {
-    // 批量删除
-    deleteMore () {
-      this.$confirm({
-        title: '提示',
-        content: '您已经选择3个产品,确认要将已选产品从购物车中移除吗?',
-        centered: true,
-        onOk: () => {
-          console.log('确定删除')
-        }
-      })
-    },
-    inited (viewer) {
-      if (viewer) {
-        const imageUrl = []
-        viewer.map(item => {
-          imageUrl.push(item.imageUrl)
-        })
-        this.$viewerApi({
-          images: imageUrl
-        })
-      }
-    },
-    onChangeList (checkedValues) {
-      this.chooseShowList = checkedValues
-    },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ name: 'viewProduct', params: { sn: row.productSn } })
-    },
     // 查询
     // 查询
     searchForm () {
     searchForm () {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.clearSelected() // 清空表格选中项
@@ -186,117 +151,84 @@ export default {
     getColumns () {
     getColumns () {
       const _this = this
       const _this = this
       this.columns = [
       this.columns = [
-        { title: '产品编码', dataIndex: 'code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'origCode', width: '12%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
-        { title: '包装数', dataIndex: 'terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '可用库存数量', dataIndex: 'carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '33%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '可用库存数量', dataIndex: 'carOwnersPrice', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '成本价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '成本价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '20%', align: 'center' }
+        { title: '单位', dataIndex: 'origCode', width: '8%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
+        { title: '包装数', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '15%', align: 'center' }
       ]
       ]
     },
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  产品分类  change
     //  产品分类  change
     changeProductType (val, opt) {
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
     },
-    // 启用 禁用
-    changeStatus (record) {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量删除
+    deleteMore () {
+      const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
+      if (!this.rowSelectionInfo || (rows.length <= 0)) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
       this.$confirm({
       this.$confirm({
         title: '提示',
         title: '提示',
-        content: record.enabledFlag == '1' ? '产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
+        content: '您已经选择'+rows.length+'个产品,确认要将已选产品从购物车中移除吗?',
         centered: true,
         centered: true,
         onOk: () => {
         onOk: () => {
-          this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
-        }
-      })
-    },
-    // 启用 禁用
-    setEnable (enabledFlag, snList) {
-      const params = {
-        productSnList: snList,
-        enabledFlag: enabledFlag
-      }
-      this.spinning = true
-      productUpdate(params).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$refs.table.clearSelected()
-          this.rowSelectionInfo = null
-          this.$refs.table.refresh()
-          this.spinning = false
-        } else {
-          this.$refs.table.refresh()
-          this.spinning = false
+          console.log('确定删除')
         }
         }
       })
       })
     },
     },
-    // 表格选中项
-    rowSelectionFun (obj) {
-      this.rowSelectionInfo = obj || null
-    },
-    // 批量操作
-    handleOutbounds (type) {
-      console.log(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length)
-      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length <= 0)) {
+    // 批量添加
+    addMore () {
+      const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
+      if (!this.rowSelectionInfo || (rows.length <= 0)) {
         this.$message.warning('请在列表勾选后再进行批量操作!')
         this.$message.warning('请在列表勾选后再进行批量操作!')
         return
         return
       }
       }
       this.$confirm({
       this.$confirm({
         title: '提示',
         title: '提示',
-        content: type == '2' ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '确定批量启用吗?',
+        content: '确定批量添加吗?',
         centered: true,
         centered: true,
         onOk: () => {
         onOk: () => {
-          this.setEnable(type == '2' ? '0' : '1', this.rowSelectionInfo.selectedRowKeys)
         }
         }
       })
       })
     },
     },
-    handleMenuClick (e) {
-      this.handleOutbounds(e.key)
-    },
     pageInit () {
     pageInit () {
       const _this = this
       const _this = this
-      _this.type = _this.$route.params.type
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
+      this.setTableH()
       this.getColumns()
       this.getColumns()
+      this.resetSearchForm()
     },
     },
     setTableH () {
     setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 235
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        const tableSearchH = this.$refs.tableSearch.offsetHeight
+        this.tableHeight = window.innerHeight - tableSearchH - (this.modes == 'pages' ? 235 : 320)
+      })
     },
     },
-    // 打开自定义报价弹窗
-    handleEditPrice () {
-      // const oldPrice = {
-
-      // }
-      // this.$refs.editPrice.setOldPrice(oldPrice)
-      this.openEditPriceModal = true
-    }
   },
   },
   watch: {
   watch: {
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      console.log(newValue)
       this.setTableH()
       this.setTableH()
     }
     }
   },
   },
   mounted () {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
       this.pageInit()
-      this.resetSearchForm()
     }
     }
   },
   },
   activated () {
   activated () {
     // 如果是新页签打开,则重置当前页面
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
       this.pageInit()
-      this.resetSearchForm()
     }
     }
   },
   },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {