Compare commits

..

No commits in common. 'b9a3424d98278d9ffc2f4995bb772241570f5d4b' and '16cb210988b68567f9b3f8115a061a90edfc1162' have entirely different histories.

  1. 10
      src/api/clue/sign.js
  2. 33
      src/api/school/setting/supplier.js
  3. 130
      src/views/Clue/Order/Comp/DialogAddProduct.vue
  4. 13
      src/views/Clue/Order/Comp/DialogDelivery.vue
  5. 38
      src/views/Clue/Order/Comp/MallOrderList.vue
  6. 13
      src/views/Clue/Order/Comp/MallSettle.vue
  7. 151
      src/views/Clue/Order/Comp/Reback.vue
  8. 104
      src/views/Clue/Set/Comp/DialogSource.vue
  9. 38
      src/views/MiniMall/MallSet/Comp/DialogSupplier.vue
  10. 29
      src/views/MiniMall/MallSet/Comp/SupplierSet.vue
  11. 12
      src/views/MiniMall/Purchase/index.vue

@ -51,13 +51,3 @@ export const updateProduceSort = (data) => {
export const getSignProfit = (params) => { export const getSignProfit = (params) => {
return request.get({ url: '/admin-api/crm/sign/profit', params }) return request.get({ url: '/admin-api/crm/sign/profit', params })
} }
// 新增产品
export const addOrderProduct = (data) => {
return request.post({ url: '/admin-api/crm/sign-prodcut/create', data })
}
// 新增产品
export const removeOrderProduct = (id) => {
return request.delete({ url: '/admin-api/crm/sign-prodcut/delete?id=' + id })
}

@ -1,33 +0,0 @@
import request from '@/config/axios'
// 查询列表
export const getSupplierPage = async (params) => {
return await request.get({ url: '/admin-api/crm/erp-supplier/page', params })
}
export const getSupplierSimpleList = async (params) => {
return await request.get({ url: '/admin-api/crm/erp-supplier/simple-list', params })
}
// 查询详情
export const getSupplier = async (id) => {
return await request.get({ url: '/admin-api/crm/erp-supplier/get?id=' + id })
}
// 新增
export const createSupplier = async (data) => {
return await request.post({
url: '/admin-api/crm/erp-supplier/create',
data: data,
isSubmitForm: true
})
}
// 修改
export const updateSupplier = async (params) => {
return await request.put({ url: '/admin-api/crm/erp-supplier/update', data: params })
}
// 删除
export const deleteSupplier = async (id) => {
return await request.delete({ url: '/admin-api/crm/erp-supplier/delete?id=' + id })
}

@ -1,130 +0,0 @@
<template>
<Dialog title="添加产品" v-model="show" width="800px">
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="成交产品" prop="productId">
<el-select
v-model="form.productId"
placeholder="选择成交产品"
filterable
@change="form.specsId = undefined"
>
<el-option
v-for="item in prodOptions"
:key="item.productId"
:label="item.productName"
:value="item.productId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="产品规格" prop="specsId">
<el-select
v-model="form.specsId"
placeholder="选择规格"
filterable
:disabled="!form.productId"
>
<el-option
v-for="item in specsOptions(form.productId)"
:key="item.specsId"
:label="item.specsName"
:value="item.specsId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="成交数量" prop="signNum">
<el-input-number v-model="form.signNum" :min="1" :controls="false" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="生产状态" prop="isProduced">
<el-radio-group v-model="form.isProduced">
<el-radio :label="0">待生产</el-radio>
<el-radio :label="1">已生产</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:autoSize="{ minRows: 3 }"
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span>
<el-button @click="show = false"> </el-button>
<el-button :disabled="formLoading" type="primary" @click="handleSave"> </el-button>
</span>
</template>
</Dialog>
</template>
<script setup name="DialogProduct">
import { addOrderProduct } from '@/api/clue/sign'
const message = useMessage() //
const specsOptions = computed({
get() {
return (prodId) => {
if (prodId) {
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
}
return []
}
}
})
const show = ref(false)
const form = ref({})
const rules = {
productId: { required: true, message: '成交产品不可为空', trigger: 'change' },
specsId: { required: true, message: '产品规格不可为空', trigger: 'change' },
signNum: { required: true, message: '成交数量不可为空', trigger: 'blur' }
}
const prodOptions = ref([])
function open(signId, arr) {
prodOptions.value = arr
form.value.signId = signId
form.value.isProduced = 0
show.value = true
}
defineExpose({ open })
const emit = defineEmits(['success'])
const formRef = ref()
const formLoading = ref(false)
async function handleSave() {
//
if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
await addOrderProduct(form.value)
message.success('新增成功!')
show.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
</script>
<style lang="scss" scoped></style>

@ -28,9 +28,9 @@
<el-select v-model="form.supplier" placeholder="选择供应商" filterable> <el-select v-model="form.supplier" placeholder="选择供应商" filterable>
<el-option <el-option
v-for="item in supplierOptions" v-for="item in supplierOptions"
:key="item.id" :key="item.value"
:label="item.supplierName" :label="item.label"
:value="item.id" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -141,18 +141,15 @@
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse' import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
import { createDelivery } from '@/api/clue/delivery' import { createDelivery } from '@/api/clue/delivery'
import { getConfigList } from '@/api/system/set' import { getConfigList } from '@/api/system/set'
import { getSupplierSimpleList } from '@/api/school/setting/supplier' import { getDictOptions } from '@/utils/dict'
import { getExtraFeeSimpleList } from '@/api/clue/extraFee' import { getExtraFeeSimpleList } from '@/api/clue/extraFee'
const message = useMessage() // const message = useMessage() //
const warehouseOptions = ref([]) const warehouseOptions = ref([])
const extraPayOptions = ref([]) const extraPayOptions = ref([])
const supplierOptions = ref([]) const supplierOptions = getDictOptions('erp_supplier')
function getOptions() { function getOptions() {
getSupplierSimpleList().then((data) => {
supplierOptions.value = data
})
getSimpleWarehouseList().then((data) => { getSimpleWarehouseList().then((data) => {
warehouseOptions.value = data warehouseOptions.value = data
}) })

@ -147,15 +147,6 @@
> >
发货 发货
</el-button> </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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -237,16 +228,6 @@
> >
取消登记 取消登记
</el-button> </el-button>
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:add-product']"
@click="handleAddProduct(scope.row)"
>
添加产品
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</SSTable> </SSTable>
@ -257,7 +238,6 @@
<DialogAfterSale ref="afterSaleDialog" /> <DialogAfterSale ref="afterSaleDialog" />
<DialogExtraFee ref="extraFeeDialog" /> <DialogExtraFee ref="extraFeeDialog" />
<DialogDelivery ref="deliveryDialog" @success="getTableList" /> <DialogDelivery ref="deliveryDialog" @success="getTableList" />
<DialogAddProduct ref="addProductDialog" @success="getTableList" />
</div> </div>
</template> </template>
@ -272,7 +252,6 @@ import DialogFeeback from './DialogFeeback.vue'
import DialogAfterSale from './DialogAfterSale.vue' import DialogAfterSale from './DialogAfterSale.vue'
import DialogExtraFee from './DialogExtraPay.vue' import DialogExtraFee from './DialogExtraPay.vue'
import DialogDelivery from './DialogDelivery.vue' import DialogDelivery from './DialogDelivery.vue'
import DialogAddProduct from './DialogAddProduct.vue'
import { removeNullField } from '@/utils' import { removeNullField } from '@/utils'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
@ -425,11 +404,6 @@ function handleDelivery(row) {
deliveryDialog.value.open(row) deliveryDialog.value.open(row)
} }
const addProductDialog = ref()
function handleAddProduct(row) {
addProductDialog.value.open(row.signId, prodOptions.value)
}
const batchIds = ref([]) const batchIds = ref([])
function handleSelectionChange(val) { function handleSelectionChange(val) {
batchIds.value = val.map((it) => it.signId) batchIds.value = val.map((it) => it.signId)
@ -486,18 +460,6 @@ function handleBatchUpdateInstall() {
} }
} }
async function handleRemoveProduct(row) {
try {
//
await message.confirm(`确认要删除${row.productName}吗?`)
//
await SignApi.removeOrderProduct(row.id)
message.success('删除成功')
//
getTableList()
} catch {}
}
async function handleChangeProdoce(row) { async function handleChangeProdoce(row) {
try { try {
// //

@ -116,9 +116,9 @@
> >
<el-option <el-option
v-for="item in supplierOptions" v-for="item in supplierOptions"
:key="item.id" :key="item.value"
:label="item.supplierName" :label="item.label"
:value="item.id" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -267,7 +267,7 @@ import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { getSimpleProductList } from '@/api/mall/product' import { getSimpleProductList } from '@/api/mall/product'
import * as SettleApi from '@/api/clue/settle' import * as SettleApi from '@/api/clue/settle'
import { getSupplierSimpleList } from '@/api/school/setting/supplier' import { getDictOptions } from '@/utils/dict'
import { removeNullField } from '@/utils/index' import { removeNullField } from '@/utils/index'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
@ -419,12 +419,9 @@ async function handleSaveSettle() {
const userOptions = ref([]) const userOptions = ref([])
const prodOptions = ref([]) const prodOptions = ref([])
const supplierOptions = ref([]) const supplierOptions = getDictOptions('erp_supplier')
function getOptions() { function getOptions() {
getSupplierSimpleList().then((data) => {
supplierOptions.value = data
})
// //
getSimpleProductList().then((data) => { getSimpleProductList().then((data) => {
prodOptions.value = data prodOptions.value = data

@ -18,83 +18,22 @@
<el-option label="已驳回" :value="4" /> <el-option label="已驳回" :value="4" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<template v-if="appStore.getAppInfo?.instanceType == 1"> <el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
<el-form-item> <el-select
<el-select v-model="searchForm.receiver"
v-model="searchForm.receiver" placeholder="接待人"
placeholder="接待人" clearable
clearable filterable
filterable style="width: 120px"
style="width: 120px" >
> <el-option
<el-option v-for="item in allUserOptions"
v-for="item in allUserOptions" :key="item.id"
:key="item.id" :label="item.nickname"
:label="item.nickname" :value="item.id"
:value="item.id" />
/> </el-select>
</el-select> </el-form-item>
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.signSchool"
placeholder="选择驾校"
filterable
clearable
@change="changeSchool"
>
<el-option
v-for="item in schoolOptions"
:key="item.schoolId"
:label="item.schoolName"
:value="item.schoolId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.signPlace"
placeholder="选择场地"
filterable
clearable
:disabled="!searchForm.signSchool"
@change="changePlace"
>
<el-option
v-for="item in placeOptions"
:key="item.placeId"
:label="item.name"
:value="item.placeId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.signClass"
:disabled="!searchForm.signPlace"
placeholder="选择班型"
filterable
clearable
>
<el-option
v-for="item in classOptions"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.licenseType" placeholder="驾照类型" filterable clearable>
<el-option
v-for="item in getDictOptions(DICT_TYPE.LINCENSE_TYPE)"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template>
<el-form-item v-else-if="appStore.getAppInfo?.instanceType == 2"> <el-form-item v-else-if="appStore.getAppInfo?.instanceType == 2">
<el-select <el-select
v-model="searchForm.convertPeople" v-model="searchForm.convertPeople"
@ -259,30 +198,6 @@
<div v-else>{{ row.isPayoff }}</div> <div v-else>{{ row.isPayoff }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="signSchool"
label="报名驾校"
min-width="90"
/>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="signPlace"
label="报名场地"
min-width="90"
/>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="signClass"
label="报名班型"
min-width="90"
/>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="licenseType"
label="驾照类型"
min-width="90"
/>
<el-table-column <el-table-column
v-if="appStore.getAppInfo?.instanceType == 1" v-if="appStore.getAppInfo?.instanceType == 1"
prop="receiverName" prop="receiverName"
@ -402,9 +317,6 @@
<script setup name="Reback"> <script setup name="Reback">
import * as FeebackApi from '@/api/clue/payment' import * as FeebackApi from '@/api/clue/payment'
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user' import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
import { getPlaceList } from '@/api/school/place'
import { getClassTypeList } from '@/api/school/class'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import DialogFeebackAudit from './DialogFeebackAudit.vue' import DialogFeebackAudit from './DialogFeebackAudit.vue'
@ -440,13 +352,6 @@ const searchForm = ref({
const userOptions = ref([]) const userOptions = ref([])
const allUserOptions = ref([]) const allUserOptions = ref([])
const schoolOptions = ref([])
const allPlaceOptions = ref([])
const placeOptions = computed(() => {
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
})
const tableList = ref([]) const tableList = ref([])
const total = ref(0) const total = ref(0)
@ -468,30 +373,11 @@ function handleReset() {
applyUser: undefined, applyUser: undefined,
checkTime: [], checkTime: [],
mobile: undefined, mobile: undefined,
signSchool: undefined,
signPlace: undefined,
signClass: undefined,
pageNo: 1, pageNo: 1,
pageSize: 20 pageSize: 20
} }
} }
function changeSchool() {
searchForm.value.signPlace = undefined
searchForm.value.signClass = undefined
}
function changePlace() {
searchForm.value.signClass = undefined
getClassTypeOptions()
}
const classOptions = ref([])
async function getClassTypeOptions() {
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
classOptions.value = data
}
const totalInfo = ref({}) const totalInfo = ref({})
const loading = ref(false) const loading = ref(false)
async function getList() { async function getList() {
@ -542,11 +428,6 @@ function handleAudit(row) {
} }
function getOptions() { function getOptions() {
//
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
schoolOptions.value = data.schoolList
allPlaceOptions.value = data.placeList
})
getUserOption().then((data) => { getUserOption().then((data) => {
userOptions.value = data userOptions.value = data
}) })

@ -23,6 +23,15 @@
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" /> <el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" :offset="0">
<el-form-item label="成本模式" prop="mode">
<el-radio-group v-model="formData.mode">
<el-radio :label="0"> 总价 </el-radio>
<el-radio :label="1"> 单价 </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status"> <el-radio-group v-model="formData.status">
@ -31,39 +40,6 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" :offset="0">
<el-form-item label="开户费用" prop="accountFee">
<el-input-number
v-model="formData.accountFee"
:controls="false"
style="width: 100%"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="开户日期" prop="accountStartTime">
<el-date-picker
v-model="formData.accountStartTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期时间"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="到期日期" prop="accountEndTime">
<el-date-picker
v-model="formData.accountEndTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期时间"
/>
</el-form-item>
</el-col>
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
@ -80,7 +56,7 @@
<el-divider direction="horizontal" content-position="left">线索成本</el-divider> <el-divider direction="horizontal" content-position="left">线索成本</el-divider>
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button> <el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button>
<el-table :data="formData.sourceCostVOS" border> <el-table :data="formData.priceVOList" border>
<el-table-column label="年份" width="120"> <el-table-column label="年份" width="120">
<template #default="{ row }"> <template #default="{ row }">
<el-date-picker <el-date-picker
@ -95,39 +71,14 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px"> <el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
<el-table-column label="充值"> <template #default="{ row }">
<template #default="{ row }"> <el-input-number
<el-input-number v-model="row.monthTargetVOList[col - 1].targetPrice"
v-model="row.monthData[col - 1].rechargeFee" size="small"
size="small" :controls="false"
:min="0" style="width: 100%"
:controls="false" />
style="width: 100%" </template>
/>
</template>
</el-table-column>
<el-table-column label="消耗">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].consumeFee"
size="small"
:controls="false"
:min="0"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column label="线索数">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].clueNum"
size="small"
:controls="false"
style="width: 100%"
:min="0"
/>
</template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -149,7 +100,6 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
sourceName: '', sourceName: '',
accountFee: undefined,
sort: 1, sort: 1,
remark: '' remark: ''
}) })
@ -213,8 +163,8 @@ const resetForm = () => {
status: 0, status: 0,
sort: 1, sort: 1,
remark: '', remark: '',
costModel: 0, mode: 0,
sourceCostVOS: [] priceVOList: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }
@ -222,19 +172,17 @@ const resetForm = () => {
function handleAddPrice() { function handleAddPrice() {
const obj = { const obj = {
year: undefined, year: undefined,
monthData: [] monthTargetVOList: []
} }
for (let i = 1; i <= 12; i++) { for (let i = 1; i <= 12; i++) {
obj.monthData.push({ obj.monthTargetVOList.push({
month: i, month: i,
consumeFee: 0, targetPrice: undefined
rechargeFee: 0,
clueNum: 0
}) })
} }
if (!formData.value.sourceCostVOS) { if (!formData.value.priceVOList) {
formData.value.sourceCostVOS = [] formData.value.priceVOList = []
} }
formData.value.sourceCostVOS.push(obj) formData.value.priceVOList.push(obj)
} }
</script> </script>

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form <el-form
ref="formRef" ref="formRef"
v-loading="formLoading" v-loading="formLoading"
@ -7,17 +7,11 @@
:rules="formRules" :rules="formRules"
label-width="80px" label-width="80px"
> >
<el-form-item label="名称" prop="supplierName"> <el-form-item label="名称" prop="label">
<el-input v-model="formData.supplierName" placeholder="请输入供应商名称" /> <el-input v-model="formData.label" placeholder="请输入供应商名称" />
</el-form-item> </el-form-item>
<el-form-item label="微信群" prop="wechatGroup"> <el-form-item label="排序" prop="sort">
<el-input v-model="formData.wechatGroup" placeholder="请输入微信群" /> <el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="0"> 启用 </el-radio>
<el-radio :label="1"> 禁用 </el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
@ -35,7 +29,7 @@
</Dialog> </Dialog>
</template> </template>
<script name="DialogSupplier" setup> <script name="DialogSupplier" setup>
import * as SupplierApi from '@/api/school/setting/supplier' import * as dictApi from '@/api/system/dict/dict.data'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -44,12 +38,12 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
supplierName: '', label: '',
wechatGroup: 1, sort: 1,
remark: '' remark: ''
}) })
const formRules = reactive({ const formRules = reactive({
supplierName: [{ required: true, message: '名称不能为空', trigger: 'blur' }] label: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
@ -63,7 +57,7 @@ const open = async (type, id) => {
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
formData.value = await SupplierApi.getSupplier(id) formData.value = await dictApi.getDictData(id)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -81,11 +75,14 @@ const submitForm = async () => {
// //
formLoading.value = true formLoading.value = true
try { try {
if (!formData.value.value) {
formData.value.value = formData.value.label
}
if (formType.value === 'create') { if (formType.value === 'create') {
await SupplierApi.createSupplier(formData.value) await dictApi.createDictData(formData.value)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await SupplierApi.updateSupplier(formData.value) await dictApi.updateDictData(formData.value)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false dialogVisible.value = false
@ -99,9 +96,10 @@ const submitForm = async () => {
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
supplierName: '', label: '',
wechatGroup: '', sort: 1,
status: 0, status: 0,
dictType: 'erp_supplier',
remark: '' remark: ''
} }
formRef.value?.resetFields() formRef.value?.resetFields()

@ -3,7 +3,7 @@
<el-form ref="queryForm" :model="searchForm" label-width="0" inline> <el-form ref="queryForm" :model="searchForm" label-width="0" inline>
<el-form-item> <el-form-item>
<el-input <el-input
v-model="searchForm.supplierName" v-model="searchForm.name"
placeholder="请输入名称" placeholder="请输入名称"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
@ -16,13 +16,9 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="tableList"> <el-table v-loading="loading" :data="tableList">
<el-table-column prop="supplierName" label="供应商名称" /> <el-table-column prop="label" label="供应商名称" />
<el-table-column prop="wechatGroup" label="微信群名称" /> <!-- <el-table-column prop="" label="微信群名称" /> -->
<el-table-column label="状态" min-width="150" prop="status"> <el-table-column prop="sort" label="排序" width="100px" />
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
<el-table-column <el-table-column
label="创建时间" label="创建时间"
@ -51,16 +47,16 @@
<script setup name="SupplierSet"> <script setup name="SupplierSet">
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import DialogSupplier from './DialogSupplier.vue' import DialogSupplier from './DialogSupplier.vue'
import * as SupplierApi from '@/api/school/setting/supplier' import * as dictApi from '@/api/system/dict/dict.data'
import { DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const searchForm = ref({ const searchForm = ref({
supplierName: '', label: '',
pageSize: 20, pageSize: 20,
pageNo: 1 pageNo: 1,
dictType: 'erp_supplier'
}) })
const total = ref(0) const total = ref(0)
@ -74,9 +70,10 @@ function handleQuery() {
} }
function resetQuery() { function resetQuery() {
searchForm.value = { searchForm.value = {
supplierName: '', label: '',
pageSize: 20, pageSize: 20,
pageNo: 1 pageNo: 1,
dictType: 'erp_supplier'
} }
getList() getList()
} }
@ -84,7 +81,7 @@ function resetQuery() {
async function getList() { async function getList() {
loading.value = true loading.value = true
try { try {
const data = await SupplierApi.getSupplierPage(searchForm.value) const data = await dictApi.getDictDataPage(searchForm.value)
tableList.value = data.list tableList.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {
@ -101,7 +98,7 @@ async function handleDelete(id) {
// //
await message.delConfirm() await message.delConfirm()
// //
await SupplierApi.deleteSupplier(id) await dictApi.deleteDictData(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

@ -37,9 +37,9 @@
<el-select v-model="queryParams.supplier" placeholder="供应商" clearable filterable> <el-select v-model="queryParams.supplier" placeholder="供应商" clearable filterable>
<el-option <el-option
v-for="item in opts.supplier" v-for="item in opts.supplier"
:key="item.id" :key="item.value"
:label="item.supplierName" :label="item.label"
:value="item.id" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -135,7 +135,7 @@ import { allSchemas } from './index.data.js'
import DialogAdd from './Comp/DialogAdd.vue' import DialogAdd from './Comp/DialogAdd.vue'
import DialogAudit from './Comp/DialogAudit.vue' import DialogAudit from './Comp/DialogAudit.vue'
import * as PurchaseApi from '@/api/mall/purchase' import * as PurchaseApi from '@/api/mall/purchase'
import { getSupplierSimpleList } from '@/api/school/setting/supplier' import { getDictOptions } from '@/utils/dict'
const creatPurchase = ref() const creatPurchase = ref()
const auditPurchase = ref() const auditPurchase = ref()
@ -164,9 +164,7 @@ function getOptions() {
ProductApi.getSimpleProductList().then((data) => { ProductApi.getSimpleProductList().then((data) => {
opts.value.product = data opts.value.product = data
}) })
getSupplierSimpleList().then((data) => { opts.value.supplier = getDictOptions('erp_supplier')
opts.value.supplier = data
})
} }
function changeProd(val) { function changeProd(val) {

Loading…
Cancel
Save