wangfukang 3 years ago
parent
commit
b4a1e11550
  1. 2
      pages/index/orderDetail.vue
  2. 3
      pages/inventory/goodsList1.vue
  3. 53
      pages/staff/clock/clock.vue
  4. 113
      pages/staff/signRule/signRule.vue

2
pages/index/orderDetail.vue

@ -12,7 +12,7 @@
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName">
<view style="color:#FF5809;">品名:{{item.productName}} ({{item.productSn == null ? '暂无':item.productSn}})</view>
<view>单价:{{item.price == null ? '暂无':item.price}} 数量:{{item.productCount == null ? '暂无':item.productCount}} 总价:{{item.discountAmount == null ? '暂无':item.discountAmount}}</view>
<view>单价:{{item.purchasePrice == null ? '暂无':item.purchasePrice}} 数量:{{item.productCount == null ? '暂无':item.productCount}} 总价:{{item.discountAmount == null ? '暂无':item.discountAmount}}</view>
<view v-if="item.supplierName !=undefined">供应商:{{item.supplierName == null ? '暂无':item.supplierName}}</view>
</view>
</view>

3
pages/inventory/goodsList1.vue

@ -255,7 +255,7 @@
</view>
<view class="popup-pay-container" style="background: #fff;display: flex;">
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格"
@blur="changePay">
@input="changePay">
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;"
@tap.stop="checkPay(customPrice)">确定</view>
</view>
@ -1200,7 +1200,6 @@
},
//编辑每一个的单价
clickPrice(index) {
this.index = index
this.wholesalePrice = this.carList.get(this.index).wholesalePrice
this.lsprice = this.carList.get(this.index).lsprice

53
pages/staff/clock/clock.vue

@ -40,7 +40,8 @@
</view>
</template>
<script>
<script>
import amap from '../../../common/ossutil/amap-wx.130.js'
import {
mapState
} from 'vuex'
@ -55,7 +56,16 @@
},
computed: mapState(['userId']),
onLoad() {
this.getStaffList()
//明珠A 116.805796,38.335286
//明珠D 116.806408,38.338111
//明珠B 116.806913,38.336937
//明珠C 116.80562,38.337177
//明珠早市精品二合一给一个大的范围 116.810029,38.335321
this.peopleType = uni.getStorageSync('type')
if(this.peopleType == 0){
this.getStaffList()
}
},
methods: {
getStaffList() {
@ -64,21 +74,30 @@
this.staffList = res.result
})
},
onClock() {
if (!this.isClock) {
this.tui.request("/app/clockIn/", "get", {
userId: this.userId
}, false, true).then((res) => {
if (res.code == 200) {
this.tui.toast('打卡成功', 2000, true)
this.value = '已打卡'
this.isClock = true
} else {
this.tui.toast(res.message)
}
console.log(res)
})
}
onClock() {
const amapObject = new amap.AMapWX({ key: 'f06653d65bcefa97e94ab08917389842' })
amapObject.getRegeo({
success: (res) => {
console.log(res, res[0].regeocodeData.formatted_address)
},
fail: (err) => {
console.log(err)
}
})
// if (!this.isClock) {
// this.tui.request("/app/clockIn/", "get", {
// userId: this.userId
// }, false, true).then((res) => {
// if (res.code == 200) {
// this.tui.toast('打卡成功', 2000, true)
// this.value = '已打卡'
// this.isClock = true
// } else {
// this.tui.toast(res.message)
// }
// console.log(res)
// })
// }
}
}
}

113
pages/staff/signRule/signRule.vue

@ -0,0 +1,113 @@
<template>
<view>
<view class="popup-height">
<uni-forms :modelValue="addForm" ref="addForm" validateTrigger="bind" :rules="rules" label-width="160rpx"
label-align="right">
<uni-forms-item label="上班时间" required>
<picker mode="time" :value="addForm.startTime" start="00:00" end="23:59" @change="start">
<view class="uni-input">{{addForm.startTime}}</view>
</picker>
</uni-forms-item>
<uni-forms-item label="下班时间" required>
<picker mode="time" :value="addForm.endTime" start="00:00" end="23:59" @change="end">
<view class="uni-input">{{addForm.endTime}}</view>
</picker>
</uni-forms-item>
<uni-forms-item label="定位" required>
<input type="text" v-model="addForm.latitude + ','+addForm.longitude" style="text-align:center;width:70%;border: 1px solid #eee;height: 72rpx;line-height: 72rpx !important;" disabled placeholder="获取位置用于员工打卡">
<view class="dw-btn" @tap="clockPosi">一键定位</view>
</uni-forms-item>
</uni-forms>
<u-button type="primary" @click="onFormSubmit">保存</u-button>
</view>
</view>
</template>
<script>
import amap from '../../../common/ossutil/amap-wx.130.js'
export default {
data() {
return {
addForm: {
startTime: '06:00',
endTime: '14:00',
latitude:'',
longitude:''
}
}
},
onLoad() {
},
methods: {
bindTimeChange(e) {
this.time = e.detail.value;
},
clockPosi(){
const amapObject = new amap.AMapWX({ key: 'f06653d65bcefa97e94ab08917389842' })
amapObject.getRegeo({
success: (res) => {
this.addForm.latitude = res[0].latitude
this.addForm.longitude = res[0].longitude
},
fail: (err) => {
console.log(err)
}
})
},
onFormSubmit() {
console.log('submit')
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()
console.log(res)
} else {
this.tui.toast(res.message)
}
}, (reason) => {
console.log(reason)
})
},
start(e) {
this.addForm.startTime = e.detail.value
},
end(e) {
this.addForm.endTime = e.detail.value
}
}
}
</script>
<style lang="scss" scoped>
.popup-height {
padding: 0 25upx;
background-color: #fff;
}
.uni-date__input {
height: 40px;
width: 100%;
line-height: 40px;
font-size: 14px;
}
.text-center {
text-align: center;
}
.dw-btn{
width: 30%;
line-height: 72rpx;
text-align: center;
background: #088FEB;
color: #fff;
}
</style>
Loading…
Cancel
Save