tianyi@bogon 3 years ago
parent
commit
318fed15e3
  1. 43
      pages/billing/addUser.vue
  2. 5
      pages/billing/changeGoods1.vue
  3. 27
      pages/index/index.vue
  4. 15
      pages/index/peopleList.vue
  5. 3
      pages/index/shareStyle.vue
  6. 56
      pages/inventory/addGoods.vue
  7. 27
      pages/inventory/addinventory.vue
  8. 5
      pages/inventory/inventory.vue
  9. 6
      pages/login/login.vue
  10. 18
      pages/staff/addStaff/addStaff.vue

43
pages/billing/addUser.vue

@ -1,20 +1,21 @@
<!-- 新增供应商和客户 -->
<template> <template>
<view> <view>
<view class="formBox"> <view class="formBox">
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px"> <uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px">
<uni-forms-item label="收货人" name="name"> <uni-forms-item label="姓名" name="name">
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入收货人" @blur="nameBlur" /> <uni-easyinput type="text" v-model="formData.name" placeholder="请输入收货人" @blur="nameBlur" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="手机号码" name="phone"> <uni-forms-item label="手机号码" name="phone">
<uni-easyinput type="number" v-model="formData.phone" placeholder="请输入手机号码" /> <uni-easyinput type="number" v-model="formData.phone" placeholder="请输入手机号码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="收货人账号" name="username" v-if="!userInfo"> <!-- <uni-forms-item label="收货人账号" name="username" v-if="!userInfo">
<uni-easyinput type="text" v-model="formData.username" placeholder="账号名为字母或数字" /> <uni-easyinput type="text" v-model="formData.username" placeholder="账号名为字母或数字" />
</uni-forms-item> </uni-forms-item> -->
<uni-forms-item label="性别" name="sex" v-if="!userInfo"> <!-- <uni-forms-item label="性别" name="sex" v-if="!userInfo">
<uni-data-checkbox v-model="formData.sex" :localdata="sexs" /> <uni-data-checkbox v-model="formData.sex" :localdata="sexs" />
</uni-forms-item> </uni-forms-item> -->
<uni-forms-item label="地址" name="address1"> <uni-forms-item label="地址" name="address1">
<view class="input selectcity" @tap="openPicker"> <view class="input selectcity" @tap="openPicker">
<input placeholder="请选择省市区" disabled type="text" v-model="formData.address1"></input> <input placeholder="请选择省市区" disabled type="text" v-model="formData.address1"></input>
@ -52,14 +53,13 @@
delShow: false, delShow: false,
addressObj: {}, addressObj: {},
formData: { formData: {
phone: '', consigneeMobile: '',
name: '', consigneeName: '',
address1: '', address1: '',
address: '', address: '',
province: '', province: '',
city: '', city: '',
area: '', area: '',
username: '',
}, },
// 单选数据源 // 单选数据源
sexs: [{ sexs: [{
@ -73,7 +73,7 @@
name: { name: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请输入收货人姓名', errorMessage: '请输入姓名',
}, },
{ {
minLength: 2, minLength: 2,
@ -85,27 +85,13 @@
phone: { phone: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请输入收货人手机号', errorMessage: '请输入手机号',
}, { }, {
minLength: 11, minLength: 11,
maxLength: 11, maxLength: 11,
errorMessage: '手机号为11个字符', errorMessage: '手机号为11个字符',
}] }]
}, },
username: {
rules: [{
required: true,
errorMessage: '请输入收货人帐号名',
}, {
validateFunction: function(rule, value, data, callback) {
let ret = /[^\w\.\/]/ig
if (!ret.test(ret)) {
callback('帐号名不正确')
}
return true
}
}]
},
address1: { address1: {
rules: [{ rules: [{
required: true, required: true,
@ -188,8 +174,6 @@
// 触发提交表单 // 触发提交表单
submit() { submit() {
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
// res.shopId = this.shopIndex;
res.shopId = 1;
if (this.userInfo) { if (this.userInfo) {
res.id = this.userInfo.id res.id = this.userInfo.id
this.tui.request("/app/customer/edit", "post", Object.assign(this.addressObj, res), false, this.tui.request("/app/customer/edit", "post", Object.assign(this.addressObj, res), false,
@ -208,13 +192,16 @@
} }
}) })
} else { } else {
this.tui.request("/app/customer/save", "post", Object.assign(this.addressObj, res), false, this.tui.request("/app/supplier/save", "post", Object.assign(this.addressObj, res), false,
true).then((res) => { true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: "添加成功", title: "添加成功",
icon: 'none' icon: 'none'
}) })
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
prevPage.$vm.popleType = 'gysName'
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })

5
pages/billing/changeGoods1.vue

@ -269,14 +269,11 @@
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
shopId: '002',
categoryId: id, categoryId: id,
// categoryId: '1695090289036890112',
supplierName: this.searchName, supplierName: this.searchName,
// supplierName: '测试',
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, true).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result.records) console.log(res.result.records)
this.shopList = res.result.records this.shopList = res.result.records

27
pages/index/index.vue

@ -9,16 +9,19 @@
</view> --> </view> -->
<view class="title-btn-d"> <view class="title-btn-d">
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')"> <view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
<i class="iconfont icon-xiaoshouyuce"> 待退货</i> <text>待退货</text>
</view> </view>
<view class="title-btn-sbtn"> <view class="title-btn-sbtn">
<i class="iconfont icon-xiaoshouyuce"> 待配货</i> <text>待配货</text>
</view> </view>
<view class="title-btn-sbtn"> <view class="title-btn-sbtn" @tap="goSonPage('/pages/index/addHangOrder')">
<i class="iconfont icon-xiaoshouyuce" @tap="goSonPage('/pages/index/addHangOrder')"> 挂单</i> <text>挂单</text>
</view> </view>
<view class="title-btn-sbtn"> <view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<i class="iconfont icon-xiaoshouyuce" @tap="goSonPage('/pages/index/shareStyle')"> 推款</i> <text>推款</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<text>待入库</text>
</view> </view>
</view> </view>
</view> </view>
@ -28,9 +31,9 @@
<view class="contentPadding"> <view class="contentPadding">
<view class="title"> <view class="title">
<i class="iconfont icon-xiaoshouyuce"> 今日营收详情 <i class="iconfont icon-xiaoshouyuce"> 今日营收详情
<view class="btn"> <!-- <view class="btn">
待配货 > 待配货 >
</view> </view> -->
</i> </i>
<!-- <image src="../../static/images/tabbar/inve1.png" mode="widthFix"></image> --> <!-- <image src="../../static/images/tabbar/inve1.png" mode="widthFix"></image> -->
@ -53,14 +56,6 @@
<u-count-to :start-val="0" :end-val="shopInfo.totalCCount"></u-count-to> <u-count-to :start-val="0" :end-val="shopInfo.totalCCount"></u-count-to>
<view class="grid-text">下单客户数</view> <view class="grid-text">下单客户数</view>
</u-grid-item> </u-grid-item>
<!-- <u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.oneHighPrice" :decimals="2"></u-count-to>
<view class="grid-text">单笔最高</view>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalJCount"></u-count-to>
<view class="grid-text">销售总件数</view>
</u-grid-item> -->
</u-grid> </u-grid>
</view> </view>
<view class="contentPadding"> <view class="contentPadding">

15
pages/index/peopleList.vue

@ -4,7 +4,7 @@
<view class="" v-if="popleType== 'khName' || popleType== 'gysName'" @tap=""> <view class="" v-if="popleType== 'khName' || popleType== 'gysName'" @tap="">
<!-- 供应商、客户走这一套 --> <!-- 供应商、客户走这一套 -->
<view> <view>
<button size="default" type="default" @tap="" hover-class="is-hover">新增人员</button> <button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">新增人员</button>
</view> </view>
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)" <view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)"
style="display: flex;flex-direction: column;height: 150rpx;"> style="display: flex;flex-direction: column;height: 150rpx;">
@ -60,6 +60,10 @@
radioType: '', //选择的是快递还是物流 radioType: '', //选择的是快递还是物流
companyType: '', //运输公司类型 快递公司有值 物流公司直接传空 companyType: '', //运输公司类型 快递公司有值 物流公司直接传空
} }
},
onShow(){
this.popleType = this.popleType
this.khOrGysList();
}, },
onLoad(options) { onLoad(options) {
this.popleType = options.popleType this.popleType = options.popleType
@ -134,7 +138,8 @@
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
}, },
//拨打电话
clickPhone(phone) { clickPhone(phone) {
console.log(phone); console.log(phone);
uni.makePhoneCall({ uni.makePhoneCall({
@ -153,6 +158,12 @@
} }
}) })
},
//新增人员
goAddPeople(){
uni.navigateTo({
url: "/pages/billing/addUser"
})
}, },
//打开弹出层 //打开弹出层
toggle(type) { toggle(type) {

3
pages/index/shareStyle.vue

@ -116,14 +116,13 @@
getShareList(id) { getShareList(id) {
this.shopList = [] this.shopList = []
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
shopId: '002',
categoryId: id, categoryId: id,
// categoryId: '1695090289036890112', // categoryId: '1695090289036890112',
supplierName: this.searchName, supplierName: this.searchName,
// supplierName: '测试', // supplierName: '测试',
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, true).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.shopList = res.result.records this.shopList = res.result.records
}else{ }else{

56
pages/inventory/addGoods.vue

@ -1,3 +1,4 @@
<!-- 底部菜单--库存--新增商品 -->
<template> <template>
<view> <view>
<view class="formBox"> <view class="formBox">
@ -21,9 +22,9 @@
<uni-forms-item label="尾货预警" name="salesWeek" required> <uni-forms-item label="尾货预警" name="salesWeek" required>
<!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> --> <!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> -->
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" /> <uni-datetime-picker type="date" :clear-icon="false" v-model="formData.salesWeek" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="库存预警" name="tailWarn" required> <uni-forms-item label="库存预警" name="tailWarn" required>
<uni-easyinput type="digit" v-model="formData.tailWarn" placeholder="请设置库存预警天数" trim="all" /> <uni-easyinput type="digit" v-model="formData.tailWarn" placeholder="请设置库存预警天数" trim="all" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="分类" name="categoryId" required> <uni-forms-item label="分类" name="categoryId" required>
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId" <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
@ -53,15 +54,15 @@
// 表单数据 // 表单数据
formData: { formData: {
productName: '', productName: '',
price: '', price: '',
productSn:'', productSn: '',
wholesalePrice:'', wholesalePrice: '',
// classification: '', // classification: '',
productPicture: [], productPicture: '',
productIntro:'', productIntro: '',
categoryId:'', categoryId: '',
salesWeek:'', salesWeek: '',
tailWarn:'' tailWarn: ''
}, },
categoryList: [], categoryList: [],
arrtList: [], arrtList: [],
@ -97,18 +98,18 @@
required: true, required: true,
errorMessage: '请填写商品名称', errorMessage: '请填写商品名称',
}, ], }, ],
}, },
tailWarn: { tailWarn: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请填写库存预警天数', errorMessage: '请填写库存预警天数',
}, ], }, ],
}, },
salesWeek: { salesWeek: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请选择尾货预警天数', errorMessage: '请选择尾货预警天数',
}, ], }, ],
} }
} }
} }
@ -183,17 +184,16 @@
}, },
formData: {}, formData: {},
success: (uploadFileRes) => { success: (uploadFileRes) => {
console.log("这里", uploadFileRes)
let path = JSON.parse(uploadFileRes.data)
//后端返回的地址,存入图片地址 //后端返回的地址,存入图片地址
this.formData.productPicture.push({ this.formData.productPicture = path.result
url: uploadFileRes.result,
name: ''
})
} }
}); });
}) })
}, },
categoryChange(e) { categoryChange(e) {
}, },
// 触发提交表单 // 触发提交表单
submit() { submit() {

27
pages/inventory/addinventory.vue

@ -152,20 +152,23 @@
let purchase = { let purchase = {
alreadyPay:0, //已付金额 alreadyPay:0, //已付金额
discount: 10, //折扣 discount: 10, //折扣
noPay:1111, //未支付金额 noPay:2000, //未支付金额
realAmount:1111, //实际金额 realAmount:2000, //实际金额
shopId:'002', shouldPay: 2000, //应付金额
shouldPay: 1111, //应付金额 totalAmount: 200, //总数量
totalAmount: 1111, //总数量
} }
let purchaseDetails = [{ let purchaseDetails = [{
allPrice: 1111, allPrice: 1000,
attributeList:'["颜色":["s"],"尺码":["m"]}', attributeList:'{"颜色":"白色","尺码":"m"}',
price: 1111, productCount:100,
productCount:1, productId:"1718617874370793472",
productId:"1695314088038633472", purchasePrice: 10, //进货价
purchasePrice: 800, //进货价 },{
wholesalePrice: 1000, //批发价 allPrice: 1000,
attributeList:'{"颜色":"黑色","尺码":"m"}',
productCount:100,
productId:"1718617874370793472",
purchasePrice: 10, //进货价
}] }]
this.tui.request("/app/stock/putIn", "post", { this.tui.request("/app/stock/putIn", "post", {
purchase: purchase, purchase: purchase,

5
pages/inventory/inventory.vue

@ -61,7 +61,8 @@
<view class="box-right-num">{{item.productSn}}</view> <view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price"> <view class="box-right-price">
<view class="price-box"> <view class="price-box">
<text>{{item.purchasePrice}}</text> <text v-if="item.purchasePrice==null" style="color: red;">未入库</text>
<text v-else>{{item.purchasePrice}}</text>
<text>采购价</text> <text>采购价</text>
</view> </view>
<view class="price-box"> <view class="price-box">
@ -184,7 +185,7 @@
supplierName:this.keyword, supplierName:this.keyword,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, true).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result.records) console.log(res.result.records)
this.shopList = res.result.records this.shopList = res.result.records

6
pages/login/login.vue

@ -146,7 +146,7 @@
saveLogin: true, saveLogin: true,
type: this.wayValue type: this.wayValue
} }
loginUrl='/auth/login' loginUrl='/auth/login' //type : 0管理员 1是普通员工
} else { } else {
data = { data = {
mobile: this.mobile, mobile: this.mobile,
@ -183,6 +183,7 @@
this.tui.toast('登录成功', 2000, true) this.tui.toast('登录成功', 2000, true)
}else{ }else{
uni.setStorageSync('shopName',res.result.shopList[0].shopName) uni.setStorageSync('shopName',res.result.shopList[0].shopName)
uni.setStorageSync('type',res.result.shopList[0].type)
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
@ -202,7 +203,8 @@
shopId: item.shopId shopId: item.shopId
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync('shopName',item.shopName) uni.setStorageSync('shopName',item.shopName)
uni.setStorageSync('type',item.type)
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'

18
pages/staff/addStaff/addStaff.vue

@ -31,11 +31,11 @@
id: '', id: '',
typeList: [{ typeList: [{
value: 0, value: 0,
text: "普通用户" text: "管理员"
}, },
{ {
value: 1, value: 1,
text: "管理员" text: "员工"
}, },
], ],
rules: { rules: {
@ -63,7 +63,8 @@
onLoad(options) { onLoad(options) {
const type = options.type const type = options.type
const item = JSON.parse(options.item) const item = JSON.parse(options.item)
console.log(item) console.log(item)
this.type = options.type
if (type === 'edit') { if (type === 'edit') {
this.addForm.nickname = item.nickname this.addForm.nickname = item.nickname
this.addForm.mobile = item.mobile this.addForm.mobile = item.mobile
@ -77,8 +78,15 @@
methods: { methods: {
onFormSubmit() { onFormSubmit() {
console.log('submit') console.log('submit')
this.$refs.addForm.validate().then(async () => { this.$refs.addForm.validate().then(async () => {
const res = await this.tui.request('/app/common/user/add', 'post', this.addForm, false, let url;
if(this.type=='edit'){
url = '/app/common/user/edit'
this.addForm.id = this.id
}else{
url = '/app/common/user/add'
}
const res = await this.tui.request(url, 'post', this.addForm, false,
true, false) true, false)
if (res.code == 200) { if (res.code == 200) {
uni.navigateBack() uni.navigateBack()

Loading…
Cancel
Save