Commit ed247072 authored by 郭欢's avatar 郭欢

'修改,'

parent bc65a5c9
...@@ -23,615 +23,3 @@ export function getInfoRes (_this, cb) { ...@@ -23,615 +23,3 @@ export function getInfoRes (_this, cb) {
}) })
.catch(() => {}) .catch(() => {})
} }
/**
* 获取机构列表及选中的机构
* @param {*} _this this指向
* @param {*} cb 回调
*/
export function getSupplierRes (_this, cb) {
_this.$http.get(_this.$myApi.SUPPLIER)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 切换机构
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} cb 回调
*/
export function changeSupplierRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.CHANGE_SUPPLIER, curParams)
.then(data => {
setLocalStorage(MY_REFRESH, true)
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.$toast('切换机构失败')
_this.showPicker = false
})
}
/**
* 供应商列表
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} cb 回调
*/
export function providerRes (_this, curParams, cb) {
const params = curParams || { type: 1 }
_this.$http.get(_this.$myApi.PROVIDERLIST, params)
.then(data => {
if (data && !curParams) {
_this.supplier = data
_this.cursupplier = data[0]
}
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 商铺列表
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} cb 回调
*/
export function shopListRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.SHOPLIST, curParams)
.then(data => {
_this.list = _this.page === 1 ? data.list : _this.list.concat(data.list)
_this.page = data.page
_this.more = data.more
_this.locked = false
_this.isloading = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.locked = false
_this.isloading = false
})
}
/**
* 修改购物车数量
* @param {*} _this this指向
* @param {*} type 类型(1:采购计划;2:采购退货;3:销售退货) (curParams参数)
* @param {*} good_id 商品id (curParams参数)
* @param {*} num 商品数量 (curParams参数)
* @param {*} provider_id 供货商id(采购退货必需) (curParams参数)
* @param {*} shop_id 商铺id(销售退货必需) (curParams参数)
*/
export function cartChangeRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.CHANGECART, curParams)
.then(data => {
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.$toast('操作失败')
_this.isClick = false
})
}
/**
* 购物车列表
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} type 类型(1:采购计划购物车;2:采购退货购物车;3:销售退货购物车) (curParams参数)
* @param {*} provider_id 供货商id(采购退货必需) (curParams参数)
* @param {*} shop_id 商铺id(销售退货必需) (curParams参数)
* @param {*} cb 回调
*/
export function cartListRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.CARTLIST, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 清空购物车
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} type 类型(1:采购计划购物车;2:采购退货购物车;3:销售退货购物车) (curParams参数)
* @param {*} provider_id 供货商id(采购退货必需) (curParams参数)
* @param {*} shop_id 商铺id(销售退货必需) (curParams参数)
* @param {*} cb 回调
*/
export function cartEmptyRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.CLEARCART, curParams)
.then(data => {
_this.$toast('购物车已清空')
typeof cb === 'function' && cb()
})
.catch(() => {})
}
// //////////////////////// 采购管理 //////////////////////
/**
* 采购计划商品列表、搜索
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} type 类型(1:采购计划购物车;2:采购退货购物车;3:销售退货购物车) (curParams参数)
* @param {*} provider_id 供货商id(采购退货必需) (curParams参数)
* @param {*} shop_id 商铺id(销售退货必需) (curParams参数)
* @param {*} cb 回调
*/
export function GoodsListRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.CATEGOODS, curParams)
.then(data => {
_this.list = _this.page === 1 ? data.list : _this.list.concat(data.list)
_this.page = data.page
_this.more = data.more
_this.locked = false
_this.isloading = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.locked = false
_this.isloading = false
})
}
/**
* 提交采购计划
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} supplier_shop_id 仓库id 必填 (curParams参数)
* @param {*} warn_id 采购预警id (curParams参数)
* @param {*} remark 备注 (curParams参数)
* @param {*} cb 回调
*/
export function addPlanRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.ADDPLAN, curParams)
.then(data => {
_this.$toast('提交成功')
setLocalStorage(PURCHASE_DATA, true)
setLocalStorage(INDEX_REFRESH, true)
setTimeout(() => {
_this.$router.go(-2)
_this.isloading = false
}, 1000)
typeof cb === 'function' && cb()
})
.catch(() => {
_this.isloading = false
})
}
/**
* 采购管理订单详情 1:采购计划,2:采购订单,3:入库订单
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购计划、采购订单、入库订单id (curParams参数)
* @param {*} type 订单类型(1:采购计划,2:采购订单,3:入库订单) (curParams参数)
* @param {*} cb 回调
*/
export function purDetailRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.PURCHASE_DETAIL, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 验收入库
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} cb 回调
*/
export function purCheckDetailRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.ENTRYCHECK, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 采购计划--立即审核
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购计划id (curParams参数)
* @param {*} cb 回调
*/
export function purAuditRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.PLANAUDIT, curParams)
.then(data => {
_this.$toast('审核通过,已生成采购订单')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 采购计划--删除
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购计划id (curParams参数)
* @param {*} cb 回调
*/
export function purDeleteRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.PLANDELETE, curParams)
.then(data => {
_this.$toast('已删除')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 采购--相关单据
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购计划id (curParams参数)
* @param {*} cb 回调
*/
export function purBillRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.PLANBILLS, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 采购订单-取消订单
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购计划id (curParams参数)
* @param {*} cb 回调
*/
export function purOrderCancelRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.PURORDERCANCEL, curParams)
.then(data => {
_this.$toast('已取消')
_this.isClick = false
typeof cb === 'function' && cb()
})
.catch(() => {
_this.isClick = false
})
}
// //////////////////////// 销售管理 //////////////////////
/**
* 销售订单详情、销售出库订单详情
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 订单id (curParams 参数)
* @param {*} cb 回调
*/
export function saleDetailRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.SALEDETAIL, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 销售订单-编辑详情
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 订单id (curParams 参数)
* @param {*} cb 回调
*/
export function saleEditDetailRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.SALE_EDIT_DETAIL, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
// //////////////////////// 采购退货 //////////////////////
/**
* 提交采购退货
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} supplier_shop_id 仓库id 必填 (curParams参数)
* @param {*} provider_id 供应商id(curParams参数)
* @param {*} remark 备注 (curParams参数)
* @param {*} cb 回调
*/
export function addPurReturnRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.PURCHASERETURN_CREATE, curParams)
.then(data => {
_this.$toast('提交成功')
setLocalStorage(PURCHASE_DATA, true)
setLocalStorage(PURCHASE_RETURN_REFRESH, true)
setTimeout(() => {
_this.$router.go(-2)
_this.isloading = false
}, 1000)
typeof cb === 'function' && cb()
})
.catch(() => {
_this.isloading = false
})
}
/**
* 采购退货--删除
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购退货id (curParams参数)
* @param {*} cb 回调
*/
export function purReturnDeleteRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.PURCHASERETURN_DETELE, curParams)
.then(data => {
_this.$toast('已删除')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 采购退货--审核
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购退货id (curParams参数)
* @param {*} cb 回调
*/
export function purReturnCheckRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.PURCHASERETURN_CHECK, curParams)
.then(data => {
_this.$toast('审核通过')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 采购退货-详情
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购退货id (curParams参数)
* @param {*} cb 回调
*/
export function purReturnDetailRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.PURCHASERETURN_DETAIL, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
// ////////////////////// 销售退货 ////////////////////////
/**
* 销售退货 - 提交
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} supplier_shop_id 仓库id 必填 (curParams参数)
* @param {*} provider_id 供应商id(curParams参数)
* @param {*} remark 备注 (curParams参数)
* @param {*} cb 回调
*/
export function addSaleReturnRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.SALERETURN_CREATE, curParams)
.then(data => {
_this.$toast('提交成功')
setLocalStorage(PURCHASE_DATA, true)
setLocalStorage(SALE_RETURN_REFRESH, true)
setTimeout(() => {
_this.$router.go(-3)
_this.isloading = false
}, 1000)
typeof cb === 'function' && cb()
})
.catch(() => {
_this.isloading = false
})
}
/**
* 销售退货--删除
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 销售退货id (curParams参数)
* @param {*} cb 回调
*/
export function saleReturnDeleteRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.SALERETURN_DELETE, curParams)
.then(data => {
_this.$toast('已删除')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 销售退货--审核
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 销售退货id (curParams参数)
* @param {*} cb 回调
*/
export function saleReturnCheckRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.SALERETURN_CHECK, curParams)
.then(data => {
_this.$toast('审核通过')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 销售退货-详情
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 销售退货id (curParams参数)
* @param {*} cb 回调
*/
export function saleReturnDetailRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.SALERETURN_DETAIL, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
// ///////////////////// 商品档案 /////////////////////
/**
* 商品档案列表、商品档案搜索
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} supplier_shop_id 仓库id (curParams参数)
* @param {*} cb 回调
*/
export function GoodsRecordRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.GOODSCLASS, curParams)
.then(data => {
_this.list = _this.page === 1 ? data.list : _this.list.concat(data.list)
_this.page = data.page
_this.more = data.more
_this.locked = false
_this.isloading = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.locked = false
_this.isloading = false
})
}
// ///////////////////// 赠送入库 /////////////////////
/**
* 赠送入库--删除
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购退货id (curParams参数)
* @param {*} cb 回调
*/
export function freeDeleteRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.FREE_DELETE, curParams)
.then(data => {
_this.$toast('已删除')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 赠送入库--审核
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 采购退货id (curParams参数)
* @param {*} cb 回调
*/
export function freeCheckRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.FREE_CHECK, curParams)
.then(data => {
_this.$toast('审核通过')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
// ///////////////////// 协助入库 /////////////////////
/**
* 协助订单--删除
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 协助订单id (curParams参数)
* @param {*} cb 回调
*/
export function assistDeleteRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.ASSIST_DETELE, curParams)
.then(data => {
_this.$toast('已删除')
_this.isClick = false
typeof cb === 'function' && cb(data)
})
.catch(() => {
_this.isClick = false
})
}
/**
* 协助订单订单详情
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 订单id (curParams参数)
* @param {*} cb 回调
*/
export function assistDetailRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.ASSIST_DETAIL, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
/**
* 协助订单--提交
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} cb 回调
*/
export function assistAddRes (_this, curParams, cb) {
_this.$http.post(_this.$myApi.ASSIST_CREATE, curParams)
.then(data => {
_this.$toast('提交成功')
setLocalStorage(PURCHASE_DATA, true)
setLocalStorage(INDEX_REFRESH, true)
setTimeout(() => {
_this.$router.go(-2)
_this.isloading = false
}, 1000)
typeof cb === 'function' && cb()
})
.catch(() => {
_this.isloading = false
})
}
/**
* 协助订单扫码支付
* @param {*} _this this指向
* @param {*} curParams 参数
* @param {*} id 订单id (curParams参数)
* @param {*} cb 回调
*/
export function assistCodeRes (_this, curParams, cb) {
_this.$http.get(_this.$myApi.ASSIST_CODE, curParams)
.then(data => {
typeof cb === 'function' && cb(data)
})
.catch(() => {})
}
export default {
purchase: [
{
name: 'purchase_plan',
title: '采购计划',
icon: require('@assets/images/index/icon1-plan.png'),
page: 'purchasePlan',
num: 0
},
{
name: 'purchase_order',
title: '采购订单',
icon: require('@assets/images/index/icon1-order.png'),
page: 'purchaseOrder',
num: 0
},
{
name: 'purchase_ruku',
title: '入库订单',
icon: require('@assets/images/index/icon1-ruku.png'),
page: 'purchaseEntry',
num: 0
},
{
name: 'purchase_goods',
title: '入库商品',
icon: require('@assets/images/index/icon1-goods.png'),
page: 'goodsList',
params: 'entry',
num: 0
}
],
sale: [
{
name: 'purchase_plan',
title: '销售订单',
icon: require('@assets/images/index/icon2-sale-order.png'),
page: 'saleOrder',
num: 0
},
{
name: 'purchase_order',
title: '销售商品',
icon: require('@assets/images/index/icon2-sale-goods.png'),
page: 'saleGoodsList',
params: 'sale',
num: 0
},
{
name: 'purchase_ruku',
title: '出库订单',
icon: require('@assets/images/index/icon2-chuku.png'),
page: 'saleOutOrder',
num: 0
},
{
name: 'purchase_goods',
title: '出库商品',
icon: require('@assets/images/index/icon2-chuku-goods.png'),
page: 'saleOutGoodsList',
params: 'out',
num: 0
}
],
archives: [
{
name: 'purchase_plan',
title: '调价清单',
icon: require('@assets/images/index/icon3-adjust-price.png'),
page: 'adjustPrice',
num: 0
},
{
name: 'purchase_order',
title: '调价商品',
icon: require('@assets/images/index/icon3-adjust-goods.png'),
page: 'adjustPriceGoods',
num: 0
},
{
name: 'purchase_ruku',
title: '调库清单',
icon: require('@assets/images/index/icon3-stock.png'),
page: 'adjustStock',
num: 0
},
{
name: 'purchase_goods',
title: '调库商品',
icon: require('@assets/images/index/icon3-goods.png'),
page: 'adjustStockGoods',
num: 0
}
],
devops: [
{
name: 'purchase_plan',
title: '商品档案',
icon: require('@assets/images/index/icon4-goods-list.png'),
page: 'goods',
num: 0
},
{
name: 'purchase_order',
title: '采购退货',
icon: require('@assets/images/index/icon4-purchase.png'),
page: 'purchaseReturn',
num: 0
},
// todo: 采购换货 -- 首页num需要修改
// {
// name: 'purchase_ruku',
// title: '采购换货',
// icon: require('@assets/images/index/icon4-exchange.png'),
// page: 'purchaseExchange',
// num: 0
// },
{
name: 'purchase_ruku',
title: '销售退货',
icon: require('@assets/images/index/icon4-sale.png'),
page: 'saleReturn',
num: 0
},
{
name: 'purchase_goods',
title: '赠送入库',
icon: require('@assets/images/index/icon4-free.png'),
page: 'freeList',
num: 0
},
{
name: 'purchase_goods',
title: '协助订单',
icon: require('@assets/images/index/icon4-goods.png'),
page: 'assistList',
num: 0
// tips: true
}
]
}
// 机构信息 // export const SELFSHOP = 'self_shop'
export const SELFSHOP = 'self_shop'
// 采购计划的购物车
export const PURCHASE_CART = 'PURCHASE_CART'
// 添加采购计划商品页面数据
export const PURCHASE_DATA = 'PURCHASE_DATA'
// 采购计划、采购订单列表、销售列表、赠送入库列表刷新
export const PURCHASE_LIST = 'PURCHASE_LIST'
export const REFRESH_LIST = 'REFRESH_LIST'
// 详情页刷新
export const DETAIL_REFRESH = 'DETAIL_REFRESH'
// 采购退货刷新
export const PURCHASE_RETURN_REFRESH = 'PURCHASE_RETURN_REFRESH'
// 销售退货刷新
export const SALE_RETURN_REFRESH = 'SALE_RETURN_REFRESH'
// 选择商户
export const CHOOSE_SHOP = 'CHOOSE_SHOP'
// 选择添加的商品
export const CHOOSE_ADD_GOODS = 'CHOOSE_ADD_GOODS'
// 添加赠送入库刷新
export const ADD_FREE_REFRESH = 'ADD_FREE_REFRESH'
// 个人中心刷新(机构切换刷新)
export const MY_REFRESH = 'MY_REFRESH'
// 首页刷新(绑定机构)
export const INDEX_REFRESH = 'INDEX_REFRESH'
/** /**
* 设置缓存 getLocalStorage * 设置缓存 getLocalStorage
* @param {*} key key * @param {*} key key
......
<template>
<div>
<!-- 筛选 -->
<div class="condition-header" :class="curType.length < 3 ? 'condition-header-one' : '' ">
<div class="header cont-list">{{selfShop ? selfShop.text : '--'}}</div>
<div class="condition-cont cont-list" :class="curType.length < 3 ? 'condition-cont-one' : '' " v-if="curType.length">
<!-- 审核状态 -->
<template v-for="(item, index) in curType">
<p class="btn-cont" @click="showPicker=true" v-if="item == 'status'" :key='index'>
<span class="one-line item-condition-cont">{{cur_audit_status.text}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 其它状态 -->
<p class="btn-cont" @click="otherShow=true" v-if="item == 'otherstatus'" :key='index'>
<span class="one-line item-condition-cont">{{cur_other_status.text}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 供应商审核 (采购:采购订单、入库订单) -->
<p class="btn-cont" @click="supplierShow=true" v-if="item == 'supplier'" :key="index">
<span class="one-line item-condition-cont">{{cursupplier.text ? cursupplier.text : '供货商选择'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 商户 -->
<p class="btn-cont time-btn" @click="goMerchant" v-if="item == 'shop'" :key="index">
<span class="one-line item-condition-cont">{{storeDetail ? storeDetail.shop_name : '全部商户'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 商品 -->
<p class="btn-cont time-btn" @click="goGoods" v-if="item == 'goods'" :key="index">
<span class="one-line item-condition-cont">{{goodsDetail ? goodsDetail.title : '全部商品'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 日期 -->
<p class="btn-cont time-btn" @click="showDate" v-if="item == 'date'" :key="index">
<span class="one-line item-condition-cont">{{cur_date ? cur_date : '日期'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
</template>
</div>
</div>
<!-- 选择审核状态 -->
<van-popup v-model="showPicker" round position="bottom">
<van-picker
title="状态"
show-toolbar
:default-index="cur_audit_index"
:columns="auditStatusList"
@confirm="chooseAuditStatus"
@cancel="showPicker = false"
/>
</van-popup>
<van-popup v-model="otherShow" round position="bottom">
<van-picker
title="状态"
show-toolbar
:default-index="cur_other_index"
:columns="otherStatusList"
@confirm="chooseOtherStatus"
@cancel="otherShow = false"
/>
</van-popup>
<!-- 选择时间 -->
<van-calendar
v-model="dateShow"
type="range"
:max-date="curday"
:min-date="minday"
:default-date="defaultday"
@confirm="chooseDate"
:allow-same-day="true"
ref="dateview"
color="#325BEF"
:poppable="true"
>
</van-calendar>
<!-- 选择供应商 -->
<van-popup v-model="supplierShow" round position="bottom">
<van-picker
title="供应商"
show-toolbar
:default-index="cur_sup_index"
:columns="supplier"
@confirm="chooseSupplier"
@cancel="supplierShow = false"
/>
</van-popup>
</div>
</template>
<script>
import { SELFSHOP, getLocalStorage } from '@assets/js/self.js'
export default {
name: 'myCondition',
props: {
curType: {
type: Array,
default: () => ['date']
},
// 审核状态信息
auditStatusList: { // 审核状态列表
type: Array,
default: () => [{ key: 1, text: '待审核状态' }, { key: 2, text: '全部' }]
},
cur_audit_status: { // 当前选中的审核状态
type: Object,
value: { key: 1, text: '待审核状态' }
},
// 供应商
supplier: { // 供应商列表
type: Array,
value: [{ id: 0, text: '全部供应商' }]
},
cursupplier: { // 当前选中的供应商
type: Object,
value: { id: 0, text: '全部供应商' }
},
// 其它状态
otherStatusList: {
type: Array,
default: () => [{ key: 1, text: '已下单/已接单' }, { key: 2, text: '全部' }]
},
cur_other_status: {
type: Object,
value: { key: 1, text: '已下单/已接单' }
},
// 商户
storeDetail: {
type: Object,
value: null
},
// 商品
goodsDetail: {
type: Object,
value: null
},
cur_date: {
type: String,
value: ''
}
},
computed: {
cur_audit_index: (vm) => {
return 0
// return vm.auditStatusList.findIndex(item => item.key === vm.cur_audit_status.key)
},
cur_sup_index: (vm) => {
return 0
// return vm.supplier.findIndex(item => item.key === vm.cursupplier.key)
},
cur_other_index: (vm) => {
return vm.otherStatusList.findIndex(item => item.key === 1)
}
},
data () {
return {
selfShop: null,
// curIndex: 0,
// 审核状态
showPicker: false,
// 供应商
supplierShow: false,
// 其它
otherShow: false,
// 日期
dateShow: false,
curday: new Date(),
minday: new Date('2021-06-01'),
defaultday: new Date()
}
},
methods: {
// 选择审核状态
chooseAuditStatus (value, index) {
// this.curIndex = index
this.showPicker = false
this.$emit('chooseAuditStatus', value, index)
},
// 选择其它状态
chooseOtherStatus (value, index) {
// this.curIndex = index
this.otherShow = false
this.$emit('chooseOtherStatus', value, index)
},
// 选择供应商
chooseSupplier (value, index) {
// this.cur_sup_index = index
this.supplierShow = false
this.$emit('chooseSupplier', value, index)
},
// 日期
showDate () {
this.$refs.dateview.reset()
this.dateShow = true
},
chooseDate (date) {
const [start, end] = date
this.dateShow = false
const curStatus = this.curType.length > 2
const curdate = `${this.formatDate(start, curStatus)} ~ ${this.formatDate(end, curStatus)}`
var formatDate = `${this.formatDate(start)},${this.formatDate(end)}`
this.$emit('changeDate', {
cur_date: curdate,
format_date: formatDate
})
},
formatDate (date, curStatus = false) {
var d = new Date(date)
var month = '' + (d.getMonth() + 1)
var day = '' + d.getDate()
var year = d.getFullYear()
if (month.length < 2) month = '0' + month
if (day.length < 2) day = '0' + day
if (curStatus) {
return [month, day].join('-')
}
return [year, month, day].join('-')
},
// 商户
goMerchant () {
// chooseShop
this.$router.push({
name: 'searchShop'
})
},
// 商品
goGoods () {
// changeGoods
const idlist = []
if (this.goodsDetail) {
idlist.push(this.goodsDetail.id)
}
this.$router.push({
name: 'addGoodsSearch',
params: {
ids: idlist,
type: 2 // 选择商品
}
})
}
},
mounted () {
this.selfShop = getLocalStorage(SELFSHOP) ? getLocalStorage(SELFSHOP) : null
this.showPicker = false
this.supplierShow = false
this.otherShow = false
this.dateShow = false
this.curday = new Date()
this.minday = new Date('2021-06-01')
this.defaultday = new Date()
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/common/module.scss";
</style>
...@@ -8,12 +8,8 @@ import myAxios from './api/index' ...@@ -8,12 +8,8 @@ import myAxios from './api/index'
import Vant from 'vant' import Vant from 'vant'
import 'vant/lib/index.css' import 'vant/lib/index.css'
import vConsole from '@/plugins/vconsole.js' import vConsole from '@/plugins/vconsole.js'
import myCondition from '@/components/common/condition.vue'
import listTips from '@/components/common/listtips.vue' import listTips from '@/components/common/listtips.vue'
// Vue.component('chooseDate', chooseDate)
// import chooseDate from '@/components/common/chooseDate.vue'
Vue.component('myCondition', myCondition)
Vue.component('listTips', listTips) Vue.component('listTips', listTips)
Vue.use(vConsole) Vue.use(vConsole)
......
<template>
<div class="login-view">
<div class="logo-view">
<img src="@assets/images/login/logo.png" />
<p class="title">机构端</p>
</div>
<!-- <div>
<div class="filed-list">
<img class="icon-img" src="@assets/images/login/tel-icon.png" />
<van-field v-model.trim="tel" type="tel" placeholder="请输入手机号" maxlength="11" />
</div>
<div class="filed-list code-cont">
<img class="icon-img" src="@assets/images/login/code-icon.png" />
<van-field v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" />
<div class="code-btn" @click="getCode">{{buttonText}}</div>
</div>
</div> -->
<div class="login-btn" @click="goLogin">重新登录</div>
</div>
</template>
<script>
export default {
name: 'againLogin',
data () {
return {}
},
methods: {
goLogin () {
window.document.location = this.$myApi.WINDOWHREF_INDEX // url-
}
}
// beforeCreate () {
// document.querySelector('body').setAttribute('style', 'background: #ffffff')
// },
// beforeDestroy () {
// document.querySelector('body').removeAttribute('style')
// }
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/login/login.scss";
</style>
<template>
<div class="login-view">
<div class="logo-view">
<img src="@assets/images/login/logo.png" />
<p class="title">绑定机构</p>
</div>
<div>
<div class="filed-list">
<img class="icon-img" src="@assets/images/login/tel-icon.png" />
<van-field v-model.trim="tel" type="tel" placeholder="请输入手机号" maxlength="11" />
</div>
<div class="filed-list code-cont">
<img class="icon-img" src="@assets/images/login/code-icon.png" />
<van-field v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" />
<div class="code-btn" @click="getCode">{{buttonText}}</div>
</div>
</div>
<div class="login-btn" @click="goLogin">绑定</div>
</div>
</template>
<script>
import { INDEX_REFRESH, setLocalStorage } from '@assets/js/self.js'
export default {
name: 'login',
data () {
return {
tel: '', // 手机号
code: '', // 验证码
buttonText: '获取验证码',
isSending: false,
seconds: 60,
timer: null
}
},
methods: {
checkData () {
if (this.tel.length !== 11) {
this.$toast('请正确输入手机号码')
return true
}
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.tel))) {
this.$toast('请正确输入手机号码------')
return true
}
if (this.code.length !== 6) {
this.$toast('请正确输入验证码')
return true
}
return false
},
getCode () {
if (this.isSending) return
if (this.tel.length !== 11) {
this.$toast('请正确输入手机号码')
return true
}
const curParams = { tel: this.tel }
this.$http.post(this.$myApi.SENDCODE, curParams)
.then(res => {
console.log(res, 'res----------')
this.isSending = true
this.countDown()
})
.catch(() => {})
},
countDown () {
// const _this = this
let seconds = 60
this.timer = setInterval(() => {
seconds--
this.buttonText = `重新获取(${seconds}s)`
if (seconds < 1) {
this.isSending = false
this.buttonText = '重新获取'
clearInterval(this.timer)
}
}, 1000)
},
goLogin () {
if (this.checkData()) return true
const curParams = {
tel: this.tel,
code: this.code
}
this.$http.post(this.$myApi.BINDLOGINTWO, curParams)
.then(res => {
console.log(res)
this.$toast('绑定成功')
setLocalStorage(INDEX_REFRESH, true)
setTimeout(() => {
this.$router.replace({
name: 'home'
})
}, 500)
})
.catch(() => {})
},
fetchData (to, from) {
this.tel = '' // 手机号
this.code = '' // 验证码
this.buttonText = '获取验证码'
this.isSending = false
this.seconds = 60
this.timer = null
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
if (this.timer) {
clearInterval(this.timer)
}
next()
}
// beforeCreate () {
// document.querySelector('body').setAttribute('style', 'background: #ffffff')
// },
// beforeDestroy () {
// document.querySelector('body').removeAttribute('style')
// }
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/login/login.scss";
</style>
<template> <template>
<div class="cont" v-if="order"> <div
<div class="top"> class="cont"
<div class="item flex-h flex-vc"> v-if="order"
<div class="title">维修类目:</div> >
<div class="title">{{order.repair_type.type_name}}</div> <div class="top">
</div> <div class="item flex-h flex-vc">
<div class="item-title">问题描述:</div> <div class="title">维修类目:</div>
<div class="item-desc que-desc">{{order.description}}</div> <div class="title">{{order.repair_type.type_name}}</div>
<div class="item flex-h flex-vc"> </div>
<div class="item-title">服务地址:</div> <div class="item-title">问题描述:</div>
<div <div class="item-desc que-desc">{{order.description}}</div>
class="item-desc" <div class="item flex-h flex-vc">
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div> <div class="item-title">服务地址:</div>
</div> <div class="item-desc">{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
<div class="item flex-h flex-vc"> </div>
<div class="item-title">客户姓名:</div> <div class="item flex-h flex-vc">
<div class="item-desc">{{order.realname}}</div> <div class="item-title">客户姓名:</div>
</div> <div class="item-desc">{{order.realname}}</div>
<div class="item flex-h flex-vc"> </div>
<div class="item-title">联系电话:</div> <div class="item flex-h flex-vc">
<div class="item-desc phone">{{order.telephone}}</div> <div class="item-title">联系电话:</div>
</div> <div class="item-desc phone">{{order.telephone}}</div>
<div class="item flex-h flex-vc"> </div>
<div class="item-title">提交时间:</div> <div class="item flex-h flex-vc">
<div class="item-desc">2021-06-17 09:28:43</div> <div class="item-title">提交时间:</div>
</div> <div class="item-desc">2021-06-17 09:28:43</div>
<div class="item flex-h flex-vc"> </div>
<div class="item-title">图片详情:</div> <div class="item flex-h flex-vc">
<div class="img flex-h" v-for="(child, index) in order.image" :key="index"> <div class="item-title">图片详情:</div>
<img :src="child.url" alt /> <div
class="img flex-h"
v-for="(child, index) in order.image"
:key="index"
>
<img
:src="child.url"
alt
/>
</div>
</div>
</div> </div>
</div> <div class="things">
</div> <div class="things_title">所需耗材</div>
<div class="things"> <div
<div class="things_title">所需耗材</div> class="list-item"
<div class="list-item" v-for="(item,index) in addList" :key="index"> v-for="(item,index) in addList"
<div class="item flex-h flex-hb" @click="showZl(index)"> :key="index"
<div class="item_title flex-h flex-vc"> >
<div class="title_left">耗材种类</div> <div
<div class="title_r">{{item.zl}}</div> class="item flex-h flex-hb"
</div> @click="showZl(index)"
<div class="select flex-h flex-vc"> >
<div class="select_txt">选择</div> <div class="item_title flex-h flex-vc">
<img src="@assets/images/my/select.png" alt /> <div class="title_left">耗材种类</div>
</div> <div class="title_r">{{item.zl}}</div>
</div> </div>
<div class="item flex-h flex-hb" @click="showHc(index)"> <div class="select flex-h flex-vc">
<div class="item_title flex-h flex-vc"> <div class="select_txt">选择</div>
<div class="title_left">耗材名称</div> <img
<div class="title_r">{{item.mc}}</div> src="@assets/images/my/select.png"
</div> alt
<div class="select flex-h flex-vc"> />
<div class="select_txt">选择</div> </div>
<img src="@assets/images/my/select.png" alt /> </div>
</div> <div
class="item flex-h flex-hb"
@click="showHc(index)"
>
<div class="item_title flex-h flex-vc">
<div class="title_left">耗材名称</div>
<div class="title_r">{{item.mc}}</div>
</div>
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img
src="@assets/images/my/select.png"
alt
/>
</div>
</div>
<div class="item flex-h flex-vc">
<div class="title_left">耗材个数</div>
<input
type="number"
placeholder="请输入"
v-model="item.sl"
/>
</div>
<!-- 种类弹窗 -->
<van-popup
v-model="item.zlSelect"
round
position="bottom"
>
<van-picker
show-toolbar
:columns="types"
@confirm="(value)=>{typeConfirm(value,index)}"
@cancel="typeCancel(index)"
/>
</van-popup>
<van-popup
v-model="item.mcSelect"
round
position="bottom"
>
<van-picker
show-toolbar
:columns="hcName"
@confirm="(value)=>{hcConfirm(value,index)}"
@cancel="hcCancel(index)"
/>
</van-popup>
</div>
<div class="line"></div>
<div class="math-btn flex-h flex-vc flex-hb">
<div
class="del-btn"
@click="delMeth"
>-删除耗材</div>
<div
class="add-btn"
@click="addMeth"
>+新增耗材</div>
</div>
</div> </div>
<div class="item flex-h flex-vc"> <div class="blank"></div>
<div class="title_left">耗材个数</div> <!-- 底部 -->
<input type="number" placeholder="请输入" v-model="item.sl" /> <div class="bottom flex-h flex-hb flex-vc">
<div class="left">
<span>{{addList.length}}</span>件,总金额:
<span>¥0</span>
</div>
<div class="sk-btn">发起收款</div>
</div> </div>
<!-- 种类弹窗 -->
<van-popup v-model="item.zlSelect" round position="bottom">
<van-picker
show-toolbar
:columns="types"
@confirm="(value)=>{typeConfirm(value,index)}"
@cancel="typeCancel(index)"
/>
</van-popup>
<van-popup v-model="item.mcSelect" round position="bottom">
<van-picker
show-toolbar
:columns="hcName"
@confirm="(value)=>{hcConfirm(value,index)}"
@cancel="hcCancel(index)"
/>
</van-popup>
</div>
<div class="line"></div>
<div class="math-btn flex-h flex-vc flex-hb">
<div class="del-btn" @click="delMeth">-删除耗材</div>
<div class="add-btn" @click="addMeth">+新增耗材</div>
</div>
</div> </div>
<div class="blank"></div>
<!-- 底部 -->
<div class="bottom flex-h flex-hb flex-vc">
<div class="left">
<span>{{addList.length}}</span>件,总金额:
<span>¥0</span>
</div>
<div class="sk-btn">发起收款</div>
</div>
</div>
</template> </template>
<script> <script>
...@@ -101,218 +143,218 @@ export default { ...@@ -101,218 +143,218 @@ export default {
name: 'charge', name: 'charge',
data () { data () {
return { return {
addList:[ addList: [
{ {
zl:'', zl: '',
mc:'', mc: '',
sl:'', sl: '',
zlSelect:false, zlSelect: false,
mcSelect: false mcSelect: false
} }
], ],
showPicker: false, showPicker: false,
types: ["洁具", "木工类","供暖类"], types: ['洁具', '木工类', '供暖类'],
type_name: '请选择', type_name: '请选择',
hcName: ["水龙头","桌子","暖气管"], hcName: ['水龙头', '桌子', '暖气管'],
hc_name: '请选择', hc_name: '请选择',
hcPicker: false, hcPicker: false,
hcNum: '', hcNum: '',
repair_order_id: '', repair_order_id: '',
order: '', order: ''
} }
}, },
created(){ created () {
// console.log('change页面') // console.log('change页面')
this.repair_order_id = this.$route.query.id this.repair_order_id = this.$route.query.id
// console.log(this.$route.query.id,'接收的id'); // console.log(this.$route.query.id,'接收的id');
this.getDetail() this.getDetail()
}, },
// mounted(){ // mounted(){
// this.getDetail() // this.getDetail()
// }, // },
methods:{ methods: {
getDetail(){ getDetail () {
let repair_order_id = this.repair_order_id.toString()
const curParams = { const curParams = {
repair_order_id: this.repair_order_id repair_order_id: this.repair_order_id
} }
// const _this = this // const _this = this
this.$http.get(this.$myApi.REPAIR_ORDER_DETAIL, curParams) this.$http
.then(res => { .get(this.$myApi.REPAIR_ORDER_DETAIL, curParams)
this.order = res.order .then((res) => {
console.log(this.order,123456); this.order = res.order
console.log(this.order, 123456)
}) })
.catch(() => {}) .catch(() => {})
}, },
showZl(index){ showZl (index) {
this.addList[index].zlSelect = true this.addList[index].zlSelect = true
}, },
typeConfirm(value, index) { typeConfirm (value, index) {
this.addList[index].zl = value this.addList[index].zl = value
this.addList[index].zlSelect = false this.addList[index].zlSelect = false
}, },
typeCancel(index) { typeCancel (index) {
this.addList[index].zlSelect = false this.addList[index].zlSelect = false
}, },
showHc(index){ showHc (index) {
this.addList[index].mcSelect = true this.addList[index].mcSelect = true
}, },
hcConfirm(value, index) { hcConfirm (value, index) {
this.addList[index].mc = value this.addList[index].mc = value
this.addList[index].mcSelect = false this.addList[index].mcSelect = false
}, },
hcCancel() { hcCancel () {
this.addList[index].mcSelect = false this.addList[index].mcSelect = false
}, },
addMeth () { addMeth () {
this.addList.push({ this.addList.push({
zl:'', zl: '',
mc:'', mc: '',
sl:'', sl: '',
zlSelect:false, zlSelect: false,
mcSelect: false mcSelect: false
}) })
}, },
delMeth(index){ delMeth (index) {
this.addList.splice(index,1) this.addList.splice(index, 1)
}, }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cont { .cont {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
padding-top: 0.2rem; padding-top: 0.2rem;
} }
.top { .top {
width: 6.9rem; width: 6.9rem;
background: #ffffff; background: #ffffff;
box-shadow: 0px 0px 0.12rem 1px rgba(214, 214, 214, 0.78); box-shadow: 0px 0px 0.12rem 1px rgba(214, 214, 214, 0.78);
border-radius: 0.12rem; border-radius: 0.12rem;
padding: 0.4rem 0.3rem 0.8rem; padding: 0.4rem 0.3rem 0.8rem;
margin: 0rem auto; margin: 0rem auto;
} }
.item { .item {
height: 0.3rem; height: 0.3rem;
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.title { .title {
color: #0054ff; color: #0054ff;
font-size: 0.32rem; font-size: 0.32rem;
font-weight: bold; font-weight: bold;
} }
.item-title { .item-title {
color: #000000; color: #000000;
font-size: 0.3rem; font-size: 0.3rem;
} }
.item-desc { .item-desc {
color: #727272; color: #727272;
font-size: 0.3rem; font-size: 0.3rem;
} }
.que-desc { .que-desc {
margin-top: 0.4rem; margin-top: 0.4rem;
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.phone { .phone {
color: #0054ff; color: #0054ff;
} }
.img { .img {
width: 1.2rem; width: 1.2rem;
height: 1.2rem; height: 1.2rem;
border-radius: 0.08rem; border-radius: 0.08rem;
margin-top: 0.8rem; margin-top: 0.8rem;
} }
.img img { .img img {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.08rem; border-radius: 0.08rem;
margin-left: 0.16rem; margin-left: 0.16rem;
margin-right: 0.16rem; margin-right: 0.16rem;
} }
.things { .things {
width: 6.9rem; width: 6.9rem;
background: #ffffff; background: #ffffff;
box-shadow: 0px 0px 0.12rem 1px rgba(214, 214, 214, 0.78); box-shadow: 0px 0px 0.12rem 1px rgba(214, 214, 214, 0.78);
border-radius: 0.12rem; border-radius: 0.12rem;
padding: 0.4rem 0.3rem; padding: 0.4rem 0.3rem;
margin: 0.2rem auto; margin: 0.2rem auto;
} }
.things_title { .things_title {
color: #000000; color: #000000;
font-size: 0.3rem; font-size: 0.3rem;
font-weight: bold; font-weight: bold;
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.title_left { .title_left {
margin-right: 0.38rem; margin-right: 0.38rem;
} }
.title_r { .title_r {
color: #727272; color: #727272;
font-size: 0.3rem; font-size: 0.3rem;
} }
.select .select_txt { .select .select_txt {
color: #0054ff; color: #0054ff;
font-size: 0.3rem; font-size: 0.3rem;
margin-right: 0.2rem; margin-right: 0.2rem;
} }
.select img { .select img {
width: 0.15rem; width: 0.15rem;
height: 0.26rem; height: 0.26rem;
} }
.line { .line {
width: 6.28rem; width: 6.28rem;
height: 1px; height: 1px;
background: #f1f1f1; background: #f1f1f1;
} }
.math-btn { .math-btn {
color: #0054ff; color: #0054ff;
font-size: 0.3rem; font-size: 0.3rem;
margin-top: 0.4rem; margin-top: 0.4rem;
} }
.list-item { .list-item {
margin-bottom: 0.8rem; margin-bottom: 0.8rem;
} }
.blank { .blank {
width: 100%; width: 100%;
height: 1rem; height: 1rem;
} }
.bottom { .bottom {
width: 100%; width: 100%;
height: 1.04rem; height: 1.04rem;
background: #ffffff; background: #ffffff;
padding-left: 0.3rem; padding-left: 0.3rem;
padding-right: 0.3rem; padding-right: 0.3rem;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
} }
.left { .left {
color: #000; color: #000;
font-size: 0.28rem; font-size: 0.28rem;
} }
.left span { .left span {
color: #0054ff; color: #0054ff;
} }
.sk-btn { .sk-btn {
width: 3rem; width: 3rem;
height: 0.76rem; height: 0.76rem;
background: #c0c0c0; background: #c0c0c0;
border-radius: 0.38rem; border-radius: 0.38rem;
text-align: center; text-align: center;
line-height: 0.76rem; line-height: 0.76rem;
color: #ffffff; color: #ffffff;
font-size: 0.26rem; font-size: 0.26rem;
} }
.skBtn { .skBtn {
width: 3rem; width: 3rem;
height: 0.76rem; height: 0.76rem;
background: #0054ff; background: #0054ff;
border-radius: 0.38rem; border-radius: 0.38rem;
text-align: center; text-align: center;
line-height: 0.76rem; line-height: 0.76rem;
color: #ffffff; color: #ffffff;
font-size: 0.26rem; font-size: 0.26rem;
} }
</style> </style>
\ No newline at end of file
<template>
<div class="relation-users-page">
<div class="header">
<p class="name">{{supplier ? supplier.shop_name : '--'}}</p>
<p>绑定账号:{{supplier_tel}}</p>
</div>
<div class="list">
<div :class="['list-item', index+1 >= list.length?'no-border':'' ]"
v-for="(item, index) in list" :key="index">
<img :src="item.avatar" v-if="item.avatar"/>
<img src="@assets/images/my/touxiang.png" v-else/>
<p>{{item.nickname}}</p>
</div>
</div>
</div>
</template>
<script>
import { SELFSHOP, getLocalStorage } from '@assets/js/self.js'
import { getInfoRes } from '@assets/js/cart_res.js'
export default {
name: 'relationUsers',
data () {
return {
supplier: null, // 机构信息
supplier_tel: '',
list: [],
isloading: false,
page: 1,
more: true,
locked: false,
limit: 10
}
},
methods: {
// 初始化
initData () {
this.list = []
this.page = 1
this.more = true
this.locked = false
this.isloading = false
},
// 绑定的微信列表
getUserList () {
if (this.more && !this.isloading) {
const curParams = {
page: this.page,
pageSize: this.limit,
shop_id: getLocalStorage(SELFSHOP) ? getLocalStorage(SELFSHOP).id : ''
}
this.isloading = true
this.$http.get(this.$myApi.WXLIST, curParams)
.then(data => {
this.list = this.page === 1 ? data.list : this.list.concat(data.list)
this.page = data.next
this.more = data.more
this.locked = false
this.isloading = false
})
.catch(() => {
this.locked = false
this.isloading = false
})
}
},
// 获取机构信息
getSupplierDetail () {
getInfoRes(this)
},
onRefresh () {
setTimeout(() => {
this.isloading = false
}, 1000)
},
scroll () {
if (
window.pageYOffset /
(document.documentElement.scrollHeight - window.innerHeight) >=
0.7 &&
this.more
) {
if (!this.locked) {
this.locked = true
this.getUserList()
}
}
},
fetchData (to, from) {
this.initData()
this.getUserList()
this.getSupplierDetail()
window.addEventListener('scroll', this.scroll, false)
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
window.removeEventListener('scroll', this.scroll, false)
next()
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/my/relation-users.scss";
</style>
<template> <template>
<div class="cont"> <div class="cont">
<div class="top flex-h flex-vc"> <div class="top flex-h flex-vc">
<div class="point"></div> <div class="point"></div>
<div class="status">工作中</div> <div class="status">工作中</div>
</div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="menu flex-h flex-hb">
<div class="hc_total">{{count}}个工单</div>
<div class="options" @click="show">
{{currentName}}
<div class="option-box" v-show="xianshi">
<div
class="option-item"
v-for="item in optionList"
:key="item.time_type"
:value="item.name"
@click="changeItem(item.time_type,item.name)"
>{{item.name}}</div>
</div>
</div>
</div>
<div class="order-item" v-for="(item, index) in list" :key="item.id">
<div class="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div
class="item-desc"
>{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{item.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div
class="item-desc"
>{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{item.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone">{{item.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">{{item.created_at}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div class="img flex-h" v-for="(child, index) in item.image" :key="index">
<img :src="child.url" alt />
</div>
</div>
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{item.worker.name}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc">{{item.worker.phone}}</div>
</div> </div>
<div class="material" v-if="item.no_pay_order != null"> <div class="menu flex-h flex-hb">
<div class="item-title">已支付耗材</div> <div class="hc_total">{{count}}个工单</div>
<div class="ma-item flex-h flex-hb"> <div class="options" >
<div class="one">洁具</div> {{currentName}}
<div class="one">水龙头*1</div> <div class="option-box" v-show="true">
<div class="one">¥16</div> <div
</div> class="option-item"
</div> v-for="item in optionList"
<div class="line"></div> :key="item.time_type"
<div class="btn flex-h flex-hr"> :value="item.name"
<div v-if="item.is_can_remark_material==1" class="btn-item bz-btn" @click="bz_click(item.id)">备注耗材</div> @click="changeItem(item.time_type,item.name)"
<div v-if="item.is_can_confirm_complete==1" class="btn-item qr-btn">确认完成</div> >{{item.name}}</div>
<div v-if="item.is_can_initiate_charge==1" class="btn-item sf-btn" @click="tz_charge(item.id)">发起收费</div> </div>
<div v-if="item.is_can_initiate_transfer_order==1" class="btn-item" @click="zd_click">发起转单</div> </div>
<div </div>
v-if="item.is_can_begin_repair==1" <van-pull-refresh v-model="isloading" @refresh="onRefresh">
class="btn-item" <div class="order-item" v-for="(item, index) in list" :key="item.id">
@click="starRepir(item.id,index)" <div class="title">{{item.order_status_display }}</div>
>开始维修</div> <div class="item flex-h flex-vc">
<div v-if="item.is_can_see_appraisal==1" class="btn-item">查看评价</div> <div class="item-title">预约时间:</div>
<div v-if="item.is_can_see_material==1" class="btn-item sf-btn" @click="look_click">查看耗材</div> <div class="item-desc">{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
</div> </div>
</div> <div class="item-title">问题描述:</div>
<!-- 空数据 --> <div class="item-desc que-desc">{{item.description}}</div>
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" /> <div class="item flex-h flex-vc">
</van-pull-refresh> <div class="item-title">服务地址:</div>
<div class="blank"></div> <div class="item-desc">{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
<!-- 发起转单弹窗 --> </div>
<van-popup v-model="zdShow" close-icon="close"> <div class="item flex-h flex-vc">
<div class="pop_title">备注转单原因</div> <div class="item-title">客户姓名:</div>
<textarea placeholder="请输入转单理由"></textarea> <div class="item-desc">{{item.realname}}</div>
<div class="btnItem flex-h"> </div>
<div class="cancel" @click="cancel">取消</div> <div class="item flex-h flex-vc">
<div class="sure" @click="zd_submit">提交</div> <div class="item-title">联系电话:</div>
</div> <div class="item-desc phone">{{item.telephone}}</div>
</van-popup> </div>
<!-- 备注耗材弹窗 --> <div class="item flex-h flex-vc">
<van-popup v-model="hcShow" close-icon="close"> <div class="item-title">提交时间:</div>
<div class="pop_title">备注耗材</div> <div class="item-desc">{{item.created_at}}</div>
<div class="list-item" v-for="(item,index) in addList" :key="index"> </div>
<input class="input" v-model="item.hc" type="text" placeholder="请输入耗材名称" /> <div class="item flex-h flex-vc">
<input class="input" v-model="item.sl" type="text" placeholder="请输入耗材个数" /> <div class="item-title">图片详情:</div>
</div> <div class="img flex-h" v-for="(child, index) in item.image" :key="index">
<div class="math-btn flex-h flex-vc flex-hb"> <img :src="child.url" alt />
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div> </div>
<div class="add-btn" @click="addMeth">+新增</div> </div>
</div> <div class="line"></div>
<div class="btnItem flex-h"> <div class="item flex-h flex-vc">
<div class="cancel" @click="cancel">取消</div> <div class="item-title">派工对象:</div>
<div class="sure" @click="bz_submit">提交</div> <div class="item-desc">{{item.worker.name}}</div>
</div> </div>
</van-popup> <div class="item flex-h flex-vc">
<!-- 查看耗材弹窗 --> <div class="item-title">联系电话:</div>
<van-popup v-model="lookShow" close-icon="close"> <div class="item-desc">{{item.worker.phone}}</div>
<div class="pop_title">查看耗材</div> </div>
<div class="ma-item one-item flex-h flex-hb"> <div class="material" v-if="item.no_pay_order != null" >
<div class="one">洁具</div> <div class="item-title">已支付耗材</div>
<div class="one">水龙头*1</div> <div class="ma-item flex-h flex-hb">
<div class="one">¥16</div> <div class="one">洁具</div>
</div> <div class="one">水龙头*1</div>
<div class="ma-item one-item flex-h flex-hb"> <div class="one">¥16</div>
<div class="one">洁具</div> </div>
<div class="one">水龙头*1</div> </div>
<div class="one">¥16</div> <div class="line"></div>
</div> <div class="btn flex-h flex-hr">
<div class="hc_total">共计2件,总价: ¥26</div> <div v-if="item.is_can_remark_material==1" class="btn-item bz-btn" @click="bz_click(item.id)" >备注耗材</div>
<div class="sure-btn" @click="bz_submit">确定</div> <div
</van-popup> v-if="item.is_can_confirm_complete==1"
<!-- tabbar --> class="btn-item qr-btn" >确认完成</div>
<my-tabbar curname="home"></my-tabbar> <div
</div> v-if="item.is_can_initiate_charge==1"
class="btn-item sf-btn"
@click="tz_charge(item.id)" >发起收费</div>
<div
v-if="item.is_can_initiate_transfer_order==1"
class="btn-item"
@click="zd_click" >发起转单</div>
<div
v-if="item.is_can_begin_repair==1"
class="btn-item"
@click="starRepir(item.id,index)" >开始维修</div>
<div v-if="item.is_can_see_appraisal==1" class="btn-item" >查看评价</div>
<div v-if="item.is_can_see_material==1" class="btn-item sf-btn" @click="look_click" >查看耗材</div>
</div>
</div>
<!-- 空数据 -->
<van-empty
class="custom-image"
description="暂无工单哦~"
v-if="!list.length && !more"
/>
</van-pull-refresh>
<div class="blank"></div>
<!-- 发起转单弹窗 -->
<van-popup v-model="zdShow" close-icon="close">
<div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel" >取消</div>
<div class="sure" @click="zd_submit" >提交</div>
</div>
</van-popup>
<!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close">
<div class="pop_title">备注耗材</div>
<div
class="list-item"
v-for="(item,index) in addList"
:key="index"
>
<input
class="input"
v-model="item.hc"
type="text"
placeholder="请输入耗材名称"
/>
<input
class="input"
v-model="item.sl"
type="text"
placeholder="请输入耗材个数"
/>
</div>
<div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div>
</div>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="bz_submit">提交</div>
</div>
</van-popup>
<!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close">
<div class="pop_title">查看耗材</div>
<div class="ma-item one-item flex-h flex-hb">
<div class="one">洁具</div>
<div class="one">水龙头*1</div>
<div class="one">¥16</div>
</div>
<div class="ma-item one-item flex-h flex-hb">
<div class="one">洁具</div>
<div class="one">水龙头*1</div>
<div class="one">¥16</div>
</div>
<div class="hc_total">共计2件,总价: ¥26</div>
<div class="sure-btn" @click="bz_submit">确定</div>
</van-popup>
<!-- tabbar -->
<my-tabbar curname="home"></my-tabbar>
</div>
</template> </template>
<script> <script>
...@@ -143,67 +164,72 @@ export default { ...@@ -143,67 +164,72 @@ export default {
components: { components: {
myTabbar myTabbar
}, },
data(){ data () {
return{ return {
count: '', count: '',
imgList: [], imgList: [],
addList:[ addList: [
{ {
hc:'', hc: '',
sl:'' sl: ''
} }
], ],
xianshi: false, xianshi: false,
currentName: '本月', currentName: '本月',
optionList: [{ optionList: [
time_type:'1', {
name: '今日' time_type: '1',
},{ name: '今日'
time_type:'2', },
name: '本周' {
},{ time_type: '2',
time_type:'3', name: '本周'
name: '本月' },
},{ {
time_type:'4', time_type: '3',
name: '自定义' name: '本月'
}], },
activeStatus: 3, {
zdShow: false,//发起转单弹窗 time_type: '4',
hcShow: false,//耗材弹窗 name: '自定义'
lookShow: false,//查看耗材弹窗 }
list: [], ],
activeStatus: 3,
zdShow: false, // 发起转单弹窗
hcShow: false, // 耗材弹窗
lookShow: false, // 查看耗材弹窗
list: [],
isloading: false, isloading: false,
page: 1, page: 1,
more: true, more: true,
locked: false, locked: false,
limit: 10, limit: 10,
status: {}, status: {}
} }
}, },
created(){ created () {
this.getList() this.getList()
// this.getStatus() // this.getStatus()
}, },
methods: { methods: {
// 初始化 // 初始化
initData () { initData () {
this.list = [] this.list = []
this.page = 1 this.page = 1
this.more = true this.more = true
this.locked = false this.locked = false
this.isloading = false this.isloading = false
}, },
getStatus(){ getStatus () {
const curParams = {} this.$http
this.$http.get(this.$myApi.ORDER_STATUS) .get(this.$myApi.ORDER_STATUS)
.then(res => { .then((res) => {
console.log(res); console.log(res)
this.status = res this.status = res
}) })
.catch(() => {}) .catch(() => {})
}, },
getList () { getList () {
if (this.more && !this.isloading) { if (this.more && !this.isloading) {
this.isloading = true this.isloading = true
const curParams = { const curParams = {
...@@ -211,336 +237,337 @@ export default { ...@@ -211,336 +237,337 @@ export default {
page: this.page, page: this.page,
limit: this.limit limit: this.limit
} }
this.$http.get(this.$myApi.REPAIR_LIST, curParams) this.$http
.then(data => { .get(this.$myApi.REPAIR_LIST, curParams)
.then((data) => {
this.list = this.page === 1 ? data.list : this.list.concat(data.list) this.list = this.page === 1 ? data.list : this.list.concat(data.list)
this.page = data.page this.page = data.page
this.more = data.more this.more = data.more
this.locked = false this.locked = false
this.isloading = false, this.isloading = false
this.count = data.count this.count = data.count
console.log(data,1111); console.log(data, 1111)
}) })
.catch(() => { .catch(() => {
this.locked = false this.locked = false
this.isloading = false this.isloading = false
}) })
} }
}, },
onRefresh () { onRefresh () {
this.initData() this.initData()
if (!this.locked) { if (!this.locked) {
this.locked = true this.locked = true
this.getList() this.getList()
} }
}, },
starRepir(id,index){ // 开始维修
console.log(id); starRepir (id, index) {
let repair_order_id = id.toString() console.log(id)
const curParams = { const curParams = {
repair_order_id: repair_order_id repair_order_id: id
} }
// const _this = this this.$http
this.$http.post(this.$myApi.REPAIR_BEGIN, curParams) .post(this.$myApi.REPAIR_BEGIN, curParams)
.then(res => { .then((res) => {})
})
.catch(() => {}) .catch(() => {})
}, },
addMeth(){ addMeth () {
this.addList.push({ this.addList.push({
hc:'', hc: '',
sl:'' sl: ''
})
},
delMeth(index){
this.addList.splice(index,1)
},
show(e){
if(this.xianshi == true){
this.xianshi = false
}else if(this.xianshi == false){
this.xianshi= true
}
},
changeItem(time_type,name) {
console.log(name);
if(time_type == this.activeStatus ){
return
}
this.activeStatus = time_type;
this.currentName = name
setTimeout(() => {
this.initData()
this.getList()
}, 0);
},
//备注耗材弹窗
bz_click(id){
console.log(id,'nfnsohnfgvdosrgvf');
this.hcShow = true
},
//转单弹窗
zd_click(){
this.zdShow = true
},
//查看耗材弹窗
look_click(){
this.lookShow = true
},
cancel(){
this.zdShow = false
this.hcShow = false
this.lookShow = false
},
//转单提交
zd_submit(){
this.zdShow = false
console.log(111)
},
//备注提交
bz_submit(id){
console.log(id,1111);
console.log('六点十分',this.addList);
this.hcShow = false
this.lookShow = false
console.log('111');
},
//发起收费
tz_charge(id){
console.log(id,'jaeofne');
this.$router.push({
path: '/charge',
query: {id}
}) })
}, },
}, delMeth (index) {
this.addList.splice(index, 1)
},
// 点击选择
show (e) {
if (this.xianshi == true) {
this.xianshi = false
} else if (this.xianshi == false) {
this.xianshi = true
}
},
// 日期维度变化
changeItem (time_type, name) {
console.log(time_type, name, '111111111111111111')
if (time_type == this.activeStatus) {
return
}
this.activeStatus = time_type
this.currentName = name
setTimeout(() => {
this.initData()
this.getList()
}, 0)
},
// 备注耗材弹窗
bz_click (id) {
console.log(id, 'nfnsohnfgvdosrgvf')
this.hcShow = true
},
// 转单弹窗
zd_click () {
this.zdShow = true
},
// 查看耗材弹窗
look_click () {
this.lookShow = true
},
cancel () {
this.zdShow = false
this.hcShow = false
this.lookShow = false
},
// 转单提交
zd_submit () {
this.zdShow = false
console.log(111)
},
// 备注提交
bz_submit (id) {
console.log(id, 1111)
console.log('六点十分', this.addList)
this.hcShow = false
this.lookShow = false
console.log('111')
},
// 发起收费
tz_charge (id) {
console.log(id, 'jaeofne')
this.$router.push({
path: '/charge',
query: { id }
})
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cont { .cont {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
padding: 0.4rem 0rem; padding: 0.4rem 0rem;
} }
.top { .top {
height: 0.36rem; height: 0.36rem;
margin-bottom: 0.38rem; margin-bottom: 0.38rem;
margin-left: 0.3rem; margin-left: 0.3rem;
} }
.top .point { .top .point {
width: 0.1rem; width: 0.1rem;
height: 0.1rem; height: 0.1rem;
background: #0054ff; background: #0054ff;
border-radius: 50%; border-radius: 50%;
margin-right: 0.13rem; margin-right: 0.13rem;
} }
.top .status { .top .status {
color: #0054ff; color: #0054ff;
font-size: 0.36rem; font-size: 0.36rem;
font-weight: bold; font-weight: bold;
} }
.menu .hc_total { .menu .hc_total {
color: #727272; color: #727272;
font-size: 0.28rem; font-size: 0.28rem;
} }
.menu .options { .menu .options {
width: 1.76rem; width: 1.76rem;
height: 0.58rem; height: 0.58rem;
background: #ffffff; background: #ffffff;
border: 1px solid #0054ff; border: 1px solid #0054ff;
border-radius: 0.12rem; border-radius: 0.12rem;
color: #0054ff; color: #0054ff;
font-size: 0.28rem; font-size: 0.28rem;
line-height: 0.58rem; line-height: 0.58rem;
text-align: center; text-align: center;
position: relative; position: relative;
margin-right: 0.3rem; margin-right: 0.3rem;
} }
.menu .options .option-box { .menu .options .option-box {
width: 1.7rem; width: 1.7rem;
// height: 2rem; // height: 2rem;
background: #fff; background: #fff;
border: 1px solid #0054ff; border: 1px solid #0054ff;
position: absolute; position: absolute;
top: 0.57rem; top: 0.57rem;
left: 0rem; left: 0rem;
border-radius: 0 0 0.12rem 0.12rem; border-radius: 0 0 0.12rem 0.12rem;
} }
.order-item { .order-item {
width: 6.9rem; width: 6.9rem;
background: #ffffff; background: #ffffff;
box-shadow: 0px 0px 0.12rem 0.01rem rgba(214, 214, 214, 0.78); box-shadow: 0px 0px 0.12rem 0.01rem rgba(214, 214, 214, 0.78);
border-radius: 0.12rem; border-radius: 0.12rem;
margin-top: 0.4rem; margin-top: 0.4rem;
padding: 0.4rem 0.3rem; padding: 0.4rem 0.3rem;
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
margin-left: 0.3rem; margin-left: 0.3rem;
} }
.title { .title {
color: #0054ff; color: #0054ff;
font-size: 0.32rem; font-size: 0.32rem;
font-weight: bold; font-weight: bold;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.item { .item {
// height: 0.3rem; // height: 0.3rem;
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
} }
.item-title { .item-title {
color: #000000; color: #000000;
font-size: 0.3rem; font-size: 0.3rem;
} }
.item-desc { .item-desc {
color: #727272; color: #727272;
font-size: 0.3rem; font-size: 0.3rem;
} }
.que-desc { .que-desc {
margin-top: 0.4rem; margin-top: 0.4rem;
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.img { .img {
width: 1.2rem; width: 1.2rem;
height: 1.2rem; height: 1.2rem;
border-radius: 0.08rem; border-radius: 0.08rem;
// margin-top: 0.8rem; // margin-top: 0.8rem;
} }
.img img { .img img {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.08rem; border-radius: 0.08rem;
margin-left: 0.16rem; margin-left: 0.16rem;
margin-right: 0.16rem; margin-right: 0.16rem;
} }
.list-item { .list-item {
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.line { .line {
width: 6.28rem; width: 6.28rem;
height: 0.01rem; height: 0.01rem;
background: #f1f1f1; background: #f1f1f1;
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.ma-item { .ma-item {
margin-top: 0.3rem; margin-top: 0.3rem;
} }
.one { .one {
color: #727272; color: #727272;
font-size: 0.3rem; font-size: 0.3rem;
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
} }
.one-item { .one-item {
margin-left: 0.3rem; margin-left: 0.3rem;
margin-right: 0.3rem; margin-right: 0.3rem;
} }
.btn-item { .btn-item {
width: 1.8rem; width: 1.8rem;
height: 0.7rem; height: 0.7rem;
background: #0054ff; background: #0054ff;
border-radius: 0.35rem; border-radius: 0.35rem;
text-align: center; text-align: center;
line-height: 0.7rem; line-height: 0.7rem;
color: #fff; color: #fff;
font-size: 0.27rem; font-size: 0.27rem;
margin-left: 0.2rem; margin-left: 0.2rem;
} }
.sf-btn { .sf-btn {
background: #ffffff; background: #ffffff;
border: 1px solid #0054ff; border: 1px solid #0054ff;
color: #0054ff; color: #0054ff;
} }
.blank { .blank {
height: 1rem; height: 1rem;
} }
.van-popup { .van-popup {
width: 6.9rem; width: 6.9rem;
max-height: 7rem; max-height: 7rem;
// height: 5.9rem; // height: 5.9rem;
background: #fff; background: #fff;
border-radius: 0.12rem; border-radius: 0.12rem;
padding-top: 0.4rem; padding-top: 0.4rem;
padding-bottom: 0.2rem; padding-bottom: 0.2rem;
text-align: center; text-align: center;
} }
.pop_title { .pop_title {
color: #000000; color: #000000;
font-size: 0.36rem; font-size: 0.36rem;
font-weight: bold; font-weight: bold;
margin-bottom: 0.4rem; margin-bottom: 0.4rem;
} }
.van-popup textarea { .van-popup textarea {
width: 6.3rem; width: 6.3rem;
height: 3rem; height: 3rem;
border: 1px solid #f1f1f1; border: 1px solid #f1f1f1;
border-radius: 0.08rem; border-radius: 0.08rem;
padding: 0.3rem 0.2rem; padding: 0.3rem 0.2rem;
} }
.van-popup textarea::-webkit-input-placeholder { .van-popup textarea::-webkit-input-placeholder {
color: #c8c8c8; color: #c8c8c8;
font-size: 0.26rem; font-size: 0.26rem;
} }
.btnItem { .btnItem {
margin-top: 0.4rem; margin-top: 0.4rem;
margin-left: 0.65rem; margin-left: 0.65rem;
} }
.btnItem .cancel { .btnItem .cancel {
width: 2.65rem; width: 2.65rem;
height: 0.78rem; height: 0.78rem;
border: 1px solid #c8c8c8; border: 1px solid #c8c8c8;
border-radius: 0.39rem; border-radius: 0.39rem;
color: #000000; color: #000000;
font-size: 0.32rem; font-size: 0.32rem;
text-align: center; text-align: center;
line-height: 0.78rem; line-height: 0.78rem;
margin-right: 0.3rem; margin-right: 0.3rem;
} }
.btnItem .sure { .btnItem .sure {
width: 2.65rem; width: 2.65rem;
height: 0.78rem; height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff); background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem; border-radius: 0.39rem;
color: #ffffff; color: #ffffff;
font-size: 0.32rem; font-size: 0.32rem;
text-align: center; text-align: center;
line-height: 0.78rem; line-height: 0.78rem;
margin-right: 0.3rem; margin-right: 0.3rem;
} }
.input { .input {
width: 6.3rem; width: 6.3rem;
height: 0.76rem; height: 0.76rem;
background: #ffffff; background: #ffffff;
border: 1px solid #f1f1f1; border: 1px solid #f1f1f1;
border-radius: 0.08rem; border-radius: 0.08rem;
text-align: left; text-align: left;
padding-left: 0.2rem; padding-left: 0.2rem;
margin-bottom: 0.1rem; margin-bottom: 0.1rem;
font-size: 0.3rem; font-size: 0.3rem;
} }
.input::-webkit-input-placeholder { .input::-webkit-input-placeholder {
color: #c8c8c8; color: #c8c8c8;
font-size: 0.3rem; font-size: 0.3rem;
} }
.math-btn { .math-btn {
margin-left: 0.3rem; margin-left: 0.3rem;
margin-right: 0.3rem; margin-right: 0.3rem;
color: #0256ff; color: #0256ff;
font-size: 0.3rem; font-size: 0.3rem;
} }
.hc_total { .hc_total {
text-align: left; text-align: left;
color: #000000; color: #000000;
font-size: 0.26rem; font-size: 0.26rem;
margin-left: 0.3rem; margin-left: 0.3rem;
} }
.sure-btn { .sure-btn {
width: 3.12rem; width: 3.12rem;
height: 0.78rem; height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff); background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem; border-radius: 0.39rem;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
line-height: 0.78rem; line-height: 0.78rem;
margin: 1.2rem auto; margin: 1.2rem auto;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="cont" v-if="user"> <div
<div class="top"></div> class="cont"
<div class="info-item"> v-if="user"
<div class="photo"> >
<img src="@assets/images/my/touxiang.png" alt /> <div class="top"></div>
</div> <div class="info-item">
<div class="btn">工作中</div> <div class="photo">
<div class="name">{{user.name}}</div> <img
<div class="group">{{user.department.name}}</div> src="@assets/images/my/touxiang.png"
<div class="tel flex-h"> alt
<div class="telNumber">{{user.phone}}</div> />
<img src="@assets/images/my/bianji.png" alt /> </div>
</div> <div class="btn">工作中</div>
<div class="name">{{user.name}}</div>
<div class="group">{{user.department.name}}</div>
<div class="tel flex-h">
<div class="telNumber">{{user.phone}}</div>
<img
src="@assets/images/my/bianji.png"
alt
/>
</div>
</div>
<!-- tabbar -->
<my-tabbar curname="my"></my-tabbar>
</div> </div>
<!-- tabbar -->
<my-tabbar curname="my"></my-tabbar>
</div>
</template> </template>
<script> <script>
...@@ -25,90 +34,90 @@ export default { ...@@ -25,90 +34,90 @@ export default {
components: { components: {
myTabbar myTabbar
}, },
data(){ data () {
return{ return {
user: '', user: ''
} }
}, },
created() { created () {
this.getUserInfo() this.getUserInfo()
}, },
methods: { methods: {
getUserInfo () { getUserInfo () {
this.$http.get(this.$myApi.USERINFO) this.$http
.then(res => { .get(this.$myApi.USERINFO)
this.user = res .then((res) => {
this.user = res
}) })
.catch(() => {}) .catch(() => {})
}, }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cont { .cont {
min-height: 100vh; min-height: 100vh;
background: #f7f7f7; background: #f7f7f7;
} }
.top { .top {
width: 100%; width: 100%;
height: 2.82rem; height: 2.82rem;
background: #0054ff; background: #0054ff;
position: relative; position: relative;
} }
.info-item { .info-item {
width: 7.5rem; width: 7.5rem;
height: 8.05rem; height: 8.05rem;
background: #ffffff; background: #ffffff;
border-radius: 0.28rem 0.28rem 0rem 0rem; border-radius: 0.28rem 0.28rem 0rem 0rem;
position: absolute; position: absolute;
top: 2.5rem; top: 2.5rem;
left: 0; left: 0;
text-align: center; text-align: center;
} }
.photo { .photo {
width: 1.7rem; width: 1.7rem;
height: 1.7rem; height: 1.7rem;
border-radius: 50%; border-radius: 50%;
background: #f1f1f1; background: #f1f1f1;
position: absolute; position: absolute;
top: -1rem; top: -1rem;
left: 2.9rem; left: 2.9rem;
} }
.btn { .btn {
width: 1.38rem; width: 1.38rem;
height: 0.48rem; height: 0.48rem;
background: #0054ff; background: #0054ff;
border-radius: 0.24rem; border-radius: 0.24rem;
color: #fff; color: #fff;
text-align: center; text-align: center;
line-height: 0.48rem; line-height: 0.48rem;
margin: 1.13rem auto 0.59rem; margin: 1.13rem auto 0.59rem;
} }
.name { .name {
color: #000000; color: #000000;
font-size: 0.38rem; font-size: 0.38rem;
margin-bottom: 0.27rem; margin-bottom: 0.27rem;
font-weight: bold; font-weight: bold;
} }
.group { .group {
color: #000000; color: #000000;
font-size: 0.3rem; font-size: 0.3rem;
margin-bottom: 0.48rem; margin-bottom: 0.48rem;
} }
.tel { .tel {
width: 2rem; width: 2rem;
height: 0.28rem; height: 0.28rem;
margin: 0 auto; margin: 0 auto;
} }
.tel .telNumber { .tel .telNumber {
color: #000000; color: #000000;
font-size: 0.3rem; font-size: 0.3rem;
margin-right: 0.2rem; margin-right: 0.2rem;
} }
.tel img { .tel img {
width: 0.28rem; width: 0.28rem;
height: 0.28rem; height: 0.28rem;
} }
</style> </style>
\ No newline at end of file
...@@ -19,4 +19,4 @@ export default { ...@@ -19,4 +19,4 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/tabbar/modifyPhone.scss"; @import "@assets/styles/tabbar/modifyPhone.scss";
</style> </style>
\ No newline at end of file
<template>
<div class="my-page">
<div class="my-header">
<img :src="userInfo.avatar" class="user-img" v-if="userInfo && userInfo.avatar" />
<img src="@assets/images/my/touxiang.png" class="user-img" v-else />
<div class="left-cont">
<p class="user-name one-line">{{userInfo.wx_nick_name}}</p>
<p class="">绑定账号:{{supplier_tel}}</p>
</div>
</div>
<div class="navlist">
<div class="list-item">
<div class="icon"><span class="iconfont icon-bangding1"></span></div>
<div class="content" @click="goRelation">
<span class="title">绑定微信</span>
<span class="iconfont icon-youhuaxiangyougengduo"></span>
</div>
</div>
<div class="list-item">
<div class="icon"><span class="iconfont icon-bangding2"></span></div>
<div class="content" @click="addRelation">
<span class="title">绑定机构</span>
<span class="iconfont icon-youhuaxiangyougengduo"></span>
</div>
</div>
<div class="list-item no-border">
<div class="icon"><span class="iconfont icon-dingyue1"></span></div>
<div class="content" @click="codeShow=true">
<span class="title">订阅通知</span>
<span class="iconfont icon-youhuaxiangyougengduo"></span>
</div>
</div>
</div>
<!-- 退出登录 -->
<div class="login-out-btn" @click="logout_click">退出当前机构</div>
<van-popup v-model="codeShow">
<img src="@assets/images/my/qrcode.jpg"/>
</van-popup>
<!-- tabbar -->
<my-tabbar curname="my"></my-tabbar>
</div>
</template>
<script>
import myTabbar from '@components/common/tabbar.vue'
import { getInfoRes } from '@assets/js/cart_res.js'
import { MY_REFRESH, INDEX_REFRESH, getLocalStorage, setLocalStorage, removeLocalStorage } from '@assets/js/self.js'
export default {
name: 'my',
components: {
myTabbar
},
data () {
return {
isclick: false,
codeShow: false,
userInfo: {},
supplier_tel: ''
}
},
methods: {
goRelation () {
this.$router.push({
name: 'relationUsers'
})
},
addRelation () {
this.$router.push({
name: 'addRelation'
})
},
getUserInfo () {
getInfoRes(this, (data) => {
this.userInfo = data
removeLocalStorage(MY_REFRESH)
})
},
logout () {
this.isclick = true
// 发起网络请求
this.$http.post(this.$myApi.LOGOUT)
.then(res => {
this.isclick = false
// 清除缓存
this.userInfo = {}
this.supplier_tel = ''
window.localStorage.clear()
setLocalStorage(INDEX_REFRESH, true)
this.$router.push({
name: 'againLogin'
})
})
.catch(() => {
this.isclick = false
})
},
logout_click () {
if (this.isclick) return
this.$dialog.confirm({
title: '提示',
message: '确定要退出当前账号吗',
theme: 'round-button',
confirmButtonColor: '#325BEF',
cancelButtonColor: '#FFFFFF',
className: 'self-dialog'
})
.then(() => {
this.logout()
})
.catch(() => {})
},
fetchData (to, from) {
this.isclick = false
if (getLocalStorage(MY_REFRESH)) {
this.getUserInfo()
}
}
},
mounted () {
this.getUserInfo()
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData()
})
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/my.scss";
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment