diff --git a/apis/setting.js b/apis/setting.js index 4ea84ee..742b965 100644 --- a/apis/setting.js +++ b/apis/setting.js @@ -6,3 +6,27 @@ export function employeeName(data) { data }) } +// 新增员工 +export function addEmployee(data) { + return http.post({ + url: '/yyt-uec/enterprise/add/employee?userId='+data.userId +'&enterpriseId=' +data.enterpriseId, + data + }) +} +// 员工列表 +export function employeeList(data) { + return http.get({ + url: '/yyt-uec/enterprise/get/employee-list', + data + }) +} +// 删除员工 +export function deleteEmployee(data) { + return http.post({ + url: '/yyt-uec/enterprise/delete/employee?enterpriseId='+data.enterpriseId, + data + }) +} + + + diff --git a/pages/about/index.vue b/pages/about/index.vue index c608e22..48c4e6c 100644 --- a/pages/about/index.vue +++ b/pages/about/index.vue @@ -51,6 +51,7 @@ export default { font-size: 64rpx; color: #000000; font-weight: 400; + margin-top: 40rpx; } .about-subtext { font-size: 28rpx; diff --git a/pages/account-management/index.vue b/pages/account-management/index.vue index 03dc090..5c417d9 100644 --- a/pages/account-management/index.vue +++ b/pages/account-management/index.vue @@ -7,26 +7,137 @@ 添加账号 + + + + + + + + + + diff --git a/pages/add-account/index.vue b/pages/add-account/index.vue index 8183fd0..81f751d 100644 --- a/pages/add-account/index.vue +++ b/pages/add-account/index.vue @@ -1,22 +1,262 @@ - diff --git a/pages/add-paper/index.vue b/pages/add-paper/index.vue index 643de8b..8eb31c0 100644 --- a/pages/add-paper/index.vue +++ b/pages/add-paper/index.vue @@ -14,7 +14,7 @@ 纸品名称 - + @@ -30,6 +30,7 @@ v-model="form.manufacturerName" :inputBorder="false" text="right" + :maxlength="100" placeholder="请输入纸厂信息" > @@ -47,7 +48,8 @@ v-model="form.brandName" :inputBorder="false" text="right" - placeholder="请输入纸品品牌名称" + :maxlength="50" + placeholder="请输入品牌信息" > @@ -57,12 +59,21 @@ 纸种信息 + - + @@ -94,11 +105,12 @@ @@ -166,6 +178,7 @@ v-model="item.minimum" :inputBorder="false" text="right" + :maxlength="9999999999" placeholder="请输入最低起送量" > {{ item.stockUnit === '1' ? '张' : '吨' }} @@ -183,7 +196,7 @@ file-mediatype="image" mode="grid" file-extname="png,jpg" - :limit="6" + :limit="5" :image-styles="imageStyles" @progress="progress" @success="success" @@ -252,7 +265,7 @@ v-model="form.otherNote" :inputBorder="false" type="textarea" - placeholder="请输入其他说明" + placeholder="请输入" > @@ -285,7 +298,7 @@ import { back, go2, uploadFile } from '@/utils/hook.js' import qnEasyinput from '@/components/qn-easyinput/qn-easyinput.vue' import uGap from '@/components/u-gap/u-gap.vue' import { getCategoryList, createProduct, getSupplierDteail, updateProduct } from '@/apis/add-paper.js' -const validateFields = ['name', 'isMainProductRep', 'manufacturerName', 'brandName', 'categoryId'] +const validateFields = ['name', 'isMainProductRep', 'manufacturerName', 'brandName', 'categoryName'] const validatePriceFields = ['isPromoting', 'listPrice', 'minimum', 'stock', 'stockUnit', 'weight'] export default { components: { @@ -300,7 +313,11 @@ export default { isMainProductRep: 0, manufacturerName: null, brandName: null, - categoryId: null + categoryName: null, + sellingProposition:'月结30天价格,不加服务费!', + description:'售价全部为含税价,支持先用后付,欢迎来电查询!近期价格波动较大,请下单前先咨询价格。', + shippingNote:'分切纸不足重量的,另加调机费;低于送货重量或超出送货范围的,运费另计。' + }, imageStyles: { width: 100, @@ -325,16 +342,7 @@ export default { } ], paperList: [], - skuList: [ - { - isPromoting: 0, - listPrice: null, - minimum: null, - stock: null, - stockUnit: '1', - weight: null - } - ], + skuList: [], imgList: [], priceIndex: 0, eidtFor: 0, @@ -372,7 +380,7 @@ export default { }, paperSelectChange(item) { this.$set(this.form, 'categoryName', item.name) - this.$set(this.form, 'categoryId', item.id) + // this.$set(this.form, 'categoryId', item.id) this.$refs.paperpopup.close() }, paperpopupShow() { @@ -400,11 +408,11 @@ export default { this.skuList[j].isPromoting = 1 } } - for(let x =0;x{{ item.categoryName }}/{{ item.name }}/{{ item.manufacturerName }} 克重(价格): - {{ sku.weight }}({{ sku.listPrice }}) + {{ sku.weight }}({{ sku.listPrice }}) - {{ item.updateTime }} + {{ item.updateTime | timeFilter }} - 编辑 + 编辑 {{ item.status === 30111 ? '下架' : '上架' }} @@ -65,9 +65,19 @@ import uGap from '@/components/u-gap/u-gap.vue' import { back, go2, loginGo2 } from '@/utils/hook.js' import { SupplierList, productStatus } from '@/apis/add-paper.js' +import { getTimer } from '@/utils/index.js' import noData from './no-data.vue' export default { components: { uGap, noData }, + filters: { + timeFilter(value) { + var abs = '' + if (value) { + abs = getTimer(value) + } + return abs + } + }, data() { return { pageShow: true, @@ -112,12 +122,12 @@ export default { }, methods: { back, + // 获取纸品列表 pageShow quertData() { return new Promise((resolve, reject) => { SupplierList({ ...this.orderPagination }) .then((res) => { - console.log('纸品列表', res) if (res) { if (res.records.length === 0) { this.pageShow = false diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 2a0c9b5..8996265 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -270,6 +270,8 @@ export default { } } }, + onLoad() { + }, onShow() { getBaseInfo({}, true).then((res) => { if (res) { diff --git a/pages/quotation-details/index.vue b/pages/quotation-details/index.vue index f3eef36..d7ef22e 100644 --- a/pages/quotation-details/index.vue +++ b/pages/quotation-details/index.vue @@ -4,13 +4,13 @@ 报价详情 - 修改报价 + 修改报价 交货要求 - 已报价 + {{ upDataObj.replyStatus | replyFilter }} 询价客户: @@ -86,6 +86,30 @@ export default { qnHeader, uGap }, + filters: { + replyFilter(value) { + var abs = '' + if (value) { + // 30128 待报价 30130 已报价 30139 转化订单 30102 已失效 + switch (value) { + case 30128: + abs = '待报价' + break + case 30130: + abs = '已报价' + break + case 30139: + abs = '转化订单' + break + case 30102: + abs = '已失效' + break + default: + break + } + } + } + }, data() { return { value: '', @@ -565,7 +589,14 @@ export default { font-size: 30rpx; color: #ff5368; letter-spacing: 0; - text-align: right; + font-weight: 500; + float: right; + padding-right: 32rpx; + } + .price-tips-gq { + font-size: 30rpx; + color: #888888; + letter-spacing: 0; font-weight: 500; float: right; padding-right: 32rpx; diff --git a/pages/setting/index.vue b/pages/setting/index.vue index da28e6f..a5ff4db 100644 --- a/pages/setting/index.vue +++ b/pages/setting/index.vue @@ -1,83 +1,92 @@ - - - - - diff --git a/pages/submit-quotation/index.vue b/pages/submit-quotation/index.vue index 1d6e693..53e7df4 100644 --- a/pages/submit-quotation/index.vue +++ b/pages/submit-quotation/index.vue @@ -41,7 +41,7 @@ {{ items.paperName }}|{{ items.gramWeight }}|{{ items.length }}*{{ items.width }}|{{ items.quantity }} - + @@ -52,7 +52,7 @@ 单价(元/吨): {{ items.unitFee }} - + @@ -80,7 +80,7 @@ 有效时间: {{ upDataObj.enquiryValidTime }} - 设置 + 设置 @@ -88,7 +88,7 @@ - + @@ -273,6 +273,7 @@ export default { this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs) this.$set(this.upDataObj, 'otherFee', 0) this.$set(this.upDataObj, 'totalAllPrice', 0) + this.priceFree() console.log('this.upDataObj', res) } }) @@ -387,6 +388,8 @@ export default { this.priceFree() }, priceFree() { + this.upDataObj.totalAllPrice = 0 + this.upDataObj.otherFee = 0 for (let i = 0; i < this.upDataObj.itemList.length; i++) { var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice) this.upDataObj.totalAllPrice = totalAllPrice.toFixed(2) diff --git a/pages/trade/quotationList.vue b/pages/trade/quotationList.vue index 91e730f..f22b753 100644 --- a/pages/trade/quotationList.vue +++ b/pages/trade/quotationList.vue @@ -1,64 +1,52 @@ + diff --git a/pages/user-info/index.vue b/pages/user-info/index.vue index 33c32b3..ae39d2d 100644 --- a/pages/user-info/index.vue +++ b/pages/user-info/index.vue @@ -51,6 +51,7 @@ import { employeeName, } from '@/apis/setting.js' title: '修改成功', icon: 'success' }) + syncStore() setTimeout(() => { back() }, 1000) @@ -75,7 +76,6 @@ import { employeeName, } from '@/apis/setting.js' font-weight: 500; } .user-btn{ - width: 108rpx; height: 54rpx; background: #007AFF; border-radius: 27rpx; @@ -83,7 +83,7 @@ import { employeeName, } from '@/apis/setting.js' color: #FFFFFF; letter-spacing: 0; font-weight: 500; - line-height: 60rpx; + line-height: 54rpx; } .user-text{ font-size: 28rpx; diff --git a/utils/index.js b/utils/index.js index 1ac58bb..72c5503 100644 --- a/utils/index.js +++ b/utils/index.js @@ -6,25 +6,59 @@ import store from '@/store/index.js' * @param fmt string 转化的格式 yyyy-mm-dd hh:MM:ss */ export const dateTimeFormat = (date, fmt) => { - if (!date) { - throw new Error('日期不正确') - } - let ret - const opt = { - 'y+': date.getFullYear().toString(), // 年 - 'm+': (date.getMonth() + 1).toString(), // 月 - 'd+': date.getDate().toString(), // 日 - 'h+': date.getHours().toString(), // 时 - 'M+': date.getMinutes().toString(), // 分 - 's+': date.getSeconds().toString() // 秒 - } - for (let k in opt) { - ret = new RegExp('(' + k + ')').exec(fmt) - if (ret) { - fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')) - } - } - return fmt + if (!date) { + throw new Error('日期不正确') + } + let ret + const opt = { + 'y+': date.getFullYear().toString(), // 年 + 'm+': (date.getMonth() + 1).toString(), // 月 + 'd+': date.getDate().toString(), // 日 + 'h+': date.getHours().toString(), // 时 + 'M+': date.getMinutes().toString(), // 分 + 's+': date.getSeconds().toString() // 秒 + } + for (let k in opt) { + ret = new RegExp('(' + k + ')').exec(fmt) + if (ret) { + fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')) + } + } + return fmt +} +/** + * 日期格式化文字描述,样例 yyyy-mm-dd hh:MM:ss + * @param stringTime 需要转换的日期 + */ +export const getTimer = (stringTime) => { + var minute = 1000 * 60; + var hour = minute * 60; + var day = hour * 24; + var week = day * 7; + var month = day * 30; + var time1 = new Date().getTime(); //当前的时间戳 + console.log(time1); + var time2 = Date.parse(new Date(stringTime)); //指定时间的时间戳 + console.log(time2); + var time = time1 - time2; + + var result = null; + if (time < 0) { + + } else if (time / month >= 1) { + result = parseInt(time / month) + "月前"; + } else if (time / week >= 1) { + result = parseInt(time / week) + "周前"; + } else if (time / day >= 1) { + result = parseInt(time / day) + "天前"; + } else if (time / hour >= 1) { + result = parseInt(time / hour) + "小时前"; + } else if (time / minute >= 1) { + result = parseInt(time / minute) + "分钟前"; + } else { + result = "刚刚"; + } + return result; } /** @@ -34,81 +68,88 @@ export const dateTimeFormat = (date, fmt) => { * @value {true} retry 是否重连,默认false * @returns 一个websocket实例 */ -export const makeSocket = async ({ pageInfo = '', retry = false }) => { - const socket = { - sockTask: null, - close: function () { - this.sockTask.close({ code: 1000 }) - closeFlag = true - }, - onMessage: function () {} - } +export const makeSocket = async ({ + pageInfo = '', + retry = false +}) => { + const socket = { + sockTask: null, + close: function() { + this.sockTask.close({ + code: 1000 + }) + closeFlag = true + }, + onMessage: function() {} + } - let limitedNum = 0 - let closeFlag = false - let timer = null + let limitedNum = 0 + let closeFlag = false + let timer = null - async function createSocket() { - let url = '' - if (env == 'production') { - url = 'wss://api-client-yyt.qniao.cn/qn-websocket-service/wechatwebsock?token=' - } else if (env == 'test') { - url = 'wss://api-client-yyt-test.qniao.cn/qn-websocket-service/wechatwebsock?token=' - } - // if (env == 'production') { - // url = 'wss://api-client-yyt.qniao.cn/trading-center/wechatwebsock?token=' - // } else if (env == 'test') { - // url = 'wss://api-client-yyt-test.qniao.cn/trading-center/wechatwebsock?token=' - // } - const token = store.state.qnToken - const socketTask = await uni.connectSocket({ - url: `${url}${token}`, - header: { - 'content-type': 'application/json' - }, - success: () => { - console.log('websocket连接成功') - }, - fail: () => { - console.log('websocket连接失败') - } - }) - socketTask.onOpen(() => { - console.log(pageInfo + ' onOpen') - timer = setInterval(() => { - socketTask.send({ data: 'ping' }) - }, 10000) - }) - socketTask.onClose(() => { - console.log(pageInfo + ' onClose') - clearInterval(timer) - timer = null - if (!closeFlag && retry && limitedNum < 20) { - limitedNum++ - console.log('重连次数:' + limitedNum) - createSocket() - } - }) + async function createSocket() { + let url = '' + if (env == 'production') { + url = 'wss://api-client-yyt.qniao.cn/qn-websocket-service/wechatwebsock?token=' + } else if (env == 'test') { + url = 'wss://api-client-yyt-test.qniao.cn/qn-websocket-service/wechatwebsock?token=' + } + // if (env == 'production') { + // url = 'wss://api-client-yyt.qniao.cn/trading-center/wechatwebsock?token=' + // } else if (env == 'test') { + // url = 'wss://api-client-yyt-test.qniao.cn/trading-center/wechatwebsock?token=' + // } + const token = store.state.qnToken + const socketTask = await uni.connectSocket({ + url: `${url}${token}`, + header: { + 'content-type': 'application/json' + }, + success: () => { + console.log('websocket连接成功') + }, + fail: () => { + console.log('websocket连接失败') + } + }) + socketTask.onOpen(() => { + console.log(pageInfo + ' onOpen') + timer = setInterval(() => { + socketTask.send({ + data: 'ping' + }) + }, 10000) + }) + socketTask.onClose(() => { + console.log(pageInfo + ' onClose') + clearInterval(timer) + timer = null + if (!closeFlag && retry && limitedNum < 20) { + limitedNum++ + console.log('重连次数:' + limitedNum) + createSocket() + } + }) - socketTask.onError(() => { - console.log(pageInfo + ' error') - }) + socketTask.onError(() => { + console.log(pageInfo + ' error') + }) - socket.sockTask = socketTask - } + socket.sockTask = socketTask + } - await createSocket() - if (socket) { - socket.onMessage = (fn) => { - socket.sockTask.onMessage((res) => { - let data = JSON.parse(res.data) - console.log(pageInfo + '接收到消息:', data) - if (data.type != 'heartbeat') { - fn(data) - } - }) - } - } + await createSocket() + if (socket) { + socket.onMessage = (fn) => { + socket.sockTask.onMessage((res) => { + let data = JSON.parse(res.data) + console.log(pageInfo + '接收到消息:', data) + if (data.type != 'heartbeat') { + fn(data) + } + }) + } + } - return socket + return socket }