Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
b41f19e1e3 | |||
cfb775c216 | |||
6659052729 | |||
916492b384 | |||
a35ab8982e | |||
f1bd1e5128 | |||
20c5b7c3c3 | |||
73d4e3bb62 | |||
79e5bad31b | |||
0a39390d4e | |||
55e1ed83a7 | |||
941030aa40 | |||
464a7a7bd7 | |||
ad39e41f70 | |||
46904145a9 | |||
7850060991 | |||
3a3dcb8750 | |||
916b219549 |
@ -4,7 +4,7 @@ ENV = 'development'
|
||||
# VUE_APP_BASE_API = 'http://8.129.208.109:8001'
|
||||
# VUE_APP_BASE_API = 'http://itxzz.51vip.biz/'
|
||||
# VUE_APP_BASE_API = http://shop.itxzz.top:35708/
|
||||
VUE_APP_BASE_API = http://localhost:8001/
|
||||
VUE_APP_BASE_API = 'http://127.0.0.1:8001'
|
||||
|
||||
# VUE_APP_BASE_API = 'https://app2.yixiang.co'
|
||||
VUE_APP_WS_API = 'ws://8.129.208.109:8001/'
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "yshop-web",
|
||||
"version": "2.4.0",
|
||||
"description": "yshop3.0 前端源码",
|
||||
"description": "yshop3.3 前端源码",
|
||||
"author": "Zheng Jie",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
@ -244,6 +244,7 @@ function CRUD(options) {
|
||||
if (!callVmHook(crud, CRUD.HOOK.beforeSubmit)) {
|
||||
return
|
||||
}
|
||||
crud.status.add = CRUD.STATUS.PROCESSING
|
||||
crud.crudMethod.add(crud.form).then(() => {
|
||||
crud.status.add = CRUD.STATUS.NORMAL
|
||||
crud.resetForm()
|
||||
@ -251,6 +252,7 @@ function CRUD(options) {
|
||||
callVmHook(crud, CRUD.HOOK.afterSubmit)
|
||||
crud.toQuery()
|
||||
}).catch(() => {
|
||||
crud.status.add = CRUD.STATUS.PREPARED
|
||||
callVmHook(crud, CRUD.HOOK.afterAddError)
|
||||
})
|
||||
},
|
||||
@ -261,6 +263,7 @@ function CRUD(options) {
|
||||
if (!callVmHook(crud, CRUD.HOOK.beforeSubmit)) {
|
||||
return
|
||||
}
|
||||
crud.status.edit = CRUD.STATUS.PROCESSING
|
||||
crud.crudMethod.edit(crud.form).then(() => {
|
||||
crud.status.edit = CRUD.STATUS.NORMAL
|
||||
crud.getDataStatus(crud.form.id).edit = CRUD.STATUS.NORMAL
|
||||
@ -269,6 +272,7 @@ function CRUD(options) {
|
||||
callVmHook(crud, CRUD.HOOK.afterSubmit)
|
||||
crud.refresh()
|
||||
}).catch(() => {
|
||||
crud.status.edit = CRUD.STATUS.PREPARED
|
||||
callVmHook(crud, CRUD.HOOK.afterEditError)
|
||||
})
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ module.exports = {
|
||||
/**
|
||||
* @description 网站标题
|
||||
*/
|
||||
title: 'YSHOP-3.2',
|
||||
title: 'YSHOP-3.3',
|
||||
/**
|
||||
* @description 是否显示 tagsView
|
||||
*/
|
||||
@ -42,7 +42,7 @@ module.exports = {
|
||||
/**
|
||||
* 底部文字,支持html语法
|
||||
*/
|
||||
footerTxt: '© 2018-2022 YSHOP <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">All Rights Reserved</a>',
|
||||
footerTxt: '© 2018-2023 YSHOP <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">All Rights Reserved</a>',
|
||||
/**
|
||||
* 备案号
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@
|
||||
<el-divider></el-divider>
|
||||
<div class="acea-row row-between-wrapper">
|
||||
<span class="content-time">昨日订单数</span>
|
||||
<span>{{ count.lastWeekCount }} 单</span>
|
||||
<span>{{ count.proCount }} 单</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -93,7 +93,7 @@ export default {
|
||||
priceCount: 0,
|
||||
goodsCount: 0,
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -19,7 +19,7 @@
|
||||
</div>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
|
||||
<h3 class="title">
|
||||
YSHOP后台管理系统-3.2
|
||||
YSHOP后台管理系统-3.3
|
||||
</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
|
@ -27,7 +27,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -25,11 +25,11 @@
|
||||
<b>用户未上传图片</b>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-image
|
||||
<el-image
|
||||
v-for="(item,index) in checkForm.explainImg.split(',')"
|
||||
:key="index"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="item"
|
||||
:src="item"
|
||||
:preview-src-list="[item]">
|
||||
</el-image>
|
||||
</div>
|
||||
@ -63,6 +63,18 @@
|
||||
<el-form-item label="邮费:">
|
||||
<el-input v-model="item.productInfo.postage" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="checkForm.deliveryName" label="快递公司:">
|
||||
<el-input v-model="checkForm.deliveryName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="checkForm.deliverySn" label="快递单号:">
|
||||
<el-input v-model="checkForm.deliverySn" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="checkForm.deliveryTime" label="发货时间:">
|
||||
<el-input v-model="checkForm.deliveryTime" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="checkForm.deliverySn" label="订单跟踪:">
|
||||
<el-button size="mini" @click="showLogisticsDialog">订单跟踪</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -83,6 +95,19 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-dialog title="订单跟踪"
|
||||
:visible.sync="kuaidiDialogVisible"
|
||||
width="40%">
|
||||
<el-steps direction="vertical"
|
||||
:active="90"
|
||||
finish-status="success"
|
||||
space="50px">
|
||||
<el-step v-for="item in logisticsList"
|
||||
:key="item.AcceptStation"
|
||||
:title="item.AcceptStation"
|
||||
:description="item.AcceptTime"></el-step>
|
||||
</el-steps>
|
||||
</el-dialog>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button class="refuse" type="danger" v-if="isShow" :loading="loading" @click="submit(1)">拒绝</el-button>
|
||||
<el-button class="check" type="primary" v-if="isShow" :loading="loading" @click="submit(0)">确认</el-button>
|
||||
@ -92,6 +117,7 @@
|
||||
|
||||
<script>
|
||||
import {salesCheck} from '@/api/yxStoreAfterSales.js'
|
||||
import { express } from '@/api/yxStoreOrder'
|
||||
export default {
|
||||
props: {
|
||||
},
|
||||
@ -100,7 +126,9 @@ export default {
|
||||
visible: false,
|
||||
isShow: false,
|
||||
loading: false,
|
||||
kuaidiDialogVisible: false,
|
||||
serviceType: '',
|
||||
logisticsList:[],
|
||||
checkForm: {},
|
||||
form: {
|
||||
salesId: '', // 售后id
|
||||
@ -122,6 +150,24 @@ export default {
|
||||
this.visible = false
|
||||
this.$refs['form'].resetFields()
|
||||
},
|
||||
showLogisticsDialog(){
|
||||
this.express();
|
||||
},
|
||||
express() {
|
||||
let params ={
|
||||
"orderCode": this.checkForm.id,
|
||||
"shipperCode": this.checkForm.deliverySn,
|
||||
"logisticCode": this.checkForm.deliveryId
|
||||
}
|
||||
|
||||
express(params).then(res=>{
|
||||
this.expressInfo = res.Traces
|
||||
this.kuaidiDialogVisible = true;
|
||||
this.logisticsList = this.expressInfo
|
||||
}).catch(err => {
|
||||
})
|
||||
|
||||
},
|
||||
async submit(type) {
|
||||
this.loading = true
|
||||
if (this.serviceType === 0) {
|
||||
@ -168,4 +214,4 @@ export default {
|
||||
.refuse{}
|
||||
.check{}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -33,7 +33,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -70,7 +70,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -24,7 +24,7 @@
|
||||
<el-button size="mini" @click="remark(order)">备注订单</el-button>
|
||||
</div>
|
||||
<div class="operate-button-container" v-show="order._status===3">
|
||||
<el-button size="mini" @click="refund(order)">立即退款</el-button>
|
||||
<!-- <el-button size="mini" @click="refund(order)">立即退款</el-button>-->
|
||||
<el-button size="mini" @click="remark(order)">备注订单</el-button>
|
||||
</div>
|
||||
<div class="operate-button-container" v-show="order._status===2">
|
||||
@ -71,7 +71,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4" class="table-cell">{{order.shippingType | formatShippingType}}</el-col>
|
||||
<el-col :span="4" class="table-cell">{{order.deliverySn | formatNull}}</el-col>
|
||||
<el-col :span="4" class="table-cell">{{order.deliveryId | formatNull}}</el-col>
|
||||
<el-col :span="4" class="table-cell">7天</el-col>
|
||||
<el-col :span="4" class="table-cell">{{order.gainIntegral}}</el-col>
|
||||
<el-col :span="4" class="table-cell">{{order.payIntegral}}</el-col>
|
||||
@ -260,9 +260,9 @@
|
||||
finish-status="success"
|
||||
space="50px">
|
||||
<el-step v-for="item in logisticsList"
|
||||
:key="item.acceptStation"
|
||||
:title="item.acceptStation"
|
||||
:description="item.acceptTime"></el-step>
|
||||
:key="item.AcceptStation"
|
||||
:title="item.AcceptStation"
|
||||
:description="item.AcceptTime"></el-step>
|
||||
</el-steps>
|
||||
</el-dialog>
|
||||
<!-- <el-dialog title="修改收货人信息"
|
||||
|
@ -65,9 +65,9 @@
|
||||
<el-timeline-item
|
||||
v-for="(obj, index) in expressInfo"
|
||||
:key="index"
|
||||
:timestamp="obj.acceptTime"
|
||||
:timestamp="obj.AcceptTime"
|
||||
>
|
||||
{{obj.acceptStation}}
|
||||
{{obj.AcceptStation}}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<el-timeline :reverse="false" v-else>
|
||||
|
@ -21,12 +21,12 @@
|
||||
<el-tab-pane name="4">
|
||||
<span slot="label"><i class="el-icon-circle-check"></i> 交易完成</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="-1">
|
||||
<span slot="label"><i class="el-icon-back"></i> 退款中</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="-2">
|
||||
<span slot="label"><i class="el-icon-finished"></i> 已退款</span>
|
||||
</el-tab-pane>
|
||||
<!--<el-tab-pane name="-1">-->
|
||||
<!-- <span slot="label"><i class="el-icon-back"></i> 退款中</span>-->
|
||||
<!--</el-tab-pane>-->
|
||||
<!--<el-tab-pane name="-2">-->
|
||||
<!-- <span slot="label"><i class="el-icon-finished"></i> 已退款</span>-->
|
||||
<!--</el-tab-pane>-->
|
||||
</el-tabs>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
@ -189,16 +189,16 @@
|
||||
>
|
||||
修改快递</el-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-button
|
||||
v-if="scope.row._status == 3"
|
||||
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="refund(scope.row)"
|
||||
>
|
||||
立刻退款</el-button>
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item>-->
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="scope.row._status == 3"-->
|
||||
<!-- v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="refund(scope.row)"-->
|
||||
<!-- >-->
|
||||
<!-- 立刻退款</el-button>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<el-dropdown-item v-if="scope.row._status == 1">
|
||||
<el-button
|
||||
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
|
||||
|
@ -17,12 +17,12 @@
|
||||
<el-tab-pane name="4">
|
||||
<span slot="label"><i class="el-icon-circle-check"></i> 交易完成</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="-1">
|
||||
<span slot="label"><i class="el-icon-back"></i> 退款中</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="-2">
|
||||
<span slot="label"><i class="el-icon-finished"></i> 已退款</span>
|
||||
</el-tab-pane>
|
||||
<!--<el-tab-pane name="-1">-->
|
||||
<!-- <span slot="label"><i class="el-icon-back"></i> 退款中</span>-->
|
||||
<!--</el-tab-pane>-->
|
||||
<!--<el-tab-pane name="-2">-->
|
||||
<!-- <span slot="label"><i class="el-icon-finished"></i> 已退款</span>-->
|
||||
<!--</el-tab-pane>-->
|
||||
</el-tabs>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
@ -126,16 +126,16 @@
|
||||
>
|
||||
订单核销</el-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-button
|
||||
v-if="scope.row._status == 3"
|
||||
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="refund(scope.row)"
|
||||
>
|
||||
立刻退款</el-button>
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item>-->
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="scope.row._status == 3"-->
|
||||
<!-- v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="refund(scope.row)"-->
|
||||
<!-- >-->
|
||||
<!-- 立刻退款</el-button>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<el-dropdown-item v-if="scope.row._status == 1">
|
||||
<el-button
|
||||
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
|
||||
|
@ -18,7 +18,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -61,7 +61,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -43,7 +43,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -38,7 +38,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -73,7 +73,7 @@
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
:loading="crud.cu === 2"
|
||||
:loading="crud.status.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>
|
||||
|
@ -89,7 +89,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -51,7 +51,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-row :gutter="15">
|
||||
|
@ -59,7 +59,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -117,9 +117,9 @@
|
||||
>{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
|
||||
<el-form-item style="margin-bottom: 0;" label="角色" prop="roledatas">
|
||||
<el-select
|
||||
v-model="form.roles"
|
||||
v-model="form.roleDatas"
|
||||
style="width: 437px"
|
||||
multiple
|
||||
placeholder="请选择角色"
|
||||
@ -138,7 +138,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@ -211,7 +211,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
let userRoles = []
|
||||
// crud交由presenter持有
|
||||
const defaultCrud = CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }})
|
||||
const defaultForm = { username: null, nickName: null, sex: '男', email: null, enabled: 'false', roles: [], job: { id: null }, dept: { id: null }, phone: null }
|
||||
const defaultForm = { username: null, nickName: null, sex: '男', email: null, enabled: 'false', roles: [],roleDatas: [], job: { id: null }, dept: { id: null }, phone: null }
|
||||
export default {
|
||||
name: 'User',
|
||||
components: { Treeselect, crudOperation, rrOperation, udOperation, pagination },
|
||||
@ -327,9 +327,12 @@ export default {
|
||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||
this.getJobs()
|
||||
userRoles = []
|
||||
this.form.roleDatas = []
|
||||
const roles = []
|
||||
const that = this
|
||||
form.roles.forEach(function(role, index) {
|
||||
roles.push(role.id)
|
||||
that.form.roleDatas.push(role.id)
|
||||
// 初始化编辑时候的角色
|
||||
const rol = { id: role.id }
|
||||
userRoles.push(rol)
|
||||
@ -350,7 +353,7 @@ export default {
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
} else if (this.roles.length === 0) {
|
||||
} else if (this.form.roleDatas.length === 0) {
|
||||
this.$message({
|
||||
message: '角色不能为空',
|
||||
type: 'warning'
|
||||
|
@ -8,19 +8,39 @@
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<img v-if="imageUrl" :src="imageUrl" class="single-img__img">
|
||||
<i v-else class="el-icon-upload">
|
||||
<img
|
||||
v-if="imageUrl"
|
||||
:src="imageUrl"
|
||||
class="single-img__img"
|
||||
>
|
||||
<i
|
||||
v-else
|
||||
class="el-icon-upload"
|
||||
>
|
||||
<div class="el-upload__text"><em>选择图片</em></div>
|
||||
<div class="el-upload__tip" slot="tip">{{tip}}</div>
|
||||
<div
|
||||
class="el-upload__tip"
|
||||
slot="tip"
|
||||
>{{tip.label}}</div>
|
||||
</i>
|
||||
</el-upload>
|
||||
<div class="overlay" v-if="imageUrl">
|
||||
<!-- <i class="iconfont icon-chakan" @click="showImage"></i>
|
||||
<i class="iconfont icon-shanchu1" @click="delImage"></i> -->
|
||||
<div
|
||||
class="overlay"
|
||||
v-if="imageUrl"
|
||||
>
|
||||
<i class="iconfont icon-chakan" @click="showImage"></i>
|
||||
<i class="iconfont icon-shanchu1" @click="delImage"></i>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="图片展示" :visible.sync="dialogVisible">
|
||||
<img width="100%" :src="dialogImageUrl" alt="">
|
||||
<el-dialog
|
||||
title="图片展示"
|
||||
:visible.sync="dialogVisible"
|
||||
>
|
||||
<img
|
||||
width="100%"
|
||||
:src="dialogImageUrl"
|
||||
alt=""
|
||||
>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -41,12 +61,12 @@ export default {
|
||||
default: ''
|
||||
},
|
||||
tip: {
|
||||
type: String,
|
||||
default: '建议尺寸: 1080*900px, 小于1MB'
|
||||
type: Object,
|
||||
default:()=>({}),
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.fileUploadURL = process.env.VUE_APP_BASE_API +'/api/canvas/upload?name=demo&type=console'
|
||||
this.fileUploadURL = process.env.VUE_APP_BASE_API + '/api/canvas/upload?name=demo&type=console'
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess (res, file) {
|
||||
@ -71,53 +91,53 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.single-img{
|
||||
&__box{
|
||||
position: relative;
|
||||
>>> .el-upload{
|
||||
width: 100%;
|
||||
.single-img {
|
||||
&__box {
|
||||
position: relative;
|
||||
>>> .el-upload {
|
||||
width: 100%;
|
||||
}
|
||||
>>> .el-upload-dragger {
|
||||
width: 100%;
|
||||
.el-upload__text {
|
||||
line-height: 40px;
|
||||
}
|
||||
>>> .el-upload-dragger{
|
||||
width: 100%;
|
||||
.el-upload__text{
|
||||
line-height: 40px;
|
||||
}
|
||||
.el-upload__tip{
|
||||
line-height: 1em;
|
||||
}
|
||||
}
|
||||
.overlay{
|
||||
display: none;
|
||||
}
|
||||
&:hover .overlay{
|
||||
position: absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.iconfont{
|
||||
padding: 5px;
|
||||
margin: 0 5px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.el-upload__tip {
|
||||
line-height: 1em;
|
||||
}
|
||||
}
|
||||
&__img{
|
||||
.overlay {
|
||||
display: none;
|
||||
}
|
||||
&:hover .overlay {
|
||||
position: absolute;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.iconfont {
|
||||
padding: 5px;
|
||||
margin: 0 5px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
&__img {
|
||||
position: absolute;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button v-if="crud.status.add" :loading="loading" type="primary" @click="upload">确认</el-button>
|
||||
<el-button v-else :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button v-else :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
|
@ -14,6 +14,14 @@
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="快递鸟申请地址">
|
||||
yshopb2c系统使用的第三方快递鸟api实现了快递查询,注册地址请点击,
|
||||
<span style="color: blue; cursor: pointer;">
|
||||
<a href="http://www.kdniao.com/reg?from=cbb-yx" target="_blank" style="color: inherit; text-decoration: underline;">
|
||||
我注册!
|
||||
</a>
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -4,15 +4,39 @@
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
<el-input
|
||||
v-model="query.value"
|
||||
clearable
|
||||
placeholder="输入搜索内容"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
clearable
|
||||
placeholder="类型"
|
||||
class="filter-item"
|
||||
style="width: 130px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in queryTypeOptions"
|
||||
:key="item.key"
|
||||
:label="item.display_name"
|
||||
:value="item.key"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-tooltip slot="right" class="item" effect="dark" content="数据库中表字段变动时使用该功能" placement="top-start">
|
||||
<el-tooltip
|
||||
slot="right"
|
||||
class="item"
|
||||
effect="dark"
|
||||
content="数据库中表字段变动时使用该功能"
|
||||
placement="top-start"
|
||||
>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
@ -21,118 +45,223 @@
|
||||
:loading="syncLoading"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="sync"
|
||||
>同步</el-button>
|
||||
>同步</el-button
|
||||
>
|
||||
</el-tooltip>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
|
||||
<el-form-item label="选择商品" prop="coverImgeUrl" >
|
||||
<cgood v-model="form.good":disabled="isdisabled" ></cgood>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="800px"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
size="small"
|
||||
label-width="140px"
|
||||
>
|
||||
<el-form-item label="选择商品" prop="coverImgeUrl">
|
||||
<cgood v-model="form.good" :disabled="isdisabled"></cgood>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品封面图:" prop="coverImgeUrl">
|
||||
<single-pic v-model="form.coverImgeUrl" type="image" :num="1" :width="150" :height="150" />
|
||||
<p style="color: #cf0f0f">图片规则:图片尺寸最大300像素*300像素;</p>
|
||||
<single-pic
|
||||
v-model="form.coverImgeUrl"
|
||||
type="image"
|
||||
:num="1"
|
||||
:width="150"
|
||||
:height="150"
|
||||
/>
|
||||
<p style="color: #cf0f0f">
|
||||
图片规则:图片尺寸最大300像素*300像素;
|
||||
</p>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="商品小程序路径" prop="url" >
|
||||
<el-input v-model="form.url" style="width: 370px;" :disabled="true"/>
|
||||
<el-form-item label="商品小程序路径" prop="url">
|
||||
<el-input
|
||||
v-model="form.url"
|
||||
style="width: 370px;"
|
||||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 1:一口价(只需要传入price,price2不传)-->
|
||||
<!-- 2:价格区间(price字段为左边界,price2字段为右边界,price和price2必传)-->
|
||||
<!-- 3:显示折扣价(price字段为原价,price2字段为现价, price和price2必传)-->
|
||||
<el-form-item label="商品名称" prop="name" >
|
||||
<el-input v-model="form.name" style="width: 370px;" :disabled="isdisabled"/>
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
style="width: 370px;"
|
||||
:disabled="isdisabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格类型" prop="priceType" >
|
||||
<el-radio-group v-model="form.priceType" >
|
||||
<el-form-item label="价格类型" prop="priceType">
|
||||
<el-radio-group v-model="form.priceType">
|
||||
<el-radio :label="'1'" class="radio">一口价</el-radio>
|
||||
<el-radio :label="'2'" class="radio">价格区间</el-radio>
|
||||
<el-radio :label="'3'" class="radio">显示折扣价</el-radio>
|
||||
</el-radio-group>
|
||||
<p v-if="isdisabled" style="color: #cf0f0f">商品审核通过已入库,只能修改价格</p>
|
||||
<p v-if="isdisabled" style="color: #cf0f0f">
|
||||
商品审核通过已入库,只能修改价格
|
||||
</p>
|
||||
</el-form-item>
|
||||
<el-col v-if="form.priceType=='1'" v-bind="grid">
|
||||
<el-form-item label="一口价" prop="price" >
|
||||
<el-col v-if="form.priceType == '1'" v-bind="grid">
|
||||
<el-form-item label="一口价" prop="price">
|
||||
<el-input v-model="form.price" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='2'" v-bind="grid">
|
||||
<el-form-item label="最低价格" prop="price" >
|
||||
<el-input v-model="form.price" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='2'" v-bind="grid">
|
||||
<el-form-item label="最高价格" prop="price2" >
|
||||
<el-input v-model="form.price2" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='3'" v-bind="grid">
|
||||
<el-form-item label="市场价" prop="price" >
|
||||
<el-col v-if="form.priceType == '2'" v-bind="grid">
|
||||
<el-form-item label="最低价格" prop="price">
|
||||
<el-input v-model="form.price" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType=='3'" v-bind="grid">
|
||||
<el-form-item label="现价" prop="price2" >
|
||||
<el-input v-model="form.price2" style="width: 200px;"/>
|
||||
<el-col v-if="form.priceType == '2'" v-bind="grid">
|
||||
<el-form-item label="最高价格" prop="price2">
|
||||
<el-input v-model="form.price2" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType == '3'" v-bind="grid">
|
||||
<el-form-item label="市场价" prop="price">
|
||||
<el-input v-model="form.price" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.priceType == '3'" v-bind="grid">
|
||||
<el-form-item label="现价" prop="price2">
|
||||
<el-input v-model="form.price2" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button
|
||||
:loading="crud.status.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="columns.visible('goodsId')" prop="goodsId" label="直播商品id" />
|
||||
<el-table-column v-if="columns.visible('name')" prop="name" label="商品名称" />
|
||||
<el-table-column v-if="columns.visible('productId')" prop="productId" label="关联商品id" />
|
||||
<el-table-column v-if="columns.visible('coverImgeUrl')" prop="coverImgUrl" label="商品图片" >
|
||||
<el-table-column
|
||||
v-if="columns.visible('goodsId')"
|
||||
prop="goodsId"
|
||||
label="直播商品id"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="columns.visible('name')"
|
||||
prop="name"
|
||||
label="商品名称"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="columns.visible('productId')"
|
||||
prop="productId"
|
||||
label="关联商品id"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="columns.visible('coverImgeUrl')"
|
||||
prop="coverImgUrl"
|
||||
label="商品图片"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.coverImgeUrl" style="color: #42b983" target="_blank"><img :src="scope.row.coverImgeUrl" alt="点击打开" class="el-avatar"></a>
|
||||
<a
|
||||
:href="scope.row.coverImgeUrl"
|
||||
style="color: #42b983"
|
||||
target="_blank"
|
||||
><img
|
||||
:src="scope.row.coverImgeUrl"
|
||||
alt="点击打开"
|
||||
class="el-avatar"
|
||||
/></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="columns.visible('url')" prop="url" label="商品小程序路径" />
|
||||
<el-table-column v-if="columns.visible('priceType')" prop="priceType" label="价格类型" >
|
||||
<el-table-column
|
||||
v-if="columns.visible('url')"
|
||||
prop="url"
|
||||
label="商品小程序路径"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="columns.visible('priceType')"
|
||||
prop="priceType"
|
||||
label="价格类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.priceType == 1" :type="''">一口价</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 2" :type="''">价格区间</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 3" :type="''">显示折扣价</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 2" :type="''"
|
||||
>价格区间</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.priceType == 3" :type="''"
|
||||
>显示折扣价</el-tag
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="columns.visible('price')" prop="price" label="price" />-->
|
||||
<!-- <el-table-column v-if="columns.visible('price2')" prop="price2" label="price2" />-->
|
||||
<el-table-column v-if="columns.visible('auditStatus')" prop="auditStatus" label="审核状态" >
|
||||
<el-table-column
|
||||
v-if="columns.visible('auditStatus')"
|
||||
prop="auditStatus"
|
||||
label="审核状态"
|
||||
>
|
||||
<!-- //0:未审核,1:审核中,2:审核通过,3审核失败-->
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.auditStatus === 0" :type="''">未审核</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 1" :type="''">审核中</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 2" :type="''">审核通过</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 3" :type="''">审核失败</el-tag>
|
||||
<el-tag v-if="scope.row.auditStatus === 0" :type="''"
|
||||
>未审核</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 1" :type="''"
|
||||
>审核中</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 2" :type="''"
|
||||
>审核通过</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 3" :type="''"
|
||||
>审核失败</el-tag
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 1, 2:表示是为api添加商品,否则是直播控制台添加的商品-->
|
||||
<el-table-column v-if="columns.visible('thirdPartyTag')" prop="thirdPartyTag" label="添加途径" >
|
||||
<el-table-column
|
||||
v-if="columns.visible('thirdPartyTag')"
|
||||
prop="thirdPartyTag"
|
||||
label="添加途径"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.thirdPartyTag == 0" :type="''">api添加</el-tag>
|
||||
<el-tag v-else-if="scope.row.thirdPartyTag == 2" :type="''">控制台</el-tag>
|
||||
<el-tag v-if="scope.row.thirdPartyTag == 0" :type="''"
|
||||
>api添加</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.thirdPartyTag == 2" :type="''"
|
||||
>控制台</el-tag
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-permission="['admin','yxWechatLiveGoods:edit','yxWechatLiveGoods:del']" label="操作" width="150px" align="center">
|
||||
<el-table-column
|
||||
v-permission="[
|
||||
'admin',
|
||||
'yxWechatLiveGoods:edit',
|
||||
'yxWechatLiveGoods:del'
|
||||
]"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
<udOperation :data="scope.row" :permission="permission" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -143,21 +272,52 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sync } from '@/api/yxWechatLiveGoods'
|
||||
import crudYxWechatLiveGoods from '@/api/yxWechatLiveGoods'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import cgood from '@/views/components/good'
|
||||
import singlePic from '@/components/singlematerial'
|
||||
import { sync } from "@/api/yxWechatLiveGoods";
|
||||
import crudYxWechatLiveGoods from "@/api/yxWechatLiveGoods";
|
||||
import CRUD, { presenter, header, form, crud } from "@crud/crud";
|
||||
import rrOperation from "@crud/RR.operation";
|
||||
import crudOperation from "@crud/CRUD.operation";
|
||||
import udOperation from "@crud/UD.operation";
|
||||
import pagination from "@crud/Pagination";
|
||||
import cgood from "@/views/components/good";
|
||||
import singlePic from "@/components/singlematerial";
|
||||
// crud交由presenter持有
|
||||
const defaultCrud = CRUD({ title: '直播商品', url: 'api/yxWechatLiveGoods', sort: 'goods_id,desc', crudMethod: { ...crudYxWechatLiveGoods }})
|
||||
const defaultForm = { good: {productId: null,storeName: null,image: null,price: null,otPrice: null}, goodsId: null, productId: null, coverImgeUrl: '', url: null, priceType: null, price: null, price2: null, name: null, thirdPartyTag: null, auditId: null, auditStatus: null }
|
||||
const defaultCrud = CRUD({
|
||||
title: "直播商品",
|
||||
url: "api/yxWechatLiveGoods",
|
||||
sort: "goods_id,desc",
|
||||
crudMethod: { ...crudYxWechatLiveGoods }
|
||||
});
|
||||
const defaultForm = {
|
||||
good: {
|
||||
productId: null,
|
||||
storeName: null,
|
||||
image: null,
|
||||
price: null,
|
||||
otPrice: null
|
||||
},
|
||||
goodsId: null,
|
||||
productId: null,
|
||||
coverImgeUrl: "",
|
||||
url: null,
|
||||
priceType: null,
|
||||
price: null,
|
||||
price2: null,
|
||||
name: null,
|
||||
thirdPartyTag: null,
|
||||
auditId: null,
|
||||
auditStatus: null
|
||||
};
|
||||
export default {
|
||||
name: 'YxWechatLiveGoods',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation ,cgood,singlePic},
|
||||
name: "YxWechatLiveGoods",
|
||||
components: {
|
||||
pagination,
|
||||
crudOperation,
|
||||
rrOperation,
|
||||
udOperation,
|
||||
cgood,
|
||||
singlePic
|
||||
},
|
||||
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
@ -171,133 +331,126 @@ export default {
|
||||
xs: 24
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'yxWechatLiveGoods:add'],
|
||||
edit: ['admin', 'yxWechatLiveGoods:edit'],
|
||||
del: ['admin', 'yxWechatLiveGoods:del']
|
||||
add: ["admin", "yxWechatLiveGoods:add"],
|
||||
edit: ["admin", "yxWechatLiveGoods:edit"],
|
||||
del: ["admin", "yxWechatLiveGoods:del"]
|
||||
},
|
||||
rules: {
|
||||
coverImgUrl: [
|
||||
{ required: true, message: '商品图片不能为空', trigger: 'blur' }
|
||||
{ required: true, message: "商品图片不能为空", trigger: "blur" }
|
||||
],
|
||||
priceType: [
|
||||
{ required: true, message: '价格类型不能为空', trigger: 'blur' }
|
||||
{ required: true, message: "价格类型不能为空", trigger: "blur" }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
price: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "商品名称不能为空", trigger: "blur" }]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '商品名称' }
|
||||
]
|
||||
queryTypeOptions: [{ key: "name", display_name: "商品名称" }]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"form.good": {
|
||||
handler(val, oldVal) {
|
||||
this.form.productId = val.productId;
|
||||
this.form.name = val.storeName;
|
||||
this.form.price = val.price;
|
||||
this.form.price2 = val.otPrice;
|
||||
this.form.priceType = "3";
|
||||
if (val.productId) {
|
||||
this.form.url = "pages/shop/GoodsCon/index?id=" + val.productId;
|
||||
}
|
||||
this.isdisabled = false;
|
||||
},
|
||||
deep: true //对象内部的属性监听,也叫深度监听
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'form.good': {
|
||||
handler(val,oldVal){
|
||||
this.form.productId = val.productId
|
||||
this.form.name = val.storeName
|
||||
this.form.price = val.price
|
||||
this.form.price2 = val.otPrice
|
||||
this.form.priceType = '3'
|
||||
if(val.productId){
|
||||
this.form.url="/pages/shop/GoodsCon/index?id="+val.productId
|
||||
}
|
||||
this.isdisabled=false;
|
||||
},
|
||||
deep:true//对象内部的属性监听,也叫深度监听
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
disable(){
|
||||
if(this.form.auditStatus=="2"){
|
||||
return this.isdisabled=true;
|
||||
}else{
|
||||
return this.isdisabled=false;
|
||||
|
||||
computed: {
|
||||
disable() {
|
||||
if (this.form.auditStatus == "2") {
|
||||
return (this.isdisabled = true);
|
||||
} else {
|
||||
return (this.isdisabled = false);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sync() {
|
||||
const ids = []
|
||||
const ids = [];
|
||||
this.crud.selections.forEach(val => {
|
||||
ids.push(val.goodsId)
|
||||
})
|
||||
this.crud.selections.forEach(val => {
|
||||
})
|
||||
this.syncLoading = true
|
||||
sync(ids).then(() => {
|
||||
this.crud.refresh()
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.syncLoading = false
|
||||
}).then(() => {
|
||||
this.syncLoading = false
|
||||
})
|
||||
ids.push(val.goodsId);
|
||||
});
|
||||
this.crud.selections.forEach(val => {});
|
||||
this.syncLoading = true;
|
||||
sync(ids)
|
||||
.then(() => {
|
||||
this.crud.refresh();
|
||||
this.crud.notify("同步成功", CRUD.NOTIFICATION_TYPE.SUCCESS);
|
||||
this.syncLoading = false;
|
||||
})
|
||||
.then(() => {
|
||||
this.syncLoading = false;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 执行删除
|
||||
* @param {*} data 数据项
|
||||
*/
|
||||
doDelete(data) {
|
||||
let delAll = false
|
||||
let dataStatus
|
||||
const ids = []
|
||||
let delAll = false;
|
||||
let dataStatus;
|
||||
const ids = [];
|
||||
if (data instanceof Array) {
|
||||
delAll = true
|
||||
delAll = true;
|
||||
data.forEach(val => {
|
||||
ids.push(val.goodsId)
|
||||
})
|
||||
ids.push(val.goodsId);
|
||||
});
|
||||
} else {
|
||||
ids.push(data.goodsId)
|
||||
dataStatus = crud.getDataStatus(data.goodsId)
|
||||
ids.push(data.goodsId);
|
||||
dataStatus = crud.getDataStatus(data.goodsId);
|
||||
}
|
||||
if (!callVmHook(crud, CRUD.HOOK.beforeDelete, data)) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (!delAll) {
|
||||
dataStatus.delete = CRUD.STATUS.PROCESSING
|
||||
dataStatus.delete = CRUD.STATUS.PROCESSING;
|
||||
}
|
||||
return crud.crudMethod.del(ids).then(() => {
|
||||
if (delAll) {
|
||||
crud.delAllLoading = false
|
||||
} else dataStatus.delete = CRUD.STATUS.PREPARED
|
||||
crud.dleChangePage(1)
|
||||
crud.delSuccessNotify()
|
||||
callVmHook(crud, CRUD.HOOK.afterDelete, data)
|
||||
crud.refresh()
|
||||
}).catch(() => {
|
||||
if (delAll) {
|
||||
crud.delAllLoading = false
|
||||
} else dataStatus.delete = CRUD.STATUS.PREPARED
|
||||
})
|
||||
return crud.crudMethod
|
||||
.del(ids)
|
||||
.then(() => {
|
||||
if (delAll) {
|
||||
crud.delAllLoading = false;
|
||||
} else dataStatus.delete = CRUD.STATUS.PREPARED;
|
||||
crud.dleChangePage(1);
|
||||
crud.delSuccessNotify();
|
||||
callVmHook(crud, CRUD.HOOK.afterDelete, data);
|
||||
crud.refresh();
|
||||
})
|
||||
.catch(() => {
|
||||
if (delAll) {
|
||||
crud.delAllLoading = false;
|
||||
} else dataStatus.delete = CRUD.STATUS.PREPARED;
|
||||
});
|
||||
},
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
const query = this.query
|
||||
const query = this.query;
|
||||
if (query.type && query.value) {
|
||||
this.crud.params[query.type] = query.value
|
||||
}else{
|
||||
delete this.crud.params.name
|
||||
this.crud.params[query.type] = query.value;
|
||||
} else {
|
||||
delete this.crud.params.name;
|
||||
}
|
||||
return true
|
||||
return true;
|
||||
}, // 新增与编辑前做的操作
|
||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||
this.form.good.productId = form.productId
|
||||
this.form.good.storeName = form.name
|
||||
this.form.good.image = form.coverImgeUrl
|
||||
this.form.good.price = form.price
|
||||
this.form.good.otPrice = form.price2
|
||||
this.form.good.auditStatus = form.auditStatus
|
||||
},
|
||||
this.form.good.productId = form.productId;
|
||||
this.form.good.storeName = form.name;
|
||||
this.form.good.image = form.coverImgeUrl;
|
||||
this.form.good.price = form.price;
|
||||
this.form.good.otPrice = form.price2;
|
||||
this.form.good.auditStatus = form.auditStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -103,7 +103,7 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU" :disabled="isDisabled">确认</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU" :disabled="isDisabled">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="修改直播间商品信息"
|
||||
|
Reference in New Issue
Block a user