diff --git a/alibabacloud_sample/dataservice.py b/alibabacloud_sample/dataservice.py index 866070f..6fa597e 100644 --- a/alibabacloud_sample/dataservice.py +++ b/alibabacloud_sample/dataservice.py @@ -243,7 +243,7 @@ class DataService: sql += "desc_files like '%" + value + "%' " sql += ")" sql += " order by verify_time desc" - print(sql) + # print(sql) cursor.execute(sql) rows = cursor.fetchall() datas = [] diff --git a/alibabacloud_sample/main.py b/alibabacloud_sample/main.py index 79a198a..30f7d48 100644 --- a/alibabacloud_sample/main.py +++ b/alibabacloud_sample/main.py @@ -80,10 +80,10 @@ def list_logs(): # 更新发票标注 @app.route('/updateInvoice',methods=['POST']) def update_invoice(): - invoice_id = request.form.get('invoiceId') - status = request.form.get('status') - desc = request.form.get('desc') - desc_files = request.form.get('desc_files') + invoice_id = request.json.get('invoiceId') + status = request.json.get('status') + desc = request.json.get('desc') + desc_files = request.json.get('desc_files') return dataservice.update_invoice_desc(invoice_id=invoice_id,desc=desc,desc_file=desc_files,status=status) if __name__ == '__main__': # Service.verify(sys.argv[1:]) diff --git a/webapp/vite-project/src/pages/manage.vue b/webapp/vite-project/src/pages/manage.vue index 7fc656c..ca5c55e 100644 --- a/webapp/vite-project/src/pages/manage.vue +++ b/webapp/vite-project/src/pages/manage.vue @@ -2,19 +2,30 @@ import {h, onMounted, ref} from "vue"; import { - SearchOutlined + SearchOutlined, + FileSearchOutlined } from '@ant-design/icons-vue' import request from '#/utils/request.ts'; +import {baseURL} from "../utils/baseurl.ts"; +import type {TableProps} from "ant-design-vue"; +interface DataType { + id: string; + status: string; + desc: string; + desc_list: string; +} const columns = [ // { - // title: '发票代码', - // dataIndex: 'invoiceCode', - // key: 'invoiceCode', + // title: '全选', + // dataIndex: 'status', + // key: 'status', + // showSelection: true, // }, { title: '发票号码', dataIndex: 'invoiceNumber', key: 'invoiceNumber', + // showSelection: true, }, { title: '销方名称', @@ -61,6 +72,11 @@ const columns = [ title: '查验时间', dataIndex: 'verify_time', key: 'verify_time', + }, + { + title: '操作', + dataIndex: 'action', + key: 'action', } ] @@ -70,13 +86,53 @@ let data = ref( []) let searchParams = ref({ page: 1, pageSize: 100, - current: 1, + total: 0, params: { verify_status: 'success', value: null, } }); +// 下拉框 +const rowSelection: TableProps['rowSelection'] = { + onChange: (selectedRowKeys: string[], selectedRows: DataType[]) => { + console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); + }, + getCheckboxProps: (record: DataType) => ({ + disabled: record.status === 'yes', // Column configuration not to be checked + name: record.status, + }), +}; +// 弹窗 +const openModal = ref(false); +const modalTitle = ref('') +const confirmLoading = ref(false); +const formData = ref({ + id: '', + status: false, + desc: '', + desc_files: '', +}); +const handleOk = () => { + confirmLoading.value = true; + request.post("/updateInvoice", { + invoiceId: formData.value.id, + status: formData.value.status?'yes':'no', + desc: formData.value.desc, + desc_files: formData.value.desc_files, + }).then(( res ) => { + console.log(res) + if (res.code === 200) { + openModal.value = false; + confirmLoading.value = false; + } + }) +}; +const handleOpen = (record) => { + formData.value = record + openModal.value = true; +}; +// 数据列表 const getList = () => { request.post("/listInvoice", { verify_status : 'success' @@ -114,16 +170,44 @@ onMounted(() => { - + + + + + + + + + + -