Browse Source

Merge branch 'master' of gitea.intra.yunpaper.com:zhangqi/kuailelunwen_new_houtai into zq-qrcode-0702

pull/70/head
zq 4 days ago
parent
commit
d6e67c3cc5
  1. 9176
      package-lock.json
  2. 1
      package.json
  3. 1
      src/assets/site/form_close.svg
  4. 1
      src/assets/site/open_success.svg
  5. 1
      src/assets/site/open_success_menu.svg
  6. 5
      src/components/GuipRadio.vue
  7. 2
      src/components/GuipSwitch.vue
  8. 91
      src/components/paymentMethod.vue
  9. 13
      src/views/Register.vue
  10. 319
      src/views/agent/siteServiceAdd.vue
  11. 254
      src/views/agent/siteServiceList.vue

9176
package-lock.json

File diff suppressed because it is too large

1
package.json

@ -17,6 +17,7 @@
"vue": "^2.6.14",
"vue-clickaway": "^2.2.2",
"vue-router": "^3.5.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2"
},
"devDependencies": {

1
src/assets/site/form_close.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.9 KiB

1
src/assets/site/open_success.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g><rect x="0" y="0" width="16" height="16" rx="8" fill="#00C261" fill-opacity="1"/></g><g><g><path d="M10.955277385177613,5.969208108535766L10.577137385177611,5.651911108535766C10.368257385177612,5.476809108535766,10.056967385177613,5.5040010085357665,9.881597385177614,5.712668108535767L7.219187385177612,8.883847108535766L6.016827385177613,7.848977108535767C5.8134663851776125,7.673937108535767,5.507526385177612,7.693407108535767,5.327981385177612,7.8928071085357665L4.996776385177612,8.260647108535768C4.994662385177612,8.262997108535767,4.9925723851776125,8.265367108535767,4.990504385177612,8.267747108535767C4.812006185177612,8.473817108535766,4.834351685177612,8.785557108535766,5.040414385177613,8.964057108535766L7.004127385177613,10.665087108535767C7.006667385177613,10.667287108535767,7.009227385177612,10.669467108535766,7.011817385177612,10.671617108535767C7.221487385177612,10.845867108535767,7.532717385177612,10.817157108535767,7.706957385177612,10.607487108535768L7.831547385177613,10.457577108535766L11.016017385177612,6.664557108535766L11.016207385177612,6.664537108535766C11.191447385177613,6.455699108535766,11.164207385177612,6.144346108535767,10.955277385177613,5.969208108535766Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

1
src/assets/site/open_success_menu.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20" height="14" viewBox="0 0 20 14"><g><rect x="0" y="0" width="20" height="14" rx="7" fill="#00C261" fill-opacity="1"/><g><path d="M13.5388,5.123347472229004Q13.612210000000001,5.031587472229004,13.6511,4.920702472229004Q13.690000000000001,4.809817472229004,13.690000000000001,4.692307472229004Q13.690000000000001,4.6243483722290035,13.676739999999999,4.557695472229004Q13.66348,4.4910414722290035,13.63748,4.4282554722290035Q13.61147,4.365470472229004,13.57371,4.308964472229004Q13.53596,4.252458472229004,13.4879,4.204403472229004Q13.43985,4.156349472229004,13.38334,4.118593472229004Q13.32684,4.080837472229004,13.264050000000001,4.054830472229004Q13.201260000000001,4.0288234722290035,13.13461,4.015565472229004Q13.06796,4.002307472229004,13,4.002307472229004Q12.84279,4.002307472229004,12.7011,4.070408472229004Q12.55941,4.1385094722290034,12.4612,4.261268472229004L12.459399999999999,4.259826472229004L9.19957,8.334607472229004L7.432481,6.920937472229004L7.43104,6.922737472229004Q7.3392800000000005,6.849327472229004,7.228395,6.810437472229004Q7.11751,6.771537472229004,7,6.771537472229004Q6.9320409,6.771537472229004,6.865388,6.784797472229004Q6.798734,6.798057472229004,6.735948,6.824057472229004Q6.673163,6.850067472229004,6.616657,6.887827472229004Q6.560151,6.925577472229004,6.512096,6.973637472229004Q6.464042,7.021687472229004,6.426286,7.078197472229004Q6.38853,7.1346974722290035,6.362523,7.197487472229004Q6.336516,7.260277472229004,6.323258,7.326927472229004Q6.3100000000000005,7.393577472229004,6.3100000000000005,7.461537472229004Q6.3100000000000005,7.618747472229003,6.378101,7.760437472229004Q6.4462019999999995,7.9021274722290045,6.56896,8.000337472229004L6.567519,8.002137472229004L8.87521,9.848297472229003Q8.98274,9.934317472229004,9.11501,9.972647472229003Q9.24728,10.010977472229005,9.38414,9.995767472229005Q9.52101,9.980557472229004,9.64164,9.914127472229005Q9.762270000000001,9.847707472229004,9.84829,9.740177472229004L13.540600000000001,5.124788472229004L13.5388,5.123347472229004Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

5
src/components/GuipRadio.vue

@ -12,10 +12,7 @@
:key="option.value"
:label="option.value"
:disabled="option.disabled"
>
<!-- 默认展示和选中显示 不同文案 -->
{{( selectedValue === option.value ) ? (option.selectedLabel ? option.selectedLabel : option.label) :option.label }}
</el-radio>
>{{( selectedValue === option.value ) ? (option.selectedLabel ? option.selectedLabel : option.label) :option.label }}</el-radio>
</el-radio-group>
</el-form-item>
</template>

2
src/components/GuipSwitch.vue

@ -81,7 +81,7 @@ export default {
this.loading = true;
try {
//
await new Promise((resolve) => setTimeout(resolve, 1000));
await new Promise((resolve) => setTimeout(resolve, 100));
this.internalValue = value;
this.$emit('update:modelValue', value);
this.$emit('change', value);

91
src/components/paymentMethod.vue

@ -1,47 +1,85 @@
<template>
<div class="payment-wrap">
<div class="payment-item" v-for="item in paymentList" :key="item.name">
<dl>
<dt>
<img v-if="item.type == '1'" src="@/assets/register/weixin_pay.png" alt="">
<img v-if="item.type == '2'" src="@/assets/register/zhifubao_pay.png" alt="">
<img v-if="item.type == '3'" src="@/assets/register/taobao_pay.png" alt="">
<img v-if="item.type == '4'" src="@/assets/register/jingdong_pay.png" alt="">
</dt>
<dd>
<p>{{ item.name }}</p>
<p>{{ item.num }}</p>
</dd>
</dl>
<GuipSwitch :modelValue="item.flag" activeText="开启" inactiveText="关闭" @change="onSwitchChange">
</GuipSwitch>
</div>
<draggable v-model="list" @start="drag=true" @end="onEnd" :move="checkMove" handle=".drag-handle" >
<div class="payment-item" v-for="item in list" :key="item.name">
<dl>
<dt class="drag-handle">
<img v-if="item.pay_type == '1'" src="@/assets/register/jingdong_pay.png" alt="">
<img v-if="item.pay_type == '2'" src="@/assets/register/weixin_pay.png" alt="">
<img v-if="item.pay_type == '3'" src="@/assets/register/zhifubao_pay.png" alt="">
<img v-if="item.pay_type == '4'" src="@/assets/register/taobao_pay.png" alt="">
</dt>
<dd>
<p>{{ item.name }}</p>
<p>{{ item.account }}</p>
</dd>
</dl>
<el-form>
<GuipSwitch :modelValue="item.status" active-value="1" inactive-value="0" activeText="开启" inactiveText="关闭" @change="onSwitchChange(item)">
</GuipSwitch>
</el-form>
</div>
</draggable>
</div>
</template>
<script>
import GuipSwitch from '@/components/GuipSwitch.vue';
import draggable from 'vuedraggable';
export default {
name: '',
props:['paymentList'],
components: {
GuipSwitch
GuipSwitch,
draggable
},
data(){
return {
payImg:{
'1':'weixin_pay.png',
'2':'zhifubao_pay.png',
'3':'taobao_pay.png',
'4':'jingdong_pay.png',
}
'1':'@/assets/register/weixin_pay.png',
'2':'@/assets/register/zhifubao_pay.png',
'3':'@/assets/register/taobao_pay.png',
'4':'@/assets/register/jingdong_pay.png',
},
list:[],
drag: false,
}
},
watch:{
paymentList: {
immediate: true,
handler(newVal) {
this.list = newVal;
},
},
},
methods:{
onSwitchChange(data){
console.log(data,'---');
data.status = data.status == "1" ? "0" : "1";
this.$emit('confirm', this.list)
},
onEnd() {
this.drag = false;
this.$emit('confirm', this.list)
},
checkMove(evt) {
//
const targetIndex = this.list.length - 1; // 1
//
// console.log(evt.relatedContext.index === evt.draggedContext.index,targetIndex === evt.draggedContext.index,'0000targetIndex00');
if ((evt.relatedContext.index === targetIndex) || (targetIndex === evt.draggedContext.index)) {
return false; //
}
return true; //
}
// onStart(event) {
// console.log(event,'event====');
// //
// const index = this.list.findIndex(item => item.id === event.draggedContext.element.id);
// // event.cancel()
// if (index === this.list.length - 1) {
// event.cancel(); //
// }
// }
}
}
</script>
@ -77,5 +115,8 @@ export default {
color: #1E2226;
}
}
.drag-handle {
cursor: move; /* 鼠标悬停时显示可拖拽光标 */
}
}
</style>

