分销等级配置商品券

main
ztt 8 months ago
parent 4d5beed336
commit 01600616a4
  1. 20
      public/assets/js/backend/shopro/commission/level.js
  2. 10
      public/assets/js/backend/shopro/coupon.js

@ -339,11 +339,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
function onSelectCoupon1() {
// let ids = [];
// form.model.coupon_rules.programme_1.forEach((i) => {
// ids.push(i.id);
// });
Fast.api.open(`shopro/coupon/select?multiple=true&status=normal`, "选择商品", {
let ids = [];
form.model.coupon_rules.programme_1.forEach((i) => {
ids.push(i.id);
});
Fast.api.open(`shopro/coupon/select?multiple=true&status=normal&use_scope=goods&ids=${ids.join(',')}`, "选择商品", {
callback(data) {
console.log(data)
form.model.coupon_rules.programme_1 = data;
@ -352,11 +352,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
function onSelectCoupon2() {
// let ids = [];
// form.model.coupon_rules.programme_2.forEach((i) => {
// ids.push(i.id);
// });
Fast.api.open(`shopro/coupon/select?multiple=true&status=normal`, "选择商品券", {
let ids = [];
form.model.coupon_rules.programme_2.forEach((i) => {
ids.push(i.id);
});
Fast.api.open(`shopro/coupon/select?multiple=true&status=normal&use_scope=goods&ids=${ids.join(',')}`, "选择商品券", {
callback(data) {
console.log(data)
form.model.coupon_rules.programme_2 = data;

@ -383,13 +383,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
const state = reactive({
multiple: new URLSearchParams(location.search).get('multiple') || false,
status: new URLSearchParams(location.search).get('status'),
use_scope: new URLSearchParams(location.search).get('use_scope'),
ids: new URLSearchParams(location.search).get('ids'), // 选中的优惠券id
data: [],
selected: [],
})
function getData() {
let tempSearch = {
status: state.status
status: state.status,
use_scope: state.use_scope,
};
let search = composeFilter(tempSearch);
Fast.api.ajax({
@ -422,15 +425,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
function onConfirm() {
// let ids = state.ids.join(',')
let ids = state.ids.join(',')
Fast.api.ajax({
url: 'shopro/coupon/select',
type: 'GET',
data: {
type: 'select',
search: JSON.stringify({ use_scope: 'goods','status':'normal' })
search: JSON.stringify({ use_scope: ['goods','='],status:['normal','='],id: [ids, 'in'] })
},
}, function (ret, res) {
Fast.api.close(state.selected)
Fast.api.close(res.data)
return false
}, function (ret, res) { })

Loading…
Cancel
Save