소스 검색

bug 修复

lilei 3 년 전
부모
커밋
d4d60881ba
3개의 변경된 파일33개의 추가작업 그리고 12개의 파일을 삭제
  1. 7 3
      src/components/MultiTab/MultiTab.vue
  2. 4 3
      src/libs/JGPrint.js
  3. 22 6
      src/views/salesManagement/salesQuery/queryPart.vue

+ 7 - 3
src/components/MultiTab/MultiTab.vue

@@ -149,8 +149,8 @@ export default {
   },
   watch: {
     '$route': function (newVal, oldVal) {
-      console.log(newVal, oldVal)
       if (newVal.name == oldVal.name) { return }
+      console.log(newVal, oldVal)
       // 解决页面地址相同参数不同时打开多个页签问题(例 详情页id或sn不同时)
       const index = this.tabsList.indexOf(newVal.name)
       if (index < 0) { // 不存在
@@ -162,7 +162,10 @@ export default {
         const oa = oldVal.meta.title.indexOf('详情') >= 0
         const ob = oldVal.meta.title.indexOf('新增') >= 0
         const oc = oldVal.meta.title.indexOf('编辑') >= 0
-        if (na || nb || nc || oa || ob || oc) {
+        // 是否时同一个父级菜单下的页面
+        const hasChildren = newVal.matched[2].name == oldVal.matched[2].name
+        console.log(newVal.matched[2].name, oldVal.matched[2].name, hasChildren)
+        if ((na || nb || nc || oa || ob || oc) && hasChildren) {
           // 替换当前页签
           this.replaceTab(newVal, oldVal)
           // 从列表打开新增,编辑
@@ -186,7 +189,8 @@ export default {
       this.activeKey = newVal.name
     },
     activeKey: function (newPathKey) {
-      this.$router.push({ name: newPathKey })
+      const pages = this.pages.find(item => item.name == newPathKey)
+      this.$router.push({ name: newPathKey, params: pages.params })
     }
   },
   render () {

+ 4 - 3
src/libs/JGPrint.js

@@ -24,9 +24,10 @@ export const JGPrint = function (data, type, printerType) {
       return
     }
     LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
-    LODOP.ADD_PRINT_HTM('0', '0', 'RightMargin:0cm', 'BottomMargin:0cm', data)
-    LODOP.SET_PRINT_PAGESIZE(3, 2090, 45, '') // 这里3表示纵向打印且纸高“按内容的高度”;2140表示纸宽214.0mm;60表示页底空白6.0mm
-    // LODOP.SET_PRINT_PAGESIZE(1, 2090, 1000, '')
+    LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",true) // 可使输出以纸张边缘为基点
+    // LODOP.SET_PRINT_PAGESIZE(3, 2090, 45, '') // 这里3表示纵向打印且纸高“按内容的高度”;2140表示纸宽214.0mm;60表示页底空白6.0mm
+    LODOP.SET_PRINT_PAGESIZE(1, 2090, 1000, '')
+    LODOP.ADD_PRINT_HTM('0', '0', '595pt', 1000, data)
     if (type == 'preview') {
       LODOP.PREVIEW()
     }

+ 22 - 6
src/views/salesManagement/salesQuery/queryPart.vue

@@ -121,7 +121,7 @@
       bordered>
       <!-- 售价 -->
       <template slot="salePrice" slot-scope="text, record">
-        <div @dblclick.stop>
+        <div style="display: flex;align-items: center;" @dblclick.stop>
           <a-input-number
             size="small"
             v-model="record.salePrice"
@@ -130,6 +130,8 @@
             :max="999999"
             style="width: 100%;"
             placeholder="请输入" />
+          <span style="color: red;margin: 0 2px;font-size: 14px;" v-if="record.origSalePriceFlag == 1">原</span>
+          <span v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
         </div>
       </template>
       <!-- 销售数量 -->
@@ -280,16 +282,16 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '10%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '11%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'currentQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: '7%', align: 'center' },
-        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '7%', align: 'center' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '6%', align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
       ]
       if (this.cost) {
@@ -407,7 +409,21 @@ export default {
     },
     // 选择配件
     handleAdd (row) {
-      this.$emit('add', row)
+      const _this = this
+      console.log(row.lastSalePrice, row.salePrice, row.lastSalePrice < row.salePrice)
+      if (row.lastSalePrice && (row.lastSalePrice < row.salePrice)) {
+        _this.$confirm({
+          title: '提示',
+          content: '售价低于定价,是否仍继续添加?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.$emit('add', row)
+          }
+        })
+      } else {
+        _this.$emit('add', row)
+      }
     },
     // 销售记录
     handleDetail (row) {