Compare commits
2 Commits
4ec9f5be26
...
6a882e6bac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a882e6bac | ||
|
|
93fd6101da |
121
src/views/components/import/ImportCommon.vue
Normal file
121
src/views/components/import/ImportCommon.vue
Normal file
@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<el-dialog :title="upload.title" :visible.sync="dialogVisible" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport"/>
|
||||
是否更新已经存在的数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link v-if="isDownload" type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板
|
||||
</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm" :disabled="!isUpload">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request, {getBaseHeader} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "ImportCommon",
|
||||
data() {
|
||||
return {
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 设置上传的请求头部
|
||||
headers: getBaseHeader(),
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: 0,
|
||||
// 上传的地址
|
||||
url: "/import-data",
|
||||
// 下载模板地址
|
||||
getUrl: "/get-import-template",
|
||||
},
|
||||
dialogVisible: false,
|
||||
baseUrl: process.env.VUE_APP_BASE_API + '/admin-api',
|
||||
isUpload: false,
|
||||
isDownload: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(data) {
|
||||
if (data.url) {
|
||||
this.isUpload = true
|
||||
}
|
||||
if (data.getUrl) {
|
||||
this.isDownload = true
|
||||
}
|
||||
this.upload = Object.assign(this.upload, data)
|
||||
if (this.isUpload) {
|
||||
this.upload.url = this.baseUrl + data.url
|
||||
}
|
||||
if (this.isDownload) {
|
||||
this.upload.getUrl = this.baseUrl + data.getUrl
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.dialogVisible = false
|
||||
if (response.code !== 0) {
|
||||
this.$modal.msgError(response.msg)
|
||||
return;
|
||||
}
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
// 拼接提示语
|
||||
let data = response.data;
|
||||
let text = '导入成功数量:' + data.createNames.length;
|
||||
for (const name of data.createNames) {
|
||||
text += '<br /> ' + name;
|
||||
}
|
||||
text += '<br />更新成功数量:' + data.updateNames.length;
|
||||
for (const name of data.updateNames) {
|
||||
text += '<br /> ' + name;
|
||||
}
|
||||
text += '<br />更新失败数量:' + Object.keys(data.failureNames).length;
|
||||
for (const name in data.failureNames) {
|
||||
text += '<br /> ' + name + ':' + data.failureNames[name];
|
||||
}
|
||||
this.$alert(text, "导入结果", {dangerouslyUseHTMLString: true});
|
||||
this.$emit('success')
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
request({
|
||||
url: this.upload.getUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
}).then(res => {
|
||||
this.$download.excel(res, `${this.upload.title}模板.xls`);
|
||||
})
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
@ -49,6 +49,7 @@
|
||||
<el-table-column label="供应商" align="center" prop="supplierName"/>
|
||||
<el-table-column label="退货时间" align="center" prop="soTime"
|
||||
width="150"/>
|
||||
<el-table-column label="退货人" align="center" prop="userName" />
|
||||
<el-table-column label="操作" fixed="right" width="180" align="center">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||
@ -57,9 +58,6 @@
|
||||
<el-button size="mini" type="text" icon="el-icon-close" @click="handleVoidSo(scope.row)"
|
||||
>作废
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleVoidSo(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -71,6 +69,113 @@
|
||||
/>
|
||||
|
||||
<SoReturnForm ref="soReturnRef" @success="getReturnList"/>
|
||||
|
||||
<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">
|
||||
退货人
|
||||
</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">
|
||||
门店
|
||||
</template>
|
||||
{{info.corpName}}
|
||||
</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 label="规格" align="center" prop="repairWares.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="supplierName" width="180">
|
||||
<template slot-scope="scope">
|
||||
{{info.supplierName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" align="center" prop="wareName" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{getWareHoseName(scope.row.wareId)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -79,7 +184,9 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
|
||||
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
|
||||
import SoReturnForm from "@/views/repair/stockOperate/form/SoReturnForm.vue";
|
||||
import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
|
||||
import {getRepairSoById, getRepairSoPage, voidSo} from "@/api/repair/stockOperate/stockOperate";
|
||||
import {getRepairSoiByIds} from "@/api/repair/stockOperate/stockOperateItem";
|
||||
import {getBaseWarehouseList} from "@/api/base/warehouse";
|
||||
|
||||
export default {
|
||||
name: "SoReturn",
|
||||
@ -97,7 +204,14 @@ export default {
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
supplier: null
|
||||
supplier: null,
|
||||
formData: {
|
||||
id: null,
|
||||
remark: null
|
||||
},
|
||||
dialogVisible: false,
|
||||
info: {},
|
||||
warehouseList: []
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@ -113,6 +227,41 @@ export default {
|
||||
this.getReturnList()
|
||||
},
|
||||
methods: {
|
||||
getWareHoseName(value){
|
||||
return this.warehouseList?.find(item => item.id === value)?.name
|
||||
},
|
||||
async handleShow(row){
|
||||
try {
|
||||
const res1 = await getRepairSoById(row.id)
|
||||
this.dialogVisible = true
|
||||
this.info = res1.data
|
||||
const ids = res1.data.goodsList.map(item => item.id)
|
||||
const res = await getRepairSoiByIds(ids)
|
||||
this.info.goodsList = res.data
|
||||
const response = await getBaseWarehouseList()
|
||||
this.warehouseList = response.data
|
||||
}catch{}
|
||||
},
|
||||
// 作废
|
||||
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.getReturnList()
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
async getReturnList() {
|
||||
try {
|
||||
this.loading = true
|
||||
@ -146,5 +295,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.box-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -109,6 +109,11 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="采购单" :visible.sync="inStockDialog" width="80%" v-dialogDrag append-to-body>
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="供应商">
|
||||
<SupplierChoose v-model="chooseSupplier"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-descriptions class="margin-top" title="车辆信息" :column="3" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@ -281,10 +286,12 @@ import {getCarBrand} from "@/api/base/carbrand";
|
||||
import {listGoods} from "@/views/partner/api/workOrder";
|
||||
import {getBaseTypeList} from "@/api/base/type";
|
||||
import {listByTicketId} from "@/api/repair/repairworker";
|
||||
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
|
||||
|
||||
export default {
|
||||
name: "WaresItem",
|
||||
components: {TicketWaresShow, WarehouseChoose, SoTable},
|
||||
components: {SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable},
|
||||
props: {
|
||||
type: Boolean,
|
||||
},
|
||||
@ -332,6 +339,7 @@ export default {
|
||||
images: null,
|
||||
chooseStaff: [],
|
||||
staffs: [],
|
||||
chooseSupplier: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -475,6 +483,7 @@ export default {
|
||||
i.totalPrice = i.waresCount * i.wares.price
|
||||
})
|
||||
})
|
||||
this.chooseSupplier = null
|
||||
this.inStockDialog = true
|
||||
this.dialogVisible = false
|
||||
} catch {
|
||||
@ -702,6 +711,10 @@ export default {
|
||||
soStatus: "02",
|
||||
remark: this.remark,
|
||||
}
|
||||
if (this.chooseSupplier){
|
||||
this.formData.supplierId = this.chooseSupplier.id
|
||||
this.formData.supplierName = this.chooseSupplier.name
|
||||
}
|
||||
this.formData.goodsList = [...values.map(item => {
|
||||
return {
|
||||
soiType: '01',
|
||||
|
||||
@ -42,6 +42,11 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="设置数量" :visible.sync="settingDialog" width="60%" v-dialogDrag append-to-body>
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="chooseRows" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" width="55">
|
||||
<template scope="scope">
|
||||
@ -100,7 +105,8 @@ export default {
|
||||
selectRows: [],
|
||||
isRefresh: false,
|
||||
settingDialog: false,
|
||||
chooseRows: []
|
||||
chooseRows: [],
|
||||
remark: null
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@ -200,6 +206,7 @@ export default {
|
||||
return newItem;
|
||||
});
|
||||
this.settingDialog = true
|
||||
this.remark = null
|
||||
},
|
||||
async submit(){
|
||||
try {
|
||||
@ -208,6 +215,7 @@ export default {
|
||||
this.$modal.msgError(`${flag[0].wares.name}的退货数量为0`)
|
||||
return
|
||||
}
|
||||
this.formData.remark = this.remark
|
||||
this.formData.soType = "06"
|
||||
this.formData.soNo = createUniqueCodeByHead("TH")
|
||||
this.formData.itemCount = this.chooseRows.length
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
|
||||
>新增
|
||||
</el-button>
|
||||
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||
>导入
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -77,16 +80,19 @@
|
||||
@pagination="getList"/>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<WaresForm ref="formRef" @success="getList"/>
|
||||
<ImportCommon ref="importRef" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as WaresApi from '@/api/repair/wares';
|
||||
import WaresForm from './WaresForm.vue';
|
||||
import ImportCommon from "@/views/components/import/ImportCommon.vue";
|
||||
|
||||
export default {
|
||||
name: "Wares",
|
||||
components: {
|
||||
ImportCommon,
|
||||
WaresForm,
|
||||
},
|
||||
data() {
|
||||
@ -134,6 +140,14 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleImport(){
|
||||
const data = {
|
||||
title: "配件导入",
|
||||
url: '/repair/wares/import-data',
|
||||
getUrl: '/repair/wares/get-import-template'
|
||||
}
|
||||
this.$refs.importRef.open(data)
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user