From 6fcb00f27e80b38cea4ccb059112ad7cf99d8745 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期五, 25 十月 2024 15:18:22 +0800 Subject: [PATCH] 新增干草配方历史功能模块 --- src/views/dry/herbFormulaHis/components/DryHerbFormulaHisForm.vue | 70 +++ src/views/dry/api/DryHerbInfo.api.ts | 8 src/views/dry/DryOrderList.vue | 30 + src/components/Form/src/jeecg/components/JSearchSelect.vue | 2 src/views/dry/dataDefine/DryHerbInfo.data.ts | 94 +++- src/views/dry/api/DryOrder.api.ts | 19 src/views/dry/components/DryHerbFormulaModal.vue | 5 src/views/dry/herbFormulaHis/DryHerbFormulaHisList.vue | 173 ++++++++ src/views/dry/herbFormulaHis/DryHerbFormulaHis_menu_insert.sql | 26 + src/views/dry/herbFormulaHis/components/DryHerbFormulaHisModal.vue | 66 +++ src/views/dry/common/prodRecordReport.vue | 7 src/views/dry/dataDefine/DryOrder.data.ts | 42 + src/views/dry/herbFormulaHis/DryHerbFormulaHis.data.ts | 285 ++++++++++++++ src/views/dry/components/dryOrder/DryOrderModal.vue | 34 + src/views/dry/herbFormulaHis/DryHerbFormulaHis.api.ts | 64 +++ src/views/dry/dataDefine/DryHerbFormula.data.ts | 222 +++++++--- 16 files changed, 1,025 insertions(+), 122 deletions(-) diff --git a/src/components/Form/src/jeecg/components/JSearchSelect.vue b/src/components/Form/src/jeecg/components/JSearchSelect.vue index 8a46827..c04f73b 100644 --- a/src/components/Form/src/jeecg/components/JSearchSelect.vue +++ b/src/components/Form/src/jeecg/components/JSearchSelect.vue @@ -299,7 +299,7 @@ } } //update-end-author:taoyan date:2022-8-15 for: VUEN-1971 銆恛nline 涓撻」娴嬭瘯銆戝叧鑱旇褰曞拰浠栬〃瀛楁 1 - + return { attrs, options, diff --git a/src/views/dry/DryOrderList.vue b/src/views/dry/DryOrderList.vue index 98d17ce..8fa18e7 100644 --- a/src/views/dry/DryOrderList.vue +++ b/src/views/dry/DryOrderList.vue @@ -5,6 +5,7 @@ <!--鎻掓Ы:table鏍囬--> <template #tableTitle> <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 鏂板</a-button> + <a-button type="primary" @click="handleSend" preIcon="ant-design:vertical-align-bottom-outlined"> 涓嬪彂</a-button> <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 瀵煎嚭</a-button> <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">瀵煎叆</j-upload-button> <a-dropdown v-if="selectedRowKeys.length > 0"> @@ -47,7 +48,7 @@ <script lang="ts" name="dry-dryOrder" setup> import { ref } from 'vue' - import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './api/DryOrder.api' + import { batchDelete, deleteOne, getExportUrl, getImportUrl, list,batchSend } from './api/DryOrder.api' import DryOrderModal from './components/dryOrder/DryOrderModal.vue' import TrendModal from './components/dryOrder/TrendModal.vue' import { columns, searchFormSchema } from './dataDefine/DryOrder.data' @@ -56,6 +57,7 @@ import { useListPage } from '/@/hooks/system/useListPage' import { downloadFile } from '/@/utils/common/renderUtils' import { router } from '/@/router' + import {message} from "ant-design-vue"; const checkedKeys = ref<Array<string | number>>([]) //娉ㄥ唽model @@ -91,7 +93,7 @@ }, }) - const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext + const [registerTable, { reload }, { rowSelection,selectedRows, selectedRowKeys }] = tableContext /** * 鏂板浜嬩欢 @@ -102,7 +104,27 @@ showFooter: true, }) } - /** + + /** + * 涓嬪彂宸ュ崟 + */ + const handleSend = async () => { + // 鍙湁鏂板缓鐘舵�佺殑宸ュ崟鎵嶅厑璁镐笅鍙戯紝鏍规嵁鍕鹃�夌殑璁板綍id鍒楄〃锛岄亶鍘唖electedRows锛屽垽鏂槸涓嶆槸鏂板缓宸ュ崟锛屽寘鍚潪鏂板缓宸ュ崟杩涜鎻愮ず + if (selectedRowKeys.value.length > 0) { + const newOrderList = selectedRows.value.filter(row => { + return row.orderStatus > 0 + }) + if (newOrderList.length > 0) { + message.warning('璇烽�夋嫨鏂板缓鐘舵�佺殑宸ュ崟') + return + }else { + await batchSend({ ids: selectedRowKeys.value }, handleSuccess) + } + } + + + } + /** * 缂栬緫浜嬩欢 */ function handleEdit(record: Recordable) { @@ -145,7 +167,7 @@ */ function getTableAction(record) { return [ - + { label: '杩囩▼瓒嬪娍', onClick: openProcessTendency.bind(null, record), diff --git a/src/views/dry/api/DryHerbInfo.api.ts b/src/views/dry/api/DryHerbInfo.api.ts index e593f94..4bc33e2 100644 --- a/src/views/dry/api/DryHerbInfo.api.ts +++ b/src/views/dry/api/DryHerbInfo.api.ts @@ -7,6 +7,7 @@ list = '/dry/dryHerbInfo/list', save='/dry/dryHerbInfo/add', edit='/dry/dryHerbInfo/edit', + queryById = '/dry/dryHerbInfo/queryById', deleteOne = '/dry/dryHerbInfo/delete', deleteBatch = '/dry/dryHerbInfo/deleteBatch', importExcel = '/dry/dryHerbInfo/importExcel', @@ -29,6 +30,13 @@ defHttp.get({url: Api.list, params}); /** + * 鍒楄〃鎺ュ彛 + * @param params + */ +export const queryById = (params) => + defHttp.get({url: Api.queryById, params}); + +/** * 鍒犻櫎鍗曚釜 */ export const deleteOne = (params,handleSuccess) => { diff --git a/src/views/dry/api/DryOrder.api.ts b/src/views/dry/api/DryOrder.api.ts index aae157d..5c04447 100644 --- a/src/views/dry/api/DryOrder.api.ts +++ b/src/views/dry/api/DryOrder.api.ts @@ -13,6 +13,7 @@ deleteBatch = '/dry/dryOrder/deleteBatch', importExcel = '/dry/dryOrder/importExcel', exportXls = '/dry/dryOrder/exportXls', + sendBatch = '/dry/dryOrder/sendBatch' } /** * 瀵煎嚭api @@ -61,6 +62,24 @@ }, }) } + +/** + * 鎵归噺涓嬪彂宸ュ崟 + */ +export const batchSend = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '纭涓嬪彂', + content: '鏄惁灏嗛�変腑宸ュ崟涓嬪彂鍒版満鍙�', + okText: '涓嬪彂', + cancelText: '鍙栨秷', + onOk: () => { + return defHttp.post({ url: Api.sendBatch, data: params }, { joinParamsToUrl: true }).then(() => { + handleSuccess() + }) + }, + }) +} /** * 淇濆瓨鎴栬�呮洿鏂� * @param params diff --git a/src/views/dry/common/prodRecordReport.vue b/src/views/dry/common/prodRecordReport.vue index 5ad030f..649b11a 100644 --- a/src/views/dry/common/prodRecordReport.vue +++ b/src/views/dry/common/prodRecordReport.vue @@ -5,9 +5,12 @@ <script setup lang="ts"> import { onMounted, ref } from 'vue' import { router } from '/@/router' - console.log(`output->router1`, router) + import { getTenantId, getToken } from '/@/utils/auth' + const token = getToken() + const tenantId = getTenantId() + console.log(`output->tenantId`, tenantId ) const reportUrl = ref('') - reportUrl.value = window._CONFIG['domianURL'] + '/jmreport/view/833110227445567488?batch=' + router.currentRoute.value.query.batch + reportUrl.value = window._CONFIG['domianURL'] + '/jmreport/view/833110227445567488?batch=' + router.currentRoute.value.query.batch +'&token=' + token+'&tenantId=' + tenantId //reportUrl.value = 'www.baidu.com' console.log(`output->reportUrl.value`, reportUrl.value) // onMounted(() => { diff --git a/src/views/dry/components/DryHerbFormulaModal.vue b/src/views/dry/components/DryHerbFormulaModal.vue index ff26716..2bf4910 100644 --- a/src/views/dry/components/DryHerbFormulaModal.vue +++ b/src/views/dry/components/DryHerbFormulaModal.vue @@ -20,6 +20,7 @@ showActionButtonGroup: false, baseColProps: { span: 24 }, }) + //琛ㄥ崟璧嬪�� const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { //閲嶇疆琛ㄥ崟 @@ -35,6 +36,10 @@ // 闅愯棌搴曢儴鏃剁鐢ㄦ暣涓〃鍗� setProps({ disabled: !data?.showFooter }) }) + const updateNameValue = (v) => { + console.log(v) + } + //璁剧疆鏍囬 const title = computed(() => (!unref(isUpdate) ? '鏂板' : '缂栬緫')) //琛ㄥ崟鎻愪氦浜嬩欢 diff --git a/src/views/dry/components/dryOrder/DryOrderModal.vue b/src/views/dry/components/dryOrder/DryOrderModal.vue index 330ef57..8db1ccc 100644 --- a/src/views/dry/components/dryOrder/DryOrderModal.vue +++ b/src/views/dry/components/dryOrder/DryOrderModal.vue @@ -5,6 +5,7 @@ </template> <script lang="ts" setup> +import dayjs from 'dayjs'; import { computed, ref, unref } from 'vue' import { saveOrUpdate } from '../../api/DryOrder.api' import { formSchema } from '../../dataDefine/DryOrder.data' @@ -31,7 +32,15 @@ await setFieldsValue({ ...data.record, }) - } + } else { + await setFieldsValue({ + orderTime: dayjs(getDateStr(new Date()), 'YYYY-MM-DD'), + code: getCodeByDate(new Date()), + dryer: 1, + feed: 16, + orderStatus: 0, + }) + } // 闅愯棌搴曢儴鏃剁鐢ㄦ暣涓〃鍗� setProps({ disabled: !data?.showFooter }) }) @@ -41,6 +50,8 @@ async function handleSubmit(v) { try { let values = await validate() + values.orderTime = dayjs(values.orderTime).format('YYYY-MM-DD HH:mm:ss') + setModalProps({ confirmLoading: true }) //鎻愪氦琛ㄥ崟 await saveOrUpdate(values, isUpdate.value) @@ -52,6 +63,27 @@ setModalProps({ confirmLoading: false }) } } + const getCodeByDate = (date) => { + let year = date.getFullYear() + let month = date.getMonth() + 1 + let day = date.getDate() + let hour = date.getHours() + let minute = date.getMinutes() + let second = date.getSeconds() + return `${year}${month}${day}${hour}${minute}${second}` + } + const getDateStr = (date) => { + let year = date.getFullYear() + let month = date.getMonth() + 1 + let day = date.getDate() + if (month < 10) { + month = '0' + month + } + if (day < 10) { + day = '0' + day + } + return `${year}-${month}-${day}` + } </script> <style lang="less" scoped> diff --git a/src/views/dry/dataDefine/DryHerbFormula.data.ts b/src/views/dry/dataDefine/DryHerbFormula.data.ts index 2cd5ccd..20c04a9 100644 --- a/src/views/dry/dataDefine/DryHerbFormula.data.ts +++ b/src/views/dry/dataDefine/DryHerbFormula.data.ts @@ -1,4 +1,7 @@ import { BasicColumn, FormSchema } from '/@/components/Table' +import {render} from "/@/utils/common/renderUtils"; +import {rules} from "/@/utils/helper/validator"; +import {queryById} from "/@/views/dry/api/DryHerbInfo.api" //鍒楄〃鏁版嵁 export const columns: BasicColumn[] = [ { @@ -6,16 +9,24 @@ align: 'center', dataIndex: 'herbId_dictText', }, - // { - // title: '鑽潗鍚嶇О', - // align: 'center', - // dataIndex: 'herbName', - // }, + { + title: '閰嶆柟鍚嶇О', + align: 'center', + dataIndex: 'name', + }, { title: '閫傜敤璁惧', align: 'center', dataIndex: 'eqpType_dictText', }, + { + title: '閰嶆柟鍒嗙被', + align: 'center', + dataIndex: 'category', + customRender: ({ text }) => { + return render.renderDict(text, 'formula_category'); + }, + }, { title: '鐩爣鍚按鐜�', align: 'center', @@ -36,26 +47,41 @@ align: 'center', dataIndex: 'windTemp', }, - { - title: '鐜娓╁害', - align: 'center', - dataIndex: 'envTemp', - }, - { - title: '鐜婀垮害', - align: 'center', - dataIndex: 'envHum', - }, + { + title: '椋庢満鍒濆棰戠巼', + align: 'center', + dataIndex: 'fanSpeed', + }, + // { + // title: '鐜娓╁害', + // align: 'center', + // dataIndex: 'envTemp', + // }, + // { + // title: '鐜婀垮害', + // align: 'center', + // dataIndex: 'envHum', + // }, { title: '鑽℃枡寤舵椂ms', align: 'center', dataIndex: 'delay', }, - { - title: '缈绘枡娆℃暟', - align: 'center', - dataIndex: 'turn', - }, + // { + // title: '缈绘枡娆℃暟', + // align: 'center', + // dataIndex: 'turn', + // }, + { + title: '鍚按鐜囪ˉ鍋�', + align: 'center', + dataIndex: 'moisOffset', + }, + { + title: '鍐烽鏃堕暱', + align: 'center', + dataIndex: 'coolingDuration', + }, // { // title: '绉熸埛id', // align: 'center', @@ -69,7 +95,7 @@ field: 'herbId', component: 'JSearchSelect', componentProps: { - dict: 'dry_herb,name,id', + dict: 'dry_herb_info,name,id', }, colProps: { span: 6 }, }, @@ -80,18 +106,31 @@ label: '鑽潗', field: 'herbId', component: 'JSearchSelect', - componentProps: { - dict: 'dry_herb,name,id', + componentProps: ({formModel})=>{ + return { + dict: 'dry_herb_info,name,id', + onChange: e => { + let param = { + id: e, + } + queryById(param).then(res => { + formModel.name = res.name + }) + }, + } }, dynamicRules: ({ model, schema }) => { return [{ required: true, message: '璇烽�夋嫨鑽潗!' }] }, }, - // { - // label: '鑽潗鍚嶇О', - // field: 'herbName', - // component: 'Input', - // }, + { + label: '閰嶆柟鍚嶇О', + field: 'name', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ラ厤鏂瑰悕绉�!' }, { ...rules.duplicateCheckRule('dry_herb_formula', 'name', model, schema)[0] }] + }, + }, { label: '璁惧绫诲瀷', field: 'eqpType', @@ -103,6 +142,16 @@ return [{ required: true, message: '璇疯澶囪澶囩被鍨�!' }] }, }, + { + label: '閰嶆柟鍒嗙被', + field: 'category', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'formula_category', + placeholder: '璇烽�夋嫨閰嶆柟鍒嗙被', + stringToNumber: true, + }, + }, { label: '鐩爣鍚按鐜�', field: 'target', @@ -155,32 +204,45 @@ } }, }, - { - label: '鐜娓╁害', - field: 'envTemp', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] - }, - renderComponentContent: () => { - return { - suffix: () => '鈩�', - } - }, - }, - { - label: '鐜婀垮害', - field: 'envHum', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] - }, - renderComponentContent: () => { - return { - suffix: () => 'rh', - } - }, - }, + { + label: '椋庢満鍒濆棰戠巼', + field: 'fanSpeed', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'Hz', + } + }, + }, + // { + // label: '鐜娓╁害', + // field: 'envTemp', + // component: 'Input', + // dynamicRules: ({ model, schema }) => { + // return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + // }, + // renderComponentContent: () => { + // return { + // suffix: () => '鈩�', + // } + // }, + // }, + // { + // label: '鐜婀垮害', + // field: 'envHum', + // component: 'Input', + // dynamicRules: ({ model, schema }) => { + // return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + // }, + // renderComponentContent: () => { + // return { + // suffix: () => 'rh', + // } + // }, + // }, { label: '鑽℃枡寤舵椂', field: 'delay', @@ -194,19 +256,45 @@ } }, }, - { - label: '缈绘枡娆℃暟', - field: 'turn', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] - }, - renderComponentContent: () => { - return { - suffix: () => '娆�', - } - }, - }, + // { + // label: '缈绘枡娆℃暟', + // field: 'turn', + // component: 'Input', + // dynamicRules: ({ model, schema }) => { + // return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + // }, + // renderComponentContent: () => { + // return { + // suffix: () => '娆�', + // } + // }, + // }, + { + label: '鍚按鐜囪ˉ鍋�', + field: 'moisOffset', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => '%', + } + }, + }, + { + label: '鍐烽鏃堕暱', + field: 'coolingDuration', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }] + }, + renderComponentContent: () => { + return { + suffix: () => 'min', + } + }, + }, // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID { label: '', diff --git a/src/views/dry/dataDefine/DryHerbInfo.data.ts b/src/views/dry/dataDefine/DryHerbInfo.data.ts index d34afa8..925f7da 100644 --- a/src/views/dry/dataDefine/DryHerbInfo.data.ts +++ b/src/views/dry/dataDefine/DryHerbInfo.data.ts @@ -1,5 +1,6 @@ import {BasicColumn} from '/@/components/Table'; import {FormSchema} from '/@/components/Table'; +import {rules} from "/@/utils/helper/validator"; //鍒楄〃鏁版嵁 export const columns: BasicColumn[] = [ @@ -23,6 +24,11 @@ align:"center", dataIndex: 'english' }, + { + title: '鑽潗鍒嗙被', + align: 'center', + dataIndex: 'type_dictText', + }, { title: '鑽敤閮ㄤ綅', align:"center", @@ -78,11 +84,11 @@ align:"center", dataIndex: 'usageTaboo' }, - { - title: '绉熸埛id', - align:"center", - dataIndex: 'tenantId' - }, + // { + // title: '绉熸埛id', + // align:"center", + // dataIndex: 'tenantId' + // }, ]; //鏌ヨ鏁版嵁 export const searchFormSchema: FormSchema[] = [ @@ -104,24 +110,36 @@ component: 'JInput', colProps: {span: 6}, }, - { - label: "鑻辨枃鍚�", - field: 'english', - component: 'JInput', - colProps: {span: 6}, - }, - { - label: "浜у湴鍒嗗竷", - field: 'origin', - component: 'JInput', - colProps: {span: 6}, - }, - { - label: "鍔熸晥涓庝綔鐢�", - field: 'efficacy', - component: 'JInput', - colProps: {span: 6}, - }, + // { + // label: "鑻辨枃鍚�", + // field: 'english', + // component: 'JInput', + // colProps: {span: 6}, + // }, + // { + // label: "浜у湴鍒嗗竷", + // field: 'origin', + // component: 'JInput', + // colProps: {span: 6}, + // }, + // { + // label: "鍔熸晥涓庝綔鐢�", + // field: 'efficacy', + // component: 'JInput', + // colProps: {span: 6}, + // }, + { + label: '鑽潗鍒嗙被', + field: 'type', + component: 'JTreeSelect', + componentProps: { + dict: 'dry_herb_type,name,id', + pidField: 'pid', + hasChildField: 'has_child', + converIsLeafVal: 1, + }, + colProps: { span: 6 }, + }, ]; //琛ㄥ崟鏁版嵁 export const formSchema: FormSchema[] = [ @@ -129,11 +147,17 @@ label: '涓嵂鍚�', field: 'name', component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ヨ嵂鏉愬悕绉�!' }, { ...rules.duplicateCheckRule('dry_herb_info', 'name', model, schema)[0] }] + }, }, { label: '鎷奸煶', field: 'pinyin', component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ヨ嵂鏉愭嫾闊�!' }, { ...rules.duplicateCheckRule('dry_herb_info', 'pinyin', model, schema)[0] }] + }, }, { label: '鍒悕', @@ -144,6 +168,20 @@ label: '鑻辨枃鍚�', field: 'english', component: 'Input', + }, + { + label: '鑽潗鍒嗙被', + field: 'type', + component: 'JTreeSelect', + componentProps: { + dict: 'dry_herb_type,name,id', + pidField: 'pid', + hasChildField: 'has_child', + converIsLeafVal: 1, + }, + dynamicRules: ({ model, schema }) => { + return [{ required: true, message: '璇疯緭鍏ヨ嵂鏉愬垎绫�!' }] + }, }, { label: '鑽敤閮ㄤ綅', @@ -200,11 +238,11 @@ field: 'usageTaboo', component: 'Input', }, - { - label: '绉熸埛id', - field: 'tenantId', - component: 'InputNumber', - }, + // { + // label: '绉熸埛id', + // field: 'tenantId', + // component: 'InputNumber', + // }, // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID { label: '', diff --git a/src/views/dry/dataDefine/DryOrder.data.ts b/src/views/dry/dataDefine/DryOrder.data.ts index c9dad1d..2dc9a24 100644 --- a/src/views/dry/dataDefine/DryOrder.data.ts +++ b/src/views/dry/dataDefine/DryOrder.data.ts @@ -27,6 +27,11 @@ align: 'center', dataIndex: 'equId_dictText', }, + { + title: '宸ュ崟鐘舵��', + align: 'center', + dataIndex: 'orderStatus_dictText', + }, // { // title: '杞﹂棿', // align: 'center', @@ -108,11 +113,7 @@ dataIndex: 'remain', }, - { - title: '宸ュ崟鐘舵��', - align: 'center', - dataIndex: 'orderStatus', - }, + { title: '鎿嶄綔浜�', align: 'center', @@ -144,8 +145,7 @@ field: 'orderTime', component: 'DatePicker', componentProps: { - showTime: true, - valueFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD', }, }, { @@ -161,7 +161,7 @@ field: 'herbId', component: 'JDictSelectTag', componentProps: { - dictCode: 'dry_herb,name,id,tenant_id=' + getTenantId(), + dictCode: 'dry_herb_formula,name,id,tenant_id=' + getTenantId(), }, }, // { @@ -237,19 +237,23 @@ dictCode: 'dry_equipment,name,id,tenant_id=' + getTenantId(), }, }, - { - label: '杞﹂棿', - field: 'shopId', - component: 'JDictSelectTag', - componentProps: { - dictCode: 'dry_shop,name,id,tenant_id=' + getTenantId(), - }, - }, // { - // label: '宸ュ崟鐘舵��', - // field: 'orderStatus', - // component: 'InputNumber', + // label: '杞﹂棿', + // field: 'shopId', + // component: 'JDictSelectTag', + // componentProps: { + // dictCode: 'dry_shop,name,id,tenant_id=' + getTenantId(), + // }, // }, + { + label: '宸ュ崟鐘舵��', + field: 'orderStatus', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'dry_order_status', + stringToNumber: true, + }, + }, // { // label: '鎿嶄綔浜�', // field: 'operator', diff --git a/src/views/dry/herbFormulaHis/DryHerbFormulaHis.api.ts b/src/views/dry/herbFormulaHis/DryHerbFormulaHis.api.ts new file mode 100644 index 0000000..159fd30 --- /dev/null +++ b/src/views/dry/herbFormulaHis/DryHerbFormulaHis.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/dry/dryHerbFormulaHis/list', + save='/dry/dryHerbFormulaHis/add', + edit='/dry/dryHerbFormulaHis/edit', + deleteOne = '/dry/dryHerbFormulaHis/delete', + deleteBatch = '/dry/dryHerbFormulaHis/deleteBatch', + importExcel = '/dry/dryHerbFormulaHis/importExcel', + exportXls = '/dry/dryHerbFormulaHis/exportXls', +} +/** + * 瀵煎嚭api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 瀵煎叆api + */ +export const getImportUrl = Api.importExcel; +/** + * 鍒楄〃鎺ュ彛 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 鍒犻櫎鍗曚釜 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 鎵归噺鍒犻櫎 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '纭鍒犻櫎', + content: '鏄惁鍒犻櫎閫変腑鏁版嵁', + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 淇濆瓨鎴栬�呮洿鏂� + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/src/views/dry/herbFormulaHis/DryHerbFormulaHis.data.ts b/src/views/dry/herbFormulaHis/DryHerbFormulaHis.data.ts new file mode 100644 index 0000000..b1b273a --- /dev/null +++ b/src/views/dry/herbFormulaHis/DryHerbFormulaHis.data.ts @@ -0,0 +1,285 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//鍒楄〃鏁版嵁 +export const columns: BasicColumn[] = [ + { + title: '璁惧', + align:"center", + dataIndex: 'eqpId_dictText' + }, + // { + // title: '宸ュ崟鍙�', + // align:"center", + // dataIndex: 'orderCode' + // }, + { + title: '鏃堕棿', + align:"center", + sorter: true, + dataIndex: 'orderTime', + customRender:({text}) =>{ + return !text?"":(text.length>10?text.substr(0,10):text) + }, + }, + { + title: '绱㈠紩', + align:"center", + sorter: true, + dataIndex: 'formulaIndex' + }, + { + title: '缂栫爜', + align:"center", + dataIndex: 'code' + }, + { + title: '鍚嶇О', + align:"center", + sorter: true, + dataIndex: 'name' + }, + { + title: '绫诲瀷', + align:"center", + sorter: true, + dataIndex: 'typ' + }, + { + title: 'ab', + align:"center", + dataIndex: 'ab' + }, + { + title: '鎶曟枡閲忥紙绛愶級', + align:"center", + dataIndex: 'weight1' + }, + { + title: '鍒濆閲嶉噺', + align:"center", + dataIndex: 'weight2' + }, + { + title: '鐑娓╁害', + align:"center", + dataIndex: 'temp1' + }, + { + title: '鐜娓╁害', + align:"center", + dataIndex: 'temp2' + }, + { + title: '鐜婀垮害', + align:"center", + dataIndex: 'temp3' + }, + { + title: '鑽℃枡寤舵椂ms', + align:"center", + dataIndex: 'delay' + }, + { + title: '缈绘枡娆℃暟', + align:"center", + dataIndex: 'turntime' + }, + { + title: '鍒濆鍚按鐜�', + align:"center", + dataIndex: 'moisture1' + }, + { + title: '鐩爣鍚按鐜�', + align:"center", + dataIndex: 'moisture3' + }, + { + title: '鑽潗鍒嗙被', + align:"center", + dataIndex: 'mtype' + }, + { + title: '鍚按鐜囪ˉ鍋�', + align:"center", + dataIndex: 'moisoffset' + }, + { + title: '鍐烽鏃堕暱', + align:"center", + dataIndex: 'coldwind' + }, + { + title: '绉熸埛id', + align:"center", + dataIndex: 'tenantId' + }, +]; +//鏌ヨ鏁版嵁 +export const searchFormSchema: FormSchema[] = [ + { + label: "璁惧", + field: 'eqpId', + component: 'Input', + colProps: {span: 6}, + }, + { + label: "鏃堕棿", + field: 'orderTime', + component: 'DatePicker', + colProps: {span: 6}, + }, + { + label: "鍚嶇О", + field: 'name', + component: 'Input', + colProps: {span: 6}, + }, + { + label: "绱㈠紩", + field: 'formulaIndex', + component: 'Input', + colProps: {span: 6}, + }, + { + label: "缂栫爜", + field: 'code', + component: 'Input', + colProps: {span: 6}, + }, + + { + label: "绫诲瀷", + field: 'typ', + component: 'Input', + colProps: {span: 6}, + }, +]; +//琛ㄥ崟鏁版嵁 +export const formSchema: FormSchema[] = [ + { + label: '璁惧', + field: 'eqpId', + component: 'Input', + }, + // { + // label: '宸ュ崟鍙�', + // field: 'orderCode', + // component: 'Input', + // }, + { + label: '鏃堕棿', + field: 'orderTime', + component: 'DatePicker', + }, + { + label: '绱㈠紩', + field: 'formulaIndex', + component: 'Input', + }, + { + label: '缂栫爜', + field: 'code', + component: 'Input', + }, + { + label: '鍚嶇О', + field: 'name', + component: 'Input', + }, + { + label: '绫诲瀷', + field: 'typ', + component: 'Input', + }, + { + label: 'ab', + field: 'ab', + component: 'Input', + }, + { + label: '鎶曟枡閲忥紙绛愶級', + field: 'weight1', + component: 'InputNumber', + }, + { + label: '鍒濆閲嶉噺', + field: 'weight2', + component: 'InputNumber', + }, + { + label: '鐑娓╁害', + field: 'temp1', + component: 'InputNumber', + }, + { + label: '鐜娓╁害', + field: 'temp2', + component: 'InputNumber', + }, + { + label: '鐜婀垮害', + field: 'temp3', + component: 'InputNumber', + }, + { + label: '鑽℃枡寤舵椂ms', + field: 'delay', + component: 'InputNumber', + }, + { + label: '缈绘枡娆℃暟', + field: 'turntime', + component: 'InputNumber', + }, + { + label: '鍒濆鍚按鐜�', + field: 'moisture1', + component: 'InputNumber', + }, + { + label: '鐩爣鍚按鐜�', + field: 'moisture3', + component: 'InputNumber', + }, + { + label: '鑽潗鍒嗙被', + field: 'mtype', + component: 'InputNumber', + }, + { + label: '鍚按鐜囪ˉ鍋�', + field: 'moisoffset', + component: 'InputNumber', + }, + { + label: '鍐烽鏃堕暱', + field: 'coldwind', + component: 'InputNumber', + }, + { + label: '绉熸埛id', + field: 'tenantId', + component: 'InputNumber', + }, + // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + + + +/** +* 娴佺▼琛ㄥ崟璋冪敤杩欎釜鏂规硶鑾峰彇formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 榛樿鍜屽師濮嬭〃鍗曚繚鎸佷竴鑷� 濡傛灉娴佺▼涓厤缃簡鏉冮檺鏁版嵁锛岃繖閲岄渶瑕佸崟鐙鐞唂ormSchema + return formSchema; +} diff --git a/src/views/dry/herbFormulaHis/DryHerbFormulaHisList.vue b/src/views/dry/herbFormulaHis/DryHerbFormulaHisList.vue new file mode 100644 index 0000000..91ad6b2 --- /dev/null +++ b/src/views/dry/herbFormulaHis/DryHerbFormulaHisList.vue @@ -0,0 +1,173 @@ +<template> + <div> + <!--寮曠敤琛ㄦ牸--> + <BasicTable @register="registerTable" :rowSelection="rowSelection"> + <!--鎻掓Ы:table鏍囬--> + <template #tableTitle> +<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 鏂板</a-button>--> + <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 瀵煎嚭</a-button> +<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">瀵煎叆</j-upload-button>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <template #overlay> + <a-menu> + <a-menu-item key="1" @click="batchHandleDelete"> + <Icon icon="ant-design:delete-outlined"></Icon> + 鍒犻櫎 + </a-menu-item> + </a-menu> + </template> + <a-button>鎵归噺鎿嶄綔 + <Icon icon="mdi:chevron-down"></Icon> + </a-button> + </a-dropdown> + </template> + <!--鎿嶄綔鏍�--> + <template #action="{ record }"> + <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> + </template> + <!--瀛楁鍥炴樉鎻掓Ы--> + <template #htmlSlot="{text}"> + <div v-html="text"></div> + </template> + <!--鐪佸競鍖哄瓧娈靛洖鏄炬彃妲�--> + <template #pcaSlot="{text}"> + {{ getAreaTextByCode(text) }} + </template> + <template #fileSlot="{text}"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">涓嬭浇</a-button> + </template> + </BasicTable> + <!-- 琛ㄥ崟鍖哄煙 --> + <DryHerbFormulaHisModal @register="registerModal" @success="handleSuccess"></DryHerbFormulaHisModal> + </div> +</template> + +<script lang="ts" name="dry-dryHerbFormulaHis" setup> + import {ref, computed, unref} from 'vue'; + import {BasicTable, useTable, TableAction} from '/@/components/Table'; + import {useModal} from '/@/components/Modal'; + import { useListPage } from '/@/hooks/system/useListPage' + import DryHerbFormulaHisModal from './components/DryHerbFormulaHisModal.vue' + import {columns, searchFormSchema} from './DryHerbFormulaHis.data'; + import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './DryHerbFormulaHis.api'; + import { downloadFile } from '/@/utils/common/renderUtils'; + const checkedKeys = ref<Array<string | number>>([]); + //娉ㄥ唽model + const [registerModal, {openModal}] = useModal(); + //娉ㄥ唽table鏁版嵁 + const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ + tableProps:{ + title: '閰嶆柟璁板綍', + api: list, + columns, + canResize:false, + formConfig: { + //labelWidth: 120, + schemas: searchFormSchema, + autoSubmitOnEnter:true, + showAdvancedButton:true, + fieldMapToNumber: [ + ], + fieldMapToTime: [ + ], + }, + actionColumn: { + width: 120, + fixed:'right' + }, + }, + exportConfig: { + name:"閰嶆柟璁板綍", + url: getExportUrl, + }, + importConfig: { + url: getImportUrl, + success: handleSuccess + }, + }) + + const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext + + /** + * 鏂板浜嬩欢 + */ + function handleAdd() { + openModal(true, { + isUpdate: false, + showFooter: true, + }); + } + /** + * 缂栬緫浜嬩欢 + */ + function handleEdit(record: Recordable) { + openModal(true, { + record, + isUpdate: true, + showFooter: true, + }); + } + /** + * 璇︽儏 + */ + function handleDetail(record: Recordable) { + openModal(true, { + record, + isUpdate: true, + showFooter: false, + }); + } + /** + * 鍒犻櫎浜嬩欢 + */ + async function handleDelete(record) { + await deleteOne({id: record.id}, handleSuccess); + } + /** + * 鎵归噺鍒犻櫎浜嬩欢 + */ + async function batchHandleDelete() { + await batchDelete({ids: selectedRowKeys.value}, handleSuccess); + } + /** + * 鎴愬姛鍥炶皟 + */ + function handleSuccess() { + (selectedRowKeys.value = []) && reload(); + } + /** + * 鎿嶄綔鏍� + */ + function getTableAction(record){ + return [ + { + label: '缂栬緫', + onClick: handleEdit.bind(null, record), + } + ] + } + /** + * 涓嬫媺鎿嶄綔鏍� + */ + function getDropDownAction(record){ + return [ + { + label: '璇︽儏', + onClick: handleDetail.bind(null, record), + }, { + label: '鍒犻櫎', + popConfirm: { + title: '鏄惁纭鍒犻櫎', + confirm: handleDelete.bind(null, record), + } + } + ] + } + + +</script> + +<style scoped> + +</style> diff --git a/src/views/dry/herbFormulaHis/DryHerbFormulaHis_menu_insert.sql b/src/views/dry/herbFormulaHis/DryHerbFormulaHis_menu_insert.sql new file mode 100644 index 0000000..f917845 --- /dev/null +++ b/src/views/dry/herbFormulaHis/DryHerbFormulaHis_menu_insert.sql @@ -0,0 +1,26 @@ +-- 娉ㄦ剰锛氳椤甸潰瀵瑰簲鐨勫墠鍙扮洰褰曚负views/dry鏂囦欢澶逛笅 +-- 濡傛灉浣犳兂鏇存敼鍒板叾浠栫洰褰曪紝璇蜂慨鏀箂ql涓璫omponent瀛楁瀵瑰簲鐨勫�� + + +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('2024081902069470350', NULL, '閰嶆柟璁板綍', '/dry/dryHerbFormulaHisList', 'dry/DryHerbFormulaHisList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0); + +-- 鏉冮檺鎺у埗sql +-- 鏂板 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024081902069470351', '2024081902069470350', '娣诲姞閰嶆柟璁板綍', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_herb_formula_his:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0, 0, '1', 0); +-- 缂栬緫 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024081902069470352', '2024081902069470350', '缂栬緫閰嶆柟璁板綍', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_herb_formula_his:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0, 0, '1', 0); +-- 鍒犻櫎 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024081902069470353', '2024081902069470350', '鍒犻櫎閰嶆柟璁板綍', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_herb_formula_his:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0, 0, '1', 0); +-- 鎵归噺鍒犻櫎 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024081902069470354', '2024081902069470350', '鎵归噺鍒犻櫎閰嶆柟璁板綍', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_herb_formula_his:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0, 0, '1', 0); +-- 瀵煎嚭excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024081902069470355', '2024081902069470350', '瀵煎嚭excel_閰嶆柟璁板綍', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_herb_formula_his:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0, 0, '1', 0); +-- 瀵煎叆excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2024081902069470356', '2024081902069470350', '瀵煎叆excel_閰嶆柟璁板綍', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_herb_formula_his:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-08-19 14:06:35', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/src/views/dry/herbFormulaHis/components/DryHerbFormulaHisForm.vue b/src/views/dry/herbFormulaHis/components/DryHerbFormulaHisForm.vue new file mode 100644 index 0000000..a5955bc --- /dev/null +++ b/src/views/dry/herbFormulaHis/components/DryHerbFormulaHisForm.vue @@ -0,0 +1,70 @@ +<template> + <div style="min-height: 400px"> + <BasicForm @register="registerForm"></BasicForm> + <div style="width: 100%;text-align: center" v-if="!formDisabled"> + <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">鎻� 浜�</a-button> + </div> + </div> +</template> + +<script lang="ts"> + import {BasicForm, useForm} from '/@/components/Form/index'; + import {computed, defineComponent} from 'vue'; + import {defHttp} from '/@/utils/http/axios'; + import { propTypes } from '/@/utils/propTypes'; + import {getBpmFormSchema} from '../DryHerbFormulaHis.data'; + import {saveOrUpdate} from '../DryHerbFormulaHis.api'; + + export default defineComponent({ + name: "DryHerbFormulaHisForm", + components:{ + BasicForm + }, + props:{ + formData: propTypes.object.def({}), + formBpm: propTypes.bool.def(true), + }, + setup(props){ + const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({ + labelWidth: 150, + schemas: getBpmFormSchema(props.formData), + showActionButtonGroup: false, + baseColProps: {span: 24} + }); + + const formDisabled = computed(()=>{ + if(props.formData.disabled === false){ + return false; + } + return true; + }); + + let formData = {}; + const queryByIdUrl = '/dry/dryHerbFormulaHis/queryById'; + async function initFormData(){ + let params = {id: props.formData.dataId}; + const data = await defHttp.get({url: queryByIdUrl, params}); + formData = {...data} + //璁剧疆琛ㄥ崟鐨勫�� + await setFieldsValue(formData); + //榛樿鏄鐢� + await setProps({disabled: formDisabled.value}) + } + + async function submitForm() { + let data = getFieldsValue(); + let params = Object.assign({}, formData, data); + console.log('琛ㄥ崟鏁版嵁', params) + await saveOrUpdate(params, true) + } + + initFormData(); + + return { + registerForm, + formDisabled, + submitForm, + } + } + }); +</script> \ No newline at end of file diff --git a/src/views/dry/herbFormulaHis/components/DryHerbFormulaHisModal.vue b/src/views/dry/herbFormulaHis/components/DryHerbFormulaHisModal.vue new file mode 100644 index 0000000..f396fa1 --- /dev/null +++ b/src/views/dry/herbFormulaHis/components/DryHerbFormulaHisModal.vue @@ -0,0 +1,66 @@ +<template> + <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit"> + <BasicForm @register="registerForm"/> + </BasicModal> +</template> + +<script lang="ts" setup> + import {ref, computed, unref} from 'vue'; + import {BasicModal, useModalInner} from '/@/components/Modal'; + import {BasicForm, useForm} from '/@/components/Form/index'; + import {formSchema} from '../DryHerbFormulaHis.data'; + import {saveOrUpdate} from '../DryHerbFormulaHis.api'; + // Emits澹版槑 + const emit = defineEmits(['register','success']); + const isUpdate = ref(true); + //琛ㄥ崟閰嶇疆 + const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ + //labelWidth: 150, + schemas: formSchema, + showActionButtonGroup: false, + baseColProps: {span: 24} + }); + //琛ㄥ崟璧嬪�� + const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { + //閲嶇疆琛ㄥ崟 + await resetFields(); + setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); + isUpdate.value = !!data?.isUpdate; + if (unref(isUpdate)) { + //琛ㄥ崟璧嬪�� + await setFieldsValue({ + ...data.record, + }); + } + // 闅愯棌搴曢儴鏃剁鐢ㄦ暣涓〃鍗� + setProps({ disabled: !data?.showFooter }) + }); + //璁剧疆鏍囬 + const title = computed(() => (!unref(isUpdate) ? '鏂板' : '缂栬緫')); + //琛ㄥ崟鎻愪氦浜嬩欢 + async function handleSubmit(v) { + try { + let values = await validate(); + setModalProps({confirmLoading: true}); + //鎻愪氦琛ㄥ崟 + await saveOrUpdate(values, isUpdate.value); + //鍏抽棴寮圭獥 + closeModal(); + //鍒锋柊鍒楄〃 + emit('success'); + } finally { + setModalProps({confirmLoading: false}); + } + } +</script> + +<style lang="less" scoped> + /** 鏃堕棿鍜屾暟瀛楄緭鍏ユ鏍峰紡 */ + :deep(.ant-input-number){ + width: 100% + } + + :deep(.ant-calendar-picker){ + width: 100% + } +</style> \ No newline at end of file -- Gitblit v1.9.3