master
lion 1 year ago
parent 12cfaf4604
commit 149c86c6f6

@ -2,9 +2,9 @@
ENV='development'
# base api
#VUE_APP_BASE_API = https://saifen.ali251.langye.net
#VUE_APP_UPLOAD_API = https://saifen.ali251.langye.net/api/admin/upload-file
#VUE_APP_PREVIEW_API=http://view.ali251.langye.net:8012/onlinePreview
VUE_APP_BASE_API = https://saifen.ali251.langye.net
VUE_APP_UPLOAD_API = https://saifen.ali251.langye.net/api/admin/upload-file
VUE_APP_PREVIEW_API=http://view.ali251.langye.net:8012/onlinePreview
VUE_APP_BASE_API = https://sepax-pdm-test.langye.net
VUE_APP_UPLOAD_API = https://sepax-pdm-test.langye.net/api/admin/upload-file
#VUE_APP_BASE_API = https://sepax-pdm-test.langye.net
#VUE_APP_UPLOAD_API = https://sepax-pdm-test.langye.net/api/admin/upload-file

@ -0,0 +1,68 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item,index) => {
if(item.key){
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
}else{
result +=`${key}[${index}]=${item}&`
}
});
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
export function index(params,isLoading = false) {
return request({
method: "get",
url: "/api/admin/region/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/region/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/region/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/region/destroy",
params
})
}
export function deCode(data) {
return request({
method: "post",
url: "/api/web/cart/decode",
data
})
}

@ -2,17 +2,27 @@
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" :title="$route.meta.title" :form="form"
:rules='rules' @submit="submit">
<template v-slot:key>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sending message type
</div>
<div class="xy-table-item-content">
{{form.key}}
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sending message type{{form.name}}
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Name
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.name"></el-input>
</div>
</div>
</template>
<template v-slot:email>
<template v-slot:email v-if="!(form.key === 'reset_password')">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Email
@ -50,6 +60,27 @@
</div>
</template>
<template v-slot:template>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Template
<div>If you want to use some dynamic variables, please follow the rules below to submit.</div>
<div v-for="(value,key) in followUse">
<template v-if="key==form.key">
<div v-for="(v,k) in value">
If you want to display {{k}}, use <span style="color:red">{{v}}</span>
</div>
</template>
</div>
</div>
<div class="xy-table-item-content">
<!-- <el-input type="textarea" :rows="5" v-model="form.description"></el-input> -->
<my-tinymce v-if="showWang" :id="'template'" @input="(e)=>{changeEditor(e,'template')}"
:value="form.template"></my-tinymce>
</div>
</div>
</template>
</xy-dialog>
</div>
@ -72,10 +103,63 @@
}, {
prop: 'value',
lable: 'Value',
}],
}],
followUse:{
'contact_email':{
'Name':'[name]',
'Email':'[email]',
'Phone':'[mobile]',
'Country/Region':'[region]',
'States/Province':'[shipping_region]',
'Question':'[question]'
},
register_email:{
'Name':'[name]',
'Email':'[email]',
'Organization':'[organization]',
'State':'[states]',
'Country/Region':'[country]',
'IP Address':'[ip]'
},
reset_password:{
Name:'[name]',
Code:'[code]'
},
order_financial:{
Email:'[email]',
Card:'[card]'
},
order_customer:{
'Name':'[name]',
'Shipping Address':'[shipping_address]',
'Billing Address':'[billing_address]',
'Products':'[product]',
'Estimated Shipping':'[estimated_shipping]',
'Subtotal':'[subtotal]',
'Tax':'[tax]',
'Total':'[total]'
},
order_worker:{
'Name':'[name]',
'Email':'[email]',
'Organization':'[organization]',
'Mobile':'[mobile]',
'Shipping Address':'[shipping_address]',
'Billing Address':'[billing_address]',
'Products':'[product]',
'Estimated Shipping':'[estimated_shipping]',
'Subtotal':'[subtotal]',
'Tax':'[tax]',
'Total':'[total]'
}
},
showWang: false,
form: {
key: '',
name: '',
email: []
email: [],
template: ''
},
rules: {
@ -92,6 +176,9 @@
title: ''
})
},
changeEditor(e, type) {
this.form[type] = e
},
delEmail(index) {
this.form.email.splice(index, 1)
@ -123,6 +210,9 @@
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.email = res.email ? res.email : []
this.form.template = res.template ? res.template : ''
this.showWang = true
})
}
},
@ -132,12 +222,16 @@
if (this.type === 'editor') {
this.getDetail()
}
this.showWang = true
} else {
this.id = ''
this.form = {
key: '',
name: '',
email: []
email: [],
template: ''
}
this.showWang = false
this.$refs['dialog'].reset()
}
},
@ -147,8 +241,13 @@
</script>
<style scoped lang="scss">
::v-deep .name,
::v-deep .email {
::v-deep .email,
::v-deep .template {
flex-basis: 100%;
}
::v-deep .name,
::v-deep .key {
flex-basis: 50%;
}
</style>

@ -2,7 +2,7 @@
<div>
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'" :title="$route.meta.title" :form="form"
:rules='rules' @submit="submit">
<template v-slot:type>
<!-- <template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Type
@ -13,8 +13,8 @@
</el-select>
</div>
</div>
</template>
<template v-slot:product_id>
</template> -->
<!-- <template v-slot:product_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Product
@ -25,7 +25,7 @@
</el-select>
</div>
</div>
</template>
</template> -->
<template v-slot:full_name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -46,6 +46,17 @@
</div>
</div>
</template>
<template v-slot:mobile>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Mobile
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.mobile"></el-input>
</div>
</div>
</template>
<template v-slot:region>
<div class="xy-table-item">
@ -71,7 +82,7 @@
</div>
</template>
<template v-slot:organization>
<!-- <template v-slot:organization>
<div class="xy-table-item">
<div class="xy-table-item-label" multiple collapse-tags style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Organization
@ -80,7 +91,7 @@
<el-input placeholder="Please Input" style="width:100%" v-model="form.organization"></el-input>
</div>
</div>
</template>
</template> -->
<template v-slot:question>
<div class="xy-table-item">
<div class="xy-table-item-label" multiple collapse-tags style="font-weight: bold">
@ -91,7 +102,7 @@
</div>
</div>
</template>
<template v-slot:additional>
<!-- <template v-slot:additional>
<div class="xy-table-item">
<div class="xy-table-item-label" multiple collapse-tags style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Additional
@ -100,7 +111,7 @@
<el-input placeholder="Please Input" type="textarea" style="width:100%" v-model="form.additional"></el-input>
</div>
</div>
</template>
</template> -->
</xy-dialog>
@ -112,9 +123,9 @@
save,
show
} from "@/api/customer/message.js"
import {
index as getProduct
} from "@/api/product/category.js"
// import {
// index as getProduct
// } from "@/api/product/category.js"
import customerMixin from "@/mixin/customer.js"
export default {
mixins:[customerMixin],
@ -135,16 +146,17 @@
}],
productList:[],
form: {
type: 0,
product_id: '',
// type: 1,
// product_id: '',
full_name: '',
email: '',
email: '',
mobile:'',
region: '',
shipping_region:'',
organization: '',
// organization: '',
question: '',
additional: '',
product_name: '',
// additional: '',
// product_name: '',
},
rules: {
email: [{
@ -159,7 +171,7 @@
}
},
created() {
this.getProductList()
// this.getProductList()
},
methods: {
async getProductList() {
@ -183,7 +195,8 @@
this.form.id = this.id
} else {
this.form.id = ''
}
}
this.form.type = 1
console.log("this.form", this.form)
// return
save({
@ -216,17 +229,18 @@
} else {
this.id = ''
this.form = {
type: 0,
product_id: '',
// type: 0,
// product_id: '',
full_name: '',
email: '',
email: '',
mobile:'',
region: '',
shipping_region:'',
organization: '',
// organization: '',
question: '',
additional: '',
// additional: '',
product_name: '',
// product_name: '',
}
this.$refs['dialog'].reset()
}

@ -54,7 +54,6 @@
data() {
return {
select: {
question: '',
page: 1,
page_size: 10,
},
@ -64,6 +63,11 @@
type: 'index',
width: 50,
fixed: 'left'
},{
prop: 'key',
label: 'Key',
align: 'left',
width:150
},{
prop: 'name',
label: 'Sending message type',
@ -100,12 +104,7 @@
},
async getList() {
const res = await index({
...this.select,
filter:[{
key:'question',
op:'like',
value:this.select.question
}]
...this.select
})
this.list = res.data
this.total = res.total

@ -12,12 +12,12 @@
<div>
<el-input v-model="select.email" placeholder="Email"></el-input>
</div>
<div>
<!-- <div>
<el-select clearable style="width:100%" v-model="select.type" placeholder="Type">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div> -->
<div>
<el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDate"
v-model="dateRange" type="datetimerange" range-separator="To" start-placeholder="Start Date"
@ -41,7 +41,7 @@
</div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:type>
<!-- <template v-slot:type>
<el-table-column align='left' label="Type" width="180" header-align="center">
<template slot-scope="scope">
<div v-for="item in typeList">
@ -49,7 +49,7 @@
</div>
</template>
</el-table-column>
</template>
</template> -->
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="Operate" width="180" header-align="center">
<template slot-scope="scope">
@ -103,17 +103,28 @@
type: 'index',
width: 50,
fixed: 'left'
}, {
prop: 'type',
label: 'Type',
align: 'left',
// width:240
}, {
},
// {
// prop: 'type',
// label: 'Type',
// align: 'left',
// // width:240
// },
{
prop: 'email',
label: 'Email',
align: 'left',
// width:240
width:240
}, {
prop: 'mobile',
label: 'Mobile',
align: 'left',
width:240
}, {
prop: 'question',
label: 'Question',
align: 'left',
},{
prop: 'created_at',
label: 'Created At',
align: 'left',

@ -0,0 +1,154 @@
<template>
<div>
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" :title="$route.meta.title" :form="form"
:rules='rules' @submit="submit">
<template v-slot:year>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Year
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.year" style="width:100%" format="yyyy" value-format="yyyy" type="year" placeholder="Please Select">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>State
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.name"></el-input>
</div>
</div>
</template>
<template v-slot:tax>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Tax(%)
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" type="number" style="width:100%" v-model="form.tax"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>sort
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.sort"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/order/tax.js"
export default {
data() {
return {
isShow: false,
id: '',
type: 'add',
showWang: false,
form: {
year:'',
name: '',
tax: 0,
sort: 0,
},
rules: {
name: [{
required: true,
message: 'Please Input'
}],
year: [{
required: true,
message: 'Please Input'
}],
tax: [{
required: true,
message: 'Please Input'
}]
}
}
},
created() {
},
methods: {
submit() {
if (this.id) {
this.form.id = this.id
} else {
this.form.id = ''
}
console.log("this.form", this.form)
// return
save({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: 'Success'
})
this.isShow = false
this.$emit('refresh', res)
})
},
getDetail() {
show({
id: this.id,
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.tax = res.tax ? res.tax : ''
this.form.sort = res.sort ? res.sort : 0
this.showWang = true
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
} else {
this.form.year = this.$moment(new Date()).format("yyyy")
}
} else {
this.id = ''
this.form = {
year: '',
name: '',
tax: 0,
sort: 0
}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .title,
::v-deep .content {
flex-basis: 100%;
}
</style>

@ -0,0 +1,144 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="State"></el-input>
</div>
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()">search</el-button>
</div>
<div>
<el-button type="primary" size="small" @click="resetSearch">reset</el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editFaq('add')">add</el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="Operate" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editFaq('editor',scope.row.id)">edit</el-button>
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="Are you sure to delete it?">
<el-button type="danger" size="small" slot="reference">delete</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
<addTax ref="addTax" @refresh="getList"></addTax>
</div>
</template>
<script>
import addTax from './components/addTax.vue';
import {
index,
destroy
} from "@/api/order/tax.js"
export default {
components: {
addTax
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
sort_name:"sort",
sort_type:"DESC",
},
total: 0,
list: [],
table_item: [{
type: 'index',
width: 50,
fixed: 'left'
},{
prop: 'year',
label: 'Year',
align: 'left',
width:180
},{
prop: 'name',
label: 'State',
align: 'left',
},{
prop: 'tax',
label: 'Tax(%)',
align: 'left',
width:180
}
]
}
},
created() {
this.getList()
},
methods: {
editFaq(type, id) {
if (type == 'editor') {
this.$refs.addTax.id = id
}
this.$refs.addTax.type = type
this.$refs.addTax.isShow = true
},
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
resetSearch() {
this.select.page = 1
this.select.title = ''
this.getList()
},
async getList() {
const res = await index({
...this.select,
filter:[{
key:'name',
op:'like',
value:this.select.name
}]
})
this.list = res.data
this.total = res.total
},
deleteList(id) {
var that = this;
destroy({
id:id
}).then(response => {
this.$Message.success('Success');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
}
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save