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
class="cont"
v-if="order"
>
<div class="top"> <div class="top">
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="title">维修类目:</div> <div class="title">维修类目:</div>
...@@ -9,9 +12,7 @@ ...@@ -9,9 +12,7 @@
<div class="item-desc que-desc">{{order.description}}</div> <div class="item-desc que-desc">{{order.description}}</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div> <div class="item-title">服务地址:</div>
<div <div class="item-desc">{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
class="item-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
</div> </div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div> <div class="item-title">客户姓名:</div>
...@@ -27,40 +28,71 @@ ...@@ -27,40 +28,71 @@
</div> </div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div> <div class="item-title">图片详情:</div>
<div class="img flex-h" v-for="(child, index) in order.image" :key="index"> <div
<img :src="child.url" alt /> class="img flex-h"
v-for="(child, index) in order.image"
:key="index"
>
<img
:src="child.url"
alt
/>
</div> </div>
</div> </div>
</div> </div>
<div class="things"> <div class="things">
<div class="things_title">所需耗材</div> <div class="things_title">所需耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index"> <div
<div class="item flex-h flex-hb" @click="showZl(index)"> class="list-item"
v-for="(item,index) in addList"
:key="index"
>
<div
class="item flex-h flex-hb"
@click="showZl(index)"
>
<div class="item_title flex-h flex-vc"> <div class="item_title flex-h flex-vc">
<div class="title_left">耗材种类</div> <div class="title_left">耗材种类</div>
<div class="title_r">{{item.zl}}</div> <div class="title_r">{{item.zl}}</div>
</div> </div>
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
<div class="select_txt">选择</div> <div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt /> <img
src="@assets/images/my/select.png"
alt
/>
</div> </div>
</div> </div>
<div class="item flex-h flex-hb" @click="showHc(index)"> <div
class="item flex-h flex-hb"
@click="showHc(index)"
>
<div class="item_title flex-h flex-vc"> <div class="item_title flex-h flex-vc">
<div class="title_left">耗材名称</div> <div class="title_left">耗材名称</div>
<div class="title_r">{{item.mc}}</div> <div class="title_r">{{item.mc}}</div>
</div> </div>
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
<div class="select_txt">选择</div> <div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt /> <img
src="@assets/images/my/select.png"
alt
/>
</div> </div>
</div> </div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="title_left">耗材个数</div> <div class="title_left">耗材个数</div>
<input type="number" placeholder="请输入" v-model="item.sl" /> <input
type="number"
placeholder="请输入"
v-model="item.sl"
/>
</div> </div>
<!-- 种类弹窗 --> <!-- 种类弹窗 -->
<van-popup v-model="item.zlSelect" round position="bottom"> <van-popup
v-model="item.zlSelect"
round
position="bottom"
>
<van-picker <van-picker
show-toolbar show-toolbar
:columns="types" :columns="types"
...@@ -68,7 +100,11 @@ ...@@ -68,7 +100,11 @@
@cancel="typeCancel(index)" @cancel="typeCancel(index)"
/> />
</van-popup> </van-popup>
<van-popup v-model="item.mcSelect" round position="bottom"> <van-popup
v-model="item.mcSelect"
round
position="bottom"
>
<van-picker <van-picker
show-toolbar show-toolbar
:columns="hcName" :columns="hcName"
...@@ -79,8 +115,14 @@ ...@@ -79,8 +115,14 @@
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="math-btn flex-h flex-vc flex-hb"> <div class="math-btn flex-h flex-vc flex-hb">
<div class="del-btn" @click="delMeth">-删除耗材</div> <div
<div class="add-btn" @click="addMeth">+新增耗材</div> class="del-btn"
@click="delMeth"
>-删除耗材</div>
<div
class="add-btn"
@click="addMeth"
>+新增耗材</div>
</div> </div>
</div> </div>
<div class="blank"></div> <div class="blank"></div>
...@@ -101,27 +143,27 @@ export default { ...@@ -101,27 +143,27 @@ 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');
...@@ -130,53 +172,53 @@ export default { ...@@ -130,53 +172,53 @@ export default {
// 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)
.then((res) => {
this.order = res.order this.order = res.order
console.log(this.order,123456); 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>
......
<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>
...@@ -4,12 +4,11 @@ ...@@ -4,12 +4,11 @@
<div class="point"></div> <div class="point"></div>
<div class="status">工作中</div> <div class="status">工作中</div>
</div> </div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="menu flex-h flex-hb"> <div class="menu flex-h flex-hb">
<div class="hc_total">{{count}}个工单</div> <div class="hc_total">{{count}}个工单</div>
<div class="options" @click="show"> <div class="options" >
{{currentName}} {{currentName}}
<div class="option-box" v-show="xianshi"> <div class="option-box" v-show="true">
<div <div
class="option-item" class="option-item"
v-for="item in optionList" v-for="item in optionList"
...@@ -20,21 +19,18 @@ ...@@ -20,21 +19,18 @@
</div> </div>
</div> </div>
</div> </div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item" v-for="(item, index) in list" :key="item.id"> <div class="order-item" v-for="(item, index) in list" :key="item.id">
<div class="title">{{item.order_status_display }}</div> <div class="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div class="item-desc">{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
class="item-desc"
>{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
</div> </div>
<div class="item-title">问题描述:</div> <div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{item.description}}</div> <div class="item-desc que-desc">{{item.description}}</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div> <div class="item-title">服务地址:</div>
<div <div class="item-desc">{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
class="item-desc"
>{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
</div> </div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div> <div class="item-title">客户姓名:</div>
...@@ -63,7 +59,7 @@ ...@@ -63,7 +59,7 @@
<div class="item-title">联系电话:</div> <div class="item-title">联系电话:</div>
<div class="item-desc">{{item.worker.phone}}</div> <div class="item-desc">{{item.worker.phone}}</div>
</div> </div>
<div class="material" v-if="item.no_pay_order != null"> <div class="material" v-if="item.no_pay_order != null" >
<div class="item-title">已支付耗材</div> <div class="item-title">已支付耗材</div>
<div class="ma-item flex-h flex-hb"> <div class="ma-item flex-h flex-hb">
<div class="one">洁具</div> <div class="one">洁具</div>
...@@ -73,21 +69,32 @@ ...@@ -73,21 +69,32 @@
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="btn flex-h flex-hr"> <div class="btn flex-h flex-hr">
<div v-if="item.is_can_remark_material==1" class="btn-item bz-btn" @click="bz_click(item.id)">备注耗材</div> <div v-if="item.is_can_remark_material==1" class="btn-item bz-btn" @click="bz_click(item.id)" >备注耗材</div>
<div v-if="item.is_can_confirm_complete==1" class="btn-item qr-btn">确认完成</div> <div
<div v-if="item.is_can_initiate_charge==1" class="btn-item sf-btn" @click="tz_charge(item.id)">发起收费</div> v-if="item.is_can_confirm_complete==1"
<div v-if="item.is_can_initiate_transfer_order==1" class="btn-item" @click="zd_click">发起转单</div> class="btn-item qr-btn" >确认完成</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 <div
v-if="item.is_can_begin_repair==1" v-if="item.is_can_begin_repair==1"
class="btn-item" class="btn-item"
@click="starRepir(item.id,index)" @click="starRepir(item.id,index)" >开始维修</div>
>开始维修</div> <div v-if="item.is_can_see_appraisal==1" class="btn-item" >查看评价</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 v-if="item.is_can_see_material==1" class="btn-item sf-btn" @click="look_click">查看耗材</div>
</div> </div>
</div> </div>
<!-- 空数据 --> <!-- 空数据 -->
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" /> <van-empty
class="custom-image"
description="暂无工单哦~"
v-if="!list.length && !more"
/>
</van-pull-refresh> </van-pull-refresh>
<div class="blank"></div> <div class="blank"></div>
<!-- 发起转单弹窗 --> <!-- 发起转单弹窗 -->
...@@ -95,16 +102,30 @@ ...@@ -95,16 +102,30 @@
<div class="pop_title">备注转单原因</div> <div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由"></textarea> <textarea placeholder="请输入转单理由"></textarea>
<div class="btnItem flex-h"> <div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div> <div class="cancel" @click="cancel" >取消</div>
<div class="sure" @click="zd_submit">提交</div> <div class="sure" @click="zd_submit" >提交</div>
</div> </div>
</van-popup> </van-popup>
<!-- 备注耗材弹窗 --> <!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close"> <van-popup v-model="hcShow" close-icon="close">
<div class="pop_title">备注耗材</div> <div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index"> <div
<input class="input" v-model="item.hc" type="text" placeholder="请输入耗材名称" /> class="list-item"
<input class="input" v-model="item.sl" type="text" placeholder="请输入耗材个数" /> 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>
<div class="math-btn flex-h flex-vc flex-hb"> <div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div> <div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div>
...@@ -143,45 +164,50 @@ export default { ...@@ -143,45 +164,50 @@ 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', {
time_type: '1',
name: '今日' name: '今日'
},{ },
time_type:'2', {
time_type: '2',
name: '本周' name: '本周'
},{ },
time_type:'3', {
time_type: '3',
name: '本月' name: '本月'
},{ },
time_type:'4', {
time_type: '4',
name: '自定义' name: '自定义'
}], }
],
activeStatus: 3, activeStatus: 3,
zdShow: false,//发起转单弹窗 zdShow: false, // 发起转单弹窗
hcShow: false,//耗材弹窗 hcShow: false, // 耗材弹窗
lookShow: false,//查看耗材弹窗 lookShow: false, // 查看耗材弹窗
list: [], 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()
}, },
...@@ -194,11 +220,11 @@ export default { ...@@ -194,11 +220,11 @@ export default {
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(() => {})
...@@ -211,15 +237,16 @@ export default { ...@@ -211,15 +237,16 @@ 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
...@@ -234,87 +261,87 @@ export default { ...@@ -234,87 +261,87 @@ export default {
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){ delMeth (index) {
this.addList.splice(index,1) this.addList.splice(index, 1)
}, },
show(e){ // 点击选择
if(this.xianshi == true){ show (e) {
if (this.xianshi == true) {
this.xianshi = false this.xianshi = false
}else if(this.xianshi == false){ } else if (this.xianshi == false) {
this.xianshi= true this.xianshi = true
} }
}, },
changeItem(time_type,name) { // 日期维度变化
console.log(name); changeItem (time_type, name) {
if(time_type == this.activeStatus ){ console.log(time_type, name, '111111111111111111')
if (time_type == this.activeStatus) {
return return
} }
this.activeStatus = time_type; this.activeStatus = time_type
this.currentName = name this.currentName = name
setTimeout(() => { setTimeout(() => {
this.initData() this.initData()
this.getList() this.getList()
}, 0); }, 0)
}, },
//备注耗材弹窗 // 备注耗材弹窗
bz_click(id){ bz_click (id) {
console.log(id,'nfnsohnfgvdosrgvf'); console.log(id, 'nfnsohnfgvdosrgvf')
this.hcShow = true this.hcShow = true
}, },
//转单弹窗 // 转单弹窗
zd_click(){ zd_click () {
this.zdShow = true this.zdShow = true
}, },
//查看耗材弹窗 // 查看耗材弹窗
look_click(){ look_click () {
this.lookShow = true this.lookShow = true
}, },
cancel(){ cancel () {
this.zdShow = false this.zdShow = false
this.hcShow = false this.hcShow = false
this.lookShow = false this.lookShow = false
}, },
//转单提交 // 转单提交
zd_submit(){ zd_submit () {
this.zdShow = false this.zdShow = false
console.log(111) console.log(111)
}, },
//备注提交 // 备注提交
bz_submit(id){ bz_submit (id) {
console.log(id,1111); console.log(id, 1111)
console.log('六点十分',this.addList); console.log('六点十分', this.addList)
this.hcShow = false this.hcShow = false
this.lookShow = false this.lookShow = false
console.log('111'); console.log('111')
}, },
//发起收费 // 发起收费
tz_charge(id){ tz_charge (id) {
console.log(id,'jaeofne'); console.log(id, 'jaeofne')
this.$router.push({ this.$router.push({
path: '/charge', path: '/charge',
query: {id} query: { id }
}) })
}, }
}, }
} }
</script> </script>
......
<template> <template>
<div class="cont" v-if="user"> <div
class="cont"
v-if="user"
>
<div class="top"></div> <div class="top"></div>
<div class="info-item"> <div class="info-item">
<div class="photo"> <div class="photo">
<img src="@assets/images/my/touxiang.png" alt /> <img
src="@assets/images/my/touxiang.png"
alt
/>
</div> </div>
<div class="btn">工作中</div> <div class="btn">工作中</div>
<div class="name">{{user.name}}</div> <div class="name">{{user.name}}</div>
<div class="group">{{user.department.name}}</div> <div class="group">{{user.department.name}}</div>
<div class="tel flex-h"> <div class="tel flex-h">
<div class="telNumber">{{user.phone}}</div> <div class="telNumber">{{user.phone}}</div>
<img src="@assets/images/my/bianji.png" alt /> <img
src="@assets/images/my/bianji.png"
alt
/>
</div> </div>
</div> </div>
<!-- tabbar --> <!-- tabbar -->
...@@ -25,24 +34,24 @@ export default { ...@@ -25,24 +34,24 @@ 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)
.then((res) => {
this.user = res this.user = res
}) })
.catch(() => {}) .catch(() => {})
},
} }
}
} }
</script> </script>
......
<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