qsh 2 weeks ago
parent 7e771a89e4
commit 91a509d49d
  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. 19
      src/views/Clue/Set/Comp/DialogSource.vue
  8. 38
      src/views/MiniMall/MallSet/Comp/DialogSupplier.vue
  9. 27
      src/views/MiniMall/MallSet/Comp/SupplierSet.vue
  10. 12
      src/views/MiniMall/Purchase/index.vue

@ -51,3 +51,13 @@ export const updateProduceSort = (data) => {
export const getSignProfit = (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 })
}

@ -0,0 +1,33 @@
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 })
}

@ -0,0 +1,130 @@
<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-option
v-for="item in supplierOptions"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.id"
:label="item.supplierName"
:value="item.id"
/>
</el-select>
</el-form-item>
@ -141,15 +141,18 @@
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
import { createDelivery } from '@/api/clue/delivery'
import { getConfigList } from '@/api/system/set'
import { getDictOptions } from '@/utils/dict'
import { getSupplierSimpleList } from '@/api/school/setting/supplier'
import { getExtraFeeSimpleList } from '@/api/clue/extraFee'
const message = useMessage() //
const warehouseOptions = ref([])
const extraPayOptions = ref([])
const supplierOptions = getDictOptions('erp_supplier')
const supplierOptions = ref([])
function getOptions() {
getSupplierSimpleList().then((data) => {
supplierOptions.value = data
})
getSimpleWarehouseList().then((data) => {
warehouseOptions.value = data
})

@ -147,6 +147,15 @@
>
发货
</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>
@ -228,6 +237,16 @@
>
取消登记
</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>
</el-table-column>
</SSTable>
@ -238,6 +257,7 @@
<DialogAfterSale ref="afterSaleDialog" />
<DialogExtraFee ref="extraFeeDialog" />
<DialogDelivery ref="deliveryDialog" @success="getTableList" />
<DialogAddProduct ref="addProductDialog" @success="getTableList" />
</div>
</template>
@ -252,6 +272,7 @@ import DialogFeeback from './DialogFeeback.vue'
import DialogAfterSale from './DialogAfterSale.vue'
import DialogExtraFee from './DialogExtraPay.vue'
import DialogDelivery from './DialogDelivery.vue'
import DialogAddProduct from './DialogAddProduct.vue'
import { removeNullField } from '@/utils'
import { formatDate } from '@/utils/formatTime'
@ -404,6 +425,11 @@ function handleDelivery(row) {
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)
@ -460,6 +486,18 @@ 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) {
try {
//

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

@ -42,9 +42,9 @@
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="开户日期" prop="starendDate">
<el-form-item label="开户日期" prop="accountStartTime">
<el-date-picker
v-model="formData.startDate"
v-model="formData.accountStartTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@ -53,9 +53,9 @@
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="到期日期" prop="endDate">
<el-form-item label="到期日期" prop="accountEndTime">
<el-date-picker
v-model="formData.endDate"
v-model="formData.accountEndTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@ -98,8 +98,9 @@
<el-table-column label="充值">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].rechargeMoney"
v-model="row.monthData[col - 1].rechargeFee"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
@ -108,9 +109,10 @@
<el-table-column label="消耗">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].costMoney"
v-model="row.monthData[col - 1].consumeFee"
size="small"
:controls="false"
:min="0"
style="width: 100%"
/>
</template>
@ -147,6 +149,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update -
const formData = ref({
sourceName: '',
accountFee: undefined,
sort: 1,
remark: ''
})
@ -224,8 +227,8 @@ function handleAddPrice() {
for (let i = 1; i <= 12; i++) {
obj.monthData.push({
month: i,
costMoney: undefined,
rechargeMoney: undefined,
consumeFee: 0,
rechargeFee: 0,
clueNum: 0
})
}

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

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

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

Loading…
Cancel
Save