Browse Source

上传代码

master
杨豪 3 years ago
parent
commit
816fa2fa6f
  1. 2
      .env.development
  2. 4
      public/UEditor/ueditor.config.js
  3. 2
      src/api/EnterpriseAuthentication.js
  4. 19
      src/api/Resources.js
  5. 8
      src/api/yxStoreProduct.js
  6. 20
      src/utils/amap.js
  7. 0
      src/views/activitys/cate.vue
  8. 0
      src/views/activitys/flag.vue
  9. 117
      src/views/activitys/index.vue
  10. 1
      src/views/activitys/order.vue
  11. 0
      src/views/activitys/publisher.vue
  12. 35
      src/views/information/articleCatetory.vue
  13. 20
      src/views/information/form.vue
  14. 29
      src/views/information/index.vue
  15. 27
      src/views/shop/demandHall/authentication.vue
  16. 92
      src/views/shop/goods/form.vue
  17. 275
      src/views/shop/projectManage/index.vue

2
.env.development

@ -1,7 +1,7 @@
ENV = 'development' ENV = 'development'
# 接口地址 # 接口地址
VUE_APP_BASE_API = 'http://192.168.0.111:8094' VUE_APP_BASE_API = 'http://192.168.1.34:8094'
VUE_APP_WS_API = 'ws://localhost:8088' VUE_APP_WS_API = 'ws://localhost:8088'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件

4
public/UEditor/ueditor.config.js

@ -34,8 +34,8 @@
// 工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义 // 工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义
toolbars: [[ toolbars: [[
'source', '|', 'undo', 'redo', '|', 'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', 'strikethrough', '|', 'superscript', 'subscript', '|', 'forecolor', 'backcolor', '|', 'bold', 'italic', 'underline', 'strikethrough', '|','superscript', 'subscript', '|', 'forecolor', 'backcolor', '|',
'removeformat', '|', 'insertorderedlist', 'insertunorderedlist', '|', 'selectall', 'cleardoc', 'paragraph', '|', 'formatmatch', '|','removeformat', '|', 'insertorderedlist', 'insertunorderedlist', '|', 'selectall', 'cleardoc', 'paragraph', '|',
'fontfamily', 'fontsize', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'fontfamily', 'fontsize', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
'link', 'unlink', '|', 'emotion', '|', 'link', 'unlink', '|', 'emotion', '|',
'|', 'horizontal', 'print', 'preview', 'fullscreen', 'drafts', 'formula' '|', 'horizontal', 'print', 'preview', 'fullscreen', 'drafts', 'formula'

2
src/api/EnterpriseAuthentication.js

@ -26,7 +26,7 @@ export function edit(data) {
export function getAuthenticationList(data) { export function getAuthenticationList(data) {
return request({ return request({
url: 'api/EnterpriseAuthentication/getAuthenticationList', url: 'api/EnterpriseAuthentication/getAuthenticationList?page='+data.page+'&size='+data.size,
method: 'post', method: 'post',
data data
}) })

19
src/api/Resources.js

@ -24,21 +24,4 @@ export function edit(data) {
}) })
} }
export function getResourceList(data) { export default { add, edit, del }
return request({
url: 'api/Resources/listResource',
method: 'post',
data
})
}
export function examineResources(data) {
return request({
url: 'api/Resources/examineResources',
method: 'post',
data
})
}
export default { add, edit, del, getResourceList, examineResources }

8
src/api/yxStoreProduct.js

@ -96,3 +96,11 @@ export function audit(data) {
data data
}) })
} }
//获取虚拟商品列表
export function getVirtualPorducts(data) {
return request({
url: 'api/yxStoreProduct/virtualPorducts',
method: 'post',
data
})
}

20
src/utils/amap.js

@ -0,0 +1,20 @@
/*
* 异步创建script标签
*/
export default function MapLoader (key) {
return new Promise((resolve, reject) => {
if (window.AMap) {
resolve(window.AMap)
} else {
var script = document.createElement('script')
script.type = 'text/javascript'
script.async = true
script.src = 'https://webapi.amap.com/maps?v=1.4.15&key=6b5ed4e01a6a876cc337c6dd805c2336&plugin=AMap.Autocomplete,AMap.PlaceSearch'
script.onerror = reject
document.head.appendChild(script)
}
window.initAMap = () => {
resolve(window.AMap)
}
})
}

0
src/views/activitys/activitys/cate.vue → src/views/activitys/cate.vue

0
src/views/activitys/activitys/flag.vue → src/views/activitys/flag.vue

117
src/views/activitys/activitys/index.vue → src/views/activitys/index.vue

