Commit f72dd4ce by zhangxw

Merge branch 'SAAS+V4.53.0-0528' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.53.0-0528
2 parents 2fe90821 98f347f2
import request from "./request"
import RequestMethods from "./request.methods"
// AI助理-账号管理-账号列表
export function getAccountList(data) {
data.method = `dj.api.script.aiagent.account.list`
return request(data, RequestMethods.POST)
}
// AI助理-账号管理-新建账号
export function createAccount(data) {
data.method = `dj.api.script.aiagent.account.create`
return request(data, RequestMethods.POST)
}
// AI助理-账号管理-启用/禁用账号
export function switchAccount(data) {
data.method = `dj.api.script.aiagent.account.switch`
return request(data, RequestMethods.POST)
}
// AI助理-账号管理-编辑账号
export function updateAccount(data) {
data.method = `dj.api.script.aiagent.account.update`
return request(data, RequestMethods.POST)
}
// // AI助理-账号管理-删除账号
export function deleteAccount(data) {
data.method = `dj.api.script.aiagent.account.delete`
return request(data, RequestMethods.POST)
}
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-04-24 15:36:37
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-04-24 16:31:47
* @FilePath: \dj-car-life-system\src\router\modules\916_largeModel.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
916: {
path: "/largeModel",
name: "largeModel",
meta: {
title: "AI大模型",
authId: "916",
parentId: "1",
cache: false
}
},
91601: {
path: "/accountManagement",
name: "accountManagement",
meta: {
title: "账号管理",
authId: "91601",
parentId: "916",
cache: false
},
auth: [
{
authId: "9160102",
parentId: "91601",
label: "编辑",
handle: "handleEdit"
},
{
authId: "9160103",
parentId: "91601",
label: "禁用",
handle: "handleDisabled"
},
{
authId: "9160104",
parentId: "91601",
label: "删除",
handle: "handleDelete"
}
],
component: _import("largeModel/accountManagement/index")
}
}
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
v-model.trim="storeSearchForm.brandName" v-model.trim="storeSearchForm.brandName"
placeholder="门店名称" placeholder="门店名称"
max-length="20" max-length="20"
@input="handleStoreInput"
@keydown.native="handleStoreInput" @keydown.native="handleStoreInput"
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-button type="primary" @click="handleCurrentChange(1)">搜索</el-button> <el-button type="primary" @click="handleSearchStore">搜索</el-button>
</el-form> </el-form>
<el-row class="tableCon"> <el-row class="tableCon">
<div class="tableBox"> <div class="tableBox">
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
@select-all="handleAll" @select-all="handleAll"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column prop="merchantNo" label="门店商户号" align="center"></el-table-column>
<el-table-column prop="merchantName" label="门店名称" align="center"> <el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -72,6 +74,8 @@ ...@@ -72,6 +74,8 @@
</template> </template>
<script> <script>
import { debounce } from "../../../index/debounce"
import { deepClone } from "@/common/util"
import { getCarBrandIds } from "@api/contentManager" import { getCarBrandIds } from "@api/contentManager"
export default { export default {
name: "RelateStoreDialog", name: "RelateStoreDialog",
...@@ -84,6 +88,7 @@ export default { ...@@ -84,6 +88,7 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
storeSearchForm: {}, storeSearchForm: {},
allData: []
} }
}, },
...@@ -101,8 +106,13 @@ export default { ...@@ -101,8 +106,13 @@ export default {
default: () => [] default: () => []
} }
}, },
created() {
// 创建防抖版本的搜索函数
this.debouncedSearch = debounce(this.handleSearchStore, 300);
},
mounted() { mounted() {
console.log(this.brandData) console.log(this.brandData)
this.allData = deepClone(this.storeSelected)
this.selectedData = this.storeSelected this.selectedData = this.storeSelected
this.getSelectingList() this.getSelectingList()
}, },
...@@ -124,6 +134,7 @@ export default { ...@@ -124,6 +134,7 @@ export default {
secBrandIdList: _second secBrandIdList: _second
} }
getCarBrandIds(params).then((res) => { getCarBrandIds(params).then((res) => {
this.allData = deepClone(res)
this.selectingData = res this.selectingData = res
this.total = res.total this.total = res.total
this.$nextTick(() => { this.$nextTick(() => {
...@@ -131,6 +142,21 @@ export default { ...@@ -131,6 +142,21 @@ export default {
}) })
}) })
}, },
handleStoreInput(e) {
this.debouncedSearch()
},
handleSearchStore() {
console.log(this.storeSearchForm.brandName)
const {brandName} = this.storeSearchForm
if(brandName) {
this.selectingData = this.selectingData.filter(item => {
return item.merchantName.includes(brandName)
})
} else {
this.selectingData = deepClone(this.allData)
}
},
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find((item) => item.merchantNo === row.merchantNo) var addOrDelete = !!selection.find((item) => item.merchantNo === row.merchantNo)
addOrDelete addOrDelete
...@@ -156,10 +182,10 @@ export default { ...@@ -156,10 +182,10 @@ export default {
const obj = this.selectingData.find((v) => v.merchantNo == row.merchantNo) const obj = this.selectingData.find((v) => v.merchantNo == row.merchantNo)
this.$refs.seletingTable.toggleRowSelection(obj) this.$refs.seletingTable.toggleRowSelection(obj)
}, },
handleCurrentChange(val) { // handleCurrentChange(val) {
this.currentPage = val // this.currentPage = val
this.getSelectingList() // this.getSelectingList()
}, // },
handleRelateStoreConfirm() { handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData) this.$emit("handleRelateStoreConfirm", this.selectedData)
}, },
......
<template> <template>
<d2-container class="customer-tags m-t-40" v-loading="loading"> <d2-container class="edit-invoice" v-loading="loading">
<div class="d2-container-content"> <div class="d2-container-content">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="150px" default-width="308px" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules"> <glsx-combi-form class="edit-form-container p-t-20" ref="editFormRef" label-width="150px" default-width="308px" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
<div slot="invoiceIssueOptions" slot-scope="scope"> <div slot="invoiceIssueOptions" slot-scope="scope">
<el-checkbox-group v-model="editData[scope.scope.name]"> <el-checkbox-group v-model="editData[scope.scope.name]">
<el-checkbox v-for="(item, index) in baseData[scope.scope.optionsName]" :key="index" :label="item[scope.scope.optionId]"> <el-checkbox v-for="(item, index) in baseData[scope.scope.optionsName]" :key="index" :label="item[scope.scope.optionId]">
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<div slot="bizOrderCode" slot-scope="scope"> <div slot="bizOrderCode" class="bizOrderCode" slot-scope="scope">
<el-input :placeholder="scope.scope.placeholder" v-model="editData[scope.scope.name]" :maxlength="scope.scope.maxlength"></el-input> <el-input :placeholder="scope.scope.placeholder" v-model="editData[scope.scope.name]" :maxlength="scope.scope.maxlength"></el-input>
<el-button type="text" class="add-mer-btn" @click="getInvoiceInfo">搜索</el-button> <el-button type="text" class="btn-search" @click="getInvoiceInfo">搜索</el-button>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
<div class="btn-box">
<el-button type="primary" @click="handleConfirm">提交</el-button> <el-button type="primary" @click="handleConfirm">提交</el-button>
<!-- <el-button type="default" @click="goBack">取消</el-button> --> <el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div> </div>
</d2-container> </d2-container>
</template> </template>
...@@ -36,21 +38,22 @@ export default { ...@@ -36,21 +38,22 @@ export default {
bizOrderCode: '', bizOrderCode: '',
privateProject: '', privateProject: '',
privateMoney: 0, privateMoney: 0,
privateAmount: '',
privatePrice: '',
privateSpec: '',
privateUnit: '',
casherName: '', casherName: '',
reviewerName: '', reviewerName: '',
allowInvoiceCount: 0, allowInvoiceCount: 0,
invoiceRemark: '', invoiceRemark: '',
expireDay: '', expireDay: '7',
email: '' email: ''
}, },
formRules: { formRules: {
invoiceIssueOptions: [{ required: true, message: '请选择可选开票种类', trigger: 'change' }], invoiceIssueOptions: [{ required: true, message: '请选择可选开票种类', trigger: 'change' }],
bizOrderCode: [{ required: true, message: '请输入主订单号', trigger: 'blur' }], bizOrderCode: [{ required: true, message: '请输入主订单号', trigger: 'blur' }],
email: [{ required: true, message: '请输入发送邮件', trigger: 'blur' }], email: [
{ required: true, message: '请输入发送邮件', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
],
privateProject: [{ required: true, message: '请输入开票项目', trigger: 'blur' }],
privateMoney: [{ required: true, message: '请输入待开票金额', trigger: 'blur' }],
}, },
editFormData: [ editFormData: [
{ {
...@@ -92,48 +95,12 @@ export default { ...@@ -92,48 +95,12 @@ export default {
maxlength: '23' maxlength: '23'
}, },
{ {
label: "数量",
name: "privateAmount",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(多条数量使用“/”隔开)",
isDisabled: true,
maxlength: '20'
},
{
label: "单价",
name: "privatePrice",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(多条单价使用“/”隔开)",
isDisabled: true,
maxlength: '23'
},
{
label: "规格型号",
name: "privateSpec",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(默认为空,显示为--)",
isDisabled: true,
maxlength: '20'
},
{
label: "单位",
name: "privateUnit",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(默认展示“pcs”)",
isDisabled: true,
maxlength: '50'
},
{
label: "收款人", label: "收款人",
name: "casherName", name: "casherName",
type: "input", type: "input",
style: { width: '42%' }, style: { width: '42%' },
placeholder: "请填写", placeholder: "请填写",
maxlength: '20' maxlength: '16'
}, },
{ {
label: "复核人", label: "复核人",
...@@ -141,7 +108,7 @@ export default { ...@@ -141,7 +108,7 @@ export default {
type: "input", type: "input",
style: { width: '42%' }, style: { width: '42%' },
placeholder: "请填写", placeholder: "请填写",
maxlength: '20' maxlength: '16'
}, },
{ {
label: "可开票张数", label: "可开票张数",
...@@ -229,7 +196,7 @@ export default { ...@@ -229,7 +196,7 @@ export default {
}) })
}, },
resetPrivateVal() { resetPrivateVal() {
const attrList = ['privateProject', 'privateAmount', 'privatePrice'] const attrList = ['privateProject']
attrList.forEach(item => { attrList.forEach(item => {
this.editData[item] = '' this.editData[item] = ''
}) })
...@@ -255,8 +222,6 @@ export default { ...@@ -255,8 +222,6 @@ export default {
let separate = idx ? '/' : '' let separate = idx ? '/' : ''
this.editData.privateProject = this.editData.privateProject + separate + item.itemName this.editData.privateProject = this.editData.privateProject + separate + item.itemName
this.editData.privateMoney = (Number(this.editData.privateMoney) + Number(item.invoiceItemAmount)).toFixed(2) this.editData.privateMoney = (Number(this.editData.privateMoney) + Number(item.invoiceItemAmount)).toFixed(2)
this.editData.privateAmount = this.editData.privateAmount + separate + '1'
this.editData.privatePrice = this.editData.privatePrice + separate + item.invoiceItemAmount
}) })
}, },
getOptionsList(formName = "editFormData") { getOptionsList(formName = "editFormData") {
...@@ -280,6 +245,9 @@ export default { ...@@ -280,6 +245,9 @@ export default {
}) })
return params return params
}, },
handleCancel() {
this.$emit('handleChangeTab', { activeTab: "2" })
},
handleConfirm() { handleConfirm() {
if (this.loading) { if (this.loading) {
...@@ -288,12 +256,12 @@ export default { ...@@ -288,12 +256,12 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = this.dealParams() var params = this.dealParams()
console.log(params, 'params----')
this.loading = true this.loading = true
invoiceCreate(params).then(res => { invoiceCreate(params).then(res => {
if (res) { if (res) {
this.$message.success("操作成功") this.$message.success("操作成功")
this.resetAll() this.resetAll()
this.handleCancel()
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
...@@ -304,8 +272,23 @@ export default { ...@@ -304,8 +272,23 @@ export default {
} }
}; };
</script> </script>
<style scoped> <style lang="scss">
.m-t-40 { .edit-invoice {
margin-top: 40px; .p-t-20 {
padding-top: 20px;
}
.bizOrderCode {
display: flex;
width: 308px;
.el-input--small {
width: calc(100% - 30px);
}
.btn-search {
margin-left: 10px;
}
}
.btn-box {
text-align: center;
}
} }
</style> </style>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:key="index"> :key="index">
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<components :is="tabName"></components> <components :is="tabName" @handleChangeTab="handleChangeTab"></components>
</div> </div>
</div> </div>
</template> </template>
...@@ -57,7 +57,15 @@ export default { ...@@ -57,7 +57,15 @@ export default {
2: "invoiceCodeList" 2: "invoiceCodeList"
} }
this.tabName = arr[+this.activeName] this.tabName = arr[+this.activeName]
},
handleChangeTab(e) {
if(!e) {
return true
} }
let { activeTab } = e
this.activeName = activeTab
this.handleClick()
},
} }
} }
</script> </script>
......
<!-- 驳回 -->
<template>
<d2-dialog
:title="detailInfo && detailInfo.id ? '编辑总部账号' : '新建总部账号'"
:is-visible="visible"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm"
>
<div class="reject-dialog">
<glsx-combi-form
class="edit-form-container"
ref="formRef"
label-width="112px"
default-width="390px"
:form-ref="rejectRef"
:form-obj="accountForm"
:form-data="formData"
:form-rules="formRules"
></glsx-combi-form>
</div>
</d2-dialog>
</template>
<script>
import { createAccount, updateAccount } from "@api/large"
import { Validator } from "@/common/validator"
export default {
name: "addAccountDialog",
data() {
var checkPhoneObj = {
required: true,
validator: (rule, value, callback) => {
Validator.checkPhoneNumber(value)
? callback()
: callback(new Error("你输入的手机号码不正确,请重新输入"))
},
trigger: "blur"
}
return {
accountForm: {
accountName: "",
accountPhone: "",
accountPhone: "",
ownerShipType: "",
ownerDept: ""
},
dialogConfig: {
title: "提示",
width: "576px",
height: "315px"
},
rejectRef: "rejectRef",
formRules: {
accountName: [
{ required: true, message: "请输入员工姓名", trigger: "blur" }
],
accountPhone: [
{ required: true, message: "请输入手机号码", trigger: "blur" },
checkPhoneObj
],
ownerPost: [{ required: true, message: "请输入岗位", trigger: "blur" }]
},
formData: [
{
label: "员工姓名",
name: "accountName",
type: "input",
width: "300px",
labelWidth: "10px"
},
{
label: "手机号码",
name: "accountPhone",
type: "input",
width: "300px",
maxlength: "11",
labelWidth: "10px"
},
// {
// label: "归属中心",
// name: "ownerShipType",
// type: "select",
// width: "300px",
// optionList: [
// {
// confValue: "总部",
// confId: 0
// },
// {
// confValue: "驻店",
// confId: 1
// }
// ],
// optionId: "confId",
// optionLabel: "confValue",
// isDisabled: true
// },
// {
// label: "归属部门",
// name: "deliveryType",
// type: "select",
// optionList: [],
// optionId: "confId",
// optionLabel: "confName",
// optionsName: "deliveryTypeList"
// },
// {
// label: "归属中心",
// name: "ownerShipType",
// type: "input",
// width: "300px",
// labelWidth: "10px",
// isDisabled: true
// },
// {
// label: "归属部门",
// name: "ownerDept",
// type: "input",
// width: "300px",
// labelWidth: "10px",
// isDisabled: true
// },
{
label: "岗位",
name: "ownerPost",
type: "input",
width: "300px",
labelWidth: "10px"
}
],
baseData: {}
}
},
props: {
visible: {
type: Boolean,
default: false
},
detailInfo: {
type: Object,
default: () => {}
}
},
computed: {
isVisible: {
get() {
return this.visible
},
set(newVal) {}
}
},
watch: {
detailInfo(val) {
if (val) {
this.accountForm = val
}
}
},
mounted() {},
methods: {
handleAddConfirm() {
this.$refs.formRef.$refs[this.rejectRef].validate(async (valid) => {
if (valid) {
let api =
this.detailInfo && this.detailInfo.id
? updateAccount
: createAccount
let params = {
accountName: this.accountForm.accountName,
accountPhone: this.accountForm.accountPhone,
ownerPost: this.accountForm.ownerPost,
ownerShipType: 0,
ownerDept: this.accountForm.ownerDept,
ownerCenter: this.accountForm.ownerCenter,
useStatus: 1
}
if (this.detailInfo && this.detailInfo.id) {
params.id = this.detailInfo.id
params.useStatus = this.detailInfo.useStatus
params.ownerShipType = this.accountForm.ownerShipType
}
api(params).then((res) => {
if (res) {
this.handleClose()
this.notice.okTips("操作成功")
}
})
}
})
},
handleClose() {
this.$emit("dialogClose", false)
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 21px 0 83px;
::v-deep .el-textarea__inner {
height: 70px;
}
::v-deep .el-input__count {
right: 15px !important;
bottom: 3px !important;
font-size: 12px;
color: #999999;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!