13
src/views/Register.vue

@ -479,7 +479,7 @@
</div>
</div>
<!-- 设置域名弹出框 -->
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="false"
<GuipDialog :dialogVisible="true" :title="dialogTitle" :show-close-button="false"
:show-cancel-button="showCancelButton" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
@dialogVisibleChange="dialogVisibleChange">
<PaymentMethod :paymentList="paymentList" />
@ -535,7 +535,6 @@
</div>
</el-dialog>
<Footer></Footer>
<div class="register-btns">
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpCurStep">跳过</GuipButton>
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="finishCurStep">完成</GuipButton>
@ -543,7 +542,6 @@
</div>
</template>
<script>
import Footer from '@/components/Footer.vue';
import GuipButton from '@/components/GuipButton.vue';
import GuipFormItem from '@/components/GuipFormItem.vue';
import GuipInput from '@/components/GuipInput.vue';
@ -567,7 +565,6 @@ export default {
GuipRadio,
GuipSelect,
SvgIcon,
Footer,
GuipSwitch,
GuipDialog,
PaymentMethod,
@ -772,24 +769,28 @@ export default {
type: '1',
name: '小知攻城狮',
num: '1520574481 (wx1bda8b3d08d169cb)',
flag: true
flag: true,
img:require('@/assets/register/weixin_pay.png')
},
{
type: '2',
name: '自收款',
num: 'wangyong@kuailebanshou.com',
img:require('@/assets/register/zhifubao_pay.png'),
flag: true
},
{
type: '3',
name: '店铺收款',
num: '轻歌曼舞82',
img:require('@/assets/register/taobao_pay.png'),
flag: false
},
{
type: '4',
name: '京东收款',
name: '平台检测卡',
num: 'celunwen',
img:require('@/assets/register/jingdong_pay.png'),
flag: false
},
],

