lanan-system-vue/src/views/repair/stockOperate/Components/SoVoid.vue
2024-09-18 14:59:38 +08:00

142 lines
4.9 KiB
Vue

<template>
<div>
<!-- 搜索 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="作废时间" prop="searchTimeArray">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="queryParams.searchTimeArray"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item v-if="soByType" label="供应商" prop="supplierId">
<SupplierChoose v-model="queryParams.supplierId" />
</el-form-item>
<el-form-item label="单据号" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item v-if="!soByType" label="领料人" prop="userId">
<StaffChoose v-model="queryParams.userId" @selected="getStaff"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose v-model="queryParams.corpId" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="handleResetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作 -->
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="200" />
<el-table-column label="数量" align="center" width="150" prop="itemCount" />
<el-table-column label="金额" align="center" prop="totalPrice" width="150" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150" />
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150" />
<el-table-column label="登记时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="作废时间" align="center" prop="updateTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="作废人" align="center" prop="updater" width="150" />
<el-table-column label="门店" align="center" prop="corpName" width="180" />
<el-table-column label="作废备注" align="center" prop="remark" width="180" />
</el-table>
<!-- 分页 -->
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
</div>
</template>
<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
export default {
name: "SoVoid",
components: {StaffChoose, SupplierChoose, CorpChoose},
props: {
soByType: {
type: Boolean,
defaultValue: true,
required: true
},
},
data() {
return {
queryParams:{
pageNo: 1,
pageSize: 10,
searchTimeArray:[],
soNo: null,
supplierId: null,
supplierName: null,
corpId: null,
userId: null,
userName: null,
soType: this.soByType ? "01" : "02",
purchaseType: this.goodsYes ? "02" : "01",
soStatus: "06"
},
showSearch: true,
loading: false,
list: [],
total: 0,
}
},
mounted() {
this.pageSo()
},
methods: {
async pageSo(){
try {
this.loading = true
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
// 子组件回调
getStaff(data){
this.queryParams.userId = data.id
this.queryParams.userName = data.name
},
// 搜索
handleQuery(){
this.queryParams.pageNo = 1
this.pageSo()
},
// 重置
handleResetQuery(){
this.resetForm('queryForm')
this.handleQuery()
}
}
}
</script>
<style scoped lang="scss">
</style>