shish 1 dzień temu
rodzic
commit
7d20110969
2 zmienionych plików z 120 dodań i 9 usunięć
  1. 112 9
      pt/src/saas/shop/shop.vue
  2. 8 0
      pt/src/service/shop/index.js

+ 112 - 9
pt/src/saas/shop/shop.vue

@@ -8,6 +8,7 @@
                 <el-link :underline="true" @click="AmountShowFn(scope.row,'1')" style="font-size:12px;display:inline-block;">{{ scope.row.totalIncome }}</el-link>
             </template>
             <template #slot-apply="{scope}">
+              <el-button type="text" @click="editShop(scope.row)">修改信息</el-button>
               <el-button type="text" @click="addStaff(scope.row)">添加员工</el-button>
               <el-button type="text" @click="clearStock(scope.row)">清库存</el-button>
             </template>
@@ -22,15 +23,19 @@
             </template>
 
             <template #table-column-hasRenew="{scope}">
-                <span v-if="scope.row.hasRenew == 0" style="color:#CCCCCC;">-</span>
-                <span v-else style="color:blue;">
-                  已续
-                </span>
+                <span v-if="scope.row.hasRenew == 0" style="color:#999999;">未续费</span>
+                <span v-else style="color:blue;">已续费</span>
             </template>
 
             <template #table-column-deadline="{scope}">
                 <span>
-                  {{ scope.row.deadline?scope.row.deadline.substr(0,11):'' }}
+                  {{ scope.row.deadline ? scope.row.deadline.substr(0,16) : '-' }}
+                </span>
+            </template>
+
+            <template #table-column-beforeDeadline="{scope}">
+                <span>
+                  {{ scope.row.beforeDeadline ? scope.row.beforeDeadline.substr(0,16) : '-' }}
                 </span>
             </template>
 
@@ -82,6 +87,54 @@
           </div>
         </el-dialog>
 
+        <!-- 修改门店信息弹窗 -->
+        <el-dialog :visible.sync="editShopPop" :close-on-click-modal="false" width="550px" title="修改门店信息">
+          <el-form :model="editShopForm" :rules="editShopRule" ref="editShopRef" label-width="110px" class="demo-form">
+            <el-form-item label="商家/门店">
+              <span style="font-weight: bold; color: #333;">{{ editShopForm.merchantName }} - {{ editShopForm.shopName }}</span>
+            </el-form-item>
+            <el-form-item label="商户号" prop="lklSjNo">
+              <el-input placeholder="请输入拉卡拉商户号" size="small" v-model="editShopForm.lklSjNo"></el-input>
+            </el-form-item>
+            <el-form-item label="B2B终端号" prop="lklB2BTermNo">
+              <el-input placeholder="请输入B2B终端号" size="small" v-model="editShopForm.lklB2BTermNo"></el-input>
+            </el-form-item>
+            <el-form-item label="扫码终端号" prop="lklScanTermNo">
+              <el-input placeholder="请输入扫码终端号" size="small" v-model="editShopForm.lklScanTermNo"></el-input>
+            </el-form-item>
+            <el-form-item label="到期时间" prop="deadline">
+              <el-date-picker
+                v-model="editShopForm.deadline"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择到期时间"
+                size="small"
+                style="width: 100%;"
+              ></el-date-picker>
+            </el-form-item>
+            <el-form-item label="上次到期时间" prop="beforeDeadline">
+              <el-date-picker
+                v-model="editShopForm.beforeDeadline"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择上次到期时间"
+                size="small"
+                style="width: 100%;"
+              ></el-date-picker>
+            </el-form-item>
+            <el-form-item label="续费状态" prop="hasRenew">
+              <el-radio-group v-model="editShopForm.hasRenew">
+                <el-radio :label="0">未续费</el-radio>
+                <el-radio :label="1">已续费</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button size="small" @click="resetEditShopForm">取 消</el-button>
+            <el-button type="primary" size="small" @click="putEditShopForm">确 认</el-button>
+          </div>
+        </el-dialog>
+
     </div>
 </template>
 <script>
@@ -115,7 +168,20 @@ export default {
             },
             clearStockRule:{
               password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
-            }
+            },
+            editShopPop: false,
+            editShopForm: {
+              id: '',
+              merchantName: '',
+              shopName: '',
+              lklSjNo: '',
+              lklB2BTermNo: '',
+              lklScanTermNo: '',
+              deadline: '',
+              beforeDeadline: '',
+              hasRenew: 0
+            },
+            editShopRule: {}
         };
     },
     mounted() {
@@ -127,6 +193,37 @@ export default {
             this.app.refresh()
           })
         },
+        editShop(shop) {
+          this.editShopForm = {
+            id: shop.id,
+            merchantName: shop.merchantName || '',
+            shopName: shop.shopName || '',
+            lklSjNo: shop.lklSjNo || '',
+            lklB2BTermNo: shop.lklB2BTermNo || '',
+            lklScanTermNo: shop.lklScanTermNo || '',
+            deadline: shop.deadline || '',
+            beforeDeadline: shop.beforeDeadline || '',
+            hasRenew: shop.hasRenew != null ? Number(shop.hasRenew) : 0
+          };
+          this.editShopPop = true;
+        },
+        resetEditShopForm() {
+          if (this.$refs['editShopRef']) {
+            this.$refs['editShopRef'].resetFields();
+          }
+          this.editShopPop = false;
+        },
+        putEditShopForm() {
+          this.$refs['editShopRef'].validate(valid => {
+            if (valid) {
+              this.$service.shop.update(this.editShopForm).then(() => {
+                this.$message.success('修改成功');
+                this.editShopPop = false;
+                this.app.refresh();
+              });
+            }
+          });
+        },
         clearStock(shop){
           this.clearStockPop = true 
           this.clearStockForm.shopId = shop.id
@@ -220,8 +317,14 @@ export default {
                         },
                         {
                             prop: 'deadline',
-                            label: '过期时间',
-                            width: '90',
+                            label: '到期时间',
+                            width: '120',
+                            align: 'center'
+                        },
+                        {
+                            prop: 'beforeDeadline',
+                            label: '上次到期',
+                            width: '120',
                             align: 'center'
                         },
                         {
@@ -249,7 +352,7 @@ export default {
                     op: {
                       visible: true,
                       props: {
-                        width: 190,
+                        width: 240,
                         align: 'center',
                         fixed: 'right',
                         label: '操作'

+ 8 - 0
pt/src/service/shop/index.js

@@ -20,5 +20,13 @@ export class ShopService extends BaseService {
 		});
 	}
 
+	update(data) {
+		return this.request({
+			url: '/update',
+			method: 'POST',
+			data: data
+		});
+	}
+
 }
 export default new ShopService();