This commit is contained in:
@jyuhsin
2025-08-30 15:45:15 +08:00
parent dab28bcf15
commit 57b0cc2244
26 changed files with 3366 additions and 1773 deletions
@@ -0,0 +1,687 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-card {
background: #ffffff;
margin: 10px auto 0;
width: 96%;
border-radius: 10px;
padding: 14px 12px;
}
.van-card__thumb {
display: flex;
align-items: center;
justify-content: center;
}
.van-card__content > div {
height: 100%;
display: flex;
flex-direction: column;
}
.train-title {
flex: 0.6;
margin-top: 4px;
}
.van-doc-card {
margin: 14px;
padding: 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 12px;
}
.van-divider {
margin: 6px 0 5px 0px;
border-color: #081776;
}
.van-tabs {
z-index: 0 !important;
}
.van-empty {
height: 70%;
top: 54%;
background-color: #F6F7F9;
}
</style>
<div id="app" v-cloak>
<van-nav-bar
@click-left="history.back()"
fixed
left-arrow
placeholder
title="资产列表"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu :active-color="themeColor">
<van-dropdown-item :options="yearOption" @change="getPdPlan"
v-model="pageForm.year"></van-dropdown-item>
<van-dropdown-item :options="pdPlanList" v-model="pageForm.zcpdid"></van-dropdown-item>
<van-dropdown-item :options="zcLxList" @change="doSearch"
v-model="pageForm.zcghlx"></van-dropdown-item>
</van-dropdown-menu>
</div>
<van-tabs @click="doSearch" style="margin-top: 53px" v-model="pageForm.isPd">
<van-tab title="全部"></van-tab>
<van-tab title="已盘点"></van-tab>
<van-tab title="未盘点"></van-tab>
</van-tabs>
<div style="margin: 0px auto 0 auto">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
:loading="mLoading"
@load="onLoad" v-if="tableData.length>0"
v-model="mLoading">
<div class="van-doc-card" v-for="o in tableData">
<div @click="welfareClick(o)" style="position: relative">
<div>
<div class="van-ellipsis"
style="margin-top: 6px; font-size: 15px;font-weight: bold;flex: 1">
{{o.zcmc}}{{o.zcbh}}
</div>
</div>
<div>
<div class="train-title"><span
style="color: grey">资产规格:</span>{{o.zcxh?o.zcxh:'暂无'}}
</div>
<div class="train-title"><span style="color: grey">资产类型:</span>{{o.zcghlx==='1'?'院级工会':'校工会'}}
</div>
<div class="train-title"><span style="color: grey">购置日期:</span>{{o.zcgzrq}}
</div>
<div class="train-title"><span style="color: grey">存放地名称:</span>{{o.zccfdmc}}
</div>
<van-divider></van-divider>
</div>
<div class="train-title"><span style="color: grey">领用人:</span>
{{o.zclyrname?o.zclyrname:'暂无'}}
</div>
<div class="train-title"><span style="color: grey">领用工会:</span>
{{o.zclydwh}}
</div>
<van-button :color="themeColor" @click.stop="openView(o)" plain round
size="mini"
style="position: absolute; left: 55%; bottom: 0%; width: 74px; height: 28px"
type="primary">
查看
</van-button>
<van-button :color="themeColor"
:disabled="pdPlanList.length==0||!pageForm.zcpdid||!pdPlanList.find(p=>p.id===pageForm.zcpdid).isShow"
@click.stop="openPd(o)"
round size="mini"
style="position: absolute; left: 77%; bottom: 0%; width: 74px; height: 28px"
type="primary"
v-if="!o.isPd">
开始盘点
</van-button>
<van-button
:disabled="pdPlanList.length==0||!pageForm.zcpdid||!pdPlanList.find(p=>p.id===pageForm.zcpdid).isShow"
@click.stop="doDelete(o)"
round size="mini"
style="position: absolute; left: 77%; bottom: 0%; width: 74px; height: 28px"
type="danger"
v-if="o.isPd">
删除盘点
</van-button>
</div>
</div>
</van-list>
<div :style="{color:themeColor}"
style="text-align: right;position: fixed;bottom: 20px;right: 20px">
<van-button :color="themeColor" hairline size="mini" type="primary">
总:{{pageForm.totalCount}}条
</van-button>
<van-button :color="themeColor" @click="doHzExcel" hairline size="mini" type="primary">
导出盘点汇总表
</van-button>
</div>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<van-popup :style="{ height: '100%',width:'100%' }" position="right" v-model="addPdShow">
<van-nav-bar
@click-left="addPdShow=false;doSearch()"
fixed
left-arrow
placeholder
title="新增盘点"
></van-nav-bar>
<van-form @submit="onSubmit">
<van-field :value="formData.zcbh" label="资产编号" readonly required></van-field>
<van-field :value="formData.zcmc" label="资产名称" readonly required></van-field>
<!-- <van-field :value="formData.zmjz" @touchstart.native.stop="zmjzShow = true" clickable
label="账面价值" placeholder="请输入账面价值"
readonly></van-field>
<van-number-keyboard
:show="zmjzShow"
@blur="zmjzShow = false"
close-button-text="完成"
extra-key="."
hide-on-click-outside
safe-area-inset-bottom
theme="custom"
v-model="formData.zmjz"
></van-number-keyboard>-->
<van-field :rules="[{ required: true, message: '' }]" :value="formData.zcrksj"
@click="zcrksjShow = true"
clickable label="入库日期" placeholder="请输入入库日期"
readonly
required></van-field>
<van-calendar :color="themeColor" :min-date="new Date('1999-01-01')"
@confirm="onConfirmZcrksj" v-model="zcrksjShow"></van-calendar>
<van-field :rules="[{ required: true, message: '' }]" :value="formData.zcbdsj"
@click="zcbdsjShow = true"
clickable label="盘点日期" placeholder="请输入盘点日期"
readonly
required></van-field>
<van-calendar :color="themeColor" :min-date="new Date('1999-01-01')"
@confirm="onConfirmZcbdsj"
required v-model="zcbdsjShow"></van-calendar>
<van-field :rules="[{ required: true, message: '' }]"
@input="userRemoteMethod"
clickable
label="责任人" placeholder="请输入责任人"
required
v-model="formData.zcbdshr_name"></van-field>
<van-action-sheet :actions="userList"
:close-on-click-overlay="false"
@cancel="userList = []"
@select="onUserSelect"
cancel-text="重新输入姓名或工号查询"
v-model="zcbdshrShow">
</van-action-sheet>
<van-field :value="formData.zcnowlydwh" label="院级工会" placeholder="输入责任人联动" readonly
required :rules="[{ required: true, message: '' }]"></van-field>
<template v-if="formData.zcghlx==='2'">
<van-field @input="lyrRemoteMethod"
clickable
label="领用人" placeholder="请输入领用人"
v-model="formData.zclyrname"></van-field>
<van-action-sheet :actions="userList"
:close-on-click-overlay="false"
@cancel="userList = []"
@select="onLyrUserSelect"
cancel-text="重新输入姓名或工号查询"
v-model="zclyrnameShow">
</van-action-sheet>
</template>
<van-field :rules="[{ required: true, message: '' }]"
clickable
label="存放地点"
maxlength="20" placeholder="请输入存放地点"
required
v-model="formData.zcnowcfdmc"></van-field>
<van-field :rules="[{ required: true, message: '' }]" :value="formData.pdzt"
@click="pdztShow = true"
clickable label="盘点情况" placeholder="请选择盘点情况"
readonly
required></van-field>
<van-popup :style="{ height: '40%' }" position="bottom" v-model="pdztShow">
<van-picker
:columns="pdztColumns"
@cancel="pdztShow = false"
@confirm="(v)=>{formData.pdzt = v;pdztShow = false}"
show-toolbar
title="盘点情况"
></van-picker>
</van-popup>
<van-field v-model="formData.wpdzt" :rules="[{ required: true, message: '' }]" required
v-if="formData.pdzt!='已盘点'&&formData.pdzt!=null"
clickable label="盘点情况" placeholder="请输入盘点情况"
></van-field>
<!-- <van-popup :style="{ height: '40%' }" position="bottom" v-model="wpdztShow">
<van-picker
:columns="wpdztColumns"
@cancel="wpdztShow = false"
@confirm="(v)=>{formData.wpdzt = v;wpdztShow = false}"
show-toolbar
title="盘点情况"
></van-picker>
</van-popup>-->
<van-field :rules="[{ required: true, message: '' }]" :value="formData.zczt"
@click="zcztShow = true"
clickable label="使用现状" placeholder="请选择使用现状"
readonly
required></van-field>
<van-popup :style="{ height: '40%' }" position="bottom" v-model="zcztShow">
<van-picker
:columns="zcztColumns"
@cancel="zcztShow = false"
@confirm="(v)=>{formData.zczt = v;zcztShow = false}"
show-toolbar
show-toolbar
title="使用现状"
></van-picker>
</van-popup>
<van-field :rules="[{ required: true, message: '请上传资产照片' }]" input-align="left"
label="资产照片"
name="files" required
style="flex-flow: column">
<template #label>
<div class="mb10">资产照片</div>
</template>
<template #input>
<vant-file-upload :files.sync="formData.zcFile" :max="1"></vant-file-upload>
</template>
</van-field>
<div style="margin: 16px;">
<van-button :color="themeColor" block native-type="submit" round type="info">提交
</van-button>
</div>
</van-form>
</van-popup>
<van-popup :style="{ height: '100%',width:'100%' }" position="right" v-model="viewPdShow">
<van-nav-bar
@click-left="viewPdShow=false"
fixed
left-arrow
placeholder
title="查看盘点信息"
></van-nav-bar>
<van-tabs @click="openVIewTab" v-model="viewTabs">
<van-tab :name="1" title="基本信息">
<van-cell-group>
<van-field :value="viewData.zcmc" label="资产名称" readonly></van-field>
<van-field :value="viewData.zcbh" label="资产编号" readonly></van-field>
<van-field :value="viewData.zcdj" label="单价" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.sl" label="数量" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zcghlx==='1'?'院级工会':'校工会'" label="资产类型"
readonly></van-field>
<van-field :value="viewData.zcxh" label="规格型号" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.contentCode" label="类别编号" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.content" label="类别名称" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zccfdmc" label="存放地点" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zcrksj" label="入库日期" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zcgzrq" label="购置日期" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zclyrname" label="领用人" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zclydwh" label="领用工会" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.pdzt" label="盘点情况" placeholder="暂无"
readonly></van-field>
<van-field :value="viewData.zczt" label="使用现状" placeholder="暂无"
readonly></van-field>
</van-cell-group>
</van-tab>
<van-tab :name="2" title="盘点信息">
<van-collapse accordion v-if="viewData.bdData&&viewData.bdData.length>0"
v-model="collapseName">
<van-collapse-item :name="i" :title="o.zcbdsj" v-for="(o,i) in viewData.bdData">
<van-field :value="o.zcnowlydwh" label="院级工会" readonly></van-field>
<!-- <van-field :value="o.zmjz" label="账面价值" placeholder="暂无"
readonly></van-field>-->
<van-field :value="o.zcrksj" label="入库时间" placeholder="暂无"
readonly></van-field>
<van-field :value="o.shrname" label="责任人" placeholder="暂无"
readonly></van-field>
<van-field :value="o.mobile" label="联系方式" placeholder="暂无"
readonly></van-field>
<van-field :value="o.pdzt" label="盘点情况" placeholder="暂无"
readonly></van-field>
<van-field :value="o.wpdzt" label="情况说明" placeholder="暂无"
readonly></van-field>
<van-field :value="o.zczt" label="使用现状" placeholder="暂无"
readonly></van-field>
<van-field abel="资产照片" name="zcfile"
required style="flex-flow: column">
<template #label>
<div class="mb10">资产照片</div>
</template>
<template #input>
<vant-file-upload :del="false" :files.sync="o.zcfile"
view></vant-file-upload>
</template>
</van-field>
</van-collapse-item>
</van-collapse>
<van-empty class="custom-image"
description="暂无数据"
image="/none.svg"
style="z-index: 1;position: fixed;height: 75%"
v-if="viewData.bdData&&viewData.bdData.length==0"
></van-empty>
</van-tab>
</van-tabs>
</van-popup>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
collapseName: "",
viewTabs: 1,
viewData: {
bdData: []
},
viewPdShow: false,
zcztColumns: ["在用", "闲置", "损坏", "外携"],
zcztShow: false,
pdztColumns: ["已盘点", "盘亏", "盘盈", "报废"],
pdztShow: false,
wpdztColumns: ["盘亏", "报废已清拖", "其他"],
wpdztShow: false,
userList: [],
zcbdshrShow: false,
zcbdsjShow: false,
zcrksjShow: false,
zmjzShow: false,
addPdShow: false,
yearOption: [],
pdPlanList: [],
zcLxList: [
{value: '', text: "全部类型"},
{value: 2, text: "校工会"},
{value: 1, text: "院级工会"},
],
pageForm: {
isPd: 2,
zcghlx: ''
},
zclyrnameShow: false
}
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
doHzExcel() {
window.open("/platform/zcgl/gdzcbg/doHzExcel?zcpdid=" + this.pageForm.zcpdid + "&zcghlx=" + this.pageForm.zcghlx)
},
doDelete(o) {
vant.Dialog.confirm({
title: '温馨提示',
message: '确认要删除本次盘点吗?',
}).then(async () => {
const loading = this.$toast.loading({
message: '删除中...',
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post("/platform/zcgl/gdzcbg/doPdDelete", {zcbdid: o.zcbdid})
if (resp.code === 0) {
await this.doSearch()
this.$toast.success(resp.msg);
} else {
this.$toast.fail(resp.msg);
}
loading.close()
})
},
async openVIewTab(val) {
if (val === 2) {
await this.getPdData(this.viewData.zcid)
if (this.viewData.bdData && this.viewData.bdData.length > 0) {
this.collapseName = 0
}
} else {
this.collapseName = ""
}
},
async openView(row) {
this.viewTabs = 1
this.viewData = clone(row)
this.viewPdShow = true
},
async getPdData(zcid) {
const data = await $.post("/platform/zcgl/gdzcbg/queryChangeData", {zcid: zcid})
if (data.code === 0) {
data.data.forEach(v => {
if (v.zcfile) {
v.zcfile = JSON.parse(v.zcfile)
}
})
this.$set(this.viewData, "bdData", data.data)
} else {
this.$set(this.viewData, "bdData", [])
}
},
onUserSelect(u) {
this.$set(this.formData, 'zcbdshrid', u.id)
this.$set(this.formData, 'zcbdshr_name', u.name)
if (this.formData.zcghlx === "2") {
this.$set(this.formData, "zcnowlydwh", "校工会")
} else {
this.$set(this.formData, "zcnowlydwh", u.unionname)
this.$set(this.formData, "zcnowlydwhid", u.unionid)
}
this.$set(this.formData, "mobile", u.mobile)
this.zcbdshrShow = false
},
onLyrUserSelect(u) {
this.$set(this.formData, "zclyrid", u.id)
this.$set(this.formData, "zclyrgh", u.loginname)
this.$set(this.formData, "zclyrname", u.username)
if (this.formData.zcghlx === "2") {
this.$set(this.formData, "zclydwh", "校工会")
} else {
this.$set(this.formData, "zclydwh", u.unionname)
}
this.$set(this.formData, "zclydwhid", u.unionid)
this.zclyrnameShow = false
},
onConfirmZcbdsj(date) {
this.$set(this.formData, "zcbdsj", moment(date).format('YYYY/MM/DD'))
this.zcbdsjShow = false
},
onConfirmZcrksj(date) {
this.$set(this.formData, "zcrksj", moment(date).format('YYYY/MM/DD'))
this.zcrksjShow = false
},
async onSubmit() {
let formData = clone(this.formData)
formData.pdPlanId = this.pageForm.zcpdid
formData.zcFile = JSON.stringify(formData.zcFile)
const resp = await $.post("/platform/zcgl/gdzcbg/doSubmit", formData)
if (resp.code === 0) {
this.$toast.success('新增盘点成功');
await this.doSearch();
this.addPdShow = false
} else {
this.$toast.fail('新增盘点失败');
}
},
async openPd(row) {
this.formData = row
this.$set(this.formData, "zcrksj", row.zcgzrq)
this.$set(this.formData, "zcbdsj", moment(new Date()).format('YYYY/MM/DD'))
this.$set(this.formData, "zcnowcfdmc", row.zccfdmc)
this.addPdShow = true
},
async userRemoteMethod(event) {
if (event) {
let arr = []
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}") {
arr = await searchUser(event, null, null, null, null)
} else {
arr = await searchUser(event, "${@shiro.getPrincipalProperty('unit').getUnionid()}", null, null, null)
}
this.userList = arr.map(v => {
return {
name: v.username + "(" + v.loginname + ")",
id: v.id,
mobile: v.mobile,
unionname: v.unionname,
loginname: v.loginname,
username: v.username,
}
})
this.zcbdshrShow = true
}
},
async lyrRemoteMethod(event) {
if (event) {
let arr = []
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}") {
arr = await searchUser(event, null, null, null, null)
} else {
arr = await searchUser(event, "${@shiro.getPrincipalProperty('unit').getUnionid()}", null, null, null)
}
this.userList = arr.map(v => {
return {
name: v.username + "(" + v.loginname + ")",
id: v.id,
mobile: v.mobile,
unionname: v.unionname,
loginname: v.loginname,
username: v.username,
unionid: v.unionid,
}
})
this.zclyrnameShow = true
}
},
async doSearch() {
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.finished = false;
this.pageForm.totalCount = 0
this.tableData = []
await this.onLoad();
},
async onLoad() {
this.mLoading = true
const res = await $.post('/platform/zcgl/gdzcbg/data', this.pageForm)
const {code, data} = res
if (this.refreshing) {
this.tableData = [];
this.refreshing = false;
}
this.mLoading = false;
if (code === 0) {
this.tableData = this.tableData.concat(data.list)
this.pageForm.totalCount = data.totalCount
if (this.tableData.length === 0) {
this.finished = true;
} else {
if (this.tableData.length >= this.pageForm.totalCount) {
this.finished = true;
this.pageForm.pageNumber++
} else {
this.pageForm.pageNumber++
}
}
}
},
async getPdPlan() {
const resp = await $.post("/platform/zcgl/gdzcbg/getPdPlan", {year: this.pageForm.year})
resp.data.forEach(v => {
const startDate = moment(v.startDate).format('YYYY-MM-DD')
const endDate = moment(v.endDate).format('YYYY-MM-DD')
v.text = startDate + "至" + endDate
v.value = v.id
v.isShow = (moment().format('YYYY-MM-DD hh:mm:ss') > v.startDate && moment().format('YYYY-MM-DD hh:mm:ss') < v.endDate)
})
this.pdPlanList = resp.data
if (this.pdPlanList && this.pdPlanList.length > 0) {
this.$set(this.pageForm, "zcpdid", this.pdPlanList[0].id)
} else {
this.$set(this.pageForm, "zcpdid", '')
}
//
}
},
async created() {
const toast = vant.Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true,
message: '数据查询中',
});
this.mLoading = true
for (let i = new Date().getFullYear() - 5; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({value: i, text: i + '年'},)
}
this.$set(this.pageForm, "year", this.yearOption[0].value)
await this.getPdPlan();
setTimeout(async () => {
toast.clear();
this.mLoading = false
await this.doSearch()
}, 500)
}
})
</script>
<!--#
}
#-->