소스 검색

模板设置页面修改

lilei 1 년 전
부모
커밋
4f877a0446

+ 1 - 1
public/version.json

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

+ 3 - 2
src/views/common/productJqList.vue

@@ -28,7 +28,7 @@ export default {
     },
     params: {
       type: Object,
-      default: ()=> {
+      default: () => {
         return null
       }
     }
@@ -51,7 +51,7 @@ export default {
       this.data = []
       this.fetching = true
       let params = { code: productCode, pageNo: 1, pageSize: 20 }
-      if(this.params){
+      if (this.params) {
         params = Object.assign(params, this.params)
       }
       shelfDealerProductList(params).then(res => {
@@ -78,6 +78,7 @@ export default {
       this.productCode = undefined
     },
     setData (value) {
+      console.log(value)
       Object.assign(this, {
         productCode: value,
         data: [],

+ 26 - 11
src/views/numsGoodsShelves/shelfProductTempl/addHwModal.vue

@@ -20,11 +20,10 @@
         <a-form-model-item label="货位号" prop="shelfPlaceCode">
           <a-input v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
         </a-form-model-item>
-        <a-form-model-item label="绑定产品" v-if="type=='add'">
+        <a-form-model-item label="绑定产品" prop="productSn">
           <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
         </a-form-model-item>
-        <a-form-model-item label="产品名称" v-if="form.productSn">{{ productName || '--' }}</a-form-model-item>
-        <a-form-model-item v-if="form.productSn" label="车主价" prop="price">
+        <a-form-model-item label="车主价">
           <a-input-number
             id="shelfSet-newHw-price"
             v-model="form.price"
@@ -35,7 +34,7 @@
             suffix="元"
             style="width: 80%;display: inline-block;" /> 元
         </a-form-model-item>
-        <a-form-model-item v-if="form.productSn" label="结算价" prop="cost">
+        <a-form-model-item label="结算价">
           <a-input-number
             id="shelfSet-newHw-cost"
             v-model="form.cost"
@@ -45,7 +44,7 @@
             placeholder="请输入结算价(最多允许两位小数)"
             style="width: 80%;display: inline-block;" /> 元
         </a-form-model-item>
-        <a-form-model-item v-if="form.productSn" label="最大库容" prop="maxQty">
+        <a-form-model-item label="最大库容" prop="maxQty">
           <a-input-number
             id="shelfSet-newHw-maxQty"
             v-model="form.maxQty"
@@ -114,8 +113,7 @@ export default {
           	message: '货位号必需字母+数字,且不能超过30个字符'
           }
         ],
-        price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
-        cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
+        productSn: [{ required: true, message: '请选择产品', trigger: 'blur' }],
         maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
       },
       productName: ''
@@ -133,7 +131,7 @@ export default {
     }
   },
   methods: {
-    // 产品 change
+    // 选择产品 change
     productJqChange (obj) {
       this.form.productSn = obj.key || undefined
       this.form.productCode = obj && obj.row && obj.row.code || ''
@@ -144,12 +142,13 @@ export default {
       this.form.oldCost = obj && obj.row && obj.row.cost || ''
       this.form.oldMaxQty = ''
     },
+    // 货位号变更
     placeCodeBlur (v) {
     	this.$nextTick(() => {
     		this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
     	})
     },
-    //  保存
+    // 保存
     handleSave () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -191,7 +190,22 @@ export default {
         }
       })
     },
+    // 编辑赋值
+    setFormData () {
+      console.log(this.nowData)
+      const product = this.nowData.shelfProductApiEntity
+      this.form.shelfPlaceCode = this.nowData.shelfPlaceCode
+      this.form.productSn = product.productSn
+      this.form.productCode = product.productCode
+      this.form.price = product.price
+      this.form.cost = product.cost
+      this.form.maxQty = product.maxQty
+      this.$refs.productJqList.setData({ key: product.productCode })
+    },
+    // 重置表单
     resetData () {
+      this.productName = ''
+      this.form.shelfPlaceCode = ''
       this.form.productSn = undefined
       this.form.productCode = undefined
       this.form.price = ''
@@ -213,10 +227,11 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.resetData()
-        this.productName = ''
       } else {
         if (this.type == 'edit') {
-          this.form.shelfPlaceCode = this.nowData.shelfPlaceCode
+          this.$nextTick(() => {
+            this.setFormData()
+          })
         }
       }
     }

+ 25 - 11
src/views/numsGoodsShelves/shelfProductTempl/list.vue

@@ -10,6 +10,15 @@
                 <a-input v-model.trim="queryParam.tempName" allowClear placeholder="请输入模板名称"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="模板类型">
+                <v-select
+                  v-model="queryParam.tempType"
+                  code="FLAG"
+                  placeholder="请选择模板类型"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfSetList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfSetList-reset">重置</a-button>
@@ -32,15 +41,15 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
-        <!-- 货架名称 -->
-        <template slot="shelfName" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.shelfName }}</span>
+        <!-- 模板名称 -->
+        <template slot="tempName" slot-scope="text, record">
+          <span class="table-td-link" @click="handleDetail(record)">{{ record.shelfName }}</span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <div>
-            <a-button size="small" type="link" class="button-primary" @click="handleCopy(record)">复制</a-button>
             <a-button size="small" type="link" class="button-primary" @click="addTemp(record)">更改名称</a-button>
+            <a-button size="small" type="link" class="button-primary" @click="handleCopy(record)">复制</a-button>
             <a-button size="small" type="link" class="button-error" @click="handleCancel(record)">删除</a-button>
           </div>
         </template>
@@ -56,7 +65,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import commonModal from '@/views/common/commonModal.vue'
-import { shelfList, modifFinishFlag, shelfModifState } from '@/api/shelf'
+import { shelfList, shelfModifState } from '@/api/shelf'
 export default {
   name: 'ShelfProductTemplList',
   components: { STable, VSelect, basicInfoModal, commonModal },
@@ -67,11 +76,13 @@ export default {
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        tempName: '' // 模板名称
+        tempName: '', // 模板名称
+        tempType: undefined // 模板类型
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '模板名称', scopedSlots: { customRender: 'shelfName' }, width: '70%', align: 'left', ellipsis: true },
+        { title: '模板类型', dataIndex: 'tempType', width: '20%', align: 'left' },
+        { title: '模板名称', scopedSlots: { customRender: 'tempName' }, width: '50%', align: 'left', ellipsis: true },
         { title: '产品款数', dataIndex: 'qty', width: '15%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
       ],
@@ -98,16 +109,16 @@ export default {
     }
   },
   methods: {
-    // 新增/修改
+    // 新增/修改模板
     addTemp (row) {
       this.nowData = row
       this.openModal = true
     },
-    // 详情设置
+    // 模板详情设置
     handleDetail (data) {
       this.$router.push({ name: 'shelfProductTemplSetting', params: { sn: data.shelfSn } })
     },
-    // 复制
+    // 复制模板
     handleCopy (row) {
       const _this = this
       this.$confirm({
@@ -129,7 +140,7 @@ export default {
         }
       })
     },
-    // 删除
+    // 删除模板
     handleCancel (record) {
       const _this = this
       this.$confirm({
@@ -154,12 +165,15 @@ export default {
     // 重置
     resetSearchForm () {
       this.queryParam.tempName = ''
+      this.queryParam.tempType = undefined
       this.$refs.table.refresh(true)
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 235
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 11 - 16
src/views/numsGoodsShelves/shelfProductTempl/set.vue

@@ -99,11 +99,10 @@ export default {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
-      tableHeight: 400,
-      exportLoading: false,
+      tableHeight: 400, // 表格高度
       queryParam: {
-        productCode: '',
-        shelfPlaceCode: ''
+        productCode: '', // 产品编码
+        shelfPlaceCode: '' // 货位号
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -115,7 +114,6 @@ export default {
             data = res.data
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              data[i].enableFlag = data[i].shelfProductApiEntity && data[i].shelfProductApiEntity.enableFlag
             }
             this.disabled = false
           }
@@ -123,14 +121,11 @@ export default {
           return data
         })
       },
-      basicInfoData: null,
-      openModal: false,
-      nowData: null,
-      openGuideModal: false,
-      modalType: null,
-      openHwModal: false,
-      showPriceStr: [],
-      showNoShelfPriceStr: []
+      basicInfoData: null, // 模板详细信息
+      nowData: null, // 当前修改的数据
+      openGuideModal: false, // 导入产品
+      modalType: null, // 新增or编辑
+      openHwModal: false // 打开新增编辑弹框
     }
   },
   computed: {
@@ -154,7 +149,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'shelfProductTemplList' })
     },
-    // 新增
+    // 新增货位
     addHW () {
       this.handleProduct(null, 'add')
     },
@@ -170,13 +165,13 @@ export default {
         this.nowData = this.basicInfoData
       }
       this.modalType = type
-      this.openModal = true
+      this.openHwModal = true
     },
     // 关闭弹框
     handleCancel () {
       this.modalType = null
       this.nowData = null
-      this.openModal = false
+      this.openHwModal = false
       this.openHwModal = false
     },
     // 基本信息