salary
qsh 5 months ago
parent 848830a21b
commit 6f4067d50c
  1. 158
      src/views/Clue/Order/Comp/DialogDelivery.vue
  2. 56
      src/views/Clue/Order/Comp/DialogOrder.vue
  3. 13
      src/views/Clue/Order/Comp/MallOrderList.vue
  4. 8
      src/views/Clue/Pool/Comp/DrawerClue.vue
  5. 9
      src/views/MiniMall/Purchase/Comp/DialogAdd.vue

@ -1,16 +1,92 @@
<template> <template>
<el-dialog title="发货" v-model="show" width="600px"> <el-dialog title="发货" v-model="show" width="700px">
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px"> <el-form :model="form" ref="formRef" :rules="rules" label-width="85px">
<el-form-item label="发货仓库" prop="warehouseId"> <el-row :gutter="20">
<el-select v-model="form.warehouseId" placeholder="选择仓库" filterable> <el-col :span="8" :offset="0">
<el-option <el-form-item label="待发数量">
v-for="item in warehouseOptions" <span class="font-bold">{{ form.sendTotalNum }}</span>
:key="item.warehouseId" </el-form-item>
:label="item.warehouseName" </el-col>
:value="item.warehouseId" <el-col :span="16" :offset="0" v-if="autoAuditPurchase == 'true'">
/> <el-form-item label="发货方式">
</el-select> <el-radio-group v-model="form.sendType">
</el-form-item> <el-radio :label="1"> 立即采购发货 </el-radio>
<el-radio :label="2"> 使用库存发货 </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<template v-if="form.sendType == 1">
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="供应商" prop="supplier">
<el-select v-model="form.supplier" placeholder="选择供应商" filterable>
<el-option
v-for="item in supplierOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="采购数量" prop="purchaseNum">
<el-input-number
:min="form.sendTotalNum"
v-model="form.purchaseNum"
:controls="false"
placeholder="请输入"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="采购单价" prop="unitPrice">
<el-input-number
:min="0"
:controls="false"
v-model="form.unitPrice"
placeholder="请输入"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="存放仓库" prop="warehouseId">
<el-select
v-model="form.warehouseId"
placeholder="请选择"
filterable
style="width: 100%"
>
<el-option
v-for="item in warehouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</template>
<template v-else>
<el-table :data="inventoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="id" label="入库批次号" width="150px" />
<el-table-column prop="warehouseName" label="存放仓库" width="120px" />
<el-table-column prop="unitPrice" label="采购价" width="90px" />
<el-table-column prop="remainNum" label="剩余库存" width="90px" />
<el-table-column label="发货数量">
<template #default="{ row }">
<el-input-number v-model="row.sendNum" size="small" :min="1" :controls="false" />
</template>
</el-table-column>
</el-table>
</template>
<el-form-item label="备注"> <el-form-item label="备注">
<Editor v-model:modelValue="form.remark" /> <Editor v-model:modelValue="form.remark" />
</el-form-item> </el-form-item>
@ -27,10 +103,13 @@
<script setup name="DialogDelivery"> <script setup name="DialogDelivery">
import { getSimpleWarehouseList } from '@/api/mall/warehouse' import { getSimpleWarehouseList } from '@/api/mall/warehouse'
import { createDelivery } from '@/api/clue/delivery' import { createDelivery } from '@/api/clue/delivery'
import { getConfigList } from '@/api/system/set'
import { getDictOptions } from '@/utils/dict'
const message = useMessage() // const message = useMessage() //
const warehouseOptions = ref([]) const warehouseOptions = ref([])
const supplierOptions = getDictOptions('erp_supplier')
function getOptions() { function getOptions() {
getSimpleWarehouseList().then((data) => { getSimpleWarehouseList().then((data) => {
warehouseOptions.value = data warehouseOptions.value = data
@ -38,9 +117,9 @@ function getOptions() {
} }
const show = ref(false) const show = ref(false)
function open(id) { function open(id, signNum) {
show.value = true show.value = true
resetForm(id) resetForm(id, signNum)
} }
defineExpose({ defineExpose({
open open
@ -48,12 +127,21 @@ defineExpose({
const form = ref({}) const form = ref({})
const rules = ref({ const rules = ref({
supplier: { required: true, message: '供应商不可为空', trigger: 'change' },
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' },
purchaseNum: { required: true, message: '采购数量不可为空', trigger: 'change,blur' },
unitPrice: { required: true, message: '采购单价不可为空', trigger: 'change,blur' },
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' } warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
}) })
function resetForm(id) { function resetForm(id, num) {
form.value = { form.value = {
sendType: 2,
sendTotalNum: num,
signProductId: id, signProductId: id,
warehouseId: undefined, warehouseId: undefined,
supplier: undefined,
purchaseNum: num,
unitPrice: undefined,
remark: undefined remark: undefined
} }
} }
@ -64,8 +152,26 @@ const formRef = ref()
async function onSubmit() { async function onSubmit() {
// //
if (!formRef.value) return if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return if (form.value.sendType == 1) {
const valid = await formRef.value.validate()
if (!valid) return
} else {
if (!deliveryArr.value.length) {
message.info('请选择库存发货!')
return
} else {
const deliveryCount = deliveryArr.value.reduce((pre, cur) => pre + cur.sendNum, 0)
if (deliveryCount < form.value.sendTotalNum) {
message.info('所选发货库存少于待发货数量,请重新选择后再发货!')
return
} else if (deliveryCount > form.value.sendTotalNum) {
message.info('所选发货库存多于待发货数量,请重新选择后再发货!')
return
}
}
}
// //
formLoading.value = true formLoading.value = true
try { try {
@ -78,8 +184,26 @@ async function onSubmit() {
} }
} }
const inventoryList = ref([
{ id: 123, warehouseName: '自营仓', unitPrice: 120, remainNum: 5 },
{ id: 234, warehouseName: '自营仓', unitPrice: 100, remainNum: 5 },
{ id: 345, warehouseName: '供应商仓', unitPrice: 110, remainNum: 999 }
])
const deliveryArr = ref([])
function handleSelectionChange(val) {
deliveryArr.value = val
}
const autoAuditPurchase = ref('false')
onMounted(() => { onMounted(() => {
getOptions() getOptions()
getConfigList({ module: 3 }).then((data) => {
//
autoAuditPurchase.value = data.find(
(it) => it.configKey == 'purchaseAuditAutoCompleteConfig'
).configValue
})
}) })
</script> </script>

@ -7,13 +7,20 @@
<el-tab-pane label="成交信息" name="orderInfo"> <el-tab-pane label="成交信息" name="orderInfo">
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" /> <Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
<template v-if="orderInfo.signProducts && orderInfo.signProducts.length"> <template v-if="orderInfo.signProducts && orderInfo.signProducts.length">
<el-divider direction="horizontal" content-position="left">成交产品</el-divider> <el-divider direction="horizontal" content-position="left">
成交产品<span v-if="prodTotalPrice">应收{{ prodTotalPrice }}</span>
</el-divider>
<el-table :data="orderInfo.signProducts" border stripe> <el-table :data="orderInfo.signProducts" border stripe>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column prop="productName" label="成交产品" /> <el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" /> <el-table-column prop="specsName" label="产品规格" />
<el-table-column prop="signNum" label="成交数量" /> <el-table-column prop="signNum" label="成交数量" width="100px" />
<el-table-column prop="warehouseName" label="发货仓库" /> <el-table-column prop="warehouseName" label="发货仓库" width="150px" />
<el-table-column label="发货状态" width="100px">
<template #default="scope">
{{ scope.row.warehouseName ? '已发货' : '待发货' }}
</template>
</el-table-column>
<el-table-column label="发货备注"> <el-table-column label="发货备注">
<template #default="scope"> <template #default="scope">
<el-popover <el-popover
@ -31,15 +38,26 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</template> </template>
<el-divider direction="horizontal" content-position="left">其他费用</el-divider> <el-divider direction="horizontal" content-position="left">
其他费用<span v-if="extraTotalPrice">应收{{ extraTotalPrice }}</span>
</el-divider>
<el-table :data="orderInfo.extraPay" border stripe> <el-table :data="orderInfo.extraPay" border stripe>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column prop="extraPayType" label="费用项" /> <el-table-column prop="extraPayType" label="费用项" />
<el-table-column prop="extraPayMoney" label="金额" /> <el-table-column prop="extraPayMoney" label="金额" />
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
</el-table> </el-table>
<el-divider
v-if="prodTotalPrice + extraTotalPrice"
direction="horizontal"
content-position="left"
>
合计应收{{ prodTotalPrice + extraTotalPrice }}
</el-divider>
<div v-if="checkPermi(['clue:order:add-fee'])"> <div v-if="checkPermi(['clue:order:add-fee'])">
<el-divider direction="horizontal" content-position="left">额外支出</el-divider> <el-divider direction="horizontal" content-position="left">
额外支出<span v-if="extraPayTotalFee">合计{{ extraPayTotalFee }}</span>
</el-divider>
<el-table :data="extraPayList" border stripe> <el-table :data="extraPayList" border stripe>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column prop="extraPayType" label="支出项" /> <el-table-column prop="extraPayType" label="支出项" />
@ -86,11 +104,31 @@ import { formatDate } from '@/utils/formatTime'
const tabName = ref('clueInfo') const tabName = ref('clueInfo')
const show = ref(false) const show = ref(false)
const clueInfo = ref({}) const clueInfo = ref({})
const orderInfo = ref({}) const orderInfo = ref({
signProducts: [],
extraPay: []
})
const returnRecordList = ref([]) const returnRecordList = ref([])
const aftersaleList = ref([]) const aftersaleList = ref([])
const extraPayList = ref([]) const extraPayList = ref([])
const prodTotalPrice = computed(() => {
return orderInfo.value.signProducts.reduce(
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
0
)
})
//
const extraTotalPrice = computed(() => {
return orderInfo.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
})
//
const extraPayTotalFee = computed(() => {
return extraPayList.value.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
})
function open(clueId, orderId) { function open(clueId, orderId) {
try { try {
show.value = true show.value = true
@ -122,6 +160,9 @@ const orderSchema = ref([])
function getFields() { function getFields() {
getClueFieldList().then((data) => { getClueFieldList().then((data) => {
const arr = useCrudSchemas(data).allSchemas.detailSchema const arr = useCrudSchemas(data).allSchemas.detailSchema
if (arr.length % 2 != 0) {
arr.push({})
}
clueSchema.value = [ clueSchema.value = [
...arr, ...arr,
{ {
@ -140,6 +181,9 @@ function getFields() {
getOrderFieldList().then((data) => { getOrderFieldList().then((data) => {
const arr = useCrudSchemas(data).allSchemas.detailSchema const arr = useCrudSchemas(data).allSchemas.detailSchema
if (arr.length % 2 != 0) {
arr.push({})
}
orderSchema.value = [ orderSchema.value = [
...arr, ...arr,
{ {

@ -68,9 +68,14 @@
<el-table :data="row.signProducts" stripe style="width: 900px"> <el-table :data="row.signProducts" stripe style="width: 900px">
<el-table-column prop="productName" label="成交产品" /> <el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" /> <el-table-column prop="specsName" label="产品规格" />
<el-table-column prop="signNum" label="成交数量" /> <el-table-column prop="signNum" label="成交数量" width="100px" />
<el-table-column prop="warehouseName" label="发货仓库" /> <el-table-column prop="warehouseName" label="发货仓库" width="150px" />
<el-table-column label="发货备注"> <el-table-column label="发货状态" width="100px">
<template #default="scope">
{{ scope.row.warehouseName ? '已发货' : '待发货' }}
</template>
</el-table-column>
<el-table-column label="发货备注" width="100px">
<template #default="scope"> <template #default="scope">
<el-popover <el-popover
placement="top" placement="top"
@ -335,7 +340,7 @@ function getOptions() {
} }
const deliveryDialog = ref() const deliveryDialog = ref()
function handleDelivery(row) { function handleDelivery(row) {
deliveryDialog.value.open(row.id) deliveryDialog.value.open(row.id, row.signNum)
} }
const userOptions = ref([]) const userOptions = ref([])

@ -179,7 +179,11 @@ const props = defineProps({
}) })
const showSchema = computed(() => { const showSchema = computed(() => {
const arr = [ const arr1 = [...props.schema]
if (arr1.length % 2 != 0) {
arr1.push({})
}
const arr2 = [
{ {
field: 'requirement', field: 'requirement',
label: '诉求', label: '诉求',
@ -192,7 +196,7 @@ const showSchema = computed(() => {
isEditor: true isEditor: true
} }
] ]
return [...props.schema, ...arr] return [...arr1, ...arr2]
}) })
const followList = ref([]) const followList = ref([])

@ -42,7 +42,13 @@
</el-col> </el-col>
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="采购数量" prop="num"> <el-form-item label="采购数量" prop="num">
<el-input-number :min="1" v-model="form.num" placeholder="请输入" style="width: 100%" /> <el-input-number
:min="1"
v-model="form.num"
:controls="false"
placeholder="请输入"
style="width: 100%"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -51,6 +57,7 @@
<el-form-item label="采购单价" prop="unitPrice"> <el-form-item label="采购单价" prop="unitPrice">
<el-input-number <el-input-number
:min="0" :min="0"
:controls="false"
v-model="form.unitPrice" v-model="form.unitPrice"
placeholder="请输入" placeholder="请输入"
style="width: 100%" style="width: 100%"

Loading…
Cancel
Save