|
|
@ -62,7 +62,7 @@ |
|
|
|
placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true" |
|
|
|
popper-class="custom-popover" @show="popshow" > |
|
|
|
<div style="text-align: center"> |
|
|
|
<GuipInput ref="GuipInput" width="252px" v-model="row.edit_sort_id" label="排序" placeholder="请输入数字"></GuipInput> |
|
|
|
<GuipInput ref="GuipInput" width="252px" v-model="row.sort_id" label="排序" placeholder="请输入数字"></GuipInput> |
|
|
|
<p style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">输入>0的数,越小排序越前;重复则新者优先;0则默认排序</p> |
|
|
|
<div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;"> |
|
|
|
<GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton> |
|
|
@ -102,16 +102,18 @@ |
|
|
|
<el-table-column prop="sort_id" label="上首页"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="flex cell_render"> |
|
|
|
<GuipSwitch :modelValue="scope.row.is_index_display" active-value="1" inactive-value="0" @change="onSwitchChange(scope.row)"></GuipSwitch> |
|
|
|
<GuipSwitch v-model="scope.row.is_index_display" active-value="1" inactive-value="0" @change="onSwitchChange(scope.row)"></GuipSwitch> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" fixed="right" min-width="150px"> |
|
|
|
<div class="flex"> |
|
|
|
<el-button type="text">编辑</el-button> |
|
|
|
<el-button type="text">删除</el-button> |
|
|
|
</div> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="flex"> |
|
|
|
<el-link :href="serviceEditUrl+'?uid='+siteInfo.uid+'&type='+scope.row.type" target="_blank" type="text">编辑</el-link> |
|
|
|
<el-button type="text" @click="handleDelClick(scope.row, scope.$index)">删除</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</GuipTable> |
|
|
|
|
|
|
@ -125,14 +127,19 @@ |
|
|
|
<PromptText text='按住左侧图标,上下拖动可进行排序,平台卡券只能放到最后。' :type="1" class="mb24 mt12"/> |
|
|
|
<PaymentMethod :paymentList="payList" @confirm="confirmPayment"/> |
|
|
|
</GuipDialog> |
|
|
|
|
|
|
|
<GuipDialog :dialogVisible="dialogDelConfim" title="提示" :show-close-button="false" @confirm="handleDelConfirm" |
|
|
|
@cancel="handleDelCancel"> |
|
|
|
确定要移除服务吗? |
|
|
|
</GuipDialog> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="register-btns"> |
|
|
|
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton> |
|
|
|
<div class="register-btns" v-if="!tableLoading"> |
|
|
|
<GuipButton v-if="serviceList.length===0" type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton> |
|
|
|
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="nextStep">完成</GuipButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -179,6 +186,9 @@ export default { |
|
|
|
dialogVisible: false, //是否展示弹框 |
|
|
|
dialogTitle: "", //弹框标题 |
|
|
|
editRow:{}, |
|
|
|
//删除二次确认 |
|
|
|
dialogDelConfim: false, |
|
|
|
delRow:{}, |
|
|
|
|
|
|
|
// 服务列表url |
|
|
|
serviceAddUrl: '/agent/siteAddFinally', |
|
|
@ -202,8 +212,25 @@ export default { |
|
|
|
}, |
|
|
|
nextStep(){ |
|
|
|
//保存数据 |
|
|
|
var data = { |
|
|
|
uid: this.siteInfo.uid, |
|
|
|
} |
|
|
|
|
|
|
|
this.$emit('handelStep', 4) |
|
|
|
this.$http('POST', '/agentnew/ajax_add_new_site_complete', data, { |
|
|
|
headers: { |
|
|
|
'Auth': this.token |
|
|
|
} |
|
|
|
}).then(response => { |
|
|
|
this.$nextTick(() => { |
|
|
|
if (response.status) { |
|
|
|
this.$emit('handelStep', 4) |
|
|
|
return true; |
|
|
|
} |
|
|
|
this.$Message.error(response.info); |
|
|
|
}) |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取服务列表 |
|
|
|
getSiteServiceList() { |
|
|
@ -218,9 +245,11 @@ export default { |
|
|
|
} |
|
|
|
}).then(response => { |
|
|
|
that.tableLoading = false |
|
|
|
that.$nextTick(() => { |
|
|
|
that.serviceList = response.data.service_list |
|
|
|
}) |
|
|
|
if(response.status && response.data.length>0){ |
|
|
|
that.$nextTick(() => { |
|
|
|
that.serviceList = response.data.service_list |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
@ -235,7 +264,38 @@ export default { |
|
|
|
serviceAdd(prodid){ |
|
|
|
this.$router.push(this.serviceAddUrl + '?uid=' + this.siteInfo.uid + '&prodid=' + prodid) |
|
|
|
}, |
|
|
|
|
|
|
|
//删除 |
|
|
|
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.siteInfo.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.error(response.info); |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 点击价格单元格时触发 |
|
|
|
handleEditClick(row, index, type) { |
|
|
|
// 关闭其他行的弹框 |
|
|
@ -292,13 +352,11 @@ export default { |
|
|
|
if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num); |
|
|
|
}, |
|
|
|
async onSwitchChange(row){ |
|
|
|
console.log(row) |
|
|
|
let obj = {} |
|
|
|
obj.uid = this.siteInfo.uid |
|
|
|
obj.type = row.type |
|
|
|
obj.is_index_display = row.is_index_display |
|
|
|
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj) |
|
|
|
console.log(res) |
|
|
|
if(!res) row.is_index_display = row.is_index_display === "1" ? "0" : "1" |
|
|
|
}, |
|
|
|
async saveSort(row){ |
|
|
@ -308,8 +366,9 @@ export default { |
|
|
|
obj.sort_id = row.sort_id |
|
|
|
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj) |
|
|
|
if(res) { |
|
|
|
row.sort_id = row.edit_sort_id; |
|
|
|
this.sortServiceList() |
|
|
|
}else{ |
|
|
|
this.getSiteServiceList() |
|
|
|
} |
|
|
|
}, |
|
|
|
sortServiceList() { |
|
|
|