|
@@ -49,6 +49,18 @@
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
+ <template #slot-batch-btn>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="margin-left: 10px;"
|
|
|
|
|
+ :disabled="selectedShops.length === 0"
|
|
|
|
|
+ @click="batchEditShop"
|
|
|
|
|
+ >
|
|
|
|
|
+ 批量修改 ({{ selectedShops.length }})
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
</x-crud>
|
|
</x-crud>
|
|
|
|
|
|
|
|
<balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
|
|
<balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
|
|
@@ -111,6 +123,12 @@
|
|
|
size="small"
|
|
size="small"
|
|
|
style="width: 100%;"
|
|
style="width: 100%;"
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
|
|
+ <div style="margin-top: 6px; display: flex; align-items: center; gap: 8px;">
|
|
|
|
|
+ <span style="font-size: 12px; color: #888;">快捷选择:</span>
|
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="setQuickDeadline('edit', 'halfYear')">半年</el-button>
|
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="setQuickDeadline('edit', 'oneYear')">明年</el-button>
|
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="setQuickDeadline('edit', 'twoYears')">后年</el-button>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="上次到期时间" prop="beforeDeadline">
|
|
<el-form-item label="上次到期时间" prop="beforeDeadline">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
@@ -135,11 +153,68 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
+ <!-- 批量修改门店信息弹窗 -->
|
|
|
|
|
+ <el-dialog :visible.sync="batchEditShopPop" :close-on-click-modal="false" width="580px" title="批量修改门店信息">
|
|
|
|
|
+ <div style="margin-bottom: 15px; padding: 10px 12px; background: #e6f7ff; border: 1px solid #91d5ff; border-radius: 4px; font-size: 13px; color: #1890ff;">
|
|
|
|
|
+ <div>已选择 <b>{{ selectedShops.length }}</b> 家门店:<span style="color: #333; word-break: break-all;">{{ selectedShopsNames }}</span></div>
|
|
|
|
|
+ <div style="margin-top: 4px; color: #ff4d4f; font-size: 12px;">说明:不填或选择“不修改”的字段将保持各个门店原本的数值。</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-form :model="batchEditShopForm" ref="batchEditShopRef" label-width="110px" class="demo-form">
|
|
|
|
|
+ <el-form-item label="商户号">
|
|
|
|
|
+ <el-input placeholder="留空则不修改" size="small" v-model="batchEditShopForm.lklSjNo"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="B2B终端号">
|
|
|
|
|
+ <el-input placeholder="留空则不修改" size="small" v-model="batchEditShopForm.lklB2BTermNo"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="扫码终端号">
|
|
|
|
|
+ <el-input placeholder="留空则不修改" size="small" v-model="batchEditShopForm.lklScanTermNo"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="到期时间">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="batchEditShopForm.deadline"
|
|
|
|
|
+ type="datetime"
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
+ placeholder="不选则不修改"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%;"
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ <div style="margin-top: 6px; display: flex; align-items: center; gap: 8px;">
|
|
|
|
|
+ <span style="font-size: 12px; color: #888;">快捷选择:</span>
|
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="setQuickDeadline('batch', 'halfYear')">半年</el-button>
|
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="setQuickDeadline('batch', 'oneYear')">明年</el-button>
|
|
|
|
|
+ <el-button size="mini" type="primary" plain @click="setQuickDeadline('batch', 'twoYears')">后年</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="上次到期时间">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="batchEditShopForm.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="续费状态">
|
|
|
|
|
+ <el-radio-group v-model="batchEditShopForm.hasRenew">
|
|
|
|
|
+ <el-radio :label="-1">不修改</el-radio>
|
|
|
|
|
+ <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="resetBatchEditShopForm">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" @click="putBatchEditShopForm">确 认</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import balanceDetail from './components/balance-detail';
|
|
import balanceDetail from './components/balance-detail';
|
|
|
import amountDetail from './components/amount-detail';
|
|
import amountDetail from './components/amount-detail';
|
|
|
|
|
+import dayjs from 'dayjs';
|
|
|
export default {
|
|
export default {
|
|
|
components:{balanceDetail,amountDetail},
|
|
components:{balanceDetail,amountDetail},
|
|
|
data() {
|
|
data() {
|
|
@@ -181,9 +256,25 @@ export default {
|
|
|
beforeDeadline: '',
|
|
beforeDeadline: '',
|
|
|
hasRenew: 0
|
|
hasRenew: 0
|
|
|
},
|
|
},
|
|
|
- editShopRule: {}
|
|
|
|
|
|
|
+ editShopRule: {},
|
|
|
|
|
+ editShopOriginalDeadline: '',
|
|
|
|
|
+ selectedShops: [],
|
|
|
|
|
+ batchEditShopPop: false,
|
|
|
|
|
+ batchEditShopForm: {
|
|
|
|
|
+ lklSjNo: '',
|
|
|
|
|
+ lklB2BTermNo: '',
|
|
|
|
|
+ lklScanTermNo: '',
|
|
|
|
|
+ deadline: '',
|
|
|
|
|
+ beforeDeadline: '',
|
|
|
|
|
+ hasRenew: -1
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ selectedShopsNames() {
|
|
|
|
|
+ return this.selectedShops.map(e => e.shopName || e.merchantName || ('ID:' + e.id)).join('、');
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
mounted() {
|
|
mounted() {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -194,6 +285,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
editShop(shop) {
|
|
editShop(shop) {
|
|
|
|
|
+ this.editShopOriginalDeadline = shop.deadline || '';
|
|
|
this.editShopForm = {
|
|
this.editShopForm = {
|
|
|
id: shop.id,
|
|
id: shop.id,
|
|
|
merchantName: shop.merchantName || '',
|
|
merchantName: shop.merchantName || '',
|
|
@@ -207,6 +299,36 @@ export default {
|
|
|
};
|
|
};
|
|
|
this.editShopPop = true;
|
|
this.editShopPop = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 到期时间快捷选择 (半年、明年、后年)
|
|
|
|
|
+ * @param {string} type 'edit' | 'batch'
|
|
|
|
|
+ * @param {string} durationKey 'halfYear' | 'oneYear' | 'twoYears'
|
|
|
|
|
+ */
|
|
|
|
|
+ setQuickDeadline(type, durationKey) {
|
|
|
|
|
+ let base = dayjs();
|
|
|
|
|
+ if (type === 'edit') {
|
|
|
|
|
+ const orig = this.editShopOriginalDeadline;
|
|
|
|
|
+ if (orig && dayjs(orig).isValid() && dayjs(orig).isAfter(dayjs())) {
|
|
|
|
|
+ base = dayjs(orig);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ let resultDate = base;
|
|
|
|
|
+ if (durationKey === 'halfYear') {
|
|
|
|
|
+ resultDate = base.add(6, 'month');
|
|
|
|
|
+ } else if (durationKey === 'oneYear') {
|
|
|
|
|
+ resultDate = base.add(1, 'year');
|
|
|
|
|
+ } else if (durationKey === 'twoYears') {
|
|
|
|
|
+ resultDate = base.add(2, 'year');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const formatted = resultDate.format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
+ if (type === 'edit') {
|
|
|
|
|
+ this.editShopForm.deadline = formatted;
|
|
|
|
|
+ } else if (type === 'batch') {
|
|
|
|
|
+ this.batchEditShopForm.deadline = formatted;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
resetEditShopForm() {
|
|
resetEditShopForm() {
|
|
|
if (this.$refs['editShopRef']) {
|
|
if (this.$refs['editShopRef']) {
|
|
|
this.$refs['editShopRef'].resetFields();
|
|
this.$refs['editShopRef'].resetFields();
|
|
@@ -224,6 +346,42 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ batchEditShop() {
|
|
|
|
|
+ if (this.selectedShops.length === 0) {
|
|
|
|
|
+ this.$message.warning('请先勾选要批量修改的门店');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.batchEditShopForm = {
|
|
|
|
|
+ lklSjNo: '',
|
|
|
|
|
+ lklB2BTermNo: '',
|
|
|
|
|
+ lklScanTermNo: '',
|
|
|
|
|
+ deadline: '',
|
|
|
|
|
+ beforeDeadline: '',
|
|
|
|
|
+ hasRenew: -1
|
|
|
|
|
+ };
|
|
|
|
|
+ this.batchEditShopPop = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ resetBatchEditShopForm() {
|
|
|
|
|
+ this.batchEditShopPop = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ putBatchEditShopForm() {
|
|
|
|
|
+ const form = this.batchEditShopForm;
|
|
|
|
|
+ if (!form.lklSjNo && !form.lklB2BTermNo && !form.lklScanTermNo && !form.deadline && !form.beforeDeadline && form.hasRenew === -1) {
|
|
|
|
|
+ this.$message.warning('请至少选择或填写一项要修改的内容');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const ids = this.selectedShops.map(e => e.id);
|
|
|
|
|
+ const postData = {
|
|
|
|
|
+ ids: ids,
|
|
|
|
|
+ isBatch: 1,
|
|
|
|
|
+ ...form
|
|
|
|
|
+ };
|
|
|
|
|
+ this.$service.shop.update(postData).then(() => {
|
|
|
|
|
+ this.$message.success(`成功批量修改 ${ids.length} 家门店的信息`);
|
|
|
|
|
+ this.batchEditShopPop = false;
|
|
|
|
|
+ this.app.refresh();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
clearStock(shop){
|
|
clearStock(shop){
|
|
|
this.clearStockPop = true
|
|
this.clearStockPop = true
|
|
|
this.clearStockForm.shopId = shop.id
|
|
this.clearStockForm.shopId = shop.id
|
|
@@ -255,6 +413,11 @@ export default {
|
|
|
ctx.service(this.$service.shop)
|
|
ctx.service(this.$service.shop)
|
|
|
.set('table', {
|
|
.set('table', {
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ width: '50'
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
prop: 'id',
|
|
prop: 'id',
|
|
|
label: 'ID',
|
|
label: 'ID',
|
|
@@ -358,6 +521,11 @@ export default {
|
|
|
label: '操作'
|
|
label: '操作'
|
|
|
},
|
|
},
|
|
|
layout: ['slot-apply']
|
|
layout: ['slot-apply']
|
|
|
|
|
+ },
|
|
|
|
|
+ on: {
|
|
|
|
|
+ 'selection-change': selection => {
|
|
|
|
|
+ this.selectedShops = selection;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.set('dict', {
|
|
.set('dict', {
|
|
@@ -374,7 +542,7 @@ export default {
|
|
|
size: 50
|
|
size: 50
|
|
|
})
|
|
})
|
|
|
.set('layout', [
|
|
.set('layout', [
|
|
|
- ['slot-tabs'],['search-key'],
|
|
|
|
|
|
|
+ ['slot-tabs'],['search-key', 'slot-batch-btn'],
|
|
|
['flex1', 'refresh-btn'],
|
|
['flex1', 'refresh-btn'],
|
|
|
['data-table'],
|
|
['data-table'],
|
|
|
['flex1', 'pagination']
|
|
['flex1', 'pagination']
|