Commit 74346a65 authored by 石盼盼's avatar 石盼盼

修改冲突

parents 27705960 ed247072
......@@ -13,113 +13,28 @@ const h5Url = 'https://repair.zeruiedu.com' // 测试h5线上地址
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
// const h5Url = 'http://depository.fhxmcy.com' // 正式h5线上地址
const wxLogin = '/api/worker/login' // 微信登录获取token、登录状态
const curScope = 'scopes=snsapi_base&type=1'
export default {
// url地址
WINDOWHREF_LOGIN: `${httpUrl}/api/scm/login?callBack=${h5Url}/login&scopes=snsapi_base&type=1`,
WINDOWHREF_LOGIN_ROUTE: `${httpUrl}/api/scm/login?callBack=${window.location.href}&scopes=snsapi_base&type=1`,
WINDOWHREF_INDEX: `${httpUrl}/api/scm/login?callBack=${h5Url}&scopes=snsapi_base&type=1`,
WINDOWHREF_ASK: `${httpUrl}/api/scm/login?callBack=${h5Url}&scopes=snsapi_userinfo&type=1`,
WINDOWHREF_LOGIN: `${httpUrl}${wxLogin}?callBack=${h5Url}/login&${curScope}`, // 身份失效跳转的登录
WINDOWHREF_LOGIN_TOKEN: `${httpUrl}${wxLogin}?callBack=${window.location.href}&${curScope}`, // 获取token和登录状态
WINDOWHREF_INDEX: `${httpUrl}${wxLogin}?callBack=${h5Url}&${curScope}`, //
WINDOWHREF_ASK: `${httpUrl}${wxLogin}?callBack=${h5Url}&scopes=snsapi_userinfo&type=1`, // 绑定后用户进行授权
// 登录相关
SENDCODE: baseUrl + '/worker/send', // 发送验证码
BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信
USERINFO: baseUrl + '/worker/user/info', // 获取用户信息
REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表
ORDER_STATUS: baseUrl + '/worker/repair/order/status', // 获取订单状态
REPAIR_BEGIN: baseUrl + '/worker/repair/begin', // 开始维修接口
REPAIR_ORDER_DETAIL: baseUrl + '/worker/repair/order/detail', // 报修单详情
REPAIR_ORDER: baseUrl + '/worker/material/order', // 发起收费生成耗材单
MATERIAL_REMARK: baseUrl + '/worker/material/remark', // 备注耗材
MATERIAL_REMARK: baseUrl + '/worker/material/remark' // 备注耗材
// BINDLOGINTWO: baseUrl + '/scm/bind/login/two', // 绑定后台账号
// REFRESHTOKEN: baseUrl + '/scm/change/token', // 更新token
// LOGOUT: baseUrl + '/scm/logout', // 更新token
// 首页
WARNGOODS: baseUrl + '/scm/warn_goods/today', // 今日预警
WARNGOODSADD: baseUrl + '/scm/warn_goods/addCars', // 采购预警-点击将商品添加至购物车
SUPPLIER: baseUrl + '/scm/supplier/my', // 机构列表
CHANGE_SUPPLIER: baseUrl + '/scm/change_agency', // 切换机构
TIPSNUM: baseUrl + '/scm/home/index', // 首页提示数量
// 消息
NOTICELIST: baseUrl + '/scm/notice/list', // 消息
// 个人中心
WXLIST: baseUrl + '/scm/supplier/wx_list', // 获取机构绑定的微信列表
SUPPLIWRDETAIL: baseUrl + '/scm/supplier/detail', // 获取机构详情
// //////////////////// 筛选 列表 /////////////////////
PROVIDERLIST: baseUrl + '/scm/purchase_return/get_providers', // 供应商列表
SHOPLIST: baseUrl + '/scm/supplier_trade_return/get_shop_list', // 商铺列表
// //////////////////// 采购管理 /////////////////////
// 采购计划
CATE: baseUrl + '/scm/cates', // 采购计划分类列表
CATEGOODS: baseUrl + '/scm/goods', // 采购计划分类商品列表 搜索商品列表
CHANGECART: baseUrl + '/scm/car_goods', // 更改购物车数量
CARTLIST: baseUrl + '/scm/cars', // 购物车列表
CLEARCART: baseUrl + '/scm/clear_car', // 清空购物车
ADDPLAN: baseUrl + '/scm/add_plan', // 提交采购计划
PLANLIST: baseUrl + '/scm/plan_list', // 采购计划列表
PURCHASE_DETAIL: baseUrl + '/scm/purchase_detail', // 详情 1:采购计划,2:采购订单,3:入库订单
PLANAUDIT: baseUrl + '/scm/audit', // 采购计划-审核
PLANDELETE: baseUrl + '/scm/del', // 采购计划-删除
PLANBILLS: baseUrl + '/scm/bills', // 相关单据
// 采购订单
PURORDERLIST: baseUrl + '/scm/order_list', // 采购订单列表
PURORDERCANCEL: baseUrl + '/scm/order_cancel', // 采购订单-取消
// 入库订单
ENTRYLIST: baseUrl + '/scm/purchase/into/storehouses/list', // 入库订单列表
ENTRYGOODS: baseUrl + '/scm/purchase/into/storehouses/goods', // 入库商品列表
ENTRYCHECK: baseUrl + '/scm/order_store', // 验收入库详情
PURENTRY: baseUrl + '/scm/order_intostore', // 验收入库
// //////////////////// 销售管理 /////////////////////
SALELIST: baseUrl + '/scm/supplier_trade/list', // 销售列表
SALEDETAIL: baseUrl + '/scm/supplier_trade/operation_out', // 销售详情
SALE_EDIT_DETAIL: baseUrl + '/scm/supplier_trade/detail', // 销售编辑详情
SALE_EDIT_SAVE: baseUrl + '/scm/supplier_trade/alter', // 销售编辑详情
SALEOUT: baseUrl + '/scm/supplier_trade/out', // 验收出库
SALEGOODSLIST: baseUrl + '/scm/supplier_trade_good/goods_list', // 销售商品
// //////////////////// 档案管理 /////////////////////
// 调价
ADJUSTPRICE: baseUrl + '/scm/adjust/price/list', // 调价列表
ADJUSTPRICEDETAIL: baseUrl + '/scm/adjust/price/detail', // 调价详情
ADJUSTPRICEGOODS: baseUrl + '/scm/adjust/price/goods', // 调价商品列表
// 调库
ADJUSTSTOCK: baseUrl + '/scm/adjust/stock/list', // 调库列表
ADJUSTSTOCKDETAIL: baseUrl + '/scm/adjust/stock/detail', // 调库列表详情
ADJUSTSTOCKGOODS: baseUrl + '/scm/adjust/stock/goods', // 调库商品列表
// //////////////////// 运维管理 /////////////////////
// 采购退货
PURCHASERETURN: baseUrl + '/scm/purchase_return/list', // 采购退货列表
PURCHASERETURN_DETAIL: baseUrl + '/scm/purchase_return/details', // 采购退货详情
PURCHASERETURN_CREATE: baseUrl + '/scm/purchase_return/create', // 采购退货添加
PURCHASERETURN_DETELE: baseUrl + '/scm/purchase_return/destroy', // 采购退货删除
PURCHASERETURN_EDIT: baseUrl + '/scm/purchase_return/edit', // 采购退货编辑
PURCHASERETURN_CHECK: baseUrl + '/scm/purchase_return/check', // 采购退货审核
// 销售退货
SALERETURN: baseUrl + '/scm/supplier_trade_return/list', // 销售退货列表
SALERETURN_DETAIL: baseUrl + '/scm/supplier_trade_return/details', // 销售退货详情
SALERETURN_CREATE: baseUrl + '/scm/supplier_trade_return/create', // 销售退货添加
SALERETURN_EDIT: baseUrl + '/scm/supplier_trade_return/edit', // 销售退货编辑
SALERETURN_DELETE: baseUrl + '/scm/supplier_trade_return/destroy', // 销售退货删除
SALERETURN_CHECK: baseUrl + '/scm/supplier_trade_return/check', // 销售退货审核
// 商品档案
GOODSCLASS: baseUrl + '/scm/goods_record', // 商品档案列表
// 赠送入库
FREELIST: baseUrl + '/scm/free/gift/storage/list', // 赠送入库列表
FREE_CREATE: baseUrl + '/scm/free/gift/storage/stock', // 赠送入库新增
FREE_CHECK: baseUrl + '/scm/free/gift/storage/check', // 赠送入库审核
FREE_DELETE: baseUrl + '/scm/free/gift/storage/delete', // 赠送入库删除
GOODS_ADD_CHOOSE: baseUrl + '/scm/free/gift/storage/goods/list', // 搜索商品-添加商品页
// 协助订单
ASSIST_CREATE: baseUrl + '/scm/help/add_trade', // 协助订单列表
ASSIST_LIST: baseUrl + '/scm/help/trade_list', // 协助订单列表
ASSIST_DETAIL: baseUrl + '/scm/help/trade_detail', // 协助订单详情
ASSIST_DETELE: baseUrl + '/scm/help/trade_del', // 协助订单删除
ASSIST_CODE: baseUrl + '/scm/help/pay_code' // 协助订单扫码支付
}
......@@ -34,35 +34,34 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
const { data, config } = response
console.log('添加响应拦截器', response)
if (data.meta.code === 400) {
console.log('===== token过期 =====')
const promisefresh = new Promise(function (resolve, reject) {
updateToken(() => {
config.headers.token = window.localStorage.getItem('token')
axios.request(response.config).then(res => {
const curData = res.data
if (curData.meta.code === 200) {
resolve(curData)
} else {
// window.localStorage.removeItem('token')
// window.localStorage.removeItem('status')
resolve(curData)
}
})
}, (err) => {
resolve(err)
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
console.log('错误--------', err)
})
})
return promisefresh
} else {
return data
// console.log('添加响应拦截器', response)
// if (data.code === 400) {
// console.log('===== token过期 =====')
// const promisefresh = new Promise(function (resolve, reject) {
// updateToken(() => {
// config.headers.token = window.localStorage.getItem('token')
// axios.request(response.config).then(res => {
// const curData = res.data
// if (curData.code === 200) {
// resolve(curData)
// } else {
// // window.localStorage.removeItem('token')
// // window.localStorage.removeItem('status')
// resolve(curData)
// }
// })
// }, (err) => {
// resolve(err)
// window.localStorage.clear()
// Toast('身份失效,请重新登录')
// window.document.location = selfApi.WINDOWHREF_LOGIN // url-
// console.log('错误--------', err)
// })
// })
// return promisefresh
// } else {
// return data
// }
}
},
error => {
let info = {}
......
import axios from './axios'
import {
Toast,
Dialog
} from 'vant'
import { Toast, Dialog } from 'vant'
import router from '../router/index'
import selfApi from '@/api/apiList'
const instance = axios()
export default {
get(url, params, headers, toast = true) {
get (url, params, headers, toast = true) {
const options = {}
options.headers = {
// token: window.localStorage.getItem('token'),
token: 'sys'
token: window.localStorage.getItem('token')
// token: 'sys'
// type: 1
}
......@@ -42,20 +39,19 @@ export default {
instance.get(url, options).then(res => {
const {
data,
message
meta
} = res
const code = res.meta.code
// console.log(code, typeof code, '11111111111111')
toast && tipsToast.clear()
if (code === 200) {
if (meta.code === 200) {
resolve(data)
} else if (code === -300) {
} else if (meta.code === -300) {
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
} else {
reject(res)
Toast(message)
Toast(meta.message)
}
}).catch(err => {
toast && tipsToast.clear()
......@@ -64,12 +60,12 @@ export default {
})
},
post(url, data, headers, params, toast = true) {
post (url, data, headers, params, toast = true) {
const options = {}
options.headers = {
// token: window.localStorage.getItem('token'),
token: 'sys'
token: window.localStorage.getItem('token')
// token: 'sys'
// type: 1
}
......@@ -96,19 +92,18 @@ export default {
instance.post(url, data, options).then(res => {
const {
data,
message
meta
} = res
const code = res.meta.code
toast && tipsToast.clear()
if (code === 200) {
if (meta.code === 200) {
resolve(data)
} else if (code === -300) {
} else if (meta.code === -300) {
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
} else {
reject(res)
Toast(message)
Toast(meta.message)
}
}).catch(err => {
toast && tipsToast.clear()
......@@ -117,7 +112,7 @@ export default {
})
},
put(url, params, headers) {
put (url, params, headers) {
const options = {}
if (headers) {
......@@ -145,7 +140,7 @@ export default {
})
},
delete(url, params, headers) {
delete (url, params, headers) {
const options = {}
if (params) {
......
This diff is collapsed.
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 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'
// export const SELFSHOP = 'self_shop'
/**
* 设置缓存 getLocalStorage
* @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'
import Vant from 'vant'
import 'vant/lib/index.css'
import vConsole from '@/plugins/vconsole.js'
import myCondition from '@/components/common/condition.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.use(vConsole)
......
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/tabbar/Home.vue'
// import selfApi from '@/api/apiList'
import selfApi from '@/api/apiList'
Vue.use(VueRouter)
const routes = [
{
path: '/home',
path: '/',
name: 'home',
meta: {
title: '工单',
......@@ -16,20 +16,16 @@ const routes = [
},
component: Home
},
// 登录
{
path: '/',
redirect: '/login'
},
{
path: '/my',
name: 'my',
path: '/login',
name: 'login',
meta: {
title: '我的',
title: '登录',
hideBack: true
},
component: () => import('../views/tabbar/my.vue')
component: () => import('@/views/login/login.vue')
},
{
path: '/mine',
name: 'mine',
......@@ -48,25 +44,6 @@ const routes = [
},
component: () => import('../views/tabbar/modifyPhone.vue')
},
// 登录
{
path: '/login',
name: 'login',
meta: {
title: '登录',
hideBack: true
},
component: () => import('@/views/login/login.vue')
},
{
path: '/againLogin',
name: 'againLogin',
meta: {
title: '登录',
hideBack: true
},
component: () => import('@/views/login/againlogin.vue')
},
// 个人中心
{
path: '/charge',
......@@ -76,22 +53,6 @@ const routes = [
hideBack: true
},
component: () => import('@/views/my/charge.vue')
},
{
path: '/relationUsers',
name: 'relationUsers',
meta: {
title: '我的'
},
component: () => import('@/views/my/relation-users.vue')
},
{
path: '/addRelation',
name: 'addRelation',
meta: {
title: '绑定机构'
},
component: () => import('@/views/my/add-relation.vue')
}
]
......@@ -99,7 +60,7 @@ const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
scrollBehavior(to, from, savePosition) {
scrollBehavior (to, from, savePosition) {
if (savePosition) {
return savePosition
} else {
......@@ -112,75 +73,38 @@ const router = new VueRouter({
})
router.beforeEach((to, from, next) => {
let token = window.localStorage.getItem('token')
let status = window.localStorage.getItem('status')
if (to.path === '/login' && token && status) {
next()
// console.log(to)
// localStorage.setItem('fromQuery',from.path); //记录路由
// console.log(to.path)
/** 商品列表 */
// if (to.path.indexOf('goodsList/') !== -1) {
// switch (to.params.type) {
// case 'entry':
// to.meta.title = '入库商品'
// break
// case 'out':
// to.meta.title = '出库商品'
// break
// case 'sale':
// to.meta.title = '销售商品'
// break
// default:
// to.meta.title = '商品列表'
// break
// }
// } else if (to.path.indexOf('returnGoods/list/') !== -1) {
// switch (to.params.type) {
// case 'purchase':
// to.meta.title = '采购退货'
// break
// case 'sale':
// to.meta.title = '销售退货'
// break
// default:
// to.meta.title = '商品列表'
// break
// }
// }
// let token = window.localStorage.getItem('token')
// let status = window.localStorage.getItem('status')
// if (to.path === '/againLogin') {
// next()
// return true
// }
// if (to.path === '/login' && token && status) {
// next()
// return true
// }
// if (to.query.token && to.query.status) {
// console.log('ok-------0', status)
// token = to.query.token
// status = to.query.status
// // console.log(token)
// // console.log(status)
// window.localStorage.setItem('token', token)
// window.localStorage.setItem('status', status)
// }
// if (token && status === '200') {
// console.log('ok-------1', 200)
// next()
// } else if (token && status === '100') {
// console.log('ok-------2', 100)
// setTimeout(() => {
// next({
// path: '/login'
// })
// }, 50)
// return true
// } else {
// console.log('ok-------3')
// window.document.location = selfApi.WINDOWHREF_LOGIN_ROUTE // url-
// return true
// }
return true
}
if (to.query.token && to.query.status) {
console.log('ok-------0', status)
token = to.query.token
status = to.query.status
// console.log(token)
// console.log(status)
window.localStorage.setItem('token', token)
window.localStorage.setItem('status', status)
}
if (token && status === '200') {
console.log('ok-------1', 200)
next()
} else if (token && status === '100') {
console.log('ok-------2', 100)
setTimeout(() => {
next({
path: '/login'
})
}, 50)
return true
} else {
console.log('ok-------3')
// return
window.document.location = selfApi.WINDOWHREF_LOGIN_TOKEN // url-
return true
}
})
router.afterEach((to, from, next) => {
......
<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>
......@@ -49,7 +49,6 @@ export default {
return false
},
getCode () {
console.log(111);
if (this.isSending) return
if (this.tel.length !== 11) {
this.$toast('请正确输入手机号码')
......@@ -64,7 +63,6 @@ export default {
.catch(() => {})
},
countDown () {
// const _this = this
let seconds = 60
this.timer = setInterval(() => {
seconds--
......@@ -82,11 +80,9 @@ export default {
tel: this.tel,
code: this.code
}
// const _this = this
this.$http.post(this.$myApi.BINDLOGIN, curParams)
.then(res => {
console.log('执行了吗');
this.$router.replace('/home')
window.document.location = this.$myApi.WINDOWHREF_ASK // url-
})
.catch(() => {})
},
......@@ -110,12 +106,6 @@ export default {
}
next()
}
// beforeCreate () {
// document.querySelector('body').setAttribute('style', 'background: #ffffff')
// },
// beforeDestroy () {
// document.querySelector('body').removeAttribute('style')
// }
}
</script>
<style lang="scss" scoped>
......
<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>
<div class="cont" v-if="order">
<div
class="cont"
v-if="order"
>
<div class="top">
<div class="item flex-h flex-vc">
<div class="title">维修类目:</div>
......@@ -9,9 +12,7 @@
<div class="item-desc que-desc">{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div
class="item-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
<div class="item-desc">{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
......@@ -27,32 +28,101 @@
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div class="img flex-h" v-for="(child, index) in order.image" :key="index">
<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 class="things">
<div class="things_title">所需耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index">
<div class="item flex-h flex-hb" @click="showZl(index)">
<div
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="title_left">耗材种类</div>
<div class="title_r">{{item.zl}}</div>
</div>
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt />
<img
src="@assets/images/my/select.png"
alt
/>
</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="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 />
<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 class="item flex-h flex-vc">
......@@ -126,7 +196,7 @@ export default {
total_price: 0,
}
},
created(){
created () {
// console.log('change页面')
this.repair_order_id = this.$route.query.id
// console.log(this.$route.query.id,'接收的id');
......@@ -135,9 +205,8 @@ export default {
// mounted(){
// this.getDetail()
// },
methods:{
getDetail(){
let repair_order_id = this.repair_order_id.toString()
methods: {
getDetail () {
const curParams = {
repair_order_id: this.repair_order_id
}
......@@ -193,10 +262,10 @@ export default {
},
addMeth () {
this.addList.push({
zl:'',
mc:'',
sl:'',
zlSelect:false,
zl: '',
mc: '',
sl: '',
zlSelect: false,
mcSelect: false
})
},
......
<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>
This diff is collapsed.
<template>
<div class="cont" v-if="user">
<div
class="cont"
v-if="user"
>
<div class="top"></div>
<div class="info-item">
<div class="photo">
<img src="@assets/images/my/touxiang.png" alt />
<img
src="@assets/images/my/touxiang.png"
alt
/>
</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 />
<img
src="@assets/images/my/bianji.png"
alt
/>
</div>
</div>
<!-- tabbar -->
......@@ -25,24 +34,24 @@ export default {
components: {
myTabbar
},
data(){
return{
user: '',
data () {
return {
user: ''
}
},
created() {
created () {
this.getUserInfo()
},
methods: {
getUserInfo () {
this.$http.get(this.$myApi.USERINFO)
.then(res => {
this.$http
.get(this.$myApi.USERINFO)
.then((res) => {
this.user = res
})
.catch(() => {})
},
}
}
}
</script>
......@@ -58,7 +67,7 @@ export default {
position: relative;
}
.info-item {
width: 100%;
width: 7.5rem;
height: 8.05rem;
background: #ffffff;
border-radius: 0.28rem 0.28rem 0rem 0rem;
......@@ -74,7 +83,7 @@ export default {
background: #f1f1f1;
position: absolute;
top: -1rem;
left: 3.2rem;
left: 2.9rem;
}
.btn {
width: 1.38rem;
......
<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