sc
This commit is contained in:
127
src/views/Clue/Order/Comp/DialogOrderProduct.vue
Normal file
127
src/views/Clue/Order/Comp/DialogOrderProduct.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<Dialog title="成交商品" v-model="show" width="80%">
|
||||
<el-table :data="orderProductList" border stripe>
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" />
|
||||
<el-table-column prop="remark" label="成交备注" />
|
||||
<el-table-column label="生产状态" width="160px">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isProduced"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="已生产"
|
||||
inactive-text="待生产"
|
||||
v-if="checkPermi(['clue:order:update-produce'])"
|
||||
size="small"
|
||||
@change="handleChangeProdoce(scope.row)"
|
||||
/>
|
||||
<div v-else>{{ scope.row.isProducedDesc }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.sendState == '待发货' ? 'danger' : 'success'" size="small">
|
||||
{{ scope.row.sendState }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.sendRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
:disabled="scope.row.sendState == '已发货'"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
@click="handleDelivery(scope.row)"
|
||||
>
|
||||
发货
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:remove-product']"
|
||||
@click="handleRemoveProduct(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as OrderApi from '@/api/clue/sign'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const show = ref(false)
|
||||
const orderProductList = ref([])
|
||||
function open(orderId) {
|
||||
try {
|
||||
show.value = true
|
||||
getFields()
|
||||
OrderApi.getSign(orderId).then((data) => {
|
||||
orderProductList.value = data.signProducts || []
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
const orderSchema = ref([])
|
||||
function getFields() {
|
||||
getOrderFieldList().then((data) => {
|
||||
const list = useCrudSchemas(data).allSchemas.detailSchema
|
||||
const arr = []
|
||||
list.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
|
||||
if (it.field == 'receivedMoney') {
|
||||
checkPermi(['clue:order:return-list']) && arr.push(it)
|
||||
} else {
|
||||
arr.push(it)
|
||||
}
|
||||
})
|
||||
if (arr.filter((item) => item.span != 2).length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
orderSchema.value = [
|
||||
...arr,
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -2,46 +2,6 @@
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<div>
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
ref="moreSearchRef"
|
||||
inline
|
||||
label-width="0"
|
||||
style="display: inline"
|
||||
>
|
||||
<el-form-item style="margin-bottom: 10px">
|
||||
<el-select
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@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 style="margin-bottom: 10px">
|
||||
<el-select
|
||||
v-model="searchForm.specsId"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.signProduct)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<Search
|
||||
v-if="!loading"
|
||||
ref="searchRef"
|
||||
@@ -67,8 +27,8 @@
|
||||
v-if="!loading"
|
||||
class="mt-10px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
rowkey="signId"
|
||||
:tableColumns="allSchemas.tableColumns.filter((it) => it.paramLevel == 1)"
|
||||
rowkey="signOrderId"
|
||||
:expandRowKeys="expendRows"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@@ -86,21 +46,39 @@
|
||||
style="width: 100%"
|
||||
> -->
|
||||
<el-table
|
||||
:data="row.signProducts"
|
||||
:data="row.childrenOrder"
|
||||
row-key="id"
|
||||
stripe
|
||||
style="width: 90%; margin: 0 auto"
|
||||
>
|
||||
<el-table-column prop="" label="子订单号" />
|
||||
<el-table-column prop="" label="登记人" width="120px" />
|
||||
<el-table-column prop="" label="成交日期" width="120px" />
|
||||
<el-table-column prop="" label="成交价" width="120px" />
|
||||
<el-table-column prop="" label="支付金额" width="120px" />
|
||||
<el-table-column prop="" label="已到账金额" width="120px" />
|
||||
<el-table-column prop="" label="提成状态" width="120px" />
|
||||
<el-table-column prop="" label="备注" />
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<el-table-column prop="signId" label="子订单号" />
|
||||
<el-table-column prop="createUserName" label="登记人" width="120px" />
|
||||
<el-table-column prop="dealDate" label="成交日期" width="120px" />
|
||||
<el-table-column prop="signPrice" label="成交价" width="120px" />
|
||||
<el-table-column prop="payAmount" label="支付金额" width="120px" />
|
||||
<el-table-column prop="receivedMoney" label="已到账金额" width="120px" />
|
||||
<el-table-column prop="isCommissioned" label="提成状态" width="120px" />
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template #default="scope">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<div v-dompurify-html="scope.row.remark"></div>
|
||||
<template #reference>
|
||||
<el-button type="primary" link>查看</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="260px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
@click="openProduct(scope.row)"
|
||||
>
|
||||
成交商品
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
@@ -259,6 +237,7 @@
|
||||
<DialogExtraFee ref="extraFeeDialog" />
|
||||
<DialogDelivery ref="deliveryDialog" @success="getTableList" />
|
||||
<DialogAddProduct ref="addProductDialog" @success="getTableList" />
|
||||
<DialogOrderProduct ref="orderProductDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -266,7 +245,6 @@
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
import DialogFeeback from './DialogFeeback.vue'
|
||||
@@ -274,6 +252,7 @@ import DialogAfterSale from './DialogAfterSale.vue'
|
||||
import DialogExtraFee from './DialogExtraPay.vue'
|
||||
import DialogDelivery from './DialogDelivery.vue'
|
||||
import DialogAddProduct from './DialogAddProduct.vue'
|
||||
import DialogOrderProduct from './DialogOrderProduct.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -293,18 +272,6 @@ const allSchemas = ref({})
|
||||
|
||||
const orderDetailDialog = ref()
|
||||
const searchRef = ref()
|
||||
const prodOptions = ref([])
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
signProduct: undefined
|
||||
@@ -351,6 +318,7 @@ async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
// const mainOrderFields = data.filter((it) => it.paramLevel == 1)
|
||||
data.forEach((elem) => {
|
||||
if (['createUser'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
@@ -371,7 +339,8 @@ const showColumns = ref([])
|
||||
|
||||
// 初始化表格
|
||||
function getCheckedColumns(list) {
|
||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||
showColumns.value =
|
||||
list && list.length ? list : allSchemas.value.tableColumns.filter((it) => it.paramLevel == 1)
|
||||
}
|
||||
|
||||
// 详情
|
||||
@@ -412,11 +381,6 @@ function handleAddFee(row) {
|
||||
}
|
||||
|
||||
async function getOptions() {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserList()
|
||||
getCurdSchemas()
|
||||
@@ -426,11 +390,6 @@ const deliveryDialog = ref()
|
||||
// deliveryDialog.value.open(row)
|
||||
// }
|
||||
|
||||
// const addProductDialog = ref()
|
||||
// function handleAddProduct(row) {
|
||||
// addProductDialog.value.open(row.signId, prodOptions.value)
|
||||
// }
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.signId)
|
||||
@@ -487,6 +446,11 @@ function handleBatchUpdateInstall() {
|
||||
}
|
||||
}
|
||||
|
||||
const orderProductDialog = ref()
|
||||
function openProduct(row) {
|
||||
orderProductDialog.value.open(row.orderId)
|
||||
}
|
||||
|
||||
// async function handleRemoveProduct(row) {
|
||||
// try {
|
||||
// // 修改状态的二次确认
|
||||
@@ -518,7 +482,7 @@ function handleBatchUpdateInstall() {
|
||||
// }
|
||||
// }
|
||||
|
||||
// const expendRows = ref([])
|
||||
const expendRows = ref([])
|
||||
// async function onDragEnd(ev) {
|
||||
// try {
|
||||
// expendRows.value = [ev.data.signId]
|
||||
|
||||
Reference in New Issue
Block a user