耗材解决问题
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
耗材价格
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入耗材价格" v-model="datas.form.price" name="" id="">
|
||||
<input placeholder="请输入耗材价格" type="number" v-model="datas.form.price" name="" id="">
|
||||
</view>
|
||||
</li>
|
||||
<li>
|
||||
@@ -59,13 +59,16 @@
|
||||
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
|
||||
text="保存"></up-button>
|
||||
</view>
|
||||
<!-- 消息提示 -->
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
computed,
|
||||
onMounted
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import {
|
||||
tbConsTypeList,
|
||||
@@ -107,13 +110,29 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
const refs = getCurrentInstance()
|
||||
let sumbit = () => {
|
||||
if (!datas.form.conUnit) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "单位不能为空"
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!datas.form.price) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "价格不能为空"
|
||||
})
|
||||
return
|
||||
}
|
||||
tbConsInfoAddlist([{
|
||||
...datas.form,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
conTypeId: datas.list[datas.nowStatusIndex].id
|
||||
}]).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
// go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
const statusHeight = computed(() => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</view>
|
||||
<view class="">
|
||||
是否启用
|
||||
<up-switch checked="true" activeValue="1" inactiveValue="0" @change="switchChangeEvent($event,item)"
|
||||
<up-switch checked="true" :activeValue="1" :inactiveValue="0" @change="switchChangeEvent($event,item)"
|
||||
:modelValue="item.status" style="transform:scale(0.7)" />
|
||||
</view>
|
||||
</li>
|
||||
@@ -126,13 +126,13 @@
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
padding: 0 28rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
|
||||
BIN
pageConsumables/bg.png
Normal file
BIN
pageConsumables/bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
@@ -114,7 +114,7 @@
|
||||
conTypeId: datas.list[datas.nowStatusIndex].id,
|
||||
id: datas.form.id
|
||||
}]).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
const statusHeight = computed(() => {
|
||||
@@ -126,11 +126,13 @@
|
||||
datas.showStatus = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
ul,
|
||||
li {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="ConsumablesTop">
|
||||
<view @tap="showStatus = !showStatus">
|
||||
{{datas.title}}
|
||||
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
|
||||
{{datas.title}}<up-icon name="arrow-down" size="12"></up-icon>
|
||||
</view>
|
||||
<view>
|
||||
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
|
||||
@@ -20,7 +20,7 @@
|
||||
<view :style="{height: '14px'}"></view>
|
||||
</view>
|
||||
|
||||
<ul class="ConsumablesConent">
|
||||
<ul class="ConsumablesConent" v-if="datas.list.length">
|
||||
<li v-for="(item,index) in datas.list" :key="index">
|
||||
<view>
|
||||
{{item.conName}}
|
||||
@@ -49,12 +49,18 @@
|
||||
所属商品: {{ filtersSproductId(item.productId)}}
|
||||
</view>
|
||||
<view class="">
|
||||
<up-button type="primary" color="#999" @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})" :plain="true" text="查看记录"></up-button>
|
||||
<up-button type="primary" color="#999" @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})"
|
||||
:plain="true" text="查看记录"></up-button>
|
||||
<up-button type="primary" @click="toggle(item)" :plain="true" text="更多操作"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
</li>
|
||||
<li style="background-color: rgba(0,0,0,0); height: 200rpx;"></li>
|
||||
</ul>
|
||||
<view v-else style="text-align: center;">
|
||||
<image src="./bg.png" style="width: 325rpx;height: 335rpx;" mode=""></image>
|
||||
<view style="font-size: 28rpx;color: #999;">暂无数据</view>
|
||||
</view>
|
||||
<view class="ConsumablesBottom">
|
||||
<view @tap="toUrl('PAGES_ADD_CONSUMABLES')">
|
||||
新增耗材
|
||||
@@ -76,8 +82,13 @@
|
||||
reactive,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {onShow} from '@dcloudio/uni-app'
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
import {
|
||||
viewConInfoFlowget,
|
||||
tbConsType,
|
||||
@@ -120,6 +131,7 @@
|
||||
// 获取分类列表
|
||||
gettbConsTypeList()
|
||||
})
|
||||
|
||||
function changeNowStatusIndex(i) {
|
||||
nowStatusIndex.value = i
|
||||
showStatus.value = false
|
||||
@@ -159,49 +171,69 @@
|
||||
report.data.consId = d.id
|
||||
actionSheet.active = d
|
||||
}
|
||||
|
||||
|
||||
let sheetClick = (index) => {
|
||||
if (index == 0) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open(actionSheet.activeId);
|
||||
report.data.name = actionSheet.active.conName
|
||||
report.data.unit = actionSheet.active.conUnit
|
||||
// 权限
|
||||
hasPermission('允许提交报损').then(ele => {
|
||||
if (ele) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open(actionSheet.activeId);
|
||||
report.data.name = actionSheet.active.conName
|
||||
report.data.unit = actionSheet.active.conUnit
|
||||
}
|
||||
})
|
||||
} else if (index == 1) {
|
||||
toUrl('PAGES_EDIT_CONSUMABLES', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
} else if (index == 2) {
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
hasPermission('允许耗材盘点').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 3) {
|
||||
console.log(actionSheet.activeId,'调试1')
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
hasPermission('允许耗材入库').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 4) {
|
||||
toUrl('PAGES_SALES_OUTBOUND', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
hasPermission('允许耗材出库').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_OUTBOUND', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// async function viewpermission(d) {
|
||||
// let res = await hasPermission(d)
|
||||
// console.log(res,'调试1')
|
||||
// return res
|
||||
// }
|
||||
async function getList(d = "") {
|
||||
viewConInfoFlowget({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
conName: datas.conName,
|
||||
conTypeId: d,
|
||||
size:100,
|
||||
page:0
|
||||
size: 100,
|
||||
page: 0
|
||||
}).then(res => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
|
||||
function inputEvent(d) {
|
||||
datas.conName = d.detail.value
|
||||
datas.conName = d.detail.value.replace(/\s*/g,"");
|
||||
getList()
|
||||
}
|
||||
|
||||
@@ -413,7 +445,7 @@
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -100,7 +100,8 @@
|
||||
conInfoId: datas.form.id,
|
||||
lpNum: profitNumber._value
|
||||
}).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
// go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
/**
|
||||
@@ -129,11 +130,13 @@
|
||||
showStatus.value = !showStatus.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
supplierId: datas.list[nowStatusIndex.value].id,
|
||||
accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price,
|
||||
}).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
// 获取供应商
|
||||
@@ -193,11 +193,13 @@
|
||||
return 30 * datas.status.length + 14 + 'px'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
})
|
||||
onMounted(() => {
|
||||
let items = JSON.parse(props.item)
|
||||
console.log(items,'调试1')
|
||||
getlist()
|
||||
})
|
||||
let getlist = () => {
|
||||
@@ -56,17 +57,20 @@
|
||||
page: 0,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
size: 30,
|
||||
sort: "createTime,desc"
|
||||
sort: "createTime,desc",
|
||||
conTypeId:JSON.parse(props.item).conTypeId
|
||||
}).then(res => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
ul,
|
||||
li {
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
<text style="color: red;">*</text> 入库数量
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入数量" v-model="datas.form.list.stockNumber" name="" id="">
|
||||
<input type="number" placeholder="请输入数量" v-model="datas.form.list.stockNumber" name="" id="">
|
||||
</view>
|
||||
</li>
|
||||
<li>
|
||||
<view>
|
||||
<text style="color: red;">*</text>单价
|
||||
<text style="color: red;">*</text>单价
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入单价(元)" v-model="datas.form.list.price" name="" id="">
|
||||
<input type="number" placeholder="请输入单价(元)" v-model="datas.form.list.price" name="" id="">
|
||||
</view>
|
||||
</li>
|
||||
<li>
|
||||
@@ -132,6 +132,7 @@
|
||||
datas.form = assign(datas.form, ...datas.item)
|
||||
})
|
||||
const refs = getCurrentInstance()
|
||||
|
||||
function toggle() {
|
||||
go.to('PAGES_ADD_SUPPLIER')
|
||||
}
|
||||
@@ -167,7 +168,7 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!datas.form.list.price){
|
||||
if (!datas.form.list.price) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "请输入必填项",
|
||||
@@ -182,7 +183,13 @@
|
||||
supplierId: datas.list[nowStatusIndex.value].id,
|
||||
accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price,
|
||||
}).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "保存成功",
|
||||
})
|
||||
setTimeout(() => {
|
||||
go.back()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
// 获取供应商
|
||||
@@ -191,12 +198,12 @@
|
||||
return 30 * datas.status.length + 14 + 'px'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user