@ -9,7 +9,7 @@
> >
<el-option <el-option
v-for="(item, index) in crud.data" v-for="(item, index) in crud.data"
:key="index" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
></el-option> ></el-option>
@ -68,7 +68,7 @@
> >
<el-option <el-option
v-for="(item, index) in option" v-for="(item, index) in option"
:key="index" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
></el-option> ></el-option>
@ -77,8 +77,8 @@
<el-form-item label="活动标签" :label-width="formLabelWidth"> <el-form-item label="活动标签" :label-width="formLabelWidth">
<!-- <el-input v-model="form.name" style="width: 370px;" /> --> <!-- <el-input v-model="form.name" style="width: 370px;" /> -->
<el-tag <el-tag
:key="tag" :key="index"
v-for="tag in dynamicTags" v-for="(tag,index) in dynamicTags"
closable closable
:disable-transitions="false" :disable-transitions="false"
@close="handleClose(tag)" @close="handleClose(tag)"
@ -183,12 +183,27 @@
</el-input> </el-input>
<el-drawer <el-drawer
:append-to-body="true" :append-to-body="true"
title="" title="选择地点"
:visible.sync="mapVisible" :visible.sync="mapVisible"
:with-header="false" size="50%"
size="60%"
> >
<div id="map" style="width: 100%; height: 100%"></div> <div class="drawer-body">
<div id="map"></div>
<div id="myPageTop">
<table>
<tr>
<td>
<label>请输入关键字</label>
</td>
</tr>
<tr>
<td>
<input id="tipinput"/>
</td>
</tr>
</table>
</div>
</div>
</el-drawer> </el-drawer>
</el-form-item> </el-form-item>
<!-- <el-form-item label="纬度" :label-width="formLabelWidth"> <!-- <el-form-item label="纬度" :label-width="formLabelWidth">
@ -397,6 +412,7 @@ import pagination from "@crud/Pagination";
import MaterialList from "@/components/material"; import MaterialList from "@/components/material";
import singlePic from "@/components/singlematerial"; import singlePic from "@/components/singlematerial";
import UeditorWrap from "vue-ueditor-wrap"; import UeditorWrap from "vue-ueditor-wrap";
import MapLoader from "@/utils/amap"
// crudpresenter // crudpresenter
const defaultCrud = CRUD({ const defaultCrud = CRUD({
title: "活动", title: "活动",
@ -472,10 +488,10 @@ export default {
}, },
myConfig: { myConfig: {
autoHeightEnabled: false, // autoHeightEnabled: false, //
initialFrameHeight: 400, // initialFrameHeight: 500, //
initialFrameWidth: "100%", // initialFrameWidth: '100%', //
UEDITOR_HOME_URL: "/UEditor/", UEDITOR_HOME_URL: '/UEditor/',
serverUrl: "", serverUrl: ''
}, },
rules: {}, rules: {},
}; };
@ -551,7 +567,7 @@ export default {
"yshop", "yshop",
function (editor, uiName) { function (editor, uiName) {
let dialog = new window.UE.ui.Dialog({ let dialog = new window.UE.ui.Dialog({
iframeUrl: "#/yshop/materia/index", iframeUrl: "/yshop/materia/index",
editor: editor, editor: editor,
name: uiName, name: uiName,
title: "上传图片", title: "上传图片",
@ -622,15 +638,22 @@ export default {
getMap() { getMap() {
let _this = this; let _this = this;
// //
map = new AMap.Map("map", { this.map = new AMap.Map("map", {
//mapStyle: 'amap://styles/grey',
zoom: 13, zoom: 13,
center: [114.31667, 30.51667], center: [114.31667, 30.51667],
}); });
//
var autoOptions = {
input: "tipinput"
};
var auto = new AMap.Autocomplete(autoOptions);
AMap.event.addListener(auto, "select", this.select); //
// //
map.on("click", showInfoClick); this.map.on("click", this.showInfoClick);
function showInfoClick(e) { },
map.clearMap(); // showInfoClick(e) {
let _this = this;
this.map.clearMap(); //
let lng = e.lnglat.getLng(); // let lng = e.lnglat.getLng(); //
let lat = e.lnglat.getLat(); // let lat = e.lnglat.getLat(); //
//marker //marker
@ -639,26 +662,43 @@ export default {
offset: new AMap.Pixel(-13, -30), offset: new AMap.Pixel(-13, -30),
}); });
_this.lnglat = lng + "," + lat; //input _this.lnglat = lng + "," + lat; //input
map.add(marker); //
map.setFitView(); // _this.map.add(marker); //
this.map.setFitView(); //
console.log(_this.lnglat.split(","), "经纬度"); console.log(_this.lnglat.split(","), "经纬度");
_this.form.longitude = _this.lnglat.split(",")[0]; _this.form.longitude = _this.lnglat.split(",")[0];
_this.form.latitude = _this.lnglat.split(",")[1]; _this.form.latitude = _this.lnglat.split(",")[1];
} },
select(e) {
var placeSearch = new AMap.PlaceSearch({
map: this.map
}); //
placeSearch.setCity(e.poi.adcode);
placeSearch.search(e.poi.name,(status,res)=>{
console.log(res)
let pois = res.poiList.pois
// res.pois
}); //
}, },
// //
toMap() { toMap() {
this.mapVisible = true; this.mapVisible = true;
setTimeout(() => { MapLoader().then((res)=>{
// //
this.getMap(); this.getMap();
}, 0); })
// setTimeout(() => {
// //
// this.getMap();
// }, 0);
}, },
}, },
}; };
</script> </script>
<style scoped> <style>
.table-img { .table-img {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
@ -687,4 +727,33 @@ export default {
margin-left: 10px; margin-left: 10px;
vertical-align: bottom; vertical-align: bottom;
} }
#edui_fixedlayer{
z-index: 2021 !important;
}
.el-drawer__header span{
font-size: 16px;
}
.drawer-body{
width: 100%;
height: 100%;
}
#map{
width: 100%;
height: 80%;
}
#myPageTop {
position: absolute;
top: 5px;
right: 10px;
background: #fff none repeat scroll 0 0;
border: 1px solid #ccc;
margin: 10px auto;
padding: 6px;
font-size: 14px;
}
.amap-sug-result{position:absolute;z-index:9999;background-color:#fefefe;border:1px solid #d1d1d1;bottom:auto}
.auto-item:hover{background-color:#cae1ff}
.auto-item{white-space:nowrap;font-size:12px;cursor:pointer;padding:4px}
.auto-item-span{color:#c1c1c1;padding-left:4px}
</style> </style>

1
src/views/activitys/activitys/order.vue → src/views/activitys/order.vue

@ -139,7 +139,6 @@
<el-table-column <el-table-column
v-permission="['admin', 'activityOrder:edit', 'activityOrder:del']" v-permission="['admin', 'activityOrder:edit', 'activityOrder:del']"
label="操作" label="操作"
width="100px"
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">

0
src/views/activitys/activitys/publisher.vue → src/views/activitys/publisher.vue

35
src/views/information/articleCatetory.vue

@ -7,20 +7,17 @@
<!--表单组件--> <!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="id" prop="id"> <!-- <el-form-item label="id" prop="id">
<el-input v-model="form.id" style="width: 370px;" /> <el-input v-model="form.id" style="width: 370px;" />
</el-form-item> </el-form-item> -->
<el-form-item label="分类名称"> <el-form-item label="分类名称">
<el-input v-model="form.name" style="width: 370px;" /> <el-input v-model="form.name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="createTime"> <el-form-item label="分类icon">
<el-input v-model="form.createTime" style="width: 370px;" /> <PicUpload v-model="form.img" style="width: 220px" type="image" :num="1" :width="80" :height="80" />
</el-form-item>
<el-form-item label="updateTime">
<el-input v-model="form.updateTime" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="isDel"> <el-form-item label="分类描述">
<el-input v-model="form.isDel" style="width: 370px;" /> <el-input type="textarea" v-model="form.description"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -33,17 +30,17 @@
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" /> <el-table-column v-if="columns.visible('id')" prop="id" label="id" />
<el-table-column v-if="columns.visible('name')" prop="name" label="分类名称" /> <el-table-column v-if="columns.visible('name')" prop="name" label="分类名称" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="createTime"> <el-table-column prop="img" label="分类icon">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <img :src="scope.row.img" style="width:35px;height:35px;border-radus:50%;" alt="">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns.visible('updateTime')" prop="updateTime" label="updateTime"> <el-table-column v-if="columns.visible('description')" prop="description" label="分类描述" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建时间">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns.visible('isDel')" prop="isDel" label="isDel" />
<el-table-column v-permission="['admin','articleCatetory:edit','articleCatetory:del']" label="操作" width="150px" align="center"> <el-table-column v-permission="['admin','articleCatetory:edit','articleCatetory:del']" label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
@ -67,17 +64,21 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation' import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import MaterialList from "@/components/material"; import MaterialList from "@/components/material";
import PicUpload from "@/components/pic-upload";
// crudpresenter // crudpresenter
const defaultCrud = CRUD({ title: '资讯分类', url: 'api/articleCatetory', sort: 'id,desc', crudMethod: { ...crudArticleCatetory }}) const defaultCrud = CRUD({ title: '资讯分类', url: 'api/articleCatetory', sort: 'id,desc', crudMethod: { ...crudArticleCatetory }})
const defaultForm = { id: null, name: null, createTime: null, updateTime: null, isDel: null } const defaultForm = {
name: null,
img: '',
description: ''
}
export default { export default {
name: 'ArticleCatetory', name: 'ArticleCatetory',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList}, components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList, PicUpload},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()], mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() { data() {
return { return {
permission: { permission: {
add: ['admin', 'articleCatetory:add'], add: ['admin', 'articleCatetory:add'],
edit: ['admin', 'articleCatetory:edit'], edit: ['admin', 'articleCatetory:edit'],

20
src/views/information/form.vue

@ -31,6 +31,18 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否热门">
<el-radio-group v-model="form.isHot">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否推荐">
<el-radio-group v-model="form.isRecommend">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="收费类型" prop="chargeType"> <!-- <el-form-item label="收费类型" prop="chargeType">
<el-radio-group v-model="form.chargeType"> <el-radio-group v-model="form.chargeType">
<el-radio :label="0">免费</el-radio> <el-radio :label="0">免费</el-radio>
@ -94,6 +106,7 @@ export default {
id: '', id: '',
cids: [], cids: [],
cid: '', cid: '',
authorId:'',
categoryId:'', categoryId:'',
chargeType:0, chargeType:0,
articleCharge:'', articleCharge:'',
@ -114,7 +127,8 @@ export default {
hide: '', hide: '',
merId: '', merId: '',
productId: '', productId: '',
isHot: '', isHot: 0,
isRecommend: 0,
isBanner: '' isBanner: ''
}, },
rules: { rules: {
@ -252,7 +266,7 @@ export default {
this.loading = false this.loading = false
// this.$parent.init() // this.$parent.init()
setTimeout(() => { setTimeout(() => {
this.$router.push({ path: '/wechat/wearticle' }); this.$router.push({ path: '/information/index' });
}, 500); }, 500);
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
@ -270,7 +284,7 @@ export default {
this.loading = false this.loading = false
// this.$parent.init() // this.$parent.init()
setTimeout(() => { setTimeout(() => {
this.$router.push({ path: '/article/index' }); this.$router.push({ path: '/information/index' });
}, 500); }, 500);
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false

29
src/views/information/index.vue

@ -4,17 +4,14 @@
<div class="head-container"> <div class="head-container">
<!-- 新增 --> <!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;"> <div style="display: inline-block;margin: 0px 2px;">
<router-link :to="'/information/form'">
<el-button <el-button
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_CREATE']" v-permission="['admin','YXARTICLE_ALL','YXARTICLE_CREATE']"
class="filter-item" class="filter-item"
size="mini" size="mini"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"> 新增</el-button>
> </router-link>
<router-link :to="'/information/form'">
新增
</router-link>
</el-button>
</div> </div>
</div> </div>
<!--表单组件--> <!--表单组件-->
@ -29,6 +26,18 @@
<a :href="scope.row.imageInput" style="color: #42b983" target="_blank"><img :src="scope.row.imageInput" alt="点击打开" class="el-avatar"></a> <a :href="scope.row.imageInput" style="color: #42b983" target="_blank"><img :src="scope.row.imageInput" alt="点击打开" class="el-avatar"></a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="是否热门">
<template slot-scope="scope">
<el-tag type="info" v-if="scope.row.isHot == 0"></el-tag>
<el-tag type="success" v-if="scope.row.isHot == 1"></el-tag>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="是否推荐">
<template slot-scope="scope">
<el-tag type="info" v-if="scope.row.isRecommend == 0"></el-tag>
<el-tag type="success" v-if="scope.row.isRecommend == 1"></el-tag>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期"> <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime }}</span> <span>{{ scope.row.createTime }}</span>
@ -54,9 +63,9 @@
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button> <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button> <el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div> </div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" /> <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover> </el-popover>
<el-popover <!-- <el-popover
:ref="'item'+scope.row.id" :ref="'item'+scope.row.id"
v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']" v-permission="['admin','YXARTICLE_ALL','YXARTICLE_DELETE']"
placement="top" placement="top"
@ -68,7 +77,7 @@
<el-button :loading="delLoading" type="primary" size="mini" @click="subPublish(scope.row.id)">确定</el-button> <el-button :loading="delLoading" type="primary" size="mini" @click="subPublish(scope.row.id)">确定</el-button>
</div> </div>
<el-button slot="reference" type="primary" size="mini">发布</el-button> <el-button slot="reference" type="primary" size="mini">发布</el-button>
</el-popover> </el-popover> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -158,6 +167,7 @@ export default {
_this.form = { _this.form = {
id: data.id, id: data.id,
cid: data.cid, cid: data.cid,
authorId: data.authorId,
title: data.level, title: data.level,
title: data.title, title: data.title,
author: data.author, author: data.author,
@ -177,6 +187,7 @@ export default {
merId: data.merId, merId: data.merId,
productId: data.productId, productId: data.productId,
isHot: data.isHot, isHot: data.isHot,
isRecommend: data.isRecommend,
isBanner: data.isBanner isBanner: data.isBanner
} }
_this.dialog = true _this.dialog = true

27
src/views/shop/demandHall/authentication.vue

@ -58,8 +58,17 @@
<el-table-column prop="bankAccount" label="对公银行账号" width="100" /> <el-table-column prop="bankAccount" label="对公银行账号" width="100" />
<el-table-column prop="bankName" label="银行名称" /> <el-table-column prop="bankName" label="银行名称" />
<el-table-column prop="bankBranch" label="开户网点" /> <el-table-column prop="bankBranch" label="开户网点" />
<el-table-column prop="legalPersonName" label="法人姓名" /> <el-table-column header-align="center" align="center" prop="prop" label="法人信息" >
<el-table-column prop="legalPersonIdcard" label="身份证号" /> <template slot-scope="scope">
<el-tooltip class="item" effect="dark" placement="top-start">
<div slot="content">姓名{{scope.row.legalPersonName}}<br/>身份证号{{scope.row.legalPersonIdcard}}</div>
<div>{{scope.row.legalPersonName}}</div>
</el-tooltip>
</template>
</el-table-column>
<!-- <el-table-column prop="legalPersonName" label="法人姓名" />
<el-table-column prop="legalPersonIdcard" label="身份证号" /> -->
<!-- <el-table-column prop="idcardPicFront" label="身份证正面"> <!-- <el-table-column prop="idcardPicFront" label="身份证正面">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="scope.row.idcardPicFront" style="color: #42b983" target="_blank"> <a :href="scope.row.idcardPicFront" style="color: #42b983" target="_blank">
@ -86,14 +95,16 @@
<el-tag type="info" v-if="scope.row.authenticationState == 0">未认证</el-tag> <el-tag type="info" v-if="scope.row.authenticationState == 0">未认证</el-tag>
<el-tag type="" v-if="scope.row.authenticationState == 1">待审核</el-tag> <el-tag type="" v-if="scope.row.authenticationState == 1">待审核</el-tag>
<el-tag type="success" v-if="scope.row.authenticationState == 2">认证通过</el-tag> <el-tag type="success" v-if="scope.row.authenticationState == 2">认证通过</el-tag>
<el-tag type="danger" v-if="scope.row.authenticationState == 3">认证失败</el-tag> <el-tooltip class="item" effect="dark" :content="scope.row.reason" placement="top-start">
<el-tag type="danger" v-if="scope.row.authenticationState == 3">认证失败</el-tag>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="reason" label="认证失败原因" width="100"> <!-- <el-table-column prop="reason" label="认证失败原因" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.authenticationState == 3">{{scope.row.reason}}</span> <span v-if="scope.row.authenticationState == 3">{{scope.row.reason}}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="操作" width="150px" align="center"> <el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" @click="showDialog(scope.row)">审核</el-button> <el-button type="primary" @click="showDialog(scope.row)">审核</el-button>
@ -147,11 +158,11 @@ export default {
authenticationState: null, authenticationState: null,
typeOptions:[ typeOptions:[
{ {
value: 1, value: 2,
label: '个人' label: '个人'
}, },
{ {
value: 2, value: 1,
label: '企业' label: '企业'
} }
], ],
@ -175,7 +186,7 @@ export default {
reason:'' reason:''
}, },
page: 1, page: 1,
size: 1, size: 10,
total: 0 total: 0
} }
}, },

92
src/views/shop/goods/form.vue

@ -5,12 +5,12 @@
<el-row :gutter="24"> <el-row :gutter="24">
<!-- 商品信息--> <!-- 商品信息-->
<el-col v-bind="grid2"> <el-col v-bind="grid2">
<el-form-item label="商品名称" prop="store_name"> <el-form-item label="商品名称:" prop="store_name">
<el-input v-model="formValidate.store_name" placeholder="请输入商品名称" /> <el-input v-model="formValidate.store_name" placeholder="请输入商品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col v-bind="grid2"> <!-- <el-col v-bind="grid2">
<el-form-item label="商品分类" prop="cate_id"> <el-form-item label="商品分类:" prop="cate_id">
<el-select v-model="formValidate.cate_id" filterable :filter-method="dataFilter" clearable> <el-select v-model="formValidate.cate_id" filterable :filter-method="dataFilter" clearable>
<el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0" <el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0"
:value="item.value" :key="item.id" :label="item.label" ></el-option> :value="item.value" :key="item.id" :label="item.label" ></el-option>
@ -18,37 +18,57 @@
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col v-bind="grid2"> <el-col v-bind="grid2">
<el-form-item label="商品关键字" prop=""> <el-form-item label="商品关键字:" prop="">
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" /> <el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid2"> <el-col v-bind="grid2">
<el-form-item label="单位" prop="unit_name"> <el-form-item label="单位:" prop="unit_name">
<el-input v-model="formValidate.unit_name" placeholder="请输入单位" /> <el-input v-model="formValidate.unit_name" placeholder="请输入单位" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid2"> <el-col v-bind="grid2">
<el-form-item label="商品简介" prop=""> <el-form-item label="商品简介:" prop="">
<el-input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介" /> <el-input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid2">
<el-form-item label="虚拟商品" >
<el-radio-group v-model="formValidate.isFake" @change="fakeChange">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid2" v-if="formValidate.isFake == 1">
<el-form-item label="选择虚拟商品" >
<el-select v-model="formValidate.virtualProductId" placeholder="请选择虚拟商品" style="width:300px;">
<el-option
v-for="item in fakeList"
:key="item.product_id"
:label="item.product_name"
:value="item.product_id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品视频:" prop="video"> <el-form-item label="商品视频:" prop="video">
<single-video v-model="formValidate.video" type="video" :num="1" :width="320" :height="240" /> <single-video v-model="formValidate.video" type="video" :num="1" :width="320" :height="240" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品封面图:" prop="image"> <el-form-item label="商品封面图:" prop="image">
<single-pic v-model="formValidate.image" type="image" :num="1" :width="150" :height="150" /> <single-pic v-model="formValidate.image" type="image" :num="1" :width="150" :height="150" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品轮播图:" prop="slider_image"> <el-form-item label="商品轮播图:" prop="slider_image">
<MaterialList v-model="formValidate.slider_image" type="image" :num="4" :width="150" :height="150" /> <MaterialList v-model="formValidate.slider_image" type="image" :num="4" :width="150" :height="150" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品规格:" props="spec_type"> <el-form-item label="商品规格:" props="spec_type">
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec"> <el-radio-group v-model="formValidate.spec_type" @change="changeSpec">
<el-radio :label="0" class="radio">单规格</el-radio> <el-radio :label="0" class="radio">单规格</el-radio>
<el-radio :label="1">多规格{{formValidate.spec_typ}}</el-radio> <el-radio :label="1">多规格{{formValidate.spec_typ}}</el-radio>
@ -58,7 +78,7 @@
<!-- 多规格添加--> <!-- 多规格添加-->
<el-col :span="24" v-if="formValidate.spec_type === 1" class="noForm"> <el-col :span="24" v-if="formValidate.spec_type === 1" class="noForm">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="选择规格" prop=""> <el-form-item label="选择规格:" prop="">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<el-select v-model="formValidate.selectRule" style="width: 23%;"> <el-select v-model="formValidate.selectRule" style="width: 23%;">
<el-option v-for="(item, index) in ruleList" :value="item.ruleName" :key="index">{{ item.ruleName }}</el-option> <el-option v-for="(item, index) in ruleList" :value="item.ruleName" :key="index">{{ item.ruleName }}</el-option>
@ -91,12 +111,12 @@
</el-col> </el-col>
<el-col :span="24" v-if="showIput"> <el-col :span="24" v-if="showIput">
<el-col :xl="6" :lg="9" :md="10" :sm="24" :xs="24" > <el-col :xl="6" :lg="9" :md="10" :sm="24" :xs="24" >
<el-form-item label="规格"> <el-form-item label="规格:">
<el-input placeholder="请输入规格" v-model="formDynamic.attrsName" /> <el-input placeholder="请输入规格" v-model="formDynamic.attrsName" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xl="6" :lg="9" :md="10" :sm="24" :xs="24"> <el-col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
<el-form-item label="规格值"> <el-form-item label="规格值:">
<el-input v-model="formDynamic.attrsVal" placeholder="请输入规格值" /> <el-input v-model="formDynamic.attrsVal" placeholder="请输入规格值" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -111,7 +131,7 @@
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0"> <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
<!-- 多规格表格--> <!-- 多规格表格-->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品属性" class="labeltop"> <el-form-item label="商品属性:" class="labeltop">
<el-table :data="manyFormValidate" size="small" style="width: 90%;"> <el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index" :label="item.title" :property="item.slot" align="center"> <el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index" :label="item.title" :property="item.slot" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -193,7 +213,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运费模板" prop="temp_id"> <el-form-item label="运费模板:" prop="temp_id">
<div class="acea-row"> <div class="acea-row">
<el-select v-model="formValidate.temp_id" class="mr20"> <el-select v-model="formValidate.temp_id" class="mr20">
<el-option v-for="(item,index) in templateList" :value="item.id" :key="item.id" :label="item.name"> <el-option v-for="(item,index) in templateList" :value="item.id" :key="item.id" :label="item.name">
@ -205,29 +225,29 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="商品详情"> <el-form-item label="商品详情:">
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap> <ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="虚拟销量"> <el-form-item label="虚拟销量:">
<el-input-number :min="0" v-model="formValidate.ficti" placeholder="请输入虚拟销量" /> <el-input-number :min="0" v-model="formValidate.ficti" placeholder="请输入虚拟销量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="积分"> <el-form-item label="积分:">
<el-input-number v-model="formValidate.give_integral" :min="0" placeholder="请输入积分" /> <el-input-number v-model="formValidate.give_integral" :min="0" placeholder="请输入积分" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="排序"> <el-form-item label="排序:">
<el-input-number :min="0" v-model="formValidate.sort" placeholder="请输入排序" /> <el-input-number :min="0" v-model="formValidate.sort" placeholder="请输入排序" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="24"> <!-- <el-col :span="24">
<el-form-item label="佣金设置"> <el-form-item label="佣金设置:">
<el-radio-group v-model="formValidate.is_sub"> <el-radio-group v-model="formValidate.is_sub">
<el-radio :label="1" class="radio">单独设置</el-radio> <el-radio :label="1" class="radio">单独设置</el-radio>
<el-radio :label="0">默认设置</el-radio> <el-radio :label="0">默认设置</el-radio>
@ -236,7 +256,7 @@
</el-col> --> </el-col> -->
<el-col :span="24" v-if="formValidate.is_sub === 1"> <el-col :span="24" v-if="formValidate.is_sub === 1">
<!--单规格返佣--> <!--单规格返佣-->
<el-form-item label="商品属性" v-if="formValidate.spec_type === 0"> <el-form-item label="商品属性:" v-if="formValidate.spec_type === 0">
<el-table :data="oneFormValidate" size="small" style="width: 90%;"> <el-table :data="oneFormValidate" size="small" style="width: 90%;">
<el-table-column prop="imageArr" label="图片" align="center"> <el-table-column prop="imageArr" label="图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -266,7 +286,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="商品属性" v-if="formValidate.spec_type === 1 && manyFormValidate.length"> <el-form-item label="商品属性:" v-if="formValidate.spec_type === 1 && manyFormValidate.length">
<el-table :data="manyFormValidate" size="small" style="width: 90%;"> <el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column prop="imageArr" label="图片" align="center"> <el-table-column prop="imageArr" label="图片" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -298,7 +318,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="商品状态"> <el-form-item label="商品状态:">
<el-radio-group v-model="formValidate.is_show" > <el-radio-group v-model="formValidate.is_show" >
<el-radio :label="1" class="radio">上架</el-radio> <el-radio :label="1" class="radio">上架</el-radio>
<el-radio :label="0">下架</el-radio> <el-radio :label="0">下架</el-radio>
@ -306,7 +326,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col v-bind="grid"> <!-- <el-col v-bind="grid">
<el-form-item label="热卖单品"> <el-form-item label="热卖单品:">
<el-radio-group v-model="formValidate.is_hot" > <el-radio-group v-model="formValidate.is_hot" >
<el-radio :label="1" class="radio">开启</el-radio> <el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
@ -314,7 +334,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="猜你喜欢"> <el-form-item label="猜你喜欢:">
<el-radio-group v-model="formValidate.is_benefit" > <el-radio-group v-model="formValidate.is_benefit" >
<el-radio :label="1" class="radio">开启</el-radio> <el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
@ -322,7 +342,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="精品推荐"> <el-form-item label="精品推荐:">
<el-radio-group v-model="formValidate.is_best" > <el-radio-group v-model="formValidate.is_best" >
<el-radio :label="1" class="radio">开启</el-radio> <el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
@ -330,7 +350,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-bind="grid"> <el-col v-bind="grid">
<el-form-item label="首发新品"> <el-form-item label="首发新品:">
<el-radio-group v-model="formValidate.is_new" > <el-radio-group v-model="formValidate.is_new" >
<el-radio :label="1" class="radio">开启</el-radio> <el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
@ -348,7 +368,7 @@
<script> <script>
import { getCates } from '@/api/yxStoreCategory' import { getCates } from '@/api/yxStoreCategory'
import { add, edit, getInfo, isFormatAttr, getStore } from '@/api/yxStoreProduct' import { add, edit, getInfo, isFormatAttr, getStore, getVirtualPorducts } from '@/api/yxStoreProduct'
import editor from '../../components/Editor' import editor from '../../components/Editor'
import picUpload from '@/components/pic-upload' import picUpload from '@/components/pic-upload'
import mulpicUpload from '@/components/mul-pic-upload' import mulpicUpload from '@/components/mul-pic-upload'
@ -409,7 +429,10 @@ export default {
serverUrl: '' serverUrl: ''
}, },
columns: [], columns: [],
fakeList: [],
formValidate: { formValidate: {
isFake: 0,
virtualProductId: null,
imageArr:[], imageArr:[],
sliderImageArr: [], sliderImageArr: [],
store_name: '', store_name: '',
@ -541,9 +564,21 @@ export default {
}, },
mounted () { mounted () {
this.getInfo(); this.getInfo();
this.getStore() this.getStore();
this.getVirtualPorducts()
}, },
methods: { methods: {
//
getVirtualPorducts(){
getVirtualPorducts().then((res)=>{
console.log(res)
this.fakeList = res
})
},
//
fakeChange(val){
console.log(val)
},
getStore(){ getStore(){
getStore().then((res)=>{ getStore().then((res)=>{
this.memberList = res this.memberList = res
@ -688,6 +723,7 @@ export default {
let cate_id = parseInt(data.cate_id) || 0; let cate_id = parseInt(data.cate_id) || 0;
this.attrs = data.items || []; this.attrs = data.items || [];
that.formValidate = data; that.formValidate = data;
that.formValidate.isFake = data.virtualProductId ? 1 : 0
that.merId = data.merId == 0 ? 1 : data.merId + ''; that.merId = data.merId == 0 ? 1 : data.merId + '';
that.formValidate.cate_id = cate_id; that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr]; that.oneFormValidate = [data.attr];

275
src/views/shop/projectManage/index.vue

@ -0,0 +1,275 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="50%">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="项目归属" prop="enterpriseId">
<el-select v-model="form.enterpriseId" placeholder="">
<el-option
v-for="item in enterprisesList"
:key="item.id"
:label="item.enterpriseName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="项目类型">
<el-radio-group v-model="form.resourceType">
<el-radio :label="1">供应</el-radio>
<el-radio :label="2">需求</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="标题" prop="title">
<el-input v-model="form.title" style="width: 370px;" />
</el-form-item>
<el-form-item label="资源类型" prop="resourceCagetoryId">
<!-- <el-cascader
v-model="form.resourceCagetoryId"
:options="resourceTypeList"
placeholder=""
:props="{ checkStrictly: true }"
:show-all-levels="false">
</el-cascader> -->
<Treeselect
v-model="form.resourceCagetoryId"
:options="resourceTypeList"
style="width: 370px"
placeholder="选择资源类型">
</Treeselect>
</el-form-item>
<el-form-item label="项目展示图片">
<MaterialList v-model="form.resourceImgs" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<el-form-item label="资金需求" prop="capital">
<el-input v-model="form.capital" style="width: 370px;" />
</el-form-item>
<el-form-item label="详细描述" prop="detailedDescription">
<el-input
type="textarea"
v-model="form.detailedDescription"
placeholder=""
style="width: 370px;"
>
</el-input>
</el-form-item>
<el-form-item label="展示开始时间" prop="resourceStartTime">
<el-date-picker
v-model="form.resourceStartTime"
type="date"
placeholder="选择日期"
style="width: 370px;">
</el-date-picker>
</el-form-item>
<el-form-item label="展示结束时间" prop="resourceEndTime">
<el-date-picker
v-model="form.resourceEndTime"
type="date"
placeholder="选择日期"
style="width: 370px;">
</el-date-picker>
</el-form-item>
</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>
</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-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" />
<el-table-column v-if="columns.visible('resourceType')" prop="resourceType" label="项目类型">
<template slot-scope="scope">
<span>{{scope.row.resourceType == 1? '供应' : '需求' }}</span>
</template>
</el-table-column>
<!-- <el-table-column v-if="columns.visible('createUserId')" prop="createUserId" label="项目归属" /> -->
<el-table-column v-if="columns.visible('title')" prop="title" label="标题" />
<!-- <el-table-column v-if="columns.visible('resourceCagetoryId')" prop="resourceCagetoryId" label="资源类型id" /> -->
<el-table-column v-if="columns.visible('capital')" prop="capital" label="资金需求" />
<el-table-column v-if="columns.visible('detailedDescription')" prop="detailedDescription" label="详细描述" width="200px">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.detailedDescription" placement="top">
<p style="width:100%;overflow:hidden;white-space: nowrap;text-overflow:ellipsis;">{{scope.row.detailedDescription}}</p>
</el-tooltip>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('resourceStartTime')" prop="resourceStartTime" label="展示开始时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.resourceStartTime).split(' ')[0] }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('resourceEndTime')" prop="resourceEndTime" label="展示结束时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.resourceEndTime).split(' ')[0] }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('resourceAuditState')" prop="resourceAuditState" label="资源审核状态">
<template slot-scope="scope">
<el-tag type="info" v-if="scope.row.resourceAuditState == 0">未提交</el-tag>
<el-tag v-if="scope.row.resourceAuditState == 1">审核中</el-tag>
<el-tag type="success" v-if="scope.row.resourceAuditState == 2">审核通过</el-tag>
<el-tag type="danger" v-if="scope.row.resourceAuditState == 3">审核不通过</el-tag>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('resourceState')" prop="resourceState" label="资源状态">
<template slot-scope="scope">
<el-tag type="info" v-if="scope.row.resourceState == 0">未开始</el-tag>
<el-tag v-if="scope.row.resourceState == 1">展示中</el-tag>
<el-tag type="success" v-if="scope.row.resourceState == 2">已结束</el-tag>
</template>
</el-table-column>
<el-table-column v-permission="['admin','Resources:edit','Resources:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudResources from '@/api/Resources'
import crudResourcesCagetory from '@/api/ResourcesCagetory'
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 MaterialList from "@/components/material";
import MulPicUpload from "@/components/mul-pic-upload";
import { initData } from "@/api/data"
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
// crudpresenter
const defaultCrud = CRUD({ title: '企业资源', url: 'api/Resources', sort: 'id,desc', crudMethod: { ...crudResources }})
const defaultForm = {
resourceType: 1,
createUserId: null,
title: null,
resourceImgs: [],
enterpriseId: '',
resourceCagetoryId: null,
capital: null,
detailedDescription: null,
resourceStartTime: null,
resourceEndTime: null,
}
export default {
name: 'Resources',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList, MulPicUpload, Treeselect},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'Resources:add'],
edit: ['admin', 'Resources:edit'],
del: ['admin', 'Resources:del']
},
resourceTypeList: [],
enterprisesList: [],
rules: {
title: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
],
enterpriseId:[
{ required: true, message: '请选择项目归属'},
],
resourceTypeList: [
{ required: true, message: '请选择资源类型'},
],
capital: [
{ required: true, message: '请输入资金需求', trigger: 'blur' },
],
detailedDescription: [
{ required: true, message: '请输入详情描述', trigger: 'blur' },
],
resourceStartTime: [
{ required: true, message: '请输入展示开始时间', trigger: 'blur' },
],
resourceEndTime: [
{ required: true, message: '请输入展示结束时间', trigger: 'blur' },
],
}
}
},
watch: {
},
mounted(){
this.getResourcesCagetory()
this.getEnterprises()
},
methods: {
//
getResourcesCagetory(){
initData('/api/ResourcesCagetory',{
page: 1,
size: 100,
sort: ['id,desc'],
}).then((res)=>{
this.resourceTypeList = this.setChild(res.content)
console.log(this.resourceTypeList)
})
},
setChild(arr){
arr.forEach(item=>{
item.label = item.cagetoryName
item.value = item.id
item.children = item.categoryList
if(item.categoryList && item.categoryList.length > 0){
this.setChild(item.categoryList)
}
})
return arr
},
//
getEnterprises(){
initData('/api/Enterprise/listEnterprises',{
page: 1,
size: 100,
sort: ['id,desc'],
}).then((res)=>{
console.log(res)
this.enterprisesList = res
})
},
//
[CRUD.HOOK.beforeRefresh]() {
return true
}, //
[CRUD.HOOK.afterToCU](crud, form) {
},
}
}
</script>
<style scoped>
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
</style>
Loading…
Cancel
Save