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

5
pages/billing/changeGoods1.vue

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

27
pages/index/index.vue

@ -9,16 +9,19 @@
</view> -->
<view class="title-btn-d">
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
<i class="iconfont icon-xiaoshouyuce"> 待退货</i>
<text>待退货</text>
</view>
<view class="title-btn-sbtn">
<i class="iconfont icon-xiaoshouyuce"> 待配货</i>
<text>待配货</text>
</view>
<view class="title-btn-sbtn">
<i class="iconfont icon-xiaoshouyuce" @tap="goSonPage('/pages/index/addHangOrder')"> 挂单</i>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/addHangOrder')">
<text>挂单</text>
</view>
<view class="title-btn-sbtn">
<i class="iconfont icon-xiaoshouyuce" @tap="goSonPage('/pages/index/shareStyle')"> 推款</i>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<text>推款</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<text>待入库</text>
</view>
</view>
</view>
@ -28,9 +31,9 @@
<view class="contentPadding">
<view class="title">
<i class="iconfont icon-xiaoshouyuce"> 今日营收详情
<view class="btn">
<!-- <view class="btn">
待配货 >
</view>
</view> -->
</i>
<!-- <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>
<view class="grid-text">下单客户数</view>
</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>
</view>
<view class="contentPadding">

15
pages/index/peopleList.vue

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

3
pages/index/shareStyle.vue

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

56
pages/inventory/addGoods.vue

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

27
pages/inventory/addinventory.vue

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

5
pages/inventory/inventory.vue

@ -61,7 +61,8 @@
<view class="box-right-num">{{item.productSn}}</view>
<view class="box-right-price">
<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>
</view>
<view class="price-box">
@ -184,7 +185,7 @@
supplierName:this.keyword,
pageNum: this.pageNum,
pageSize: '10'
}, false, true).then((res) => {
}, false, false).then((res) => {
if (res.code == 200) {
console.log(res.result.records)
this.shopList = res.result.records

6
pages/login/login.vue

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

18
pages/staff/addStaff/addStaff.vue

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

Loading…
Cancel
Save