319
src/views/agent/siteServiceAdd.vue

@ -1,28 +1,56 @@
<template>
<div class="main-content12">
<!-- page content -->
<div class="site-setting-wrap min-flex-right">
<div class="siteMessage flex-common" id="siteMessage1">
<h3>站点信息</h3>
<el-form>
<div class="flex-wrap">
<div class="flex-left">
<GuipInput ref="GuipInput" column="column" label="站点简称" :maxlength="10"
:showWordLimit="true" desc="一个站点对应一个销售渠道,定义好名字好区分" v-model="siteInfo.short_name"
prop="short_name" placeholder="仅自己区分站点销售渠道,客户看不到" />
<GuipInput ref="GuipInput" column="column" label="公司电话" desc="在站点首页底部“关于我们”展示"
v-model="siteInfo.phone_num" prop="company_phone" placeholder="非必填" />
<div>
<div class="warning-text">
<img class="warning-icon" src="@/assets/site/info_filled.svg" alt="">
<span>操作提示设置价格并保存即添加服务</span>
</div>
<div class="main-content12">
<!-- page content -->
<div class="flex-common" v-for="(ver_row) in serviceAddList" :key="ver_row.name">
<h3>{{ver_row.name}}</h3>
<div class="service-setting-area" :class="row.status == 1 ? 'service-setting-open' : ''" v-for="(row) in ver_row.list" :key="row.type">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="service-flex service-title">
<div class="service-title-left">
<span class="service-title-name">{{row.type_name}}</span>
<span v-if="row.status == 1" class="service-title-status">已开启</span>
<span v-if="row.status == 1" class="service-title-close">关闭服务</span>
</div>
<div class="service-title-right">
<el-checkbox v-model="row.has_base_price" @change="toggleSetBasePrice(row)">设置起售价格</el-checkbox>
</div>
</div>
<div class="service-flex">
<div class="service-info-item">
<span class="mr12">供货价格</span>
<span>{{row.supply_price}}</span>
</div>
<div class="service-info-item" v-if="row.freedom_set">
<GuipRadio label="计费方式" v-model="row.default_set" :options="methodOptions" @change="methodChange()"/>
</div>
<div class="service-info-item">
<GuipInput v-model="row.unit_price" label="售价管理" ref="GuipInput" width="180px" unit="元"></GuipInput>
<template v-if="row.default_set == 0">
<span class="mr12"></span>
<GuipInput v-model="row.unit_num" ref="GuipInput" width="180px" unit="字符"></GuipInput>
</template>
</div>
</div>
<div class="service-flex" v-if="row.has_base_price">
<div class="service-info-item">
<GuipInput v-model="row.b_unit_num" label="起售价格" ref="GuipInput" width="240px" unit="字符内"></GuipInput>
<span class="ml12 mr12">用户需支付</span>
<GuipInput v-model="row.b_unit_price" ref="GuipInput" width="240px" unit="元"></GuipInput>
<span class="service-base-remark ml12">备注超过设定字符按照正常售价收取</span>
</div>
</div>
<div class="flex-line"></div>
<div class="flex-right">
<GuipTextarea v-model="siteInfo.company_name" label="详细介绍" column="column"
prop="doctor_detail" width="100%" height="90px" placeholder="请输入描述内容"
desc="在站点首页底部“关于我们”展示" show-word-limit />
<div class="service-flex service-opt">
<GuipButton type="ignore" @click="reset">重置</GuipButton>
<GuipButton type="primary" @click="save(row)" size="medium">保存</GuipButton>
</div>
</div>
</el-form>
<GroupFormBtns @cancel="cancleUpdateSiteInfo()" @confirm="updateSiteInfo()" />
</el-form>
</div>
</div>
</div>
</div>
@ -30,167 +58,210 @@
<script>
import store from '@/store';
import { mapState } from 'vuex';
import GuipInput from '@/components/GuipInput.vue';
import GuipTextarea from '@/components/GuipTextarea.vue';
import GroupFormBtns from '@/components/GroupFormBtns.vue';
import GuipRadio from "@/components/GuipRadio.vue";
import GuipInput from "@/components/GuipInput.vue";
import GuipButton from "@/components/GuipButton.vue";
export default {
name: 'siteServiceAdd',
props: [''],
components: {
GuipButton,
GuipInput,
GuipTextarea,
GroupFormBtns
GuipRadio
},
data() {
return {
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU',
uid:0,
serviceAddList:[],
methodOptions: [],
}
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
},
created() {
if(!this.$route.query.uid) {
this.$message.error('非法请求');
this.$router.push('/agent/siteList')
}
this.uid = this.$route.query.uid;
store.commit('SET_CUSTOMIZE', true);
store.commit('SET_SLIDER_MENU', 'siteSettingData');
},
mounted() {
store.commit('SET_PAGETITLE', '基本设置');
store.commit('SET_PAGETITLE', '站点信息');
this.getSiteInfo();
this.getServiceAdd();
},
methods: {
//
getSiteInfo() {
getServiceAdd() {
const that = this
that.siteInfo = []
this.$http('POST', '/agentnew/ajax_get_site_info', {
uid: this.$route.query.uid,
this.$http('POST', '/agentnew/ajax_get_service_add', {
uid: that.uid,
prodid: that.$route.query.prodid,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
that.siteInfo = response.data
that.serviceAddList = response.data.service_add_list
store.commit('SET_BREADRIGHTTEXT', response.data.site_short_name);
that.methodOptions = Object.entries(response.data.freedom_set_method).map(([key, value]) => ({
label: value,
value: Number(key)
}));
})
}).catch(error => {
console.error(error, 'error')
})
},
toggleSetBasePrice(row){
row.has_base_price = row.has_base_price == true ? false : true;
},
methodChange(){
},
reset(){
},
save(row){
console.log(row)
const that = this
this.$http('POST', "/agentnew/ajax_set_service_price", {
uid: that.uid,
type: row.type,
unit_num: row.unit_num,
unit_price: row.unit_price,
// unit_piece: row.unit_piece,
b_unit_num: row.b_unit_num,
b_unit_price: row.b_unit_price,
// b_unit_piece: row.b_unit_piece,
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('保存成功');
return true;
}
that.$message.success(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
}
}
</script>
<style lang="scss" scoped>
.pageheader {
display: flex;
justify-content: space-between;
/* 关键属性 */
align-items: center;
margin: 16px 0px 16px 0px;
.ml12{
margin-left: 12px;
}
.pagetitle {
font-size: 18px;
font-weight: bold;
line-height: normal;
letter-spacing: 0.08em;
.mr12{
margin-right: 12px;
}
.warning-text{
margin: 0 12px;
display: flex;
align-items: center;
padding: 8px 13px;
align-self: stretch;
z-index: 1;
border-radius: 4px;
background: #FEFCE8;
border: 1px solid rgba(255, 140, 0, 0.3);
.warning-icon{
width: 16px;
height: 16px;;
margin-right: 8px;
}
span{
color: #1E2226;
margin-top: 8px;
letter-spacing: 0.08em;
font-size: 14px;
}
}
.siteMessage {
border-radius: 4px;
transition: all .5s;
border: 1px solid transparent;
.service-setting-open{
background: #F2FBED!important;
}
.combo-formItem {
::v-deep {
.form-item-bottom {
position: relative;
}
.select-trigger {
background: #F6F7FA;
border-color: transparent;
}
.service-setting-area{
padding: 24px;
background: #F6F7FA;
margin-bottom: 12px;
letter-spacing: 0.08em;
.is-open .select-trigger {
border-color: #006AFF;
}
.el-form-item{
margin: 0;
}
.el-input__inner {
border-radius: 2px 0 0 2px;
}
}
.self-drop-wrap {
position: absolute;
z-index: 1;
width: 100%;
}
.appendDrop {
height: 38px;
align-items: center;
border-radius: 0 2px 2px 0;
border: 1px solid #DFE2E6;
border-left-color: transparent;
justify-content: center;
box-sizing: border-box;
padding: 0 30px 0 12px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
&:hover {
border: 1px solid #006AFF;
}
}
}
.addStore {
margin-top: 12px;
// border-radius: 4px;
// opacity: 1;
// /* text/text_white_2 */
// border: 1px dashed #BABDC2;
// padding: 15px 20px;
// color: #626573;
// justify-content: center;
// img {
// margin-right: 12px;
// }
}
.el-checkbox{
color: #1E2226;
}
.service-flex{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
}
.site-setting-wrap {
width: 100%;
}
.service-flex:last-child{
margin-bottom: 0;
}
#siteMessage2 {
margin: 12px 0;
}
.service-title{
.domain-wrap {
.domain-item {
margin-bottom: 10px;
.service-title-left .service-title-name{
color: #1E2226;
margin-right: 24px;
}
.domain-item p:last-child {
padding-left: 23px;
color: #8A9099;
.service-title-left .service-title-status{
border-radius: 4px;
border: 1px solid rgba(0, 194, 97, 0.6);
color: #0DAF49;
padding: 2px 10px 2px 32px;
background-image: url(@/assets/site/open_success.svg);
background-repeat: no-repeat;
background-position: 10px 50%;
background-size: 16px 16px;
margin-right: 12px;
}
p {
text-align: left;
line-height: 18px;
margin-bottom: 8px;
.service-title-left .service-title-close{
color: #8A9099;
background-image: url(@/assets/site/form_close.svg);
background-repeat: no-repeat;
background-position: 0 50%;
background-size: 16px 16px;
padding: 2px 10px 2px 22px;
}
}
.domain-box {
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.service-info-item{
display: flex;
align-items: center;
}
.service-base-remark{
font-size: 12px;
color: #8A9099;
}
.service-opt{
justify-content: right;
}
}
</style>

254
src/views/agent/siteServiceList.vue

@ -10,24 +10,25 @@
<!-- page header -->
<div class="pageheader">
<div class="pageheader-left">
<el-checkbox @change="toggleAllSelection">全选</el-checkbox>
<span class="checked-text">共80条已选0条</span>
<GuipButton type="ignore" :btnstyle="btnInfostyleObj">批量删除</GuipButton>
<el-checkbox @change="toggleAllSelection" :indeterminate="isIndeterminate" v-model="selectAll">全选</el-checkbox>
<span class="checked-text">{{ serviceList.length }}已选{{ selectedCount }}</span>
<GuipButton type="ignore" :btnstyle="btnInfostyleObj" @click="handleBatchDelClick">批量删除</GuipButton>
</div>
<div class="pageheader-right">
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(1)">添加查重服务</GuipButton>
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(2)">添加写作辅助</GuipButton>
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(3)">添加AIGC</GuipButton>
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(3)">添加写作辅助</GuipButton>
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(2)">添加AIGC</GuipButton>
</div>
</div>
<!-- page content -->
<el-form>
<GuipTable :tableData="serviceList" ref="multipleTable" autoColumn="true" :loading="tableLoading">
<el-table-column label="选择" width="70" header-align="center" align="center">
<template slot-scope="scope">
<el-checkbox @change="toggleSelection(scope.row)"></el-checkbox>
<GuipTable :tableData="serviceList" ref="multipleTable" autoColumn="true" :loading="tableLoading"
@selection-change="handleSelectionChange" @select="handleSelect">
<el-table-column type="selection" width="100">
<template slot="header">
<span class="selection-header-text">选择</span>
</template>
</el-table-column>
@ -125,16 +126,19 @@
</GuipTable>
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="false"
:show-cancel-button="showCancelButton" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
@dialogVisibleChange="dialogVisibleChange">
<PaymentMethod :paymentList="payList" />
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="false" @confirm="handleConfirm"
@cancel="handleCancel">
<PaymentMethod :paymentList="payList" @confirm="confirmPayment"/>
</GuipDialog>
<GuipDialog :dialogVisible="dialogDelConfim" title="提示" :show-close-button="false" @confirm="handleDelConfirm"
@cancel="handleDelCancel">
确定要移除服务吗?
</GuipDialog>
<GuipDialog :dialogVisible="dialogBatchDelConfim" title="提示" :show-close-button="false" @confirm="handleBatchDelConfirm"
@cancel="handleBatchDelCancel">
确定要移除选中的服务吗?
</GuipDialog>
</el-form>
</div>
</div>
@ -189,17 +193,23 @@ export default {
serviceList: [],
//
payList: [],
selectedRows:[],//
selectAll: false,//
isIndeterminate: false,///
//
popoverFlag:false,
//
dialogVisible: false, //
dialogTitle: "", //
showCancelButton: true, //
showCloseButton: true, //
editRow:{},
//
//
dialogDelConfim: false,
delRow:{},
dialogBatchDelConfim: false,
delRows:[],
// url
serviceAddUrl: '/agent/siteServiceAdd',
@ -219,16 +229,18 @@ export default {
mounted() {
this.getSiteServiceList();
},
computed: {
selectedCount() {
return this.selectedRows.length;
},
},
methods: {
jumpAdd(type){
this.$router.push(this.serviceAddUrl + '?type=' + type + '&uid=' + this.uid)
jumpAdd(prodid){
this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + prodid)
},
toggleAllSelection() {
this.$refs.multipleTable.$refs.guiptable.toggleAllSelection();
},
toggleSelection(row){
console.log(row)
},
//
getSiteServiceList() {
this.tableLoading = true
@ -250,14 +262,87 @@ export default {
console.error(error, 'error')
})
},
onSwitchChange(row){
row.is_display = row.is_display == 1 ? 0 : 1
handleSelect(selection, row) {
console.log('操作的行:', row);
console.log('当前所有选中行:', selection);
},
//
handleSelectionChange(rows) {
this.selectedRows = rows;
//
const allSelected = rows.length === this.serviceList.length;
const noneSelected = rows.length === 0;
let obj = {}
obj.uid = this.uid
obj.type = row.type
obj.is_display = row.is_display
this.saveRequest('/agentnew/ajax_set_service_display_index', obj, row)
this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected;
},
//
handleBatchDelClick() {
this.dialogBatchDelConfim = true
},
handleBatchDelCancel(){
this.dialogBatchDelConfim = false
},
handleBatchDelConfirm(){
let delTypes = [];
this.selectedRows.forEach((row) => {
delTypes.push(row.type)
});
const that = this
this.dialogBatchDelConfim = false
this.$http('POST', '/agentnew/ajax_del_services', {
uid: that.uid,
types: JSON.stringify(delTypes)
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('删除成功');
that.selectedRows = [];
that.$nextTick(() => {
this.serviceList = this.serviceList.filter(row => !delTypes.includes(row.type));
})
return true;
}
that.$message.success(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
//
handleDelClick(row, index) {
this.dialogDelConfim = true
this.delRow.index = index
this.delRow.type = row.type
},
handleDelCancel(){
this.dialogDelConfim = false
},
handleDelConfirm(){
const that = this
this.dialogDelConfim = false
this.$http('POST', '/agentnew/ajax_del_service', {
uid: that.uid,
type: that.delRow.type
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('删除成功');
this.$nextTick(() => {
that.serviceList.splice(that.delRow.index, 1);
})
return true;
}
that.$message.success(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
//
handleEditClick(row, index, type) {
@ -325,6 +410,15 @@ export default {
obj.sort_num = row.sort_id
this.saveRequest('/agentnew/ajax_set_service_sort', obj, row)
},
onSwitchChange(row){
row.is_display = row.is_display == "1" ? "0" : "1"
let obj = {}
obj.uid = this.uid
obj.type = row.type
obj.is_display = row.is_display
this.saveRequest('/agentnew/ajax_set_service_display_index', obj, row)
},
saveRequest(url, obj, row){
const that = this
this.$http('POST', url, obj,{
@ -347,6 +441,7 @@ export default {
popPayMentModal(row){
this.dialogVisible = true;
this.dialogTitle = row.type_desc + '-收款方式'
this.editRow = row
this.getPayList(row.type)
},
//
@ -368,61 +463,76 @@ export default {
console.error(error, 'error')
})
},
confirmPayment(payList){
this.payList = payList
},
//
handleConfirm() {
this.$message.success('点击了确认按钮');
this.dialogVisible = false;
let obj = {}
obj.uid = this.uid
obj.type = this.editRow.type
obj.info = ""
let hasClose = false
this.payList.forEach((row) => {
if(row.status == 1) {
let value = row.pay_type
if(row.id) value += ',' + row.id
obj.info = obj.info + ';' + value;
}else{
hasClose = true
}
});
obj.info = obj.info.substr(1, obj.info.length-1);
if(hasClose) this.editRow.payment_method_desc = '自定义支付';
this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
},
//
handleCancel() {
this.$message.warning('点击了取消按钮');
this.dialogVisible = false;
},
//
handleClose() {
this.$message.info('弹框已关闭');
this.dialogVisible = false;
},
dialogVisibleChange(data) {
console.log(data, 'data098908090');
},
//
handleDelClick(row, index) {
this.dialogDelConfim = true
this.delRow.index = index
this.delRow.type = row.type
},
handleDelConfirm(){
const that = this
that.dialogDelConfim = false
this.$http('POST', '/agentnew/ajax_del_service', {
uid: that.uid,
type: that.delRow.type
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('删除成功');
this.$nextTick(() => {
that.serviceList.splice(that.delRow.index, 1);
})
return true;
}
that.$message.success(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
handleDelCancel(){
this.dialogDelConfim = false
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .custom-popover {
position: fixed !important;
// max-height: 290px;
// overflow-y: auto;
margin-top: 0 !important;
margin-left: 0 !important;
transform: none !important;
}
::v-deep .el-table__header-wrapper .el-checkbox {
display: none;
}
/* 隐藏表头的复选框 */
::v-deep .el-table__header-wrapper .el-checkbox {
display: none !important;
}
/* 确保选择文字可见 */
::v-deep .selection-header-text {
display: inline-block;
margin-left: 8px;
/* 调整位置 */
font-size: 14px;
color: #606266;
font-weight: bold;
}
/* 调整表头单元格的padding */
::v-deep .el-table .el-table__header th {
padding: 8px 0;
/* 根据需要调整 */
}
.flex-service-title{
margin-bottom: 12px;
}

Loading…
Cancel
Save