更新代码

This commit is contained in:
xiao-fajia 2024-09-22 21:38:20 +08:00
parent c99a04622e
commit a850c6f694
25 changed files with 1182 additions and 192 deletions

View File

@ -28,3 +28,11 @@ export function voidSo(data){
data
})
}
// 查看单据
export function getRepairSoById(id){
return request({
url: preUrl + "/get?id=" + id,
method: "get"
})
}

View File

@ -10,3 +10,11 @@ export function getSoiPage(params){
params
})
}
// 按IDS查
export function getRepairSoiByIds(ids){
return request({
url: preUrl + "/get?ids=" + ids,
method: "get"
})
}

View File

@ -19,3 +19,20 @@ export function getStPage(params){
params
})
}
// 作废
export function voidSt(data){
return request({
url: preUrl + "/void",
method: "post",
data
})
}
// 查单据
export function getSt(id){
return request({
url: preUrl + "/get?id=" + id,
method: "get"
})
}

View File

@ -10,3 +10,11 @@ export function getStiPage(params){
params
})
}
// 查配件
export function getStIsWares(ids){
return request({
url: preUrl + "/getWares?ids=" + ids,
method: "get"
})
}

View File

@ -27,3 +27,12 @@ export function getTicketsById(id){
method: "get"
})
}
// 作废
export function setTicketsVoid(data){
return request({
url: preUrl + "/void",
method: "post",
data
})
}

View File

@ -101,6 +101,10 @@ export default {
}
},
handleSelectionChange(data) {
data = {
...data,
wareId: data.warehouse
}
this.$emit("input", data)
this.$emit("selected", data)
this.$refs.selectTable.blur()

View File

@ -24,7 +24,7 @@ export default {
name: "WarehouseChoose",
props:{
value:{
type: String,
type: [String, Object],
default: "",
required:false
}
@ -43,7 +43,7 @@ export default {
watch:{
value(val){
if (val){
this.warehouseSelected = val
this.warehouseSelected = val.name
}else {
this.warehouseSelected = null
}
@ -67,7 +67,7 @@ export default {
return JSON.parse(JSON.stringify(result))
},
handleNodeClick(node){
this.$emit("input", node.name)
this.$emit("input", node)
this.$emit("change")
this.warehouseSelected = node.name
this.$refs.selectTree.blur()

View File

@ -15,11 +15,11 @@
<el-form-item v-if="soByType && !goodsYes" label="供应商" prop="supplierId">
<SupplierChoose v-model="queryParams.supplier"/>
</el-form-item>
<el-form-item v-if="goodsYes" label="关键字" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
<el-form-item v-if="goodsYes" label="关键字" prop="query">
<el-input v-model="queryParams.query" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
</el-form-item>
<el-form-item v-else label="单据号" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
<el-form-item v-else label="单据号" prop="query">
<el-input v-model="queryParams.query" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item v-if="soByType" label="状态" prop="soStatus">
<el-select v-model="queryParams.soStatus" clearable>
@ -42,44 +42,44 @@
</el-form>
<!-- 操作 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-download" size="mini"
>导出
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" plain icon="el-icon-download" size="mini"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<!-- 急件 -->
<el-table v-if="goodsYes" 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="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"/>
<el-table-column label="所属分类" align="center" width="150" prop="name"/>
<el-table-column label="数量" align="center" width="150" prop="name"/>
<el-table-column label="单位" align="center" width="150" prop="name"/>
<el-table-column label="成本" align="center" width="150" prop="name"/>
<el-table-column label="供应商" align="center" width="180" prop="name"/>
<el-table-column label="仓库" align="center" width="150" prop="name"/>
<el-table-column label="状态" align="center" width="150" prop="name"/>
<el-table-column label="时间" align="center" width="150" prop="name"/>
<el-table-column label="门店" align="center" width="180" prop="name"/>
<el-table-column label="操作" align="center" width="180" fixed="right">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
>审核
</el-button>
</template>
</el-table-column>
</el-table>
<!-- <el-table v-if="goodsYes" 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="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"/>-->
<!-- <el-table-column label="所属分类" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="数量" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="单位" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="成本" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="供应商" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="仓库" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="状态" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="时间" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="门店" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="操作" align="center" width="180" fixed="right">-->
<!-- <template v-slot="scope">-->
<!-- <el-button size="mini" type="text" icon="el-icon-edit"-->
<!-- >审核-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- 采购/领料 -->
<el-table v-else v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<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>
@ -105,9 +105,12 @@
<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-view" @click="handleShow(scope.row)"
>查看
</el-button>
<!-- <el-button size="mini" type="text" icon="el-icon-edit-outline"-->
<!-- >修改-->
<!-- </el-button>-->
<el-button size="mini" type="text" icon="el-icon-close" @click="handleVoidSo(scope.row)"
>作废
</el-button>
@ -118,6 +121,8 @@
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
/>
<SoShow :so-by-type="soByType" ref="soShow" />
</div>
</template>
@ -127,8 +132,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, voidSo} from "@/api/repair/stockOperate/stockOperate";
import {getSoiPage} from "@/api/repair/stockOperate/stockOperateItem";
import {getRepairSoPage, voidSo, getRepairSoById} from "@/api/repair/stockOperate/stockOperate";
import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue";
export default {
name: "SoIndex",
@ -139,6 +144,7 @@ export default {
}
},
components: {
SoShow,
StaffChoose,
SupplierChoose,
CorpChoose
@ -203,24 +209,24 @@ 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 {
this.loading = false
}
if (this.soByType && this.goodsYes){
this.queryParams.soType = "03"
this.queryParams.purchaseType = "02"
}
if (this.soByType && !this.goodsYes){
this.queryParams.soType = "01"
this.queryParams.soType = "01"
}
if (!this.soByType){
this.queryParams.soType = "02"
}
try {
this.loading = true
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
//
@ -265,6 +271,11 @@ export default {
} catch {
}
},
//
async handleShow(row){
const res = await getRepairSoById(row.id)
await this.$refs.soShow.open(res.data)
}
}
}
</script>

View File

@ -143,7 +143,7 @@ export default {
return {
goodsId: item.id,
goodsType: "0",
wareId: "0",
wareId: item.wareId,
goodsCount: item.count,
goodsPrice: item.newPrice,
remark: item.remark
@ -153,7 +153,7 @@ export default {
//
async handleSubmit(){
try {
this.createInit()
await this.createInit()
await createRepairSo(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
@ -180,18 +180,18 @@ export default {
this.partList = []
},
//
createInit(){
async createInit(){
const data = this.formData
this.formData = {
...data,
userId: data.user.id,
userName: data.user.name,
userId: data?.user?.id,
userName: data?.user?.name,
}
if (this.soByType){
this.formData = {
...data,
supplierId: data.supplier.id,
supplierName: data.supplier.name
...this.formData,
supplierId: data?.supplier?.id,
supplierName: data?.supplier?.name
}
}
}

View File

@ -0,0 +1,177 @@
<template>
<div class="app-container">
<el-dialog title="单据详情" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>单据信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
单号
</template>
{{info.soNo}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
数量
</template>
{{info.itemCount}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
金额
</template>
{{info.totalPrice}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{soByType ? '采购员' : '领料人'}}
</template>
{{info.userName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
供应商
</template>
{{info.supplierName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
登记时间
</template>
{{parseTime(info.createTime, '{y}-{m}-{d}')}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{soByType ? '入库时间' : '领料时间'}}
</template>
{{parseTime(info.soTime, '{y}-{m}-{d}')}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
门店
</template>
{{info.corpName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_SO_STATUS" :value="info.soStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
备注
</template>
{{info.remark}}
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>商品信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-table v-loading="loading" :data="info.goodsList" :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="repairWares.name" width="180" />
<el-table-column label="商品编码" align="center" prop="repairWares.code" width="180" />
<el-table-column v-if="soByType" label="条形码" align="center" prop="repairWares.barCode" width="180" />
<el-table-column label="规格" align="center" prop="repairWares.model" width="180" />
<el-table-column label="数量" align="center" prop="goodsCount" width="150" />
<el-table-column :label="soByType ? '进价' : '成本'" align="center" prop="goodsPrice" width="150">
<template scope="scope">
{{scope.row.goodsPrice}}
</template>
</el-table-column>
<el-table-column label="合计" align="center" prop="total" width="150">
<template scope="scope">
{{scope.row.goodsCount * scope.row.goodsPrice}}
</template>
</el-table-column>
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="180">
<template slot-scope="scope">
{{info.supplierName}}
</template>
</el-table-column>
<el-table-column :label="soByType ? '采购仓库' : '仓库'" align="center" prop="wareName" width="150">
<template slot-scope="scope">
{{getWareHoseName(scope.row.wareId)}}
</template>
</el-table-column>
<el-table-column label="所属门店" align="center" prop="corpName" width="180" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150">
<template slot-scope="scope">
{{parseTime(info.soTime, '{y}-{m}-{d}')}}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" width="180" />
</el-table>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import UserChoose from "@/views/repair/Components/UserChoose.vue";
import SoiTable from "@/views/repair/stockOperate/Components/SoiTable.vue";
import {getRepairSoiByIds} from "@/api/repair/stockOperate/stockOperateItem";
import {getBaseWarehouseList} from "@/api/base/warehouse";
export default {
name: "soShow",
components: {SoiTable, UserChoose},
props:{
soByType:{
type: Boolean,
default: true,
}
},
data() {
return {
dialogVisible: false,
info:{},
loading: true,
warehouseList: null
}
},
methods: {
async open(row){
this.dialogVisible = true
this.info = row
const ids = row.goodsList.map(item => item.id)
const res = await getRepairSoiByIds(ids)
this.info.goodsList = res.data
const response = await getBaseWarehouseList()
this.warehouseList = response.data
this.loading = false
},
getWareHoseName(value){
return this.warehouseList.find(item => item.id === value).name
}
}
}
</script>
<style scoped lang="scss">
.box-card {
margin-bottom: 10px;
}
</style>

View File

@ -19,12 +19,16 @@
<el-table-column label="商品编码" align="center" width="180" prop="code"/>
<el-table-column label="仓库" align="center" width="150" prop="warehouse">
<div class="item" slot-scope="scope">
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.warehouse" />
<span class="item__txt">{{ scope.row.warehouse }}</span>
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.ware" @change="changeWare(scope.row)"/>
<span class="item__txt">{{ scope.row.warehouseName }}</span>
</div>
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="stock"/>
<el-table-column label="单位" align="center" width="150" prop="unit"/>
<el-table-column label="单位" align="center" width="150" prop="unit">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="150" prop="count">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count" placeholder="请输入内容"></el-input>
@ -187,6 +191,13 @@ export default {
this.cancelEditable(cell)
})
this.clickCellMap[id] = []
},
changeWare(row){
if (row.ware){
row['wareId'] = row.ware.id
row['warehouse'] = row.ware.id
row['warehouseName'] = row.ware.name
}
}
}
}

View File

@ -58,10 +58,19 @@
<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-column label="操作" align="center" width="180" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
<SoShow :so-by-type="soByType" ref="soShow" />
</div>
</template>
@ -69,11 +78,12 @@
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";
import {getRepairSoPage, getRepairSoById} from "@/api/repair/stockOperate/stockOperate";
import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue";
export default {
name: "SoVoid",
components: {StaffChoose, SupplierChoose, CorpChoose},
components: {SoShow, StaffChoose, SupplierChoose, CorpChoose},
props: {
soByType: {
type: Boolean,
@ -139,6 +149,9 @@ export default {
//
handleQuery(){
this.queryParams.pageNo = 1
if (this.queryParams.user){
this.queryParams.userId = this.queryParams.user.id
}
this.pageSo()
},
//
@ -148,6 +161,11 @@ export default {
this.queryParams.corp = null
this.queryParams.user = null
this.handleQuery()
},
//
async handleShow(row){
const res = await getRepairSoById(row.id)
await this.$refs.soShow.open(res.data)
}
}
}

View File

@ -12,17 +12,14 @@
end-placeholder="结束日期">
</el-date-picker>
</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="standard">
<el-input v-model="queryParams.standard" style="width: 18rem" placeholder="请输入规格"/>
<el-form-item label="关键字" prop="query">
<el-input v-model="queryParams.query" style="width: 18rem" placeholder="请输入单号、商品名称、编码或规格"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose v-model="queryParams.corp" />
</el-form-item>
<el-form-item v-if="soByType" label="所属库位" prop="warehouseId">
<WarehouseChoose v-model="queryParams.warehouseId" @selected="getWarehouse"/>
<el-form-item v-if="soByType" label="所属库位" prop="wareId">
<WarehouseChoose v-model="queryParams.ware" @selected="getWarehouse"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -45,23 +42,35 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<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" />
<el-table-column v-if="soByType" label="条形码" align="center" prop="soNo" width="180" />
<el-table-column label="规格" align="center" prop="soNo" width="180" />
<el-table-column label="数量" align="center" prop="itemCount" width="150" />
<el-table-column :label="soByType ? '进价' : '成本'" align="center" prop="itemCount" width="150" />
<el-table-column label="合计" align="center" prop="itemCount" width="150" />
<el-table-column v-if="soByType" label="供应商" align="center" prop="itemCount" width="180" />
<el-table-column :label="soByType ? '采购仓库' : '仓库'" align="center" prop="itemCount" width="150" />
<el-table-column label="所属门店" align="center" prop="itemCount" width="180" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="itemCount" width="150" />
<el-table-column label="备注" align="center" prop="itemCount" width="180" />
<el-table-column label="单号" align="center" prop="so.soNo" width="200" />
<el-table-column label="商品名称" align="center" prop="repairWares.name" width="180" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="so.userName" width="180" />
<el-table-column label="商品编码" align="center" prop="repairWares.code" width="180" />
<el-table-column v-if="soByType" label="条形码" align="center" prop="repairWares.barCode" width="180" />
<el-table-column label="规格" align="center" prop="repairWares.model" width="180" />
<el-table-column label="数量" align="center" prop="goodsCount" width="150" />
<el-table-column :label="soByType ? '进价' : '成本'" align="center" prop="goodsPrice" width="150" />
<el-table-column label="合计" align="center" prop="itemCount" width="150">
<template slot-scope="scope">
{{scope.row.goodsCount * scope.row.goodsPrice}}
</template>
</el-table-column>
<el-table-column v-if="soByType" label="供应商" align="center" prop="so.supplierName" width="180" />
<el-table-column :label="soByType ? '采购仓库' : '仓库'" align="center" prop="wareId" width="150">
<template slot-scope="scope">
{{getWareHoseName(scope.row.wareId)}}
</template>
</el-table-column>
<el-table-column label="所属门店" align="center" prop="so.corpId" width="180" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="so.createTime" width="150">
<template slot-scope="scope">
{{parseTime(scope.row.so.createTime, '{y}-{m}-{d}')}}
</template>
</el-table-column>
<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>
@ -69,7 +78,8 @@
<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {getSoiPage} from "@/api/repair/stockOperate/stockOperateItem";
import {getSoiPage, getRepairSoiByIds} from "@/api/repair/stockOperate/stockOperateItem";
import {getBaseWarehouseList} from "@/api/base/warehouse";
export default {
name: "SoiTable",
@ -95,9 +105,12 @@ export default {
soNo: null,
corpId: null,
soiType: this.soByType ? "01" : "02",
warehouseId: null,
ware: null,
wareId: null,
corp: null,
query: null
},
warehouseList: null,
showSearch: true,
loading: false,
list: [],
@ -116,7 +129,16 @@ export default {
try {
this.loading = true
const res = await getSoiPage(this.queryParams)
this.list = res.data.records
const data = res.data.records
if (data && data.length > 0){
const ids = data.map(item => item.id)
const response = await getRepairSoiByIds(ids)
this.list = response.data
const wareResponse = await getBaseWarehouseList()
this.warehouseList = wareResponse.data
}else {
this.list = data
}
this.total = res.data.total
}finally {
this.loading = false
@ -125,13 +147,21 @@ export default {
//
handleQuery(){
this.queryParams.pageNo = 1
if (this.queryParams.ware){
this.queryParams.wareId = this.queryParams.ware.id
}
this.pageSoi()
},
//
handleResetQuery(){
this.resetForm('queryForm')
this.queryParams.corp = null
this.queryParams.ware = null
this.handleQuery()
},
getWareHoseName(value){
if (!(this.warehouseList && this.warehouseList.length > 0)) return ''
return this.warehouseList.find(item => item.id === value).name
}
}
}

View File

@ -4,9 +4,9 @@
<el-tab-pane label="采购单据" name="purchase">
<SoIndex :so-by-type="soByType"/>
</el-tab-pane>
<el-tab-pane label="急件单据" name="urgentPurchase">
<SoIndex :so-by-type="soByType" :goods-yes="true"/>
</el-tab-pane>
<!-- <el-tab-pane label="急件单据" name="urgentPurchase">-->
<!-- <SoIndex :so-by-type="soByType" :goods-yes="true"/>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="作废单据" name="voidPurchase">
<SoVoid :so-by-type="soByType" />
</el-tab-pane>

View File

@ -3,6 +3,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="至"
@ -10,8 +11,8 @@
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="stByType ? '单据号' : '关键字'" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
<el-form-item label="单据号" prop="stNo">
<el-input v-model="queryParams.stNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item label="调出门店" prop="outCorpId">
<CorpChoose v-model="queryParams.outCorp"/>
@ -19,12 +20,12 @@
<el-form-item label="调入门店" prop="inCorpId">
<CorpChoose v-model="queryParams.inCorp"/>
</el-form-item>
<el-form-item label="审核状态" prop="stStatus">
<el-select v-model="queryParams.stStatus">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_ST_STATUS)" :key="item.value" :label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="审核状态" prop="stStatus">-->
<!-- <el-select v-model="queryParams.stStatus">-->
<!-- <el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_ST_STATUS)" :key="item.value" :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<!-- </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="handleReset">重置</el-button>
@ -40,8 +41,16 @@
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="stNo" width="200"/>
<el-table-column label="调出门店" align="center" prop="outCorpId" width="180"/>
<el-table-column label="调入门店" align="center" prop="inCorpId" width="180"/>
<el-table-column label="调出门店" align="center" prop="outCorpId" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{getCompanyName(scope.row.outCorpId)}}
</template>
</el-table-column>
<el-table-column label="调入门店" align="center" prop="inCorpId" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{getCompanyName(scope.row.inCorpId)}}
</template>
</el-table-column>
<el-table-column label="调拨数量" align="center" prop="itemCount" width="150"/>
<el-table-column v-if="stByType" label="调拨成本" align="center" prop="totalPrice" width="150"/>
<el-table-column label="调拨总额" align="center" prop="totalPrice" width="150"/>
@ -52,7 +61,11 @@
<el-table-column label="调拨日期" align="center" prop="stTime" width="150"/>
<el-table-column label="调拨人" align="center" prop="userName" width="150"/>
<el-table-column v-if="!stByType" label="审核日期" align="center" prop="itemCount" width="150"/>
<el-table-column label="状态" align="center" prop="stStatus" width="150"/>
<el-table-column label="状态" align="center" prop="stStatus" width="150">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_ST_STATUS" v-model="scope.row.stStatus" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" width="180"/>
<el-table-column v-if="!stByType" label="退回备注" align="center" prop="remark" width="180"/>
<el-table-column label="操作" fixed="right" width="180" align="center">
@ -60,7 +73,10 @@
<!-- <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-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button size="mini" type="text" icon="el-icon-close" @click="handleVoid(scope.row)"
>作废
</el-button>
</template>
@ -76,16 +92,20 @@
</el-table>
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
<StShow ref="stShow" />
</div>
</template>
<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import {getStPage} from "@/api/repair/stockTransfer/stockTransfer";
import {getStPage, voidSt} from "@/api/repair/stockTransfer/stockTransfer";
import {getCompanyList} from "@/api/base/company";
import StShow from "@/views/repair/stockTransfer/Components/StShow.vue";
export default {
name: "StIndex",
components: {CorpChoose},
components: {StShow, CorpChoose},
props: {
stByType: {
type: Boolean,
@ -117,13 +137,26 @@ export default {
showSearch: true,
loading: false,
list: [],
total: 0
total: 0,
formData:{},
companyList: []
}
},
mounted() {
this.getList()
this.companyInit()
},
methods: {
async companyInit(){
if (!(this.companyList && this.companyList.length > 0)){
const res = await getCompanyList();
this.companyList = res.data
}
},
getCompanyName(id){
if (!(this.companyList && this.companyList.length > 0)) return ""
return this.companyList.find(item => item.id === id).corpName
},
async getList() {
const res = await getStPage(this.queryParams)
this.list = res.data.records
@ -138,7 +171,32 @@ export default {
this.queryParams.outCorp = null
this.queryParams.inCorp = null
this.handleQuery()
}
},
handleVoid(row){
this.$prompt('作废备注', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
this.formData.id = row.id
this.formData.remark = value
this.formData.stStatus = "04"
this.doVoid()
}).catch(() => {
})
},
async doVoid(){
await voidSt(this.formData)
this.$modal.msgSuccess("作废成功")
await this.getList()
},
handleShow(row){
row = {
...row,
outCorpName: this.getCompanyName(row.outCorpId),
inCorpName: this.getCompanyName(row.inCorpId),
}
this.$refs.stShow.open(row)
},
}
}
</script>

View File

@ -133,7 +133,7 @@ export default {
return x + y.totalPrice
}, 0)
const itemCount = data.reduce((x, y) => {
return x + y.goodsCount
return parseInt(x) + parseInt(y.goodsCount)
}, 0)
this.formData.totalPrice = tempPrice
this.formData.thisDebt = tempPrice
@ -159,10 +159,14 @@ export default {
//
async handleSubmit() {
try {
this.createInit()
await createSt(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
const flag = this.formData.oldCorp && this.formData.newCorp && this.formData.user && this.formData.goodsList.length
if (!flag) await this.$modal.msgError("请完善信息")
else {
this.createInit()
await createSt(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
}
} catch {
}
},
@ -171,11 +175,12 @@ export default {
const data = this.formData
this.formData = {
...data,
outCorpId: data.oldCorp.id,
inCorpId: data.newCorp.id,
userId: data.user.id,
userName: data.user.name,
outCorpId: data?.oldCorp?.id,
inCorpId: data?.newCorp?.id,
userId: data?.user?.id,
userName: data?.user?.name,
}
this.formData.goodsList.forEach(item => item.id = null)
},
//
init(){

View File

@ -0,0 +1,175 @@
<template>
<div class="app-container">
<el-dialog title="单据详情" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>单据信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
单号
</template>
{{ info.stNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
调出门店
</template>
{{ info.outCorpName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
调入门店
</template>
{{ info.inCorpName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
总数量
</template>
{{ info.itemCount }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
总金额
</template>
{{ info.totalPrice }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
调拨日期
</template>
{{ parseTime(info.stTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
调拨人
</template>
{{ info.userName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠金额
</template>
{{ info.discountPrice }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
本次收款
</template>
{{ info.thisCollection }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
本次欠款
</template>
{{ info.thisDebt }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_ST_STATUS" :value="info.stStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
备注
</template>
{{ info.remark }}
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>商品信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-table v-loading="loading" :data="info.items" :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="wares.name" width="180"/>
<el-table-column label="商品编码" align="center" prop="wares.code" width="180"/>
<el-table-column label="条形码" align="center" prop="wares.barCode" width="180"/>
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
<el-table-column label="数量" align="center" prop="goodsCount" width="150"/>
<el-table-column label="单价" align="center" prop="goodsPrice" width="150">
<template scope="scope">
{{ scope.row.goodsPrice }}
</template>
</el-table-column>
<el-table-column label="合计" align="center" prop="total" width="150">
<template scope="scope">
{{ scope.row.goodsCount * scope.row.goodsPrice }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" width="180"/>
</el-table>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getBaseWarehouseList} from "@/api/base/warehouse";
import {getSt} from "@/api/repair/stockTransfer/stockTransfer";
export default {
name: "sTShow",
props: {
soByType: {
type: Boolean,
default: true,
}
},
data() {
return {
dialogVisible: false,
info: {},
loading: true,
warehouseList: null
}
},
methods: {
async open(row) {
try {
this.dialogVisible = true
this.loading = true
this.info = row
const id = row.id
const res = await getSt(id)
console.log(res.data)
this.info.items = res.data.items
const response = await getBaseWarehouseList()
this.warehouseList = response.data
} finally {
this.loading = false
}
},
getWareHoseName(value) {
return this.warehouseList.find(item => item.id === value).name
}
}
}
</script>
<style scoped lang="scss">
.box-card {
margin-bottom: 10px;
}
</style>

View File

@ -14,8 +14,16 @@
</el-table-column>
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
<el-table-column label="规格" align="center" width="180" prop="model"/>
<el-table-column label="单位" align="center" width="150" prop="unit"/>
<el-table-column label="原库位" align="center" width="150" prop="warehouse"/>
<el-table-column label="单位" align="center" width="150" prop="unit">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column label="原库位" align="center" width="150" prop="warehouse">
<template slot-scope="scope">
{{getWareHoseName(scope.row.wareId)}}
</template>
</el-table-column>
<el-table-column label="账上数量" align="center" width="150" prop="stock"/>
<el-table-column label="调拨数量" align="center" width="150" prop="goodsCount">
<div class="item" slot-scope="scope">
@ -48,6 +56,8 @@
</template>
<script>
import {getBaseWarehouseList} from "@/api/base/warehouse";
export default {
name: "StTable",
props: {
@ -66,7 +76,8 @@ export default {
//
editProp: ['goodsCount', 'goodsPrice', 'remark'],
// cell
clickCellMap: {}
clickCellMap: {},
warehouseList: null
}
},
watch: {
@ -92,7 +103,14 @@ export default {
deep: true
},
},
mounted() {
this.getWarehouseList()
},
methods: {
async getWarehouseList(){
const response = await getBaseWarehouseList()
this.warehouseList = response.data
},
//
deleteItem(index) {
this.$emit("deleteItem", index)
@ -171,6 +189,9 @@ export default {
this.cancelEditable(cell)
})
this.clickCellMap[id] = []
},
getWareHoseName(value){
return this.warehouseList.find(item => item.id === value).name
}
}
}

View File

@ -3,6 +3,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="至"
@ -10,18 +11,18 @@
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="单据号" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
<el-form-item label="单据号" prop="stNo">
<el-input v-model="queryParams.stNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item label="调出门店" prop="corpId">
<CorpChoose />
<el-form-item label="调出门店" prop="outCorpId">
<CorpChoose v-model="queryParams.outCorp"/>
</el-form-item>
<el-form-item label="调入门店" prop="corpId">
<CorpChoose />
<el-form-item label="调入门店" prop="inCorpId">
<CorpChoose v-model="queryParams.inCorp"/>
</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="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
@ -33,39 +34,118 @@
<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="180" />
<el-table-column label="调入门店" align="center" prop="soNo" width="180" />
<el-table-column label="总数量" align="center" prop="soNo" width="180" />
<el-table-column label="总金额" align="center" prop="soNo" width="180" />
<el-table-column label="调拨日期" align="center" prop="soNo" width="180" />
<el-table-column label="调拨人" align="center" prop="soNo" width="180" />
<el-table-column label="状态" align="center" prop="soNo" width="180" />
<el-table-column label="作废备注" align="center" prop="soNo" width="180" />
<el-table-column label="单号" align="center" prop="stNo" width="200" />
<el-table-column label="调出门店" :show-overflow-tooltip="true" align="center" prop="outCorpId" width="200">
<template slot-scope="scope">
{{getCompanyName(scope.row.outCorpId)}}
</template>
</el-table-column>
<el-table-column label="调入门店" :show-overflow-tooltip="true" align="center" prop="inCorpId" width="200">
<template slot-scope="scope">
{{getCompanyName(scope.row.inCorpId)}}
</template>
</el-table-column>
<el-table-column label="总数量" align="center" prop="itemCount" width="180" />
<el-table-column label="总金额" align="center" prop="totalPrice" width="180" />
<el-table-column label="调拨日期" align="center" prop="createTime" width="180">
<template slot-scope="scope">
{{parseTime(scope.row.stTime, '{y}-{m}-{d}')}}
</template>
</el-table-column>
<el-table-column label="调拨人" align="center" prop="userName" width="180" />
<el-table-column label="状态" align="center" prop="stStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_ST_STATUS" v-model="scope.row.stStatus" />
</template>
</el-table-column>
<el-table-column label="作废备注" align="center" prop="remark" width="180" />
<el-table-column label="操作" align="center" width="180" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(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"
/>
<StShow ref="stShow" />
</div>
</template>
<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import {getStPage} from "@/api/repair/stockTransfer/stockTransfer";
import {getCompanyList} from "@/api/base/company";
import StShow from "@/views/repair/stockTransfer/Components/StShow.vue";
export default {
name: "StVoid",
components: {CorpChoose},
components: {StShow, CorpChoose},
data() {
return {
queryParams:{
pageNo: 1,
pageSize: 10,
searchTimeArray: [],
stStatus: "04",
outCorp: null,
outCorpId: null,
inCorp: null,
inCorpId: null,
stNo: null
},
showSearch:true,
loading: false,
list: [],
total: 0
total: 0,
corpList: []
}
},
methods: {}
mounted() {
this.getPage()
this.listCompany()
},
methods: {
async getPage(){
try {
this.loading = true
const res = await getStPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
async listCompany(){
const res = await getCompanyList();
this.corpList = res.data
},
getCompanyName(id){
if (!(this.corpList && this.corpList.length > 0)) return ''
return this.corpList.find(item => item.id === id).corpName
},
handleShow(row){
row = {
...row,
outCorpName: this.getCompanyName(row.outCorpId),
inCorpName: this.getCompanyName(row.inCorpId),
}
this.$refs.stShow.open(row)
},
handleReset(){
this.resetForm('queryForm')
this.queryParams.outCorp = null
this.queryParams.inCorp= null
this.handleQuery()
},
handleQuery(){
this.queryParams.pageNo = 1
this.queryParams.inCorpId = this.queryParams?.inCorp?.id
this.queryParams.outCorpId = this.queryParams?.outCorp?.id
this.getPage()
}
}
}
</script>

View File

@ -3,6 +3,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="至"
@ -10,11 +11,11 @@
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="关键字" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
<el-form-item label="关键字" prop="query">
<el-input v-model="queryParams.query" style="width: 18rem" placeholder="请输入单号、商品名称、编码或规格"/>
</el-form-item>
<el-form-item label="调出门店" prop="outCorpId">
<CorpChoose v-model="queryParams.outCorp" />
<CorpChoose v-model="queryParams.outCorp"/>
</el-form-item>
<el-form-item label="调入门店" prop="inCorpId">
<CorpChoose v-model="queryParams.inCorp"/>
@ -38,23 +39,39 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="stId" width="180" />
<el-table-column label="商品名称" align="center" prop="goodsId" width="180" />
<el-table-column label="规格" align="center" prop="soNo" width="180" />
<el-table-column label="商品编码" align="center" prop="soNo" width="180" />
<el-table-column v-if="!stByType" label="条形码" align="center" prop="soNo" width="180" />
<el-table-column label="数量" align="center" prop="itemCount" width="150" />
<el-table-column label="成本" align="center" prop="itemCount" width="150" />
<el-table-column label="合计成本" align="center" prop="itemCount" width="150" />
<el-table-column v-if="stByType" label="出库金额" align="center" prop="itemCount" width="150" />
<el-table-column label="合计金额" align="center" prop="itemCount" width="150" />
<el-table-column label="负责人" align="center" prop="itemCount" width="150" />
<el-table-column label="调出门店" align="center" prop="itemCount" width="180" />
<el-table-column label="调出仓库" align="center" prop="itemCount" width="180" />
<el-table-column label="调入门店" align="center" prop="itemCount" width="180" />
<el-table-column label="调入仓库" align="center" prop="itemCount" width="180" />
<el-table-column label="调拨时间" align="center" prop="itemCount" width="180" />
<el-table-column label="备注" align="center" prop="remark" width="180" />
<el-table-column label="单号" align="center" prop="st.stNo" width="200"/>
<el-table-column label="商品名称" align="center" prop="wares.name" width="180"/>
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
<el-table-column label="商品编码" align="center" prop="wares.code" width="180"/>
<el-table-column v-if="!stByType" label="条形码" align="wares.barCode" prop="soNo" width="180"/>
<el-table-column label="数量" align="center" prop="goodsCount" width="150"/>
<el-table-column label="成本" align="center" prop="wares.price" width="150"/>
<el-table-column label="合计成本" align="center" prop="totalPrice" width="150">
<template slot-scope="scope">
{{scope.row.wares.price * scope.row.goodsCount}}
</template>
</el-table-column>
<el-table-column v-if="stByType" label="出库金额" align="center" prop="goodsPrice" width="150"/>
<el-table-column label="合计金额" align="center" prop="itemCount" width="150">
<template slot-scope="scope">
{{scope.row.goodsPrice * scope.row.goodsCount}}
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="st.userName" width="150"/>
<el-table-column label="调出门店" align="center" prop="st.outCorpId" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{getCompanyName(scope.row.st.outCorpId)}}
</template>
</el-table-column>
<!-- <el-table-column label="调出仓库" align="center" prop="itemCount" width="180"/>-->
<el-table-column label="调入门店" align="center" prop="st.inCorpId" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{getCompanyName(scope.row.st.inCorpId)}}
</template>
</el-table-column>
<!-- <el-table-column label="调入仓库" align="center" prop="itemCount" width="180"/>-->
<el-table-column label="调拨时间" align="center" prop="st.stTime" 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"
/>
@ -62,24 +79,25 @@
</template>
<script>
import {getStiPage} from "@/api/repair/stockTransfer/stockTransferItem";
import {getStiPage, getStIsWares} from "@/api/repair/stockTransfer/stockTransferItem";
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import {getCompanyList} from "@/api/base/company";
export default {
name: "StiTable",
components: {CorpChoose},
props:{
stByType:{
props: {
stByType: {
type: Boolean,
defaultValue: true,
required: true
}
},
watch:{
'queryParams.outCorp'(val){
watch: {
'queryParams.outCorp'(val) {
this.queryParams.outCorpId = val ? val.id : null
},
'queryParams.inCorp'(val){
'queryParams.inCorp'(val) {
this.queryParams.inCorpId = val ? val.id : null
}
},
@ -92,28 +110,51 @@ export default {
outCorp: null,
outCorpId: null,
inCorp: null,
inCorpId: null
inCorpId: null,
query: null
},
showSearch: true,
loading: false,
list: [],
total: 0,
corpList: []
}
},
mounted() {
this.getList()
this.listCompany()
},
methods: {
async getList(){
async listCompany(){
const res = await getCompanyList();
this.corpList = res.data
},
getCompanyName(id){
if (!(this.corpList && this.corpList.length > 0)) return ''
return this.corpList.find(item => item.id === id).corpName
},
async getList() {
const res = await getStiPage(this.queryParams)
this.list = res.data.records
const ids = res.data.records.map(item => item.id)
if (ids && ids.length > 0){
const response = await getStIsWares(ids)
if (response.data && response.data.length > 0) {
this.list = response.data
} else {
this.list = res.data.records
}
}else {
this.list = res.data.records
}
this.total = res.data.total
},
handleQuery(){
handleQuery() {
this.queryParams.pageNo = 1
this.queryParams.inCorpId = this.queryParams?.inCorp?.id
this.queryParams.outCorpId = this.queryParams?.outCorp?.id
this.getList()
},
handleReset(){
handleReset() {
this.resetForm("queryForm")
this.queryParams.outCorp = null
this.queryParams.inCorp = null

View File

@ -0,0 +1,81 @@
<template>
<div>
<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 align="center" :label="getLabelName" width="200" prop="name">
<template slot-scope="scope">
{{ scope.row[listType]?.name }}
</template>
</el-table-column>
<el-table-column align="center" label="规格" width="180" prop="model">
<template slot-scope="scope">
{{ scope.row[listType]?.model }}
</template>
</el-table-column>
<el-table-column align="center" label="编码" width="180" prop="code">
<template slot-scope="scope">
{{ scope.row[listType]?.code }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="180" prop="itemCount"/>
<el-table-column align="center" label="单位" width="180" prop="unit">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row[listType].unit"/>
</template>
</el-table-column>
<el-table-column align="center" label="单价" width="180" prop="itemPrice"/>
<el-table-column align="center" label="折扣" width="180" prop="itemDiscount"/>
<el-table-column align="center" label="金额" width="180" prop="itemMoney"/>
<el-table-column align="center" label="施工人员" width="180" prop="repairName"/>
<el-table-column align="center" label="销售人员" width="180" prop="saleName"/>
<el-table-column align="center" label="备注" width="180" prop="remark"/>
</el-table>
</div>
</template>
<script>
export default {
name: "TicketItemShow",
props: {
list: {
type: Array,
default: () => {
return []
}
},
listType: {
type: String,
default: null
}
},
data() {
return {
loading: !(this.list && this.list.length),
}
},
computed: {
getLabelName() {
switch (this.listType) {
case "project":
return "维修项目";
case "ware":
return "维修配件";
case "other":
return "附加费用";
default:
return '';
}
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -41,7 +41,7 @@
</el-col>
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<TicketTable :ticket-type="TicketType" :list="list"/>
<TicketTable :ticket-type="TicketType" :list="list" @setVoid="getPage"/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
</div>

View File

@ -94,8 +94,13 @@
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
<el-table-column label="备注" align="center" prop="remark" width="180"/>
<el-table-column label="所属门店" align="center" prop="corpId" width="180"/>
<el-table-column label="操作" fixed="right" align="center" width="180" v-if="TicketType !== 'tv'">
<template v-slot="scope">
<el-table-column label="工单状态" align="center" prop="ticketsStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus" />
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
@ -105,7 +110,7 @@
<el-button v-if="TicketType === 'tp'" size="mini" type="text" icon="el-icon-refresh-right"
>返结
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"
<el-button v-if="TicketType !== 'tv'" size="mini" type="text" icon="el-icon-delete" @click="handleVoid(scope.row)"
>作废
</el-button>
</template>
@ -133,15 +138,17 @@
<!-- <el-table-column label="作废人" align="center" prop="soNo" width="180" />-->
<!-- <el-table-column label="作废备注" align="center" prop="remark" width="180" />-->
<!-- </el-table>-->
<TicketsShow ref="ticketsShow" />
</div>
</template>
<script>
import {getDictsByType} from "@/api/system/dict/data";
import {setTicketsVoid} from "@/api/repair/tickets/Tickets";
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
export default {
name: "TicketTable",
components: {TicketsShow},
props: {
TicketType: {
type: String,
@ -156,11 +163,35 @@ export default {
data() {
return {
loading: false,
formData: {
id: null,
ticketsStatus: null,
remark: null
}
}
},
methods: {
handleShow(row) {
this.$refs.ticketsShow.open(row)
},
async handleVoid(row){
this.$prompt('作废备注', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
this.formData.id = row.id
this.formData.remark = value
this.formData.ticketsStatus = "03"
this.doVoid()
}).catch(() => {})
},
async doVoid(){
try {
await setTicketsVoid(this.formData)
this.$modal.msgSuccess("作废成功")
this.$emit("setVoid")
}catch{}
}
}
}
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<el-dialog title="单据详情" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>工单信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
订单编号
</template>
{{ info.ticketNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
维修类别
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsWorkStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
客户名称
</template>
{{ info.userName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车牌号
</template>
{{ info.carNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车系
</template>
{{ info.carBrandName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
手机号
</template>
{{ info.userMobile }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
创建时间
</template>
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
预计完工
</template>
{{ parseTime(info.outTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
合计金额
</template>
{{ info.totalPrice }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
参考成本
</template>
{{ info.cost }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
参考毛利
</template>
{{ info.profit }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
领料状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
服务顾问
</template>
{{ info.adviserName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
所属门店
</template>
{{ info.corpId }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
工单状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
备注
</template>
{{ info.remark }}
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
<el-card class="box-card" v-if="projects && projects.length > 0">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>项目信息</span>
</div>
<!-- 卡片内容 -->
<div>
<TicketItemShow :list="projects" list-type="project"/>
</div>
</el-card>
<el-card class="box-card" v-if="wares && wares.length > 0">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>材料信息</span>
</div>
<!-- 卡片内容 -->
<div>
<TicketItemShow :list="wares" list-type="ware"/>
</div>
</el-card>
<el-card class="box-card" v-if="others && others.length > 0">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>附加信息</span>
</div>
<!-- 卡片内容 -->
<div>
<TicketItemShow :list="others" list-type="other"/>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import TicketItemShow from "@/views/repair/tickets/Components/TicketItemShow.vue";
import {getTicketsById} from "@/api/repair/tickets/Tickets";
export default {
name: "TicketsShow",
components: {TicketItemShow},
data() {
return {
dialogVisible: false,
info: {},
projects: [],
wares: [],
others: []
}
},
methods: {
async open(row) {
const res = await getTicketsById(row.id)
const data = res.data.items
this.projects = data.filter(item => item.project)
this.wares = data.filter(item => item.ware)
this.others = data.filter(item => item.other)
this.info = row
this.dialogVisible = true
}
}
}
</script>
<style scoped lang="scss">
.box-card {
margin-bottom: 10px;
}
</style>

View File

@ -156,7 +156,7 @@
<template slot="label">
备注
</template>
<el-input/>
<el-input v-model="formData.remark"/>
</el-descriptions-item>
</el-descriptions>
</el-col>
@ -172,7 +172,7 @@
</el-col>
<el-col v-else :span="8" style="margin-top:1rem;display: flex;justify-content: right">
<el-button type="danger">结算</el-button>
<el-button type="warning">挂单</el-button>
<el-button type="warning" @click="handlePendingSave">挂单</el-button>
</el-col>
</el-row>
<el-row v-if="createTicketType" :gutter="2">
@ -269,7 +269,7 @@ export default {
qualityDay: null,
ticketType: null,
itemList: [],
ticketStatus: "01"
ticketsStatus: "01"
},
selectUser: {},
selectCar: {},
@ -488,6 +488,11 @@ export default {
this.partList = [itemList.find(item => item.itemType === '02')]
this.otherList = [itemList.find(item => item.itemType === '03')]
}catch{}
},
//
handlePendingSave(){
this.formData.ticketsStatus = "06"
this.handleSave()
}
}
}