|
|
|
@ -31,7 +31,8 @@ |
|
|
|
</div> |
|
|
|
<crudOperation :permission="permission"> |
|
|
|
<template v-slot:middle> |
|
|
|
<el-button :loading="crud.downloadLoading" size="mini" :disabled="crud.selections.length === 0" @click="doExport(crud.selections)"> |
|
|
|
<!-- @click="doExport(crud.selections)" --> |
|
|
|
<el-button :loading="crud.downloadLoading" size="mini" :disabled="crud.selections.length === 0"> |
|
|
|
<i class="iconfont icon-daochu" /> |
|
|
|
导出 |
|
|
|
</el-button> |
|
|
|
@ -55,36 +56,41 @@ |
|
|
|
@row-dblclick="handleRowDblClick" |
|
|
|
> |
|
|
|
<!-- <el-table-column type="selection" align="center" width="55" /> --> |
|
|
|
<el-table-column prop="type" label="类型" /> |
|
|
|
<el-table-column prop="billNo" label="任务单号" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="warehouseName" label="所属市州" /> |
|
|
|
<el-table-column prop="stockNum" label="关联单号" /> |
|
|
|
<el-table-column prop="stockNum" label="申请人" /> |
|
|
|
<el-table-column prop="stockNum" label="申请部门" /> |
|
|
|
<el-table-column prop="takeDate" label="创建时间" width="150px"> |
|
|
|
<el-table-column prop="manageType" label="类型"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.takeDate | parseTime }}</div> |
|
|
|
<el-tag v-if="scope.row.manageType === 1">入库</el-tag> |
|
|
|
<el-tag v-if="scope.row.manageType === 2" type="success">出库</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="takeStart" label="入库开始时间" width="150px"> |
|
|
|
<el-table-column prop="mainBillNo" label="任务单号" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="fondsName" label="所属市州" /> |
|
|
|
<el-table-column prop="branchBillNo" label="关联单号" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="applicantName" label="申请人" /> |
|
|
|
<el-table-column prop="applicantDeptName" label="申请部门" /> |
|
|
|
<el-table-column prop="createTime" label="创建时间" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.takeStart | parseTime }}</div> |
|
|
|
<div>{{ scope.row.createTime | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="takeEnd" label="入库结束时间" width="150px"> |
|
|
|
<el-table-column prop="checkStartTime" label="入库开始时间" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.takeEnd | parseTime }}</div> |
|
|
|
<div>{{ scope.row.checkStartTime | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="checkEndTime" label="入库结束时间" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.checkEndTime | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="stockNum" label="总金额" /> |
|
|
|
<el-table-column prop="stockNum" label="总数量" /> |
|
|
|
<el-table-column prop="stockNum" label="异常数量" /> |
|
|
|
<el-table-column prop="inOutCount" label="总数量" align="right" /> |
|
|
|
<el-table-column prop="exceptionCount" label="异常数量" align="right" /> |
|
|
|
<el-table-column prop="status" label="状态" align="center" min-width="100px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="(scope.row.status || '').toString().trim() === '0'" class="row-state row-lending ">未盘点</span> |
|
|
|
<span v-if="(scope.row.status || '').toString().trim() === '-1'" class="row-state row-lending state-active">已终止</span> |
|
|
|
<span v-if="(scope.row.status || '').toString().trim() === '1'" class="row-state row-warehousing state-active">盘点中</span> |
|
|
|
<span v-if="(scope.row.status || '').toString().trim() === '2'" class="row-state row-binding state-active">已完成</span> |
|
|
|
<span v-if="scope.row.status === 0" class="row-state row-lending ">未开始</span> |
|
|
|
<span v-if="scope.row.status === -1" class="row-state row-lending state-active">已终止</span> |
|
|
|
<span v-if="scope.row.status === 1" class="row-state row-warehousing state-active">进行中</span> |
|
|
|
<span v-if="scope.row.status === 2" class="row-state row-binding state-active">已完成</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -105,25 +111,30 @@ |
|
|
|
<div v-if="selectedTask" class="task-detail"> |
|
|
|
<!-- 任务基本信息 --> |
|
|
|
<el-table class="archives-table" stripe style="width: 100%;" :data="selectedTask"> |
|
|
|
<el-table-column prop="type" label="类型" /> |
|
|
|
<el-table-column prop="billNo" label="任务单号" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="warehouseName" label="所属市州" /> |
|
|
|
<el-table-column prop="stockNum" label="关联单号" /> |
|
|
|
<el-table-column prop="stockNum" label="申请人" /> |
|
|
|
<el-table-column prop="stockNum" label="申请部门" /> |
|
|
|
<el-table-column prop="takeDate" label="创建时间" width="150px"> |
|
|
|
<el-table-column prop="manageType" label="类型"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.takeDate | parseTime }}</div> |
|
|
|
<el-tag v-if="scope.row.manageType === 1">入库</el-tag> |
|
|
|
<el-tag v-if="scope.row.manageType === 2" type="success">出库</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="takeStart" label="入库开始时间" width="150px"> |
|
|
|
<el-table-column prop="mainBillNo" label="任务单号" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="fondsName" label="所属市州" /> |
|
|
|
<el-table-column prop="branchBillNo" label="关联单号" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="applicantName" label="申请人" /> |
|
|
|
<el-table-column prop="applicantDeptName" label="申请部门" /> |
|
|
|
<el-table-column prop="createTime" label="创建时间" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.takeStart | parseTime }}</div> |
|
|
|
<div>{{ scope.row.createTime | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="takeEnd" label="入库结束时间" width="150px"> |
|
|
|
<el-table-column prop="checkStartTime" label="入库开始时间" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.takeEnd | parseTime }}</div> |
|
|
|
<div>{{ scope.row.checkStartTime | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="checkEndTime" label="入库结束时间" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div>{{ scope.row.checkEndTime | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="stockNum" label="总金额" /> |
|
|
|
@ -150,20 +161,23 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="taskResult" label="结果"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag v-if="scope.row.taskResult === 0">未盘</el-tag> |
|
|
|
<el-tag v-if="scope.row.taskResult === 1" type="success">正常</el-tag> |
|
|
|
<el-tag v-if="scope.row.taskResult === 2" type="error">盘亏</el-tag> |
|
|
|
<el-tag v-if="scope.row.status === 0" type="error">失败</el-tag> |
|
|
|
<el-tag v-if="scope.row.status === 1" type="info">未盘</el-tag> |
|
|
|
<el-tag v-if="scope.row.status === 2 || scope.row.status === 3" type="success">成功</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="assetMark" label="资产编码" min-width="220px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="assetName" label="资产名称" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="taskRemark" label="盘点备注" min-width="100px" /> |
|
|
|
<el-table-column prop="capitalStatus" label="资产状态" min-width="100px" /> |
|
|
|
<el-table-column prop="mark" label="资产编码" min-width="220px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="name" label="资产名称" min-width="180px" :show-overflow-tooltip="true" /> |
|
|
|
<!-- <el-table-column prop="remark" label="盘点备注" min-width="100px" /> --> |
|
|
|
<!-- <el-table-column prop="capitalStatus" label="资产状态" min-width="100px" /> --> |
|
|
|
<el-table-column prop="capitaltypename" label="资产类型" min-width="100px" /> |
|
|
|
<el-table-column prop="departmentname" label="使用部门" min-width="260px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="resourcename" label="使用人" min-width="100px" /> |
|
|
|
<el-table-column prop="departmentname" label="所属部门" min-width="100px" :show-overflow-tooltip="true" /> |
|
|
|
<!-- <el-table-column prop="resourcename" label="使用人" min-width="100px" /> --> |
|
|
|
<el-table-column prop="glrname" label="管理人" min-width="100px" /> |
|
|
|
<el-table-column prop="cfd" label="存放地" min-width="260px" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column prop="startprice" label="单价" width="80px" align="right" :formatter="(row) => formatMoney(row.startprice)" /> |
|
|
|
<el-table-column prop="capitalnum" label="数量" align="right" /> |
|
|
|
<!-- <el-table-column prop="" label="总额" /> --> |
|
|
|
<!-- <el-table-column prop="cfd" label="存放地" min-width="260px" :show-overflow-tooltip="true" /> --> |
|
|
|
</el-table> |
|
|
|
<div style="margin-top: 10px; display: flex; justify-content: flex-end;"> |
|
|
|
<el-pagination |
|
|
|
@ -187,12 +201,12 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import crudAsset, { FetchInitAssetInfo, FetchStockTakeDetailsByTaskId } from '@/api/asset/index' |
|
|
|
import crudAsset, { FetchInOutDetailsByBillNo } from '@/api/asset/index' |
|
|
|
import CRUD, { presenter, header, form, crud } from '@crud/crud' |
|
|
|
import crudOperation from '@crud/CRUD.operation' |
|
|
|
import pagination from '@crud/Pagination' |
|
|
|
import { exportFile } from '@/utils/index' |
|
|
|
import qs from 'qs' |
|
|
|
// import { exportFile } from '@/utils/index' |
|
|
|
// import qs from 'qs' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
const defaultForm = { } |
|
|
|
@ -200,7 +214,7 @@ export default { |
|
|
|
name: 'InOutLog', |
|
|
|
components: { pagination, crudOperation }, |
|
|
|
cruds() { |
|
|
|
return CRUD({ title: '出入库日志', url: 'api/stocktake/initStockTakeBill', crudMethod: { ...crudAsset }, optShow: { |
|
|
|
return CRUD({ title: '出入库日志', url: 'api/asset/initInOutBill', crudMethod: { ...crudAsset }, optShow: { |
|
|
|
add: false, |
|
|
|
edit: false, |
|
|
|
del: false, |
|
|
|
@ -217,8 +231,8 @@ export default { |
|
|
|
optionVal: '', |
|
|
|
options: [ |
|
|
|
{ value: '', label: '全部' }, |
|
|
|
{ value: 'billNo', label: '入库' }, |
|
|
|
{ value: 'departmentname', label: '出库' } |
|
|
|
{ value: '1', label: '入库' }, // manageType=1 |
|
|
|
{ value: '2', label: '出库' } // manageType=2 |
|
|
|
], |
|
|
|
fetchLoading: false, |
|
|
|
showFilterList: false, |
|
|
|
@ -234,8 +248,9 @@ export default { |
|
|
|
inventoryPageSize: 10, |
|
|
|
inventoryTotal: 0, |
|
|
|
statusOptions: [ |
|
|
|
{ value: 0, label: '未完成' }, |
|
|
|
{ value: 1, label: '执行中' }, |
|
|
|
{ value: -1, label: '已终止' }, |
|
|
|
{ value: 0, label: '未开始' }, |
|
|
|
{ value: 1, label: '进行中' }, |
|
|
|
{ value: 2, label: '已完成' } |
|
|
|
], |
|
|
|
query: { |
|
|
|
@ -256,20 +271,31 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
formatMoney(money) { |
|
|
|
if (!money && money !== 0) return '——' |
|
|
|
return Number(money).toLocaleString('en-US') |
|
|
|
}, |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
// 传递搜索参数 |
|
|
|
this.crud.query[this.optionVal] = this.keyWord |
|
|
|
// this.crud.params.billNo = this.query.billNo |
|
|
|
// this.crud.params.warehouseId = this.query.warehouseId |
|
|
|
// 清空原有搜索参数,防止干扰 |
|
|
|
delete this.crud.query.billNo |
|
|
|
delete this.crud.query.manageType |
|
|
|
|
|
|
|
// 输入框统一作为 单号 billNo 搜索 |
|
|
|
this.crud.query.billNo = this.keyWord |
|
|
|
|
|
|
|
// 下拉框选择 出入库类型 manageType |
|
|
|
if (this.optionVal) { |
|
|
|
this.crud.query.manageType = this.optionVal |
|
|
|
} |
|
|
|
|
|
|
|
// 状态筛选 |
|
|
|
this.crud.params.status = this.query.status |
|
|
|
|
|
|
|
// 保存原始参数 |
|
|
|
// 分页参数(保留你原有逻辑) |
|
|
|
this.originalPage = this.crud.page.page |
|
|
|
this.originalSize = this.crud.page.size |
|
|
|
// 添加pageNo和pageSize参数 |
|
|
|
this.crud.params.pageNo = this.crud.page.page |
|
|
|
this.crud.params.pageSize = this.crud.page.size |
|
|
|
// 清空page和size参数 |
|
|
|
this.crud.params.page = undefined |
|
|
|
this.crud.params.size = undefined |
|
|
|
}, |
|
|
|
@ -300,19 +326,21 @@ export default { |
|
|
|
[CRUD.HOOK.beforeAddCancel](crud) { |
|
|
|
}, |
|
|
|
searchChange(val) { |
|
|
|
if (val) { |
|
|
|
// 切换类型时清空关键词 |
|
|
|
this.keyWord = '' |
|
|
|
this.options.forEach(option => { |
|
|
|
if (option.value !== val) { |
|
|
|
this.crud.query[option.value] = null |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// 清空查询参数 |
|
|
|
delete this.crud.query.manageType |
|
|
|
delete this.crud.query.billNo |
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
// 清空所有搜索条件 |
|
|
|
this.keyWord = '' |
|
|
|
this.crud.query[this.optionVal] = this.keyWord |
|
|
|
this.optionVal = '' |
|
|
|
this.query.status = '' |
|
|
|
// 清空 crud 搜索参数 |
|
|
|
delete this.crud.query.billNo |
|
|
|
delete this.crud.query.manageType |
|
|
|
// 刷新查询 |
|
|
|
this.crud.toQuery() |
|
|
|
}, |
|
|
|
// 触发单选 |
|
|
|
@ -320,54 +348,25 @@ export default { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
doExport(data) { |
|
|
|
crud.downloadLoading = true |
|
|
|
this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
const ids = [] |
|
|
|
data.forEach(val => { |
|
|
|
ids.push(val.fondsId) |
|
|
|
}) |
|
|
|
const params = { |
|
|
|
'fondsIds': ids |
|
|
|
} |
|
|
|
exportFile(this.baseApi + '/api/fonds/download?' + qs.stringify(params, { indices: false })) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取资产数据 |
|
|
|
fetchAssetsData(isBtn) { |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (isBtn) { |
|
|
|
this.fetchLoading = true |
|
|
|
} |
|
|
|
|
|
|
|
this.showFilterList = true |
|
|
|
const params = { |
|
|
|
'departmentname': this.crud.form.departmentname, |
|
|
|
'pageNo': this.currentPage, |
|
|
|
'pageSize': this.pageSize |
|
|
|
} |
|
|
|
FetchInitAssetInfo(params).then(res => { |
|
|
|
console.log('res', res) |
|
|
|
this.listTable = res.records |
|
|
|
this.totalAssets = res.total |
|
|
|
this.fetchLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.$message({ message: '获取数据失败', type: 'error', offset: 8 }) |
|
|
|
this.fetchLoading = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// doExport(data) { |
|
|
|
// crud.downloadLoading = true |
|
|
|
// this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
// confirmButtonText: '继续', |
|
|
|
// cancelButtonText: '取消', |
|
|
|
// type: 'warning', |
|
|
|
// dangerouslyUseHTMLString: true |
|
|
|
// }).then(() => { |
|
|
|
// const ids = [] |
|
|
|
// data.forEach(val => { |
|
|
|
// ids.push(val.fondsId) |
|
|
|
// }) |
|
|
|
// const params = { |
|
|
|
// 'fondsIds': ids |
|
|
|
// } |
|
|
|
// exportFile(this.baseApi + '/api/fonds/download?' + qs.stringify(params, { indices: false })) |
|
|
|
// }).catch(() => { |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// 处理双击行事件 |
|
|
|
handleRowDblClick(row) { |
|
|
|
this.selectedTask = [] |
|
|
|
@ -384,12 +383,12 @@ export default { |
|
|
|
|
|
|
|
this.inventoryLoading = true |
|
|
|
const params = { |
|
|
|
'taskId': this.selectedTask[0].id, |
|
|
|
'billNo': this.selectedTask[0].branchBillNo, |
|
|
|
'pageNo': this.inventoryPage, |
|
|
|
'pageSize': this.inventoryPageSize |
|
|
|
} |
|
|
|
FetchStockTakeDetailsByTaskId(params).then(res => { |
|
|
|
console.log('FetchStockTakeDetailsByTaskId', res) |
|
|
|
FetchInOutDetailsByBillNo(params).then(res => { |
|
|
|
console.log('FetchInOutDetailsByBillNo', res) |
|
|
|
this.inventoryList = res.records |
|
|
|
this.inventoryTotal = res.total |
|
|
|
this.inventoryLoading = false |
|
|
|
|