更换正式环境,测试修改
This commit is contained in:
@@ -1,27 +1,18 @@
|
||||
<template>
|
||||
<view class="ConsumablesTop">
|
||||
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
|
||||
{{datas.title}}<up-icon name="arrow-down" size="12"></up-icon>
|
||||
<view @tap="pageData.show = !pageData.show" style="display: flex;align-items: center;">
|
||||
{{pageData.title}}<up-icon name="arrow-down" size="12"></up-icon>
|
||||
</view>
|
||||
<view>
|
||||
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
|
||||
<input v-model="pageData.query.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
|
||||
</view>
|
||||
<view @tap="toUrl('PAGES_ADD_TYPE') ">
|
||||
新增类别
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
|
||||
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in datas.typeLists" :key="index">
|
||||
<view :class="{'color-main':nowStatusIndex===index}">{{item}}</view>
|
||||
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||
</view>
|
||||
<view :style="{height: '14px'}"></view>
|
||||
</view>
|
||||
|
||||
<view class="ConsumablesConent" v-if="datas.list.length">
|
||||
<view v-for="(item,index) in datas.list" :key="index">
|
||||
<view class="ConsumablesConent" v-if="pageData.list.length">
|
||||
<view v-for="(item,index) in pageData.list" :key="index">
|
||||
<view> {{item.conName}}
|
||||
<view> {{item.consGroupName}} </view>
|
||||
</view>
|
||||
@@ -59,7 +50,6 @@
|
||||
<view @tap="toUrl('PAGES_ADD_CONSUMABLES')"> 新增耗材 </view>
|
||||
<view @tap="toUrl('PAGES_SUPPLIER')"> 供应商管理 </view>
|
||||
</view>
|
||||
<my-action-sheet @itemClick="sheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
<my-reportDamage ref="reportDamage" title="耗材报损" :item="report.data" @affirm="affirm"></my-reportDamage>
|
||||
|
||||
<up-popup :show="show" :round="18" mode="center" >
|
||||
@@ -74,69 +64,69 @@
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
<up-action-sheet :round="10" @select="actionSelect" @close="actions.show = false" cancelText="取消" :actions="actions.list"
|
||||
:show="actions.show"></up-action-sheet>
|
||||
<up-picker :show="pageData.show" :columns="pageData.typeList" keyName="name" @cancel="pageData.show=false" @confirm="confirmConsGroup" ></up-picker>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import myActionSheet from './components/my-action-sheet';
|
||||
import myReportDamage from './components/my-reportDamage';
|
||||
import color from '@/commons/color.js';
|
||||
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
||||
import { getConsPage,getConsGrpupList } from '@/http/api/cons.js';
|
||||
|
||||
let reportDamage = ref(null)
|
||||
let refMoreSheet = ref(null)
|
||||
let show = ref(false)
|
||||
let showData = ref()
|
||||
const report = reactive({
|
||||
data: {
|
||||
// thumbnail: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240918/a17a62b7b55a4b65a2a2542050672b34.png',
|
||||
name: "美式咖啡",
|
||||
// title: "商品报损",
|
||||
unit: "杯",
|
||||
},
|
||||
})
|
||||
let datas = reactive({
|
||||
let pageData = reactive({
|
||||
show: false,
|
||||
query: {
|
||||
conName: '',
|
||||
consGroupId: '',
|
||||
size: 100,
|
||||
page: 1
|
||||
},
|
||||
list: [],
|
||||
conName: "",
|
||||
showtwo: false,
|
||||
status: '0',
|
||||
// 类型列表
|
||||
typeList: [],
|
||||
// 类型列表渲染数组
|
||||
typeLists: ['全部'],
|
||||
title: '耗材类型'
|
||||
})
|
||||
const statusHeight = computed(() => {
|
||||
return 30 * datas.typeLists.length + 14 + 'px'
|
||||
|
||||
/**
|
||||
* 更多操作列表
|
||||
*/
|
||||
const actions = reactive({
|
||||
list: [
|
||||
{ name: '报损', color: 'red', fontSize: '16' },
|
||||
{ name: '编辑', color: '#333', fontSize: '16' },
|
||||
{ name: '清点', color: '#333', fontSize: '16' },
|
||||
{ name: '入库', color: '#333', fontSize: '16' },
|
||||
{ name: '出库', color: '#333', fontSize: '16' },
|
||||
],
|
||||
data: null,
|
||||
show: false,
|
||||
})
|
||||
|
||||
const actionSheet = reactive({
|
||||
list: ['报损', '编辑', '清点', '入库', '出库', ],
|
||||
activeId: null,
|
||||
active: ""
|
||||
})
|
||||
let showStatus = ref(false)
|
||||
let nowStatusIndex = ref(0)
|
||||
onShow(() => {
|
||||
getList()
|
||||
// 获取分类列表
|
||||
gettbConsTypeList()
|
||||
})
|
||||
|
||||
/**
|
||||
* 获取耗材列表
|
||||
*/
|
||||
async function getList(d = "") {
|
||||
getConsPage({
|
||||
conName: datas.conName,
|
||||
conTypeId: d,
|
||||
size: 100,
|
||||
page: 1
|
||||
}).then(res => {
|
||||
datas.list = res.records
|
||||
async function getList() {
|
||||
getConsPage(pageData.query).then(res => {
|
||||
pageData.list = res.records
|
||||
})
|
||||
}
|
||||
|
||||
@@ -144,27 +134,19 @@
|
||||
* 获取耗材类别
|
||||
*/
|
||||
let gettbConsTypeList = () => {
|
||||
datas.typeLists = ['全部']
|
||||
getConsGrpupList({
|
||||
page: 1,
|
||||
size: 30,
|
||||
}).then(res => {
|
||||
datas.typeList = res
|
||||
res.forEach(ele => {
|
||||
datas.typeLists.push(ele.name)
|
||||
})
|
||||
pageData.typeList = [[{name:'全部',id:''},...res]]
|
||||
})
|
||||
}
|
||||
function changeNowStatusIndex(i) {
|
||||
nowStatusIndex.value = i
|
||||
showStatus.value = false
|
||||
if (i == 0) {
|
||||
datas.title = '全部'
|
||||
getList()
|
||||
} else {
|
||||
datas.title = datas.typeList[i - 1].conTypeName
|
||||
getList(datas.typeList[i - 1].id)
|
||||
}
|
||||
|
||||
function confirmConsGroup(e){
|
||||
pageData.show = false
|
||||
pageData.query.consGroupId = e.value[0].id
|
||||
pageData.title = e.value[0].name
|
||||
getList()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,62 +163,58 @@
|
||||
}
|
||||
|
||||
let toggle = (d) => {
|
||||
refMoreSheet.value.open()
|
||||
actionSheet.active = d
|
||||
actionSheet.activeId = d.id
|
||||
// refMoreSheet.value.open()
|
||||
actions.show = true;
|
||||
actions.actions = d
|
||||
report.data.consId = d.id
|
||||
}
|
||||
|
||||
let sheetClick = (index) => {
|
||||
if (index == 0) {
|
||||
let actionSelect = ( e ) => {
|
||||
if ( e.name == '报损' ) {
|
||||
// 权限
|
||||
hasPermission('允许提交报损').then(ele => {
|
||||
if (ele) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open(actionSheet.activeId);
|
||||
report.data.name = actionSheet.active.conName
|
||||
report.data.unit = actionSheet.active.conUnit
|
||||
reportDamage.value.open(actions.actions.id);
|
||||
report.data.name = actions.actions.conName
|
||||
report.data.unit = actions.actions.conUnit
|
||||
}
|
||||
})
|
||||
} else if (index == 1) {
|
||||
toUrl('PAGES_EDIT_CONSUMABLES', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
} else if ( e.name == '编辑' ) {
|
||||
toUrl('PAGES_ADD_CONSUMABLES', {
|
||||
item: JSON.stringify(actions.actions)
|
||||
})
|
||||
} else if (index == 2) {
|
||||
} else if ( e.name == '清点' ) {
|
||||
hasPermission('允许耗材盘点').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
item: JSON.stringify(actions.actions)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 3) {
|
||||
} else if ( e.name == '入库' ) {
|
||||
hasPermission('允许耗材入库').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
consId: actions.actions.id,
|
||||
item: JSON.stringify(actions.actions)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 4) {
|
||||
} else if ( e.name == '出库' ) {
|
||||
hasPermission('允许耗材出库').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_OUTBOUND', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
consId: actions.actions.id,
|
||||
item: JSON.stringify(actions.actions)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// async function viewpermission(d) {
|
||||
// let res = await hasPermission(d)
|
||||
// return res
|
||||
// }
|
||||
|
||||
function inputEvent(d) {
|
||||
datas.conName = d.detail.value.replace(/\s*/g, "");
|
||||
pageData.query.conName = d.detail.value.replace(/\s*/g, "");
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user