Files
2026-10-08 18:19:39 +08:00

119 lines
4.0 KiB
Vue

<template>
<div>
<el-table :data="list" style="width: 100%">
<el-table-column prop="user.company.companyName" label="企业"/>
<el-table-column prop="desc" label="产品描述"/>
<el-table-column prop="amount" label="报价"/>
<el-table-column label="附件">
<template v-slot="{ row }">
<p v-for="(item, index) in row.files" :key="index">
<a :href="item" target="_blank">预览:文件{{ index + 1 }}</a>
</p>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注"/>
<el-table-column label="状态">
<template v-slot="{ row }">
<span v-if="row.status === 0">待选商</span>
<span v-if="row.status === 1">已选</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template v-slot="{ row }">
<el-button type="primary" size="small" v-if="info.status === 1" @click="edit(row)" plain>编辑</el-button>
<el-button type="primary" size="small" v-if="info.status === 1" :disabled="!row.amount" @click="confirm(row._id)">选商
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 2rem; text-align: center">
<el-button plain @click.native="cancel">关闭</el-button>
</div>
<el-dialog title="编辑报价" :visible.sync="dialogVisible" width="50%" append-to-body>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="报价">
<el-input v-model="form.amount" placeholder="请输入报价"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="附件">
<vk-data-upload accept="*" list-type="text" v-model="form.files"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "SelectQuote",
props: {
info: {
type: Object
}
},
data() {
return {
list: [],
clickedInfo: null,
dialogVisible: null,
form: {
_id: null,
amount: null,
remark: null,
files: [],
}
}
},
methods: {
async getList() {
const {rows} = await vk.callFunction({
url: 'admin/selfProduct/quote/sys/getQuoteList',
data: {pageSize: 500, quoteId: this.info._id}
})
this.list = rows
},
cancel() {
this.$emit('cancel')
},
async confirm(quoteId) {
await vk.callFunction({
url: 'admin/selfProduct/quote/sys/confirmQuote',
data: {
quoteId,
sheetId: this.info._id
}
})
this.cancel()
},
edit(info) {
this.form = {
_id: info._id,
amount: info.amount,
remark: info.remark,
files: info.files ?? []
}
this.dialogVisible = true
},
doEdit(){
vk.callFunction({
url: 'admin/selfProduct/quote/sys/editQuote',
data: this.form
}).then(() => {
this.dialogVisible = false
this.getList()
})
}
},
mounted() {
this.getList()
}
}
</script>