莳松crm管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-crm-manage-web/src/views/Clue/Order/Comp/Delivery.vue

196 lines
5.5 KiB

10 months ago
<template>
<div>
<el-form :model="searchForm" label-width="0" inline>
<el-form-item>
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
</el-form-item>
<el-form-item>
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="searchForm.dealDate"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator="-"
10 months ago
start-placeholder="成交日期"
end-placeholder="成交日期"
10 months ago
/>
</el-form-item>
<el-form-item>
<el-select
10 months ago
v-model="searchForm.productId"
10 months ago
placeholder="选择成交产品"
filterable
10 months ago
clearable
10 months ago
@change="searchForm.specsId = undefined"
>
<el-option
v-for="item in prodOptions"
:key="item.productId"
:label="item.productName"
:value="item.productId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.specsId"
placeholder="选择规格"
filterable
10 months ago
clearable
:disabled="!searchForm.productId"
10 months ago
>
<el-option
10 months ago
v-for="item in specsOptions(searchForm.productId)"
10 months ago
:key="item.specsId"
:label="item.specsName"
:value="item.specsId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableList" border>
10 months ago
<el-table-column prop="signId" label="成交单号" min-width="120px" />
<el-table-column prop="name" label="线索名称" min-width="120px" />
<el-table-column prop="phone" label="联系方式" width="120px" />
10 months ago
<el-table-column prop="signUserName" label="登记人" min-width="90" />
10 months ago
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
10 months ago
<el-table-column prop="productName" label="成交产品" min-width="150px" />
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
10 months ago
<el-table-column prop="signNum" label="销售数量" width="90px" />
10 months ago
<el-table-column
prop="createTime"
label="发货时间"
10 months ago
width="120px"
10 months ago
:formatter="dateFormatter"
/>
10 months ago
<el-table-column prop="batchNo" label="发货批次" min-width="120px" />
<el-table-column prop="warehouseName" label="发货仓库" min-width="120px" />
<el-table-column prop="sendNum" label="发货数量" width="90px" />
10 months ago
<el-table-column label="发货备注">
<template #default="scope">
<el-popover
placement="top"
width="500px"
trigger="click"
v-if="scope.row.warehouseName && scope.row.remark"
>
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="scope.row.remark"></div>
</el-popover>
10 months ago
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script setup name="Delivery">
import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { getSimpleProductList } from '@/api/mall/product'
10 months ago
import * as DeliveryApi from '@/api/clue/delivery'
9 months ago
import { removeNullField } from '@/utils'
10 months ago
import { dateFormatter } from '@/utils/formatTime'
10 months ago
// const message = useMessage() // 消息弹窗
const searchForm = ref({
signId: undefined,
name: undefined,
dealDate: [],
signUser: undefined,
10 months ago
productId: undefined,
specsId: undefined,
10 months ago
pageNo: 1,
pageSize: 20
})
const userOptions = ref([])
const tableList = ref([])
const total = ref(0)
function handleSearch() {
searchForm.value.pageNo = 1
getList()
}
function handleReset() {
searchForm.value = {
signId: undefined,
name: undefined,
dealDate: [],
signUser: undefined,
10 months ago
productId: undefined,
specsId: undefined,
10 months ago
pageNo: 1,
pageSize: 20
}
}
const loading = ref(false)
async function getList() {
loading.value = true
try {
9 months ago
const data = await DeliveryApi.getDeliveryPage(removeNullField(searchForm.value))
10 months ago
tableList.value = data.list
total.value = data.total
10 months ago
} finally {
loading.value = false
}
}
const prodOptions = ref([])
const specsOptions = computed({
get() {
return (prodId) => {
if (prodId) {
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
}
return []
}
}
})
function getOptions() {
getUserOption().then((data) => {
userOptions.value = data
})
// 产品
getSimpleProductList().then((data) => {
prodOptions.value = data
})
}
onMounted(() => {
getOptions()
handleSearch()
})
</script>
<style lang="scss" scoped></style>