更新代码
This commit is contained in:
parent
f7bdee8d14
commit
a99907fbf2
@ -11,6 +11,7 @@ export function createRepairSo(data){
|
||||
})
|
||||
}
|
||||
|
||||
// 分页
|
||||
export function getRepairSoPage(params){
|
||||
return request({
|
||||
url: preUrl + "/page",
|
||||
@ -18,3 +19,12 @@ export function getRepairSoPage(params){
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 作废
|
||||
export function voidSo(data){
|
||||
return request({
|
||||
url: preUrl + "/void",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -1 +1,12 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const preUrl= "/repair/soi"
|
||||
|
||||
// 分页查询
|
||||
export function getSoiPage(params){
|
||||
return request({
|
||||
url: preUrl + "/page",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
@ -10,6 +10,12 @@ import {getCompanyList} from "@/api/base/company";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
props:{
|
||||
value:{
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
corpSelected: undefined,
|
||||
@ -19,7 +25,14 @@ export default {
|
||||
watch:{
|
||||
corpSelected(val) {
|
||||
const company = this.corpList.find(item => item.id === val);
|
||||
this.$emit("selected", company);
|
||||
this.$emit("input", company);
|
||||
},
|
||||
value(val){
|
||||
if (val){
|
||||
this.corpSelected = val.id
|
||||
}else {
|
||||
this.corpSelected = null
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -36,7 +36,7 @@ export default {
|
||||
price: "100",
|
||||
type: "不知道",
|
||||
unit: "个",
|
||||
warehouse: "d1",
|
||||
warehouse: "6335b519fde3cabf298e763bc1c38df1",
|
||||
miniStock: 100,
|
||||
maxStock: 100,
|
||||
stock: 20,
|
||||
@ -57,7 +57,7 @@ export default {
|
||||
price: "10",
|
||||
type: "不知道",
|
||||
unit: "个",
|
||||
warehouse: "d2",
|
||||
warehouse: "6335b519fde3cabf298e763bc1c38df1",
|
||||
miniStock: 10,
|
||||
maxStock: 10,
|
||||
stock: 5,
|
||||
|
@ -22,6 +22,13 @@ import {getBaseWarehouseList} from "@/api/base/warehouse";
|
||||
|
||||
export default {
|
||||
name: "WarehouseChoose",
|
||||
props:{
|
||||
value:{
|
||||
type: String,
|
||||
default: "",
|
||||
required:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
warehouseSelected: undefined,
|
||||
@ -33,6 +40,15 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
value(val){
|
||||
if (val){
|
||||
this.warehouseSelected = val
|
||||
}else {
|
||||
this.warehouseSelected = null
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.listWarehouse()
|
||||
},
|
||||
|
@ -4,6 +4,7 @@
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
|
||||
<el-date-picker
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="queryParams.searchTimeArray"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
@ -12,7 +13,7 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="soByType && !goodsYes" label="供应商" prop="supplierId">
|
||||
<SupplierChoose/>
|
||||
<SupplierChoose v-model="queryParams.supplierId"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="goodsYes" label="关键字" prop="soNo">
|
||||
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
|
||||
@ -29,10 +30,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="!soByType" label="领料人" prop="userId">
|
||||
<StaffChoose @selected="getStaff"/>
|
||||
<StaffChoose v-model="queryParams.userId" @selected="getStaff"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
|
||||
<CorpChoose @selected="getCompany"/>
|
||||
<CorpChoose v-model="queryParams.corpId" @selected="getCompany"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
@ -55,7 +56,7 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单号" align="center" prop="soNo" width="180"/>
|
||||
<el-table-column label="单号" align="center" prop="soId" width="200"/>
|
||||
<el-table-column label="商品名称" align="center" width="180" prop="name"/>
|
||||
<el-table-column label="规格" align="center" width="180" prop="name"/>
|
||||
<el-table-column label="商品编码" align="center" width="180" prop="name"/>
|
||||
@ -84,29 +85,38 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单号" align="center" prop="soNo" width="180"/>
|
||||
<el-table-column label="单号" align="center" prop="soNo" width="200"/>
|
||||
<el-table-column label="数量" align="center" prop="itemCount" width="150"/>
|
||||
<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 v-if="soByType" label="供应商" align="center" prop="supplierName" width="200"/>
|
||||
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150"/>
|
||||
<el-table-column label="登记时间" align="center" prop="createTime" 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="corpName" width="180"/>
|
||||
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150"/>
|
||||
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_SO_STATUS" :value="scope.row.soStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" width="180"/>
|
||||
<el-table-column label="操作" fixed="right" width="180" align="center">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-close"
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit"-->
|
||||
<!-- >修改-->
|
||||
<!-- </el-button>-->
|
||||
<el-button size="mini" type="text" icon="el-icon-close" @click="handleVoidSo(scope.row)"
|
||||
>作废
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -117,7 +127,8 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
|
||||
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
|
||||
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
|
||||
import {getRepairSoPage, voidSo} from "@/api/repair/stockOperate/stockOperate";
|
||||
import {getSoiPage} from "@/api/repair/stockOperate/stockOperateItem";
|
||||
|
||||
export default {
|
||||
name: "SoIndex",
|
||||
@ -157,7 +168,14 @@ export default {
|
||||
corpId: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
soType: this.soByType ? "01" : "02"
|
||||
soType: this.soByType ? "01" : "02",
|
||||
purchaseType: this.goodsYes ? "02" : "01",
|
||||
goodsType: this.goodsYes ? "1" : "0"
|
||||
},
|
||||
formData: {
|
||||
remark: null,
|
||||
id: null,
|
||||
soStatus: "06"
|
||||
},
|
||||
showSearch: true,
|
||||
list: [],
|
||||
@ -171,17 +189,30 @@ export default {
|
||||
methods: {
|
||||
// 分页
|
||||
async pageSo() {
|
||||
if (this.soByType && this.goodsYes) {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await getSoiPage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await getRepairSoPage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
}finally {
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
},
|
||||
// 搜索按钮
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1
|
||||
this.pageSo()
|
||||
},
|
||||
// 搜索重置
|
||||
resetQuery() {
|
||||
@ -196,6 +227,25 @@ export default {
|
||||
// 门店选择
|
||||
getCompany(data) {
|
||||
console.log(data)
|
||||
},
|
||||
// 作废
|
||||
handleVoidSo(row) {
|
||||
this.$prompt('作废备注', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
}).then(({value}) => {
|
||||
this.formData.id = row.id
|
||||
this.formData.remark = value
|
||||
this.doVoidSo()
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
async doVoidSo() {
|
||||
try {
|
||||
await voidSo(this.formData)
|
||||
this.$modal.msgSuccess("作废成功")
|
||||
await this.pageSo()
|
||||
}catch{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
<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="至"
|
||||
@ -12,20 +13,20 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="soByType" label="供应商" prop="supplierId">
|
||||
<SupplierChoose />
|
||||
<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 @selected="getStaff"/>
|
||||
<StaffChoose v-model="queryParams.userId" @selected="getStaff"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
|
||||
<CorpChoose />
|
||||
<CorpChoose v-model="queryParams.corpId" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh">重置</el-button>
|
||||
<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>
|
||||
<!-- 操作 -->
|
||||
@ -38,20 +39,28 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单号" align="center" prop="soNo" width="180" />
|
||||
<el-table-column label="数量" align="center" width="150" prop="name" />
|
||||
<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" />
|
||||
<el-table-column label="作废时间" align="center" prop="createTime" width="150" />
|
||||
<el-table-column label="作废人" align="center" prop="createTime" 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 v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -60,6 +69,7 @@
|
||||
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",
|
||||
@ -82,7 +92,10 @@ export default {
|
||||
supplierName: null,
|
||||
corpId: null,
|
||||
userId: null,
|
||||
userName: null
|
||||
userName: null,
|
||||
soType: this.soByType ? "01" : "02",
|
||||
purchaseType: this.goodsYes ? "02" : "01",
|
||||
soStatus: "06"
|
||||
},
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
@ -90,12 +103,35 @@ export default {
|
||||
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>
|
||||
|
@ -4,6 +4,7 @@
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
|
||||
<el-date-picker
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="queryParams.searchTimeArray"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
@ -14,18 +15,18 @@
|
||||
<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="soNo">
|
||||
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
|
||||
<el-form-item v-if="soByType" label="规格" prop="standard">
|
||||
<el-input v-model="queryParams.standard" style="width: 18rem" placeholder="请输入规格"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
|
||||
<CorpChoose />
|
||||
<CorpChoose v-model="queryParams.corpId" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="soByType" label="所属库位" prop="corpId">
|
||||
<WarehouseChoose @selected="getWarehouse"/>
|
||||
<el-form-item v-if="soByType" label="所属库位" prop="warehouseId">
|
||||
<WarehouseChoose v-model="queryParams.warehouseId" @selected="getWarehouse"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh">重置</el-button>
|
||||
<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>
|
||||
<!-- 操作 -->
|
||||
@ -44,7 +45,7 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单号" align="center" prop="soNo" width="180" />
|
||||
<el-table-column label="单号" align="center" prop="soId" width="200" />
|
||||
<el-table-column label="商品名称" align="center" prop="soNo" width="180" />
|
||||
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="soNo" width="180" />
|
||||
<el-table-column label="商品编码" align="center" prop="soNo" width="180" />
|
||||
@ -68,6 +69,7 @@
|
||||
<script>
|
||||
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
|
||||
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
|
||||
import {getSoiPage} from "@/api/repair/stockOperate/stockOperateItem";
|
||||
|
||||
export default {
|
||||
name: "SoiTable",
|
||||
@ -87,6 +89,8 @@ export default {
|
||||
searchTimeArray:[],
|
||||
soNo: null,
|
||||
corpId: null,
|
||||
soiType: this.soByType ? "01" : "02",
|
||||
warehouseId: null
|
||||
},
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
@ -94,10 +98,34 @@ export default {
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.pageSoi()
|
||||
},
|
||||
methods: {
|
||||
// 库位选择
|
||||
getWarehouse(data){
|
||||
},
|
||||
// 分页
|
||||
async pageSoi(){
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await getSoiPage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
}finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
handleQuery(){
|
||||
this.queryParams.pageNo = 1
|
||||
this.pageSoi()
|
||||
},
|
||||
// 重置
|
||||
handleResetQuery(){
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user