18 Commits
v3.2 ... master

Author SHA1 Message Date
b41f19e1e3 修改跳转 2023-07-28 13:49:55 +08:00
cfb775c216 快递鸟注册 2023-07-28 13:23:38 +08:00
6659052729 bugfix 2023-04-14 20:23:45 +08:00
916492b384 列表退款隐藏 2023-04-08 21:44:51 +08:00
a35ab8982e 售后相关处理 2023-04-05 18:59:26 +08:00
f1bd1e5128 多角色保存bugfix 2023-04-02 22:51:45 +08:00
20c5b7c3c3 首页统计bugfix 2023-02-11 12:20:17 +08:00
73d4e3bb62 物流单号显示错误 2023-02-09 00:18:12 +08:00
79e5bad31b 物流信息调整 2023-02-08 01:05:43 +08:00
0a39390d4e fix 全局loading 2023-02-01 21:17:56 +08:00
55e1ed83a7 Merge remote-tracking branch 'origin/v3.3' 2022-10-04 14:19:05 +08:00
941030aa40 去掉订单列表退款中、已退款 2022-08-05 21:50:17 +08:00
464a7a7bd7 Merge remote-tracking branch 'origin/master' into v3.3 2022-08-04 23:30:09 +08:00
ad39e41f70 去掉订单列表退款中、已退款 2022-08-04 23:29:37 +08:00
46904145a9 fix: 新增直播间商品一直提示300007错误代码 2022-07-27 10:25:10 +08:00
7850060991 修改选中adv组件报错的问题 2022-05-31 12:24:45 +08:00
3a3dcb8750 版本修改 2022-05-01 14:41:20 +08:00
916b219549 本地接口地址修改 2022-04-27 12:52:35 +08:00
29 changed files with 516 additions and 282 deletions

View File

@ -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/'

View File

@ -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": {

View File

@ -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)
})
},

View File

@ -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>',
/**
* 备案号
*/

View File

@ -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() {

View File

@ -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="账号">

View File

@ -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>
<!--表格渲染-->

View File

@ -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>

View File

@ -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>
<!--表格渲染-->

View File

@ -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>
<!--表格渲染-->

View File

@ -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>
<!--表格渲染-->

View File

@ -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="修改收货人信息"

View File

@ -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>

View File

@ -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']"

View File

@ -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']"

View File

@ -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>
<!--表格渲染-->

View File

@ -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>
<!--表格渲染-->

View File

@ -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>
<!--表格渲染-->

View File

@ -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>
<!--表格渲染-->

View File

@ -73,7 +73,7 @@
取消
</el-button>
<el-button
:loading="crud.cu === 2"
:loading="crud.status.cu === 2"
type="primary"
@click="crud.submitCU"
>

View File

@ -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>
<!--表格渲染-->

View File

@ -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">

View File

@ -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>
<!--表格渲染-->

View File

@ -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'

View File

@ -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>

View File

@ -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>
<!--表格渲染-->

View File

@ -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>

View File

@ -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一口价只需要传入priceprice2不传-->
<!-- 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>

View File

@ -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="修改直播间商品信息"