客户对账

szh-new
张同海 2 months ago
parent 326e19a682
commit 8ae9391e76

@ -46,6 +46,20 @@
return [] return []
}, },
}, },
checkedChildren: { type: String },
checkedValue: {
type: Boolean,
default: () => {
return true
},
},
unCheckedChildren: { type: String },
unCheckedValue: {
type: Boolean,
default: () => {
return false
},
},
formModel: { type: Object }, formModel: { type: Object },
}, },
emits: ['change', 'update:value', 'edit'], emits: ['change', 'update:value', 'edit'],
@ -59,7 +73,7 @@
} }
function GetState() { function GetState() {
let RData: any = null let RData: any = null
if (state.value) { if (state.value || state.value === false) {
if (props.treeData.length) { if (props.treeData.length) {
let FnFor = (Data) => { let FnFor = (Data) => {
Data.forEach((item: any) => { Data.forEach((item: any) => {
@ -86,6 +100,12 @@
}) })
} else if (state.value.$d && state.value.$isDayjsObject) { } else if (state.value.$d && state.value.$isDayjsObject) {
RData = dayjs(state.value.$d).format('YYYY-MM-DD') RData = dayjs(state.value.$d).format('YYYY-MM-DD')
} else if (props.checkedChildren) {
if (state.value == props.checkedValue) {
RData = props.checkedChildren
} else if (state.value == props.unCheckedValue) {
RData = props.unCheckedChildren
}
} else { } else {
if (props.label == '来源明细') { if (props.label == '来源明细') {
appStore.getSourceData.forEach((item) => { appStore.getSourceData.forEach((item) => {

@ -8,7 +8,6 @@ export function GetCheckBillList(parameter) {
data: parameter, data: parameter,
}) })
} }
// 客户对账编辑 (Auth) # // 客户对账编辑 (Auth) #
export function EditCheckBill(parameter) { export function EditCheckBill(parameter) {
return request({ return request({

@ -48,31 +48,33 @@ export const schemas: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
}, },
{ {
field: 'customerName', field: 'customerId',
component: 'Input', component: 'Input',
label: '对账客户Name', label: '对账客户',
colProps: { span: 4 }, colProps: { span: 4 },
show: false, show: false,
}, },
{ {
field: 'customerId',
component: 'ApiSelect',
label: '对账客户', label: '对账客户',
field: 'customerName',
component: 'ApiSelect',
colProps: { span: 4 }, colProps: { span: 4 },
componentProps: ({ formModel }) => { componentProps: (a) => {
return { return {
allowClear: true,
showSearch: true,
api: GetAllClientList, api: GetAllClientList,
labelField: 'shortName', labelField: 'shortName',
valueField: 'id', valueField: 'shortName',
resultField: 'data', resultField: 'data',
immediate: true,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => { onChange: (e, obj) => {
if (e && obj) { if (e && obj) {
formModel.customerName = obj.label console.log(obj)
a.formModel.customerId = obj.id
} }
}, },
} }
@ -97,6 +99,12 @@ export const schemas: FormSchema[] = [
label: '是否不含税', label: '是否不含税',
defaultValue: false, defaultValue: false,
colProps: { span: 2 }, colProps: { span: 2 },
componentProps: {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
},
}, },
// isLocking // isLocking
// { field: 'billName', component: 'Input', label: '对账单名称', colProps: { span: 4 } }, // { field: 'billName', component: 'Input', label: '对账单名称', colProps: { span: 4 } },
@ -171,9 +179,9 @@ export const Editschemas: FormSchema[] = [
}, },
}, },
{ {
field: 'customerName', field: 'customerId',
component: 'DEdit', component: 'DEdit',
label: '对账客户Name', label: '对账客户',
colProps: { span: 4 }, colProps: { span: 4 },
show: false, show: false,
componentProps: (e) => { componentProps: (e) => {
@ -186,29 +194,30 @@ export const Editschemas: FormSchema[] = [
}, },
}, },
{ {
field: 'customerId',
component: 'DEdit',
label: '对账客户', label: '对账客户',
field: 'customerName',
component: 'DEdit',
colProps: { span: 4 }, colProps: { span: 4 },
componentProps: ({ formModel }) => { componentProps: (a) => {
return { return {
allowClear: true,
showSearch: true,
api: GetAllClientList, api: GetAllClientList,
labelField: 'shortName', labelField: 'shortName',
valueField: 'id', valueField: 'shortName',
resultField: 'data', resultField: 'data',
immediate: true,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => { onChange: (e, obj) => {
if (e && obj) { if (e && obj) {
formModel.customerName = obj.label a.formModel.customerId = obj.id
} }
}, },
onEdit: () => { onEdit: () => {
const { formActionType } = e const { formActionType } = a
formActionType ? formActionType.linkageForm(e) : null formActionType ? formActionType.linkageForm(a) : null
}, },
} }
}, },
@ -221,6 +230,10 @@ export const Editschemas: FormSchema[] = [
colProps: { span: 2 }, colProps: { span: 2 },
componentProps: (e) => { componentProps: (e) => {
return { return {
checkedChildren: '是',
checkedValue: true,
unCheckedChildren: '否',
unCheckedValue: false,
onEdit: () => { onEdit: () => {
const { formActionType } = e const { formActionType } = e
formActionType ? formActionType.linkageForm(e) : null formActionType ? formActionType.linkageForm(e) : null

@ -93,7 +93,7 @@
</a-select> </a-select>
</span> --> </span> -->
</div> </div>
<div class="CsbillNo"> 对账编号{{ billNo }} </div> <div class="CsbillNo" v-if="billNo"> {{ billNo }} </div>
</div> </div>
<div class="CsMain p-4" id="detail"> <div class="CsMain p-4" id="detail">
<ActionBar <ActionBar
@ -145,12 +145,17 @@
</template> </template>
</BasicTable> </BasicTable>
<div class="totalBox"> <div class="totalBox">
<span class="Ttitle">合计</span>
<div class="unitBox"> <div class="unitBox">
<div v-for="item in calcColumns" :key="item.dataIndex" class="unit"> <!-- <div v-for="item in calcColumns" :key="item.dataIndex" class="unit">
<span class="title">{{ item.title }}:</span> <span class="title">{{ item.title }}:</span>
<span class="num">{{ Ldata[item.dataIndex] }}</span> <span class="num">{{ Ldata[item.dataIndex] }}</span>
</div> </div> -->
<a-table
class="ds-table"
:columns="calcColumns"
:data-source="[Ldata]"
:pagination="false"
></a-table>
</div> </div>
</div> </div>
</a-spin> </a-spin>
@ -254,6 +259,7 @@
const spinningT = ref(false) const spinningT = ref(false)
const billNo = ref() const billNo = ref()
const isLocking = ref(false) const isLocking = ref(false)
const calcData = ref([])
init() init()
// ------------------------------------- // -------------------------------------
const RefActionBar = ref() const RefActionBar = ref()
@ -309,7 +315,7 @@
// //
const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({ const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({
labelWidth: 120, labelWidth: 120,
schemas: id.value ? schemas : Editschemas, schemas: id.value ? Editschemas : schemas,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
span: 5, span: 5,
@ -720,7 +726,7 @@
.CsHeader { .CsHeader {
padding-bottom: 0 !important; padding-bottom: 0 !important;
margin: 0 0 10px 0 !important; margin: 0 0 10px 0 !important;
border: 1px solid #e8ebed; // border: 1px solid #e8ebed;
.headerForm { .headerForm {
background: #fff; background: #fff;
padding: 5px 15px 10px 15px !important; padding: 5px 15px 10px 15px !important;

Loading…
Cancel
Save