更换正式环境,测试修改
This commit is contained in:
@@ -2,37 +2,17 @@
|
||||
<view class="item bg-fff border-r-12">
|
||||
<view class="u-flex u-text-left u-row-between border-bottom u-p-b-30">
|
||||
<view class="">
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="data.createdAt"></uni-dateformat>
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="data.createTime"></uni-dateformat>
|
||||
</view>
|
||||
<view class="tag">{{data.type}}</view>
|
||||
<view class="tag">{{getTypeName(data.inOutItem)}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-text-left u-row-left u-m-t-30">
|
||||
<view class="name">{{data.productName}}</view>
|
||||
<!-- <view class="category u-flex u-m-l-10">
|
||||
<view class="tag">分类</view>
|
||||
</view> -->
|
||||
<view class="id color-999 u-font-24 bg-gray u-m-l-10">
|
||||
ID:{{data.id}}
|
||||
</view>
|
||||
<view class="name up-line-1">{{data.productName}}</view>
|
||||
<view class="id color-999 u-font-24 bg-gray u-m-l-10"> ID:{{data.id}} </view>
|
||||
</view>
|
||||
<view class="info u-flex bg-gray u-p-24 u-m-t-20 u-row-between">
|
||||
<view class="u-text-right">
|
||||
<!-- <view>
|
||||
<text>总价值</text>
|
||||
<text class="u-m-l-10">3</text>
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
<text>单价</text>
|
||||
<text class="u-m-l-10">2</text>
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
<text>货品编码</text>
|
||||
<text class="u-m-l-10">2</text>
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
<text>供应商名称</text>
|
||||
<text class="u-m-l-10">2</text>
|
||||
</view> -->
|
||||
|
||||
<view class="u-flex">
|
||||
<view class="text-ming-w">订单号</view>
|
||||
<text class="u-m-l-10 u-font-24 color-main">{{data.orderNo||''}}</text>
|
||||
@@ -40,59 +20,41 @@
|
||||
<view class="u-m-t-10 u-flex u-relative">
|
||||
<view class="text-ming-w">库存</view>
|
||||
<view class="u-relative">
|
||||
<text class="u-m-l-10">{{data.leftNumber}}</text>
|
||||
<text class="u-m-l-10">{{data.beforeNumber}}</text>
|
||||
<view class="u-absolute u-flex addNumber">
|
||||
<uni-icons type="arrow-right" :color="color.ColorMain" size="16"></uni-icons>
|
||||
<text class="color-main u-m-l-10">{{data.leftNumber+data.stockNumber}}</text>
|
||||
<uni-icons type="arrow-right" :color="$utils.ColorMain" size="16"></uni-icons>
|
||||
<text class="color-main u-m-l-10">{{data.afterNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="u-m-t-10 u-flex">
|
||||
<view class="text-ming-w">剩余库存</view>
|
||||
<view class="u-m-l-10 color-main">{{data.leftNumber+data.stockNumber}}{{data.unitName}}</view>
|
||||
<view class="u-m-l-10 color-main">{{data.afterNumber}}{{data.unitName}}</view>
|
||||
</view>
|
||||
<view class="u-m-t-10 u-flex" v-if="data.remark" style="align-items: flex-start;">
|
||||
<view class="text-ming-w">备注</view>
|
||||
<view class="u-m-l-10" style="text-align: left;">{{data.remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-flex u-row-right">
|
||||
<view>
|
||||
<view class="no-wrap">
|
||||
<text class="color-main font-bold" v-if="data.stockNumber>0">{{data.stockNumber}}</text>
|
||||
<text class="color-red font-bold" v-else>{{data.stockNumber}}</text>
|
||||
<text class="color-main font-bold" v-if="data.inOutNumber > 0">{{data.inOutNumber}}</text>
|
||||
<text class="color-red font-bold" v-else>{{data.inOutNumber}}</text>
|
||||
<text>{{data.unitName}}</text>
|
||||
</view>
|
||||
<!-- <view class="u-m-t-10">剩余库存</view> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="u-flex u-row-right u-m-t-20">
|
||||
<view class="u-flex u-m-r-30">
|
||||
<my-button shape="circle" height="70" type="default" @tap="del">
|
||||
<view class="u-p-l-30 u-p-r-30">
|
||||
删除
|
||||
</view>
|
||||
</my-button>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<my-button shape="circle" height="70" plain type="primary" @tap="more">更多操作</my-button>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import color from '@/commons/color.js'
|
||||
|
||||
function del() {
|
||||
console.log('del');
|
||||
}
|
||||
import { $invoicingType } from '@/commons/goodsData.js'
|
||||
const props = defineProps({
|
||||
index: {
|
||||
type: Number
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
@@ -100,11 +62,13 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
const emits = defineEmits(['more'])
|
||||
|
||||
function more() {
|
||||
emits('more', props.index)
|
||||
|
||||
let getTypeName = (type) => {
|
||||
let item = $invoicingType.filter(item=> item.value == type)[0]
|
||||
return item?item.text:''
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class=" bg-fff u-flex u-p-l-30 u-row-between">
|
||||
<view class="u-flex ">
|
||||
<view class="u-flex u-p-t-30 u-p-b-30 u-flex-1 u-row-center" @tap="timeToggle">
|
||||
<text class="u-m-r-12 no-wrap" :class="{'color-main':filters.time.start&&filters.time.end}">筛选时间</text>
|
||||
<text class="u-m-r-12 no-wrap" :class="{'color-main':pageData.query.beginDate&&pageData.query.endDate}">筛选时间</text>
|
||||
<image src="/pageProduct/static/images/icon-arrow-down-fill.svg" class="icon-arrow-down-fill"
|
||||
mode="">
|
||||
</image>
|
||||
@@ -22,7 +22,7 @@
|
||||
<view @tap="changeTypesActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in types.list" :key="index">
|
||||
<view>{{item.text}}</view>
|
||||
<uni-icons v-if="types.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||
<uni-icons v-if="types.active===index" type="checkmarkempty" :color="$utils.ColorMain"></uni-icons>
|
||||
</view>
|
||||
<view :style="{height: types.bottomHeight+'px'}"></view>
|
||||
</view>
|
||||
@@ -31,26 +31,18 @@
|
||||
|
||||
|
||||
<view class=" min-page bg-gray list u-p-30">
|
||||
<view class="u-flex u-m-b-30" v-if="filters.time.start&&filters.time.end">
|
||||
<view class="u-flex u-m-b-30" v-if="pageData.query.beginDate&&pageData.query.endDate">
|
||||
<view class="time-area u-font-24 color-main u-flex">
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="filters.time.start"></uni-dateformat>
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="pageData.query.beginDate"></uni-dateformat>
|
||||
<text class="u-p-l-10 u-p-r-10">至</text>
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="filters.time.end"></uni-dateformat>
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="pageData.query.endDate"></uni-dateformat>
|
||||
<view class="u-m-l-10 u-flex" @tap="clearTime">
|
||||
<uni-icons type="clear" size="18" :color="color.ColorMain"></uni-icons>
|
||||
<uni-icons type="clear" size="18" :color="$utils.ColorMain"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="recoreds color-fff ">
|
||||
<view class="u-font-32">详情记录</view>
|
||||
<view class="u-flex u-row-between u-m-t-48">
|
||||
<view class="u-flex u-flex-col u-row-center u-col-center">
|
||||
<view>变动数量</view>
|
||||
<view class="u-font-32 u-m-t-10 font-bold">{{pageData.changeSum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<template v-if="pageData.list.length">
|
||||
<view class="u-m-b-28 " v-for="(item,index) in pageData.list" :key="index">
|
||||
<my-list-item :data="item" ></my-list-item>
|
||||
@@ -74,28 +66,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onPullDownRefresh
|
||||
} from '@dcloudio/uni-app';
|
||||
import color from '@/commons/color';
|
||||
import { onLoad, onReady, onShow, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||
import { ref, reactive, computed, watch } from 'vue';
|
||||
|
||||
import myListItem from './components/list-item.vue';
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
computed,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
$getProductDetail,
|
||||
$getProductStockDetail,$getProductStockDetailSum
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import {
|
||||
$invoicingType
|
||||
} from '@/commons/goodsData.js'
|
||||
|
||||
import { $invoicingType } from '@/commons/goodsData.js'
|
||||
import { productStockFlow } from '@/http/api/product.js'
|
||||
|
||||
|
||||
const search = reactive({
|
||||
keyword: '',
|
||||
show: false
|
||||
@@ -135,75 +114,39 @@
|
||||
|
||||
function changeTypesActive(i) {
|
||||
types.active = i
|
||||
pageData.query.inOutItem = types.list[i].value
|
||||
types.show = false
|
||||
toggleMask()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 类型选择
|
||||
*/
|
||||
function showTypesToggle() {
|
||||
types.show = !types.show
|
||||
maskShow()
|
||||
}
|
||||
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
pageData.query.page=page-1
|
||||
init()
|
||||
}
|
||||
|
||||
|
||||
const filters = reactive({
|
||||
time: {
|
||||
start: '',
|
||||
end: ''
|
||||
}
|
||||
})
|
||||
|
||||
function resetQuery(){
|
||||
pageData.query.page=0
|
||||
pageData.query.page = 1
|
||||
}
|
||||
function clearTime() {
|
||||
filters.time.start = ''
|
||||
filters.time.end = ''
|
||||
pageData.query.beginDate = ''
|
||||
pageData.query.endDate = ''
|
||||
resetQuery()
|
||||
init()
|
||||
}
|
||||
|
||||
const datePicker = ref(null)
|
||||
function datePickerConfirm(e) {
|
||||
filters.time.start = e.start
|
||||
filters.time.end = e.end
|
||||
resetQuery()
|
||||
init()
|
||||
}
|
||||
|
||||
function timeToggle() {
|
||||
datePicker.value.toggle()
|
||||
}
|
||||
|
||||
|
||||
const mask = ref(null)
|
||||
|
||||
function toggleMask(show) {
|
||||
mask.value.toggle()
|
||||
}
|
||||
|
||||
function maskShow() {
|
||||
mask.value.open()
|
||||
}
|
||||
|
||||
function maskHide() {
|
||||
mask.value.close()
|
||||
}
|
||||
|
||||
|
||||
const pageData = reactive({
|
||||
query: {
|
||||
page: 0,
|
||||
page: 1,
|
||||
size: 10,
|
||||
productId:'',
|
||||
column:'/api/tbProductStockDetail/stock/count',
|
||||
shopId:uni.getStorageSync('shopId'),
|
||||
createdAt:[]
|
||||
inOutItem:'',
|
||||
beginDate:'',
|
||||
endDate:'',
|
||||
},
|
||||
totalElements: 0,
|
||||
list: [],
|
||||
@@ -211,23 +154,6 @@
|
||||
hasAjax:false,
|
||||
changeSum:0
|
||||
})
|
||||
async function init() {
|
||||
const createdAt=(filters.time.start&&filters.time.end)?[filters.time.start,filters.time.end ]:[]
|
||||
const res = await $getProductStockDetail({
|
||||
...pageData.query,
|
||||
type:types.active!==''?types.list[types.active].value:'',
|
||||
createdAt
|
||||
})
|
||||
pageData.hasAjax=true
|
||||
pageData.list = res.content
|
||||
pageData.totalElements = res.totalElements
|
||||
}
|
||||
async function getSum(){
|
||||
const res = await $getProductStockDetailSum({
|
||||
productId: pageData.query.productId
|
||||
})
|
||||
pageData.changeSum = res.exchange
|
||||
}
|
||||
watch(()=>types.active,(newval)=>{
|
||||
resetQuery()
|
||||
init()
|
||||
@@ -237,8 +163,40 @@
|
||||
console.log(opt);
|
||||
Object.assign(pageData.query,opt)
|
||||
init()
|
||||
// getSum()
|
||||
})
|
||||
async function init() {
|
||||
const res = await productStockFlow(pageData.query)
|
||||
pageData.hasAjax=true
|
||||
pageData.list = res.records
|
||||
pageData.totalElements = res.totalRow
|
||||
}
|
||||
function timeToggle() {
|
||||
datePicker.value.toggle()
|
||||
}
|
||||
function datePickerConfirm(e) {
|
||||
pageData.query.beginDate = e.start
|
||||
pageData.query.endDate = e.end
|
||||
resetQuery()
|
||||
init()
|
||||
}
|
||||
|
||||
function toggleMask(show) {
|
||||
mask.value.toggle()
|
||||
}
|
||||
|
||||
function maskShow() {
|
||||
mask.value.open()
|
||||
}
|
||||
|
||||
function maskHide() {
|
||||
mask.value.close()
|
||||
}
|
||||
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
pageData.query.page = page
|
||||
init()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user