耗材样式

This commit is contained in:
duan 2024-11-01 11:36:33 +08:00
parent 7605773087
commit 88d2816946
7 changed files with 111 additions and 89 deletions

View File

@ -109,7 +109,8 @@
} }
const refs = getCurrentInstance() const refs = getCurrentInstance()
let sumbit = () => { let sumbit = () => {
if (!datas.form.conUnit) { let conUnitdata = datas.form.conUnit.replace(/(^\s*)|(\s*$)/g, "")
if (!conUnitdata) {
refs.ctx.$refs.uToastRef.show({ refs.ctx.$refs.uToastRef.show({
type: 'default', type: 'default',
message: "单位不能为空" message: "单位不能为空"
@ -147,11 +148,8 @@
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
.topTitle { .topTitle {
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
@ -198,6 +196,7 @@
.bottombutton { .bottombutton {
margin-top: 84rpx; margin-top: 84rpx;
padding: 0 24rpx; padding: 0 24rpx;
>button { >button {
width: 530rpx; width: 530rpx;
height: 80rpx; height: 80rpx;

View File

@ -3,7 +3,7 @@
<view> <view>
<view> <view>
<view> <view>
供应商 <text style="color: red;">*</text> 供应商
</view> </view>
<view> <view>
<input type="text" placeholder="请输入供应商名称" v-model="datas.form.purveyorName" name="" id=""> <input type="text" placeholder="请输入供应商名称" v-model="datas.form.purveyorName" name="" id="">
@ -11,7 +11,7 @@
</view> </view>
<view> <view>
<view> <view>
联系电话 <text style="color: red;">*</text> 联系电话
</view> </view>
<view> <view>
<input type="text" placeholder="请输入联系电话" v-model="datas.form.purveyorTelephone" name="" id=""> <input type="text" placeholder="请输入联系电话" v-model="datas.form.purveyorTelephone" name="" id="">
@ -19,7 +19,7 @@
</view> </view>
<view> <view>
<view> <view>
地址 <text style="color: red;">*</text> 地址
</view> </view>
<view> <view>
<input type="text" placeholder="请输入地址" v-model="datas.form.address" name="" id=""> <input type="text" placeholder="请输入地址" v-model="datas.form.address" name="" id="">
@ -39,6 +39,8 @@
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true" <up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
text="保存"></up-button> text="保存"></up-button>
</view> </view>
<!-- 消息提示 -->
<up-toast ref="uToastRef"></up-toast>
</template> </template>
@ -47,7 +49,8 @@
ref, ref,
computed, computed,
reactive, reactive,
onMounted onMounted,
getCurrentInstance
} from 'vue'; } from 'vue';
import color from '@/commons/color.js'; import color from '@/commons/color.js';
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
@ -59,10 +62,17 @@
shopId: uni.getStorageSync("shopId"), shopId: uni.getStorageSync("shopId"),
}, },
}) })
const currentInstance = getCurrentInstance()
function sumbit() { function sumbit() {
if(!datas.form.purveyorName||!datas.form.purveyorTelephone||!datas.form.address){
currentInstance.ctx.$refs.uToastRef.show({
message: "请填写必填项",
type: 'default',
})
return
}
tbShopPurveyorpost(datas.form).then(res => { tbShopPurveyorpost(datas.form).then(res => {
go.to('PAGES_SUPPLIER') go.back()
}) })
} }
</script> </script>

View File

@ -192,6 +192,7 @@
show.value = false; show.value = false;
vdata.imgUrlList = []; vdata.imgUrlList = [];
vdata.stockNumber = 1; vdata.stockNumber = 1;
emits('affirm','')
}) })
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="ConsumablesTop"> <view class="ConsumablesTop">
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;"> <view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
{{datas.title}}<up-icon name="arrow-down" size="12"></up-icon> {{datas.title}}<up-icon name="arrow-down" size="12"></up-icon>
</view> </view>
<view> <view>
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" /> <input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
@ -46,12 +46,14 @@
</view> </view>
<view> <view>
<view class=""> <view class="">
所属商品: {{ filtersSproductId(item.productId)}} 所属商品: {{ filtersSproductId(item.product)}}
</view> </view>
<view class=""> <view class="">
<up-button shape="circle" type="primary" size="mini" color="#999" @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})" <up-button shape="circle" type="primary" size="mini" color="#999"
:plain="true" text="查看记录"></up-button>&nbsp;&nbsp; @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})" :plain="true"
<up-button type="primary" shape="circle" size="mini" @click="toggle(item)" :plain="true" text="更多操作"></up-button> text="查看记录"></up-button>&nbsp;&nbsp;
<up-button type="primary" shape="circle" size="mini" @click="toggle(item)" :plain="true"
text="更多操作"></up-button>
</view> </view>
</view> </view>
</view> </view>
@ -162,7 +164,9 @@
* 报损确认 * 报损确认
*/ */
function affirm() { function affirm() {
console.log(2) getList()
//
gettbConsTypeList()
} }
let toggle = (d) => { let toggle = (d) => {
@ -232,19 +236,20 @@
} }
function inputEvent(d) { function inputEvent(d) {
datas.conName = d.detail.value.replace(/\s*/g,""); datas.conName = d.detail.value.replace(/\s*/g, "");
getList() getList()
} }
function filtersSproductId(d) { function filtersSproductId(d) {
if (!d) return '' if (!d) return ''
const dataArr = d.split(',') // const dataArr = d.split(',')
let str = '' let str = ''
dataArr.forEach(ele => { d.forEach(ele => {
const startIndex = ele.indexOf('_') // str += ele.name
// const startIndex = ele.indexOf('_')
// const productId = ele.slice(0, startIndex) // const productId = ele.slice(0, startIndex)
const productName = ele.slice(startIndex + 1, ele.length) // const productName = ele.slice(startIndex + 1, ele.length)
str = productName + ',' + str str = ele.name + ',' + str
}) })
return str return str
@ -257,10 +262,8 @@
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
ul, ul,
li { li {
list-style: none; list-style: none;

View File

@ -82,16 +82,19 @@
}) })
let profitPrice = computed(() => { let profitPrice = computed(() => {
// //
// if (datas.item.balance < 0) { if (datas.form.balance == '-') {
// let a = datas.item.balance * -1 return (0 - datas.item.balance) * datas.item.price
// return formatDecimal((a - datas.form.balance) * datas.item.price) } else {
// } else { return (datas.form.balance - datas.item.balance) * datas.item.price
return (datas.form.balance - datas.item.balance ) * datas.item.price }
// }
}) })
let profitNumber = computed(() => { let profitNumber = computed(() => {
// //
return datas.form.balance- datas.item.balance if (datas.form.balance == '-') {
return 0 - datas.item.balance
} else {
return datas.form.balance - datas.item.balance
}
}) })
function toggle() { function toggle() {
@ -136,8 +139,6 @@
} }
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
.df() { .df() {
display: flex; display: flex;
align-items: center; align-items: center;
@ -198,6 +199,7 @@
.bottombutton { .bottombutton {
margin-top: 84rpx; margin-top: 84rpx;
padding: 0 24rpx; padding: 0 24rpx;
>button { >button {
width: 530rpx; width: 530rpx;
height: 80rpx; height: 80rpx;

View File

@ -1,62 +1,66 @@
<template> <template>
<view class="supplier"> <view class="supplier">
<view v-for="item in datas.list" :key="item.id"> <template v-if="datas.list.length>0">
<view class=""> <view v-for="item in datas.list" :key="item.id">
<view style="display: flex;align-items: center;"> <view class="">
<image src="./profile.png" style="width: 64rpx;height: 64rpx;" mode=""></image> <view style="display: flex;align-items: center;">
<view style="margin-left: 16rpx;"> <image src="./profile.png" style="width: 64rpx;height: 64rpx;" mode=""></image>
<view style="font-weight: 400;font-size: 28rpx;color: #333333;"> <view style="margin-left: 16rpx;">
{{item.purveyorName}} <view style="font-weight: 400;font-size: 28rpx;color: #333333;">
{{item.purveyorName}}
</view>
<text style="color: #999;">{{item.purveyorTelephone}}</text>
</view> </view>
<text style="color: #999;">{{item.purveyorTelephone}}</text>
</view> </view>
</view> <text style="font-size: 28rpx;font-weight: 400;" :style="{color:item.type==0?'#FD7B49':''}">
{{ item.type == 0 ? '待支付' : '已完结' }}
<text style="font-size: 28rpx;font-weight: 400;" :style="{color:item.type==0?'#FD7B49':''}"> </text>
{{ item.type == 0 ? '待支付' : '已完结' }}
</text>
</view>
<view class="">
<view class="">
<view :style="{color:item.waitAmount>0?' #F02C45;':''}">
{{item.waitAmount}}
</view>
<view class="">
剩余支付金额
</view>
</view> </view>
<view class=""> <view class="">
<view style="color: #318AFE;"> <view class="">
{{item.waitCount}}未付 <view :style="{color:item.waitAmount>0?' #F02C45;':''}">
{{item.waitAmount}}
</view>
<view class="">
剩余支付金额
</view>
</view> </view>
<view class=""> <view class="">
待付款笔数 <view style="color: #318AFE;">
{{item.waitCount}}未付
</view>
<view class="">
待付款笔数
</view>
</view> </view>
</view> </view>
<view class="df">
<span>上次进货日期</span>
<span v-if="item.lastTransactAt">{{dayjs(item.lastTransactAt).format('YYYY-MM-DD HH:mm:ss')}}</span>
</view>
<view class="df">
<span>地址</span>
<span>{{item.address}}</span>
</view>
<view class="df">
<span>备注</span>
<span>{{item.remark}}</span>
</view>
<view class="">
<up-button type="primary" shape="circle" size="mini"
@tap="toUrl('PAGES_EDIT_SUPPLIER',{item:JSON.stringify(item)})" :plain="true" text="编辑">
</up-button>&nbsp;&nbsp;&nbsp;&nbsp;<up-button size="mini" shape="circle" type="primary"
@tap="deleteEvent(item.id)" :plain="true" text="删除">
</up-button>&nbsp;&nbsp;&nbsp;&nbsp;<up-button size="mini" shape="circle" type="primary"
style="background-color: #318AFE;color: #fff;"
@tap="toUrl('PAGES_PAYMENT_SETTLEMENT',{id:item.id})" :plain="true" text="结款记录"></up-button>
</view>
</view> </view>
<view class="df"> <view style="height: 200rpx;"> </view>
<span>上次进货日期</span> </template>
<span>{{dayjs(item.lastTransactAt).format('YYYY-MM-DD HH:mm:ss')}}</span> <view v-else style="text-align: center;background-color: #f9f9f9;">暂无数据</view>
</view>
<view class="df">
<span>地址</span>
<span>{{item.address}}</span>
</view>
<view class="df">
<span>备注</span>
<span>{{item.remark}}</span>
</view>
<view class="">
<up-button type="primary" shape="circle" size="mini"
@tap="toUrl('PAGES_EDIT_SUPPLIER',{item:JSON.stringify(item)})" :plain="true" text="编辑">
</up-button>&nbsp;&nbsp;&nbsp;&nbsp;<up-button size="mini" shape="circle" type="primary" @tap="deleteEvent(item.id)"
:plain="true" text="删除">
</up-button>&nbsp;&nbsp;&nbsp;&nbsp;<up-button size="mini" shape="circle" type="primary"
style="background-color: #318AFE;color: #fff;"
@tap="toUrl('PAGES_PAYMENT_SETTLEMENT',{id:item.id})" :plain="true" text="结款记录"></up-button>
</view>
</view>
</view> </view>
<view class="bottombutton"> <view class="bottombutton">
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="toUrl('PAGES_ADD_SUPPLIER')" <up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="toUrl('PAGES_ADD_SUPPLIER')"
@ -69,6 +73,9 @@
onMounted, onMounted,
reactive reactive
} from 'vue'; } from 'vue';
import {
onShow,
} from '@dcloudio/uni-app';
import dayjs from 'dayjs' // import dayjs from 'dayjs' //
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
import { import {
@ -78,7 +85,7 @@
let datas = reactive({ let datas = reactive({
list: [] list: []
}) })
onMounted(() => { onShow(() => {
getList() getList()
}) })
let deleteEvent = (id) => { let deleteEvent = (id) => {

View File

@ -20,7 +20,7 @@
<view style="padding:32rpx 16rpx;"> <view style="padding:32rpx 16rpx;">
<view @tap="getNewdata('addCountNumber')"> <view @tap="getNewdata('addCountNumber')">
增加数量 <text 增加数量 <text
style="color: #76ACF0;font-weight: bold;">{{datas.countList?datas.countList.addCountNumber:''}}</text> style="color: #76ACF0;font-weight: bold;">{{datas.countList.addCountNumber?datas.countList.addCountNumber:'0'}}</text>
</view> </view>
<view class="df viewdf"> <view class="df viewdf">
<view @tap="getNewdata('stockInNumber')" <view @tap="getNewdata('stockInNumber')"
@ -29,7 +29,7 @@
入库 入库
</view> </view>
<view class=""> <view class="">
{{datas.countList?datas.countList.stockInNumber:''}} {{datas.countList.stockInNumber?datas.countList.stockInNumber:0}}
</view> </view>
</view> </view>
<view @tap="getNewdata('addNumber')" style="font-size: 24rpx;width: 178rpx;text-align: center;"> <view @tap="getNewdata('addNumber')" style="font-size: 24rpx;width: 178rpx;text-align: center;">
@ -37,7 +37,7 @@
手动增加 手动增加
</view> </view>
<view class=""> <view class="">
{{datas.countList?datas.countList.addNumber:''}} {{datas.countList.addNumber?datas.countList.addNumber:'0'}}
</view> </view>
</view> </view>
</view> </view>
@ -45,7 +45,7 @@
<view style="padding:32rpx 16rpx;"> <view style="padding:32rpx 16rpx;">
<view class="" @tap="getNewdata('subCountNumber')"> <view class="" @tap="getNewdata('subCountNumber')">
减少数量 <text 减少数量 <text
style="color: #52BDA4;font-weight: bold;">{{datas.countList?datas.countList.subCountNumber:0}}</text> style="color: #52BDA4;font-weight: bold;">{{datas.countList.subCountNumber?datas.countList.subCountNumber:0}}</text>
</view> </view>
<view class="df viewdf"> <view class="df viewdf">
<view @tap="getNewdata('subNumber')" <view @tap="getNewdata('subNumber')"
@ -54,7 +54,7 @@
手动减少 手动减少
</view> </view>
<view class=""> <view class="">
{{datas.countList?datas.countList.subNumber:0}} {{datas.countList.subNumber?datas.countList.subNumber:0}}
</view> </view>
</view> </view>
<view @tap="getNewdata('stockOutNumber')" <view @tap="getNewdata('stockOutNumber')"
@ -63,7 +63,7 @@
出库 出库
</view> </view>
<view class=""> <view class="">
{{datas.countList?datas.countList.stockOutNumber:0}} {{datas.countList.stockOutNumber?datas.countList.stockOutNumber:0}}
</view> </view>
</view> </view>
<view @tap="getNewdata('saleNumber')" style="font-size: 24rpx;width: 112rpx;text-align: center;"> <view @tap="getNewdata('saleNumber')" style="font-size: 24rpx;width: 112rpx;text-align: center;">
@ -71,7 +71,7 @@
商品消耗 商品消耗
</view> </view>
<view class=""> <view class="">
{{datas.countList?datas.countList.saleNumber:0}} {{datas.countList.saleNumber?datas.countList.saleNumber:0}}
</view> </view>
</view> </view>
</view> </view>
@ -91,7 +91,7 @@
<view class=""> <view class="">
<view style="font-size: 24rpx;color: #666666;"> <view style="font-size: 24rpx;color: #666666;">
库存 {{ inventory(item.balance,item.bizType,item.amount)}} <text 库存 {{ inventory(item.balance,item.bizType,item.amount)}} <text
:style="{color:item.bizType=='+'?'#1bca72':'red'}"> - {{ item.amount|0 }}</text> :style="{color:item.bizType=='+'?'#1bca72':'red'}"> {{ item.amount|0 }}</text>
</view> </view>
<view style="font-size: 24rpx;color: #666666;"> <view style="font-size: 24rpx;color: #666666;">
剩余库存 {{item.balance}} 剩余库存 {{item.balance}}