init
- 框架初始化 - 安装插件 - 修复PHP8.4报错
This commit is contained in:
437
public/assets/js/backend/shopro/order/aftersale.js
Normal file
437
public/assets/js/backend/shopro/order/aftersale.js
Normal file
@@ -0,0 +1,437 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: () => {
|
||||
const { reactive, onMounted } = Vue
|
||||
const index = {
|
||||
setup() {
|
||||
const state = reactive({
|
||||
data: [],
|
||||
filter: {
|
||||
drawer: false,
|
||||
data: {
|
||||
'aftersale_list.aftersale_status': 'all',
|
||||
'aftersale_list.goods_title': '',
|
||||
keyword: { field: 'aftersale_list.aftersale_sn', value: '' },
|
||||
user: { field: 'user.nickname', value: '' },
|
||||
'aftersale_list.type': '',
|
||||
'aftersale_list.dispatch_status': '',
|
||||
'aftersale_list.refund_status': '',
|
||||
},
|
||||
tools: {
|
||||
'aftersale_list.goods_title': {
|
||||
type: 'tinput',
|
||||
label: '商品名称',
|
||||
value: '',
|
||||
},
|
||||
keyword: {
|
||||
type: 'tinputprepend',
|
||||
label: '售后信息',
|
||||
placeholder: '请输入查询内容',
|
||||
value: {
|
||||
field: 'aftersale_list.aftersale_sn',
|
||||
value: '',
|
||||
},
|
||||
options: {
|
||||
data: [{
|
||||
label: '售后单号',
|
||||
value: 'aftersale_list.aftersale_sn',
|
||||
},
|
||||
{
|
||||
label: '售后手机号',
|
||||
value: 'aftersale_list.mobile',
|
||||
},
|
||||
{
|
||||
label: '订单编号',
|
||||
value: 'order_sn',
|
||||
}]
|
||||
}
|
||||
},
|
||||
user: {
|
||||
type: 'tinputprepend',
|
||||
label: '售后用户',
|
||||
placeholder: '请输入查询内容',
|
||||
value: {
|
||||
field: 'user.nickname',
|
||||
value: '',
|
||||
},
|
||||
options: {
|
||||
data: [{
|
||||
label: '用户昵称',
|
||||
value: 'user.nickname',
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
value: 'user.mobile',
|
||||
}]
|
||||
},
|
||||
},
|
||||
'aftersale_list.type': {
|
||||
type: 'tselect',
|
||||
label: '售后类型',
|
||||
value: '',
|
||||
options: {
|
||||
data: [],
|
||||
props: {
|
||||
label: 'name',
|
||||
value: 'type',
|
||||
},
|
||||
},
|
||||
},
|
||||
'aftersale_list.dispatch_status': {
|
||||
type: 'tselect',
|
||||
label: '发货状态',
|
||||
value: '',
|
||||
options: {
|
||||
data: [],
|
||||
props: {
|
||||
label: 'name',
|
||||
value: 'type',
|
||||
},
|
||||
},
|
||||
},
|
||||
'aftersale_list.refund_status': {
|
||||
type: 'tselect',
|
||||
label: '退款状态',
|
||||
value: '',
|
||||
options: {
|
||||
data: [],
|
||||
props: {
|
||||
label: 'name',
|
||||
value: 'type',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
condition: {},
|
||||
}
|
||||
})
|
||||
|
||||
const type = reactive({
|
||||
data: {}
|
||||
})
|
||||
function getType() {
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/order/aftersale/getType',
|
||||
type: 'GET',
|
||||
}, function (ret, res) {
|
||||
type.data = res.data
|
||||
for (key in res.data) {
|
||||
if (key == 'aftersale_status') {
|
||||
} else {
|
||||
state.filter.tools[`aftersale_list.${key}`].options.data = res.data[key]
|
||||
}
|
||||
}
|
||||
return false
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
|
||||
function getData() {
|
||||
let tempSearch = JSON.parse(JSON.stringify(state.filter.data));
|
||||
let search = composeFilter(tempSearch, {
|
||||
'aftersale_list.goods_title': 'like',
|
||||
'aftersale_list.aftersale_sn': 'like',
|
||||
'aftersale_list.mobile': 'like',
|
||||
order_sn: 'like',
|
||||
'user.nickname': 'like',
|
||||
'user.mobile': 'like',
|
||||
});
|
||||
search = {
|
||||
search: JSON.stringify({
|
||||
'aftersale_list._': '',
|
||||
...JSON.parse(search.search),
|
||||
}),
|
||||
};
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/order/aftersale',
|
||||
type: 'GET',
|
||||
data: {
|
||||
page: pagination.page,
|
||||
list_rows: pagination.list_rows,
|
||||
...search,
|
||||
},
|
||||
}, function (ret, res) {
|
||||
state.data = res.data.data
|
||||
pagination.total = res.data.total
|
||||
return false
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
|
||||
function onOpenFilter() {
|
||||
state.filter.drawer = true
|
||||
}
|
||||
function onChangeFilter() {
|
||||
pagination.page = 1
|
||||
getData()
|
||||
state.filter.drawer && (state.filter.drawer = false)
|
||||
}
|
||||
|
||||
function onChangeTab() {
|
||||
pagination.page = 1
|
||||
getData()
|
||||
}
|
||||
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
list_rows: 10,
|
||||
total: 0,
|
||||
})
|
||||
|
||||
function onDetail(id) {
|
||||
Fast.api.open(`shopro/order/aftersale/detail/id/${id}?id=${id}`, "详情", {
|
||||
callback() {
|
||||
getData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function onOpenGoods(id) {
|
||||
Fast.api.open(`shopro/goods/goods/add?type=edit&id=${id}`, "商品详情", {
|
||||
callback() {
|
||||
getData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function onOpenOrderDetail(id) {
|
||||
Fast.api.open(`shopro/order/order/detail?id=${id}`, "订单详情", {
|
||||
callback() {
|
||||
getData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getType()
|
||||
getData()
|
||||
})
|
||||
|
||||
return {
|
||||
onClipboard,
|
||||
state,
|
||||
type,
|
||||
getData,
|
||||
onOpenFilter,
|
||||
onChangeFilter,
|
||||
onChangeTab,
|
||||
pagination,
|
||||
onDetail,
|
||||
onOpenGoods,
|
||||
onOpenOrderDetail,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('index', index);
|
||||
},
|
||||
detail: () => {
|
||||
const { reactive, onMounted } = Vue
|
||||
const detail = {
|
||||
setup() {
|
||||
const state = reactive({
|
||||
id: new URLSearchParams(location.search).get('id'),
|
||||
data: {},
|
||||
stepActive: 1,
|
||||
})
|
||||
|
||||
function getDetail() {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/order/aftersale/detail/id/${state.id}`,
|
||||
type: 'GET',
|
||||
}, function (ret, res) {
|
||||
state.data = res.data;
|
||||
setStepActive()
|
||||
return false
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
|
||||
function setStepActive() {
|
||||
if (
|
||||
state.data.aftersale_status == -1 ||
|
||||
state.data.aftersale_status == -2 ||
|
||||
state.data.aftersale_status == 2
|
||||
) {
|
||||
state.stepActive = 3;
|
||||
} else {
|
||||
state.stepActive = state.data.aftersale_status + 1;
|
||||
}
|
||||
}
|
||||
|
||||
function onRefund() {
|
||||
Fast.api.open(`shopro/order/aftersale/refund/id/${state.id}?id=${state.id}&suggest_refund_fee=${state.data.suggest_refund_fee}`, "售后退款", {
|
||||
callback() {
|
||||
getDetail()
|
||||
}
|
||||
})
|
||||
}
|
||||
function onRefuse() {
|
||||
Fast.api.open(`shopro/order/aftersale/refuse/id/${state.id}?id=${state.id}`, "拒绝售后", {
|
||||
callback() {
|
||||
getDetail()
|
||||
}
|
||||
})
|
||||
}
|
||||
function onCompleted() {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/order/aftersale/completed/id/${state.id}`,
|
||||
type: 'POST',
|
||||
}, function (ret, res) {
|
||||
getDetail()
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
|
||||
function onAddLog() {
|
||||
Fast.api.open(`shopro/order/aftersale/addLog/id/${state.id}?id=${state.id}`, "回复买家", {
|
||||
callback() {
|
||||
getDetail()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDetail()
|
||||
})
|
||||
|
||||
return {
|
||||
onClipboard,
|
||||
state,
|
||||
onRefund,
|
||||
onRefuse,
|
||||
onCompleted,
|
||||
onAddLog,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('detail', detail);
|
||||
},
|
||||
refund: () => {
|
||||
const { reactive, getCurrentInstance } = Vue
|
||||
const refund = {
|
||||
setup() {
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const state = reactive({
|
||||
id: new URLSearchParams(location.search).get('id'),
|
||||
suggest_refund_fee: new URLSearchParams(location.search).get('suggest_refund_fee'),
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
model: {
|
||||
refund_type: 'back',
|
||||
refund_money: '',
|
||||
},
|
||||
rules: {
|
||||
refund_money: [{ required: true, message: '请输入退款金额', trigger: 'blur' }],
|
||||
},
|
||||
})
|
||||
|
||||
function onConfirm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/order/aftersale/refund/id/${state.id}`,
|
||||
type: 'POST',
|
||||
data: form.model
|
||||
}, function (ret, res) {
|
||||
Fast.api.close()
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
form,
|
||||
onConfirm,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('refund', refund);
|
||||
},
|
||||
refuse: () => {
|
||||
const { reactive, getCurrentInstance } = Vue
|
||||
const refuse = {
|
||||
setup() {
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const state = reactive({
|
||||
id: new URLSearchParams(location.search).get('id'),
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
model: {
|
||||
refuse_msg: '',
|
||||
},
|
||||
rules: {
|
||||
refuse_msg: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }],
|
||||
},
|
||||
})
|
||||
|
||||
function onConfirm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/order/aftersale/refuse/id/${state.id}`,
|
||||
type: 'POST',
|
||||
data: form.model
|
||||
}, function (ret, res) {
|
||||
Fast.api.close()
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
form,
|
||||
onConfirm,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('refuse', refuse);
|
||||
},
|
||||
addlog: () => {
|
||||
const { reactive, getCurrentInstance } = Vue
|
||||
const addLog = {
|
||||
setup() {
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const state = reactive({
|
||||
id: new URLSearchParams(location.search).get('id'),
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
model: {
|
||||
content: '',
|
||||
images: [],
|
||||
},
|
||||
rules: {
|
||||
content: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
})
|
||||
|
||||
function onConfirm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/order/aftersale/addLog/id/${state.id}`,
|
||||
type: 'POST',
|
||||
data: form.model
|
||||
}, function (ret, res) {
|
||||
Fast.api.close()
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
form,
|
||||
onConfirm,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('addLog', addLog);
|
||||
},
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
273
public/assets/js/backend/shopro/order/invoice.js
Normal file
273
public/assets/js/backend/shopro/order/invoice.js
Normal file
@@ -0,0 +1,273 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: () => {
|
||||
const { reactive, onMounted } = Vue
|
||||
const index = {
|
||||
setup() {
|
||||
const state = reactive({
|
||||
data: [],
|
||||
filter: {
|
||||
drawer: false,
|
||||
data: {
|
||||
status: 'all',
|
||||
order: { field: 'order.order_sn', value: '' },
|
||||
user: { field: 'user.nickname', value: '' },
|
||||
invoice: { field: 'name', value: '' },
|
||||
type: '',
|
||||
},
|
||||
tools: {
|
||||
order: {
|
||||
type: 'tinputprepend',
|
||||
label: '订单信息',
|
||||
placeholder: '请输入查询内容',
|
||||
value: {
|
||||
field: 'order.order_sn',
|
||||
value: '',
|
||||
},
|
||||
options: {
|
||||
data: [{
|
||||
label: '订单编号',
|
||||
value: 'order.order_sn',
|
||||
},
|
||||
{
|
||||
label: '订单ID',
|
||||
value: 'order_id',
|
||||
}]
|
||||
}
|
||||
},
|
||||
user: {
|
||||
type: 'tinputprepend',
|
||||
label: '用户信息',
|
||||
placeholder: '请输入查询内容',
|
||||
value: {
|
||||
field: 'user.nickname',
|
||||
value: '',
|
||||
},
|
||||
options: {
|
||||
data: [{
|
||||
label: '用户昵称',
|
||||
value: 'user.nickname',
|
||||
},
|
||||
{
|
||||
label: '用户手机号',
|
||||
value: 'user.mobile',
|
||||
}]
|
||||
}
|
||||
},
|
||||
invoice: {
|
||||
type: 'tinputprepend',
|
||||
label: '发票信息',
|
||||
placeholder: '请输入查询内容',
|
||||
value: {
|
||||
field: 'name',
|
||||
value: '',
|
||||
},
|
||||
options: {
|
||||
data: [{
|
||||
label: '发票抬头',
|
||||
value: 'name',
|
||||
},
|
||||
{
|
||||
label: '税号',
|
||||
value: 'tax_no',
|
||||
},
|
||||
{
|
||||
label: ' 联系方式',
|
||||
value: 'mobile',
|
||||
},
|
||||
{
|
||||
label: ' 公司地址',
|
||||
value: 'address',
|
||||
}]
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'tselect',
|
||||
label: '发票类型',
|
||||
value: '',
|
||||
options: {
|
||||
data: [{
|
||||
label: '全部',
|
||||
value: 'all',
|
||||
},
|
||||
{
|
||||
label: '个人',
|
||||
value: 'person',
|
||||
},
|
||||
{
|
||||
label: '企/事业单位',
|
||||
value: 'company',
|
||||
}]
|
||||
},
|
||||
},
|
||||
},
|
||||
condition: {},
|
||||
},
|
||||
statusStyle: {
|
||||
cancel: 'danger',
|
||||
unpaid: 'info',
|
||||
waiting: 'warning',
|
||||
finish: 'success',
|
||||
},
|
||||
})
|
||||
|
||||
const type = reactive({
|
||||
data: {
|
||||
status: [{
|
||||
name: '全部',
|
||||
type: 'all',
|
||||
},
|
||||
{
|
||||
name: '已取消',
|
||||
type: 'cancel',
|
||||
},
|
||||
{
|
||||
name: '未支付',
|
||||
type: 'unpaid',
|
||||
},
|
||||
{
|
||||
name: '等待处理',
|
||||
type: 'waiting',
|
||||
},
|
||||
{
|
||||
name: '已开具',
|
||||
type: 'finish',
|
||||
}],
|
||||
}
|
||||
})
|
||||
|
||||
function getData() {
|
||||
let tempSearch = JSON.parse(JSON.stringify(state.filter.data));
|
||||
let search = composeFilter(tempSearch, {
|
||||
'order.order_sn': 'like',
|
||||
'user.nickname': 'like',
|
||||
'user.mobile': 'like',
|
||||
name: 'like',
|
||||
tax_no: 'like',
|
||||
address: 'like',
|
||||
});
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/order/invoice',
|
||||
type: 'GET',
|
||||
data: {
|
||||
page: pagination.page,
|
||||
list_rows: pagination.list_rows,
|
||||
...search,
|
||||
},
|
||||
}, function (ret, res) {
|
||||
state.data = res.data.data
|
||||
pagination.total = res.data.total
|
||||
return false
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
|
||||
function onOpenFilter() {
|
||||
state.filter.drawer = true
|
||||
}
|
||||
function onChangeFilter() {
|
||||
pagination.page = 1
|
||||
getData()
|
||||
state.filter.drawer && (state.filter.drawer = false)
|
||||
}
|
||||
|
||||
function onChangeTab() {
|
||||
pagination.page = 1
|
||||
getData()
|
||||
}
|
||||
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
list_rows: 10,
|
||||
total: 0,
|
||||
})
|
||||
|
||||
function onConfirm(item) {
|
||||
let params = {
|
||||
id: item.id,
|
||||
order_status_text: item.order_status_text,
|
||||
order_fee: item.order_fee,
|
||||
amount: item.amount,
|
||||
}
|
||||
Fast.api.open(`shopro/order/invoice/confirm/id/${item.id}?item=${encodeURI(JSON.stringify(params))}`, "开具发票", {
|
||||
callback() {
|
||||
getData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function onOpenOrderDetail(id) {
|
||||
Fast.api.open(`shopro/order/order/detail?id=${id}`, "订单详情", {
|
||||
callback() {
|
||||
getData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
|
||||
return {
|
||||
onClipboard,
|
||||
state,
|
||||
type,
|
||||
getData,
|
||||
onOpenFilter,
|
||||
onChangeFilter,
|
||||
onChangeTab,
|
||||
pagination,
|
||||
onOpenOrderDetail,
|
||||
onConfirm,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('index', index);
|
||||
},
|
||||
confirm: () => {
|
||||
const { reactive, getCurrentInstance } = Vue
|
||||
const confirm = {
|
||||
setup() {
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const state = reactive({
|
||||
item: JSON.parse(new URLSearchParams(location.search).get('item')),
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
model: {
|
||||
invoice_amount: state.item.amount,
|
||||
download_urls: [],
|
||||
},
|
||||
rules: {
|
||||
invoice_amount: [{ required: true, message: '请输入实际开票金额', trigger: 'blur' }],
|
||||
download_urls: [{ required: true, message: '请选择发票图片', trigger: 'blur' }],
|
||||
},
|
||||
});
|
||||
|
||||
function onConfirm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
Fast.api.ajax({
|
||||
url: `shopro/order/invoice/confirm/id/${state.item.id}`,
|
||||
type: 'POST',
|
||||
data: form.model
|
||||
}, function (ret, res) {
|
||||
Fast.api.close()
|
||||
}, function (ret, res) { })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
form,
|
||||
onConfirm,
|
||||
}
|
||||
}
|
||||
}
|
||||
createApp('confirm', confirm);
|
||||
},
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
1584
public/assets/js/backend/shopro/order/order.js
Normal file
1584
public/assets/js/backend/shopro/order/order.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user