克隆 规则

master
lion 6 months ago
parent 4c02137721
commit 1747ab8d84

@ -2,7 +2,7 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = https://yunyubang.ali251.langye.net/
VUE_APP_BASE_API = http://yunyubang-test.ali251.langye.net/
#VUE_APP_BASE_API = https://yunyubang.ali251.langye.net/
#VUE_APP_BASE_DEV_API = https://yunyubang.ali251.langye.net/

@ -2,5 +2,5 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = https://yunyubang.ali251.langye.net/
VUE_APP_BASE_API =
#VUE_APP_BASE_DEV_API = https://yybtest.ali251.langye.net/

@ -81,3 +81,11 @@ export function save(data){
data
})
}
export function clone(params){
return request({
method:'post',
url:'/api/admin/order/clone',
data: params
})
}

@ -0,0 +1,42 @@
import request from '@/utils/request'
export function index(params) {
return request({
method: 'get',
url: '/api/admin/special-order-config/index',
params
})
}
export function show(params) {
return request({
method: 'get',
url: `/api/admin/special-order-config/show/${params.id}`,
params
})
}
export function store(data) {
return request({
method: 'post',
url: '/api/admin/special-order-config/store',
data
})
}
export function update(data) {
return request({
method: 'post',
url: `/api/admin/special-order-config/update/${data.id}`,
data
})
}
export function destroy(data) {
return request({
method: 'post',
url: `/api/admin/special-order-config/destroy/${data.id}`,
data
})
}

@ -0,0 +1,107 @@
<template>
<div>
<Modal :value="isShow" :title="title" @on-visible-change="$emit('update:isShow',$event)">
<div class="searchMerchants">
<el-input
type="text"
@keyup.enter.native="searchMerchants"
v-model="keyword"
placeholder="请输入关键词查找商户"
></el-input>
<el-button type="primary" @click="searchMerchants"></el-button>
</div>
<Table
size="small"
highlight-row
:columns="merchantTable"
:data="merchants"
@on-current-change="merchantSelect"
/>
<Page
:current="pageIndex"
:total="total"
simple
style="padding-top: 14px;display: flex;justify-content: center;"
@on-change="pageChange"
/>
</Modal>
</div>
</template>
<script>
import { index as merchantIndex } from '@/api/merchant'
export default {
props: {
isShow: {
type: Boolean,
default: false
},
title: {
type: String,
default: '商户选择'
}
},
data() {
return {
keyword: '',
pageIndex: 1,
total: 0,
merchants: [],
merchantTable: [
{ title: '简称', key: 'username' },
{ title: '全称', key: 'name', align: 'left' }
]
}
},
methods: {
async getMerchants() {
const res = await merchantIndex(
{
page_size: 10,
page: this.pageIndex,
keyword: this.keyword
},
false
)
this.total = res.total || 0
this.merchants = res.data || []
},
searchMerchants() {
this.pageIndex = 1
this.getMerchants()
},
pageChange(e) {
this.pageIndex = e
this.getMerchants()
},
merchantSelect(row) {
if (!row) return
this.$emit('select', row)
this.$emit('update:isShow', false)
}
},
watch: {
isShow(newVal) {
if (newVal) {
this.getMerchants()
}
}
}
}
</script>
<style scoped lang="scss">
.searchMerchants{
display: flex;
justify-content: space-between;
margin-bottom:16px;
.el-input{
width:80%
}
}
</style>

@ -0,0 +1,285 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增特殊订单流程配置' : '编辑特殊订单流程配置'"
:form="form"
:rules="rules"
@submit="submit"
>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>配置名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入配置名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:product_name_keyword>
<div class="xy-table-item">
<div class="xy-table-item-label">产品名称识别关键词</div>
<div class="xy-table-item-content">
<el-input
v-model="form.product_name_keyword"
placeholder="请输入关键词(用于识别产品名称)"
clearable
style="width: 300px;"
></el-input>
</div>
</div>
</template>
<template v-slot:target_merchant_id>
<div class="xy-table-item">
<div class="xy-table-item-label">目标商户</div>
<div class="xy-table-item-content">
<el-input
v-model="targetMerchantLabel"
placeholder="请选择目标商户"
readonly
clearable
style="width: 300px;"
@focus="isShowTargetMerchantSelect = true"
></el-input>
</div>
</div>
</template>
<template v-slot:auto_assign_enabled>
<div class="xy-table-item">
<div class="xy-table-item-label">启用自动分发</div>
<div class="xy-table-item-content">
<el-switch v-model="form.auto_assign_enabled"></el-switch>
</div>
</div>
</template>
<!-- 暂时注释掉服务监管商户 -->
<!-- <template v-slot:service_supervisor_merchant_id>
<div class="xy-table-item">
<div class="xy-table-item-label">服务监管商户</div>
<div class="xy-table-item-content">
<el-input
v-model="supervisorMerchantLabel"
placeholder="请选择服务监管商户"
readonly
clearable
style="width: 300px;"
@focus="isShowSupervisorMerchantSelect = true"
></el-input>
</div>
</div>
</template> -->
<template v-slot:state>
<div class="xy-table-item">
<div class="xy-table-item-label">状态</div>
<div class="xy-table-item-content">
<el-select v-model="form.state" placeholder="请选择状态" clearable style="width: 300px;">
<el-option label="启用" value="active"></el-option>
<el-option label="禁用" value="inactive"></el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
<merchant-select-modal
title="选择目标商户"
:is-show.sync="isShowTargetMerchantSelect"
@select="selectTargetMerchant"
/>
<!-- 暂时注释掉服务监管商户选择弹窗 -->
<!-- <merchant-select-modal
title="选择服务监管商户"
:is-show.sync="isShowSupervisorMerchantSelect"
@select="selectSupervisorMerchant"
/> -->
</div>
</template>
<script>
import {
store,
show,
update
} from "@/api/specialOrderConfig"
import merchantSelectModal from '@/views/order/component/MerchantSelectModal'
import {
Message
} from 'element-ui'
export default {
components: {
merchantSelectModal
},
data() {
return {
isShow: false,
type: 'add',
id: '',
isShowTargetMerchantSelect: false,
// isShowSupervisorMerchantSelect: false,
targetMerchantLabel: '',
// supervisorMerchantLabel: '',
form: {
name: '',
product_name_keyword: '',
target_merchant_id: '',
auto_assign_enabled: false,
// service_supervisor_merchant_id: '',
state: 'active'
},
rules: {
name: [{
required: true,
message: '请输入配置名称',
trigger: 'blur'
}]
}
}
},
methods: {
async getDetail() {
const res = await show({
id: this.id
})
const data = res?.data || res
if (data) {
this.form = {
name: data.name || '',
product_name_keyword: data.product_name_keyword || '',
target_merchant_id: data.target_merchant_id || '',
auto_assign_enabled: data.auto_assign_enabled === true || data.auto_assign_enabled === 1 || data.auto_assign_enabled === '1',
// service_supervisor_merchant_id: data.service_supervisor_merchant_id || '',
state: data.state || 'active'
}
this.targetMerchantLabel =
data?.target_merchant?.username ||
data?.target_merchant?.name ||
data?.target_merchant_name ||
(data.target_merchant_id ? String(data.target_merchant_id) : '')
// this.supervisorMerchantLabel =
// data?.service_supervisor_merchant?.username ||
// data?.service_supervisor_merchant?.name ||
// data?.service_supervisor_merchant_name ||
// (data.service_supervisor_merchant_id ? String(data.service_supervisor_merchant_id) : '')
}
},
selectTargetMerchant(row) {
this.form.target_merchant_id = row.id
this.targetMerchantLabel = row.username || row.name || String(row.id)
},
// selectSupervisorMerchant(row) {
// this.form.service_supervisor_merchant_id = row.id
// this.supervisorMerchantLabel = row.username || row.name || String(row.id)
// },
submit() {
if (this.type === 'add') {
store({
name: this.form.name,
product_name_keyword: this.form.product_name_keyword,
target_merchant_id: this.form.target_merchant_id,
auto_assign_enabled:
this.form.auto_assign_enabled === true ||
this.form.auto_assign_enabled === 1 ||
this.form.auto_assign_enabled === '1'
? 1
: 0,
// service_supervisor_merchant_id: this.form.service_supervisor_merchant_id,
state: this.form.state
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.isShow = false
this.$emit('refresh')
}).catch(err => {
Message({
type: 'error',
message: '新增失败'
})
})
return
}
if (this.type === 'editor') {
update({
id: this.id,
name: this.form.name,
product_name_keyword: this.form.product_name_keyword,
target_merchant_id: this.form.target_merchant_id,
auto_assign_enabled:
this.form.auto_assign_enabled === true ||
this.form.auto_assign_enabled === 1 ||
this.form.auto_assign_enabled === '1'
? 1
: 0,
// service_supervisor_merchant_id: this.form.service_supervisor_merchant_id,
state: this.form.state
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.isShow = false
this.$emit('refresh')
}).catch(err => {
Message({
type: 'error',
message: '编辑失败'
})
})
}
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor' || this.type === 'copy') {
this.getDetail()
} else {
//
this.form = {
name: '',
product_name_keyword: '',
target_merchant_id: '',
auto_assign_enabled: false,
service_supervisor_merchant_id: '',
state: 'active'
}
this.targetMerchantLabel = ''
// this.supervisorMerchantLabel = ''
}
} else {
this.id = ''
this.type = 'add'
this.form = {
name: '',
product_name_keyword: '',
target_merchant_id: '',
auto_assign_enabled: false,
// service_supervisor_merchant_id: '',
state: 'active'
}
this.targetMerchantLabel = ''
this.supervisorMerchantLabel = ''
if (this.$refs['dialog']) {
this.$refs['dialog'].reset()
}
}
}
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label {
width: 160px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
</style>

@ -5,7 +5,7 @@
<slot>
<div style="display: flex">
<Input v-model="select.keyword" class="select" style="width: 200px; margin-right: 10px"
placeholder="关键字搜索" />
placeholder="关键字搜索" />
<el-checkbox style="margin-left: 10px;line-height:36px" v-model="select.next_follow_time"></el-checkbox>
<Button class="select" type="primary" style="margin-right: 10px;margin-left: 10px;" @click="searchOrder"></Button>
<xy-selectors @search="searchOrder" @reset="resetsearch">
@ -39,7 +39,7 @@
<div class="select-content-item-label">订单状态</div>
<div>
<template v-for="(value,key) of orderStates">
<!-- <el-tag size="small" v-if="key!='unpaid'" -->
<!-- <el-tag size="small" v-if="key!='unpaid'" -->
<el-tag size="small"
:effect="select.orderStates.key === key ? 'dark' : 'plain'"
@click="select.orderStates = {key,value}" style="margin-right: 6px;">{{value}}</el-tag>
@ -79,17 +79,17 @@
</el-date-picker>
</div>
</div>
</el-col>
<el-col :span="12">
<div class="select-content-item">
<div class="select-content-item-label">预产期</div>
<div>
<el-date-picker @change="changeDueDate" v-model="select.dueDate" type="daterange"
:picker-options="pickerOptions" value-format="yyyy-MM-dd" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right">
</el-date-picker>
</div>
</div>
</el-col>
<el-col :span="12">
<div class="select-content-item">
<div class="select-content-item-label">预产期</div>
<div>
<el-date-picker @change="changeDueDate" v-model="select.dueDate" type="daterange"
:picker-options="pickerOptions" value-format="yyyy-MM-dd" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" align="right">
</el-date-picker>
</div>
</div>
</el-col>
</el-row>
@ -130,10 +130,19 @@
<xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="e => {select.pageSize = e;searchOrder()}"
@pageIndexChange="pageChange">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="320" header-align="center">
<el-table-column fixed="right" label="操作" width="380" header-align="center">
<template slot-scope="scope">
<!-- <actions :row="scope.row" @log="showLog(scope.row)" @refresh="getOrders"></actions> -->
<!-- <actions :row="scope.row" @log="showLog(scope.row)" @refresh="getOrders"></actions> -->
<actions :row="scope.row" @log="showLog(scope.row)" @refresh="getOrders"></actions>
<Button
icon="ios-copy"
type="primary"
style="margin-left: 10px;margin-bottom: 6px;"
size="small"
ghost
@click="cloneOrderHandler(scope.row)">
克隆订单
</Button>
<!-- <Button icon="ios-chatbubbles-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>跟进</Button>-->
<!-- <Button v-show="scope.row.state_name == ''" icon="ios-paper-plane-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>分发</Button>-->
<!-- <Button v-show="scope.row.state_name == ''" icon="ios-close" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>取消</Button>-->
@ -145,8 +154,8 @@
</xy-table>
<orderLog :id="selectId" :is-show.sync="isShowLog" @refresh="getOrders"></orderLog>
<!-- <orderEdit :id="selectId" :is-show.sync="isShowEdit" @refresh="getOrders"></orderEdit> -->
<orderEdit :id="selectId" :is-show.sync="isShowEdit" @refresh="getOrders"></orderEdit>
<!-- <orderEdit :id="selectId" :is-show.sync="isShowEdit" @refresh="getOrders"></orderEdit> -->
<orderEdit :id="selectId" :is-show.sync="isShowEdit" @refresh="getOrders"></orderEdit>
</div>
</template>
@ -154,7 +163,8 @@
<script>
import {
getList,
index as getTypes
index as getTypes,
clone as cloneOrder
} from "@/api/order"
import {
parseTime
@ -165,6 +175,7 @@
import {
index as merchantIndex
} from '@/api/merchant'
import { Message, MessageBox } from 'element-ui'
import orderLog from '@/views/order/component/orderLog'
import actions from '@/views/order/component/actions'
@ -179,7 +190,7 @@
return {
selectId: null,
isShowLog: false,
isShowEdit: false,
isShowEdit: false,
memberId:"",
merchants: [],
orderItemStates: [],
@ -192,7 +203,7 @@
name: "",
id: ""
},
keyword: '',
keyword: '',
next_follow_time:false,
productType: '',
orderStates: '',
@ -200,18 +211,18 @@
is_merchant: false,
createdDate: [],
payDate: [],
updateDate: [],
updateDate: [],
dueDate:[],
start_created: "",
end_created: "",
start_paid: "",
end_paid: "",
due_date_state : '',
end_paid: "",
due_date_state : '',
due_date_end : '',
start_updated: "",
end_updated: "",
order_paid: false,
order_item_id:"",
order_paid: false,
order_item_id:"",
due_date:''
},
pickerOptions: {
@ -255,7 +266,7 @@
prop: "order_name",
label: "订单名称",
width: 220,
align: 'left',
align: 'left',
// fixed: 'left'
},
{
@ -302,7 +313,7 @@
{
label: "客户服务地址",
width: 220,
align: "left",
align: "left",
prop:'customAddress',
customFn: (row) => {
return ( <div style = {
@ -338,7 +349,7 @@
width: 110
},
{
label: "头像",
label: "头像",
prop:'member.avatar',
width: 80,
customFn: (row) => {
@ -363,62 +374,62 @@
prop: "member.area",
label: "区域",
width: 110
},
{
prop: "member.address",
label: "地址",
width: 160,
align:'left',
customFn: (row) => {
return(<div>
{
row.member_address? <div> {
row.member_address
} </div> : <div>{
row.member?row.member.address:''
}</div>
}
</div>)
}
},
{
prop: "member.address",
label: "地址",
width: 160,
align:'left',
customFn: (row) => {
return(<div>
{
row.member_address? <div> {
row.member_address
} </div> : <div>{
row.member?row.member.address:''
}</div>
}
</div>)
}
},
{
prop: "member.due_date",
label: "预产期",
width: 120
},
{
prop: "product_type.name",
label: "产品类型",
width: 100
},
{
prop: "order.model_name",
label: "产品型号",
width: 100
},
{
prop: "merchant.username",
label: "服务商家",
align: "left",
width: 160
},
{
label: "历史商家",
width: 160,
align: "left",
customFn: (row) => {
return row.assign_merchant.map(item => {
return ( <div> {
item.username
} </div>)
})
}
},
{
prop: "state_name",
label: "状态",
width: 120
},
{
prop: "product_type.name",
label: "产品类型",
width: 100
},
{
prop: "order.model_name",
label: "产品型号",
width: 100
},
{
prop: "merchant.username",
label: "服务商家",
align: "left",
width: 160
},
{
label: "历史商家",
width: 160,
align: "left",
customFn: (row) => {
return row.assign_merchant.map(item => {
return ( <div> {
item.username
} </div>)
})
}
},
{
prop: "state_name",
label: "状态",
width: 120
},
// {
// label: "",
@ -426,17 +437,17 @@
// multiHd: [{
// prop: "name",
// label: "",
// width: 110,
// customFn: (row) => {
// return (row.row.member?.name)
// width: 110,
// customFn: (row) => {
// return (row.row.member?.name)
// }
// },
// {
// prop: "wechat_nickname",
// label: "",
// width: 110,
// customFn: (row) => {
// return (row.row.member?.wechat_nickname)
// width: 110,
// customFn: (row) => {
// return (row.row.member?.wechat_nickname)
// }
// },
// {
@ -458,31 +469,31 @@
// {
// prop: "phone",
// label: "",
// width: 120,
// customFn: (row) => {
// return (row.row.member?.phone)
// width: 120,
// customFn: (row) => {
// return (row.row.member?.phone)
// }
// },
// {
// prop: "area",
// label: "",
// width: 110,
// customFn: (row) => {
// return (row.row.member?.area)
// width: 110,
// customFn: (row) => {
// return (row.row.member?.area)
// }
// },
// {
// prop: "due_date",
// label: "",
// width: 120,
// customFn: (row) => {
// return (row.row.member?.due_date)
// width: 120,
// customFn: (row) => {
// return (row.row.member?.due_date)
// }
// }
// ],
// },
// {
// label: '',
// label: '',
// prop:'orderInfo',
// multiHd: [{
// prop: "product_type.name",
@ -551,7 +562,7 @@
resetsearch() {
this.select.page = 1;
this.select.merchant = '';
this.select.keyword = '';
this.select.keyword = '';
this.select.next_follow_time = false;
this.select.productType = '';
this.select.orderStates = '';
@ -563,51 +574,51 @@
this.select.start_created = "";
this.select.end_created = '';
this.select.start_paid = '';
this.select.end_paid = '';
this.select.due_date_state = ''
this.select.end_paid = '';
this.select.due_date_state = ''
this.select.due_date_end = ''
this.select.start_updated = '';
this.select.end_updated = '';
this.select.order_item_id=""
this.select.end_updated = '';
this.select.order_item_id=""
this.select.due_date = ''
this.getOrders();
},
changeUpdateDate(e) {
if(e){
this.select.start_updated = e[0]+' 00:00:00';
this.select.end_updated = e[1]+' 23:59:59';
}else{
this.select.start_updated = ""
this.select.end_updated = ""
changeUpdateDate(e) {
if(e){
this.select.start_updated = e[0]+' 00:00:00';
this.select.end_updated = e[1]+' 23:59:59';
}else{
this.select.start_updated = ""
this.select.end_updated = ""
}
},
changePayDate(e) {
if(e){
changePayDate(e) {
if(e){
this.select.start_paid = e[0]+' 00:00:00';
this.select.end_paid = e[1]+' 23:59:59';
}else{
this.select.start_paid = "";
this.select.end_paid = "";
this.select.end_paid = e[1]+' 23:59:59';
}else{
this.select.start_paid = "";
this.select.end_paid = "";
}
},
changeDueDate(e){
if(e){
this.select.due_date_state = e[0]+' 00:00:00';
this.select.due_date_end = e[1]+' 23:59:59';
}else{
this.select.due_date_state = "";
this.select.due_date_end = "";
}
},
changeCreatedDate(e) {
console.log("date",e)
if(e){
this.select.start_created = e[0]+' 00:00:00';
this.select.end_created = e[1]+' 23:59:59';
}else{
this.select.start_created = '';
this.select.end_created = '';
changeDueDate(e){
if(e){
this.select.due_date_state = e[0]+' 00:00:00';
this.select.due_date_end = e[1]+' 23:59:59';
}else{
this.select.due_date_state = "";
this.select.due_date_end = "";
}
},
changeCreatedDate(e) {
console.log("date",e)
if(e){
this.select.start_created = e[0]+' 00:00:00';
this.select.end_created = e[1]+' 23:59:59';
}else{
this.select.start_created = '';
this.select.end_created = '';
}
},
@ -635,8 +646,8 @@
async getOrders() {
let is_merchant = this.select.is_merchant
this.select.is_merchant = is_merchant ? 1 : 0;
let is_next_follow_time = this.select.next_follow_time
this.select.is_merchant = is_merchant ? 1 : 0;
let is_next_follow_time = this.select.next_follow_time
this.select.next_follow_time = is_next_follow_time ? 1 : '';
let order_paid = this.select.order_paid
@ -646,15 +657,15 @@
page_size: this.select.pageSize,
product_type_id: this.select.productType,
merchant_id: this.select.merchant.id,
order_state: this.select.orderStates.key,
member_id:this.memberId,
sort_name:'paid_at',
order_state: this.select.orderStates.key,
member_id:this.memberId,
sort_name:'paid_at',
sort_type:'DESC',
...this.select
})
this.select.is_merchant = is_merchant;
this.select.is_merchant = is_merchant;
this.select.next_follow_time = is_next_follow_time;
this.select.order_paid = order_paid;
this.select.order_paid = order_paid;
this.select.order_item_id=""
this.total = res.total
this.list = res.rows
@ -665,13 +676,44 @@
this.isShowLog = true
},
cloneOrderHandler(row) {
const orderId = row.order_id
if (!orderId) {
Message({
type: 'warning',
message: '订单ID不存在'
})
return
}
MessageBox.confirm('是否确认克隆该订单?', '确认克隆', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
cloneOrder({ id: orderId }).then(res => {
Message({
type: 'success',
message: '克隆订单成功'
})
this.getOrders()
}).catch(err => {
Message({
type: 'error',
message: err?.errmsg || '克隆订单失败'
})
})
}).catch(() => {
//
})
},
downloadExel() {
let is_merchant = this.select.is_merchant
this.select.is_merchant = is_merchant ? 1 : 0;
let is_next_follow_time = this.select.next_follow_time
this.select.is_merchant = is_merchant ? 1 : 0;
let is_next_follow_time = this.select.next_follow_time
this.select.next_follow_time = is_next_follow_time ? 1 : '';
let order_paid = this.select.order_paid
@ -683,35 +725,35 @@
keyword: this.select.keyword,
product_type_id: this.select.productType,
merchant_id: this.select.merchant.id,
is_export: 1,
is_export: 1,
member_id:this.memberId,
...this.select
},
'订单列表.xlsx')
this.select.is_merchant = is_merchant;
this.select.next_follow_time = is_next_follow_time;
this.select.is_merchant = is_merchant;
this.select.next_follow_time = is_next_follow_time;
this.select.order_paid = order_paid;
}
},
watch:{
'$route.query.user_id'(newval){
if(newval){
this.memberId = this.$route.query.user_id
this.getOrders()
}
},
'$route.query.order_item_id'(newval){
if(newval){
this.select.order_item_id = this.$route.query.order_item_id?this.$route.query.order_item_id:""
this.getOrders()
}
},
},
mounted() {
this.memberId = this.$route.query.user_id
watch:{
'$route.query.user_id'(newval){
if(newval){
this.memberId = this.$route.query.user_id
this.getOrders()
}
},
'$route.query.order_item_id'(newval){
if(newval){
this.select.order_item_id = this.$route.query.order_item_id?this.$route.query.order_item_id:""
this.getOrders()
}
},
},
mounted() {
this.memberId = this.$route.query.user_id
this.select.order_item_id = this.$route.query.order_item_id?this.$route.query.order_item_id:""
this.getTypes()
this.getOrders()
@ -748,4 +790,4 @@
::v-deep .ivu-icon-ios-close:before {
//color: #fff;
}
</style>
</style>

@ -0,0 +1,180 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="特殊订单流程配置" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="searchConfig"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['specialOrderConfigEdit'].isShow = true,$refs['specialOrderConfigEdit'].type = 'add'">新增</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
:list="list"
:total="total"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorConfig(scope.row.id,'editor')"></Button>
<Poptip
transfer
confirm
title="确认要删除吗?"
@on-ok="deleteConfig(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
<specialOrderConfigEdit ref="specialOrderConfigEdit" @refresh="getConfigList"></specialOrderConfigEdit>
</div>
</template>
<script>
import {index,destroy} from "@/api/specialOrderConfig"
import {parseTime} from "@/utils"
import specialOrderConfigEdit from '@/views/order/component/specialOrderConfigEdit'
import { Message } from 'element-ui'
export default {
components:{
specialOrderConfigEdit
},
data() {
return {
select:{
pageSize:10,
page:1,
keyword:""
},
total:0,
list:[],
table:[
{ label:"ID", prop:'id', width:80, align:'center' },
{ label:"配置名称", prop:'name', align:'left', minWidth:160 },
{ label:"产品名称识别关键词", prop:'product_name_keyword', align:'left', minWidth:180 },
{
label:"目标商户",
prop:'target_merchant_id',
align:'left',
minWidth:160,
formatter: (cell, data, value) => {
return cell?.target_merchant?.username || cell?.target_merchant?.name || cell?.target_merchant_name || value
}
},
{
label:"自动分发",
prop:'auto_assign_enabled',
width:100,
align:'center',
formatter: (cell, data, value) => {
return value === true || value === 1 || value === '1' ? '是' : '否'
}
},
//
// {
// label:"",
// prop:'service_supervisor_merchant_id',
// align:'left',
// minWidth:160,
// formatter: (cell, data, value) => {
// return cell?.service_supervisor_merchant?.username || cell?.service_supervisor_merchant?.name || cell?.service_supervisor_merchant_name || value
// }
// },
{
label:"状态",
prop:'state',
width:100,
align:'center',
formatter: (cell, data, value) => {
return value === 'active' || value === 1 || value === '1' ? '启用' : '禁用'
}
},
{
label:"创建时间",
prop:'created_at',
width:180,
align:'center',
formatter: (cell, data, value, index) => {
if (value)
return parseTime(new Date(value))
}
},
{
label:"更新时间",
prop:'updated_at',
width:180,
align:'center',
formatter: (cell, data, value, index) => {
if (value)
return parseTime(new Date(value))
}
}
]
}
},
methods: {
async getConfigList(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.page,
keyword:this.select.keyword
})
this.list = res.data || res.rows || []
this.total = res.total || 0
},
pageChange(e){
this.select.page = e
this.getConfigList()
},
pageSizeChange(e){
this.select.pageSize = e
this.select.page = 1
this.getConfigList()
},
searchConfig(){
this.select.page = 1
this.getConfigList()
},
deleteConfig(row){
destroy({id:row.id}).then(res => {
Message({
type:'success',
message:'删除成功'
})
this.getConfigList()
}).catch(err => {
Message({
type:'error',
message:'删除失败'
})
})
},
editorConfig(id,type){
this.$refs['specialOrderConfigEdit'].id = id
this.$refs['specialOrderConfigEdit'].type = type
this.$refs['specialOrderConfigEdit'].isShow = true
},
},
mounted() {
this.getConfigList()
}
}
</script>
<style scoped lang="scss">
</style>

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/mac/Documents/朗业/2022/y-孕育邦/后端代码/yunyubang/public/admin',
outputDir: '/Users/mac/Documents/朗业/2022/y-孕育邦/后端代码/yunyubang/public/admin_test',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save