From aed6fe7716c2d0b456a67be7753a2e9c8f0b7e11 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 29 八月 2025 17:28:30 +0800 Subject: [PATCH] 开发DNC首页集成三维工艺列表页面 --- src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue | 138 ++++++++++ src/views/dashboard/SyncProcessList.vue | 228 +++++++++++++++++ src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.Style#Drawer.vue | 158 ++++++++++++ src/views/dashboard/dncIndex/DncManagerSignage.vue | 29 ++ src/views/dnc/base/SyncProcessSpecificationInfoList.vue | 192 ++++++++++++++ 5 files changed, 742 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/SyncProcessList.vue b/src/views/dashboard/SyncProcessList.vue new file mode 100644 index 0000000..3800ad6 --- /dev/null +++ b/src/views/dashboard/SyncProcessList.vue @@ -0,0 +1,228 @@ +<template> + <div class="sync-process-container"> + <a-spin :spinning="loading"> + <a-table + :columns="columns" + :data-source="syncProcessList" + rowKey="id" + :pagination="false" + class="process-table" + :scroll="{ y: 400 }" + > + + <span slot="action" slot-scope="text, record"> + <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handleInspection(record.id)"> + <a>棰嗗彇</a> + </a-popconfirm> + </span> + </a-table> + </a-spin> + + <!-- 琛ㄥ崟鍖哄煙 --> + <syncProcessSpecificationInfo-modal ref="modalForm" @ok="modalFormOk"></syncProcessSpecificationInfo-modal> + </div> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import SyncProcessSpecificationInfoModal from '../dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@api/manage' + +export default { + name: "SyncProcessSpecificationInfoList", + mixins: [JeecgListMixin], + components: { + SyncProcessSpecificationInfoModal + }, + data() { + return { + syncProcessList: [], + url: { + list: '/dnc/home/syncProcessSpecificationInfo', + isSameNode: '/assign/flow/isSameNode', + receiveInspectionOrder:"/dnc/home/receiveTree" + }, + // 琛ㄦ牸鍒楅厤缃� + columns: [ + { + title: '浜у搧浠e彿', + align: "center", + dataIndex: 'productCode', + scopedSlots: { customRender: 'productCode' }, + width: '10%' + }, + { + title: '閮ㄤ欢鍚嶇О', + align: "center", + dataIndex: 'partName', + }, + { + title: '閮ㄤ欢缂栧彿', + align: "center", + dataIndex: 'partNumber', + }, + { + title: '閮ㄤ欢鐗堟湰', + align: "center", + dataIndex: 'partVersion', + }, + { + title: '宸ヨ壓瑙勭▼缂栧彿', + align: "center", + dataIndex: 'planNumber', + }, + { + title: '宸ヨ壓瑙勭▼鐗堟湰', + align: "center", + dataIndex: 'planVersion', + }, + { + title: '鍙戝竷鏃堕棿', + align: "center", + dataIndex: 'createTime' + }, + { + title: '鎿嶄綔', + align: "center", + scopedSlots: { customRender: 'action' }, + } + ] + }; + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + handleReceive(item) { + console.log('棰嗗彇浠诲姟', item); + // 瀹為檯涓氬姟涓皟鐢ㄩ鍙栨帴鍙� + this.$message.success('浠诲姟棰嗗彇鎴愬姛'); + // 鏇存柊鏈湴鏁版嵁鐘舵�� + this.syncProcessList = this.syncProcessList.map(i => + i.id === item.id ? {...i, isReceive: true} : i + ); + }, + loadData() { + this.syncProcessList = []; + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!'); + return; + } + this.loading = true; + getAction(this.url.list).then((res) => { + if (res.success) { + // 浣跨敤鐪熷疄鎺ュ彛鏁版嵁 + this.syncProcessList = res.result.records || res.result; + } else { + this.$message.warning(res.message); + } + }).finally(() => { + this.loading = false; + }); + }, + /** + * 棰嗗彇 + * @param id + */ + handleInspection(id) { + var that = this + this.loading = true + getAction(that.url.receiveInspectionOrder, { id }) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + this.loading = false + } + }) + }, + }, + mounted() { + this.loadData(); + } +} +</script> + +<style scoped> +@import '~@assets/less/common.less'; + +.sync-process-container { + padding: 16px; + background-color: #fff; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09); + height: 500px; + display: flex; + flex-direction: column; +} + +.table-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + flex-shrink: 0; +} + +.table-title { + font-size: 16px; + font-weight: 600; + color: #1d2129; +} + +.more-button { + background-color: #1890ff; + border-color: #1890ff; + font-weight: 500; +} + +.more-button:hover { + background-color: #40a9ff; + border-color: #40a9ff; +} + +/* 琛ㄦ牸鏍峰紡 */ +.process-table { + flex: 1; + overflow: hidden; +} + +/* 浜у搧浠e彿閾炬帴鏍峰紡 */ +.process-table >>> .ant-table-tbody a { + color: #1890ff; + transition: color 0.3s; + font-weight: 500; +} + +.process-table >>> .ant-table-tbody a:hover { + color: #40a9ff; + text-decoration: underline; +} + +/* 鎿嶄綔鎸夐挳鏍峰紡 */ +.process-table >>> .ant-btn-link { + padding: 0 4px; +} + +/* 琛ㄦ牸琛屾偓鍋滄晥鏋� */ +.process-table >>> .ant-table-row:hover td { + background-color: #f0f8ff !important; + cursor: pointer; +} + +/* 琛ㄦ牸婊氬姩鍖哄煙鏍峰紡 */ +.process-table >>> .ant-table-body { + overflow-y: auto !important; +} +</style> \ No newline at end of file diff --git a/src/views/dashboard/dncIndex/DncManagerSignage.vue b/src/views/dashboard/dncIndex/DncManagerSignage.vue index b2fe580..a4a13c6 100644 --- a/src/views/dashboard/dncIndex/DncManagerSignage.vue +++ b/src/views/dashboard/dncIndex/DncManagerSignage.vue @@ -20,8 +20,12 @@ <!-- 鍙充晶涓や釜灏忓崱鐗� --> <div class="right-cards"> <div class="card top-card"> - <h2 class="card-title">鍗$墖1</h2> + <h2 class="card-title">涓夌淮宸ヨ壓鐢熸垚浜у搧缁撴瀯鏍�</h2> + <h2 class="more-btns" @click = "gotoSyncProcessList">鏇村</h2> <div class="card-content"> + <syncProcessList + ref="syncProcessList" + ></syncProcessList> </div> </div> @@ -36,11 +40,14 @@ <script> import TodoList from '@views/dashboard/TodoList.vue' +import SyncProcessList from '@views/dashboard/SyncProcessList.vue' + export default { name: 'DncManagerSignage', components: { - TodoList + TodoList, + SyncProcessList }, data() { return { @@ -56,7 +63,10 @@ methods: { gotoTodoList() { this.$router.push('/flowable/workflow/FlowTodo') - } + }, + gotoSyncProcessList(){ + this.$router.push('/dnc/base/SyncProcessSpecificationInfoList') + }, } } </script> @@ -116,6 +126,19 @@ border: none; cursor: pointer; } + +.more-btns { + position: absolute; + top: 140px; + right: 40px; + color: #1890ff; + font-size: 14px; + background: none; + border: none; + cursor: pointer; + text-decoration: none; + z-index: 10; +} .top-card { flex: 1; } diff --git a/src/views/dnc/base/SyncProcessSpecificationInfoList.vue b/src/views/dnc/base/SyncProcessSpecificationInfoList.vue new file mode 100644 index 0000000..cb5201f --- /dev/null +++ b/src/views/dnc/base/SyncProcessSpecificationInfoList.vue @@ -0,0 +1,192 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="浜у搧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" v-model="queryParam.productName"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="浜у搧浠e彿"> + <a-input placeholder="璇疯緭鍏ヤ骇鍝佷唬鍙�" v-model="queryParam.productCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="閮ㄤ欢鍚嶇О"> + <a-input placeholder="璇疯緭鍏ラ儴浠跺悕绉�" v-model="queryParam.partName"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="閮ㄤ欢缂栧彿"> + <a-input placeholder="璇疯緭鍏ラ儴浠剁紪鍙�" v-model="queryParam.partNumber"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handleInspection(record.id)"> + <a>棰嗗彇</a> + </a-popconfirm> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <syncProcessSpecificationInfo-modal ref="modalForm" @ok="modalFormOk"></syncProcessSpecificationInfo-modal> + </a-card> +</template> + +<script> + import '@assets/less/TableExpand.less' + import SyncProcessSpecificationInfoModal from './modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction } from '@api/manage' + + export default { + name: "SyncProcessSpecificationInfoList", + mixins:[JeecgListMixin], + components: { + SyncProcessSpecificationInfoModal + }, + data () { + return { + description: '涓夌淮宸ヨ壓宸ヨ壓瑙勭▼淇℃伅绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title: '浜у搧鍚嶇О', + align:"center", + dataIndex: 'productName' + }, + { + title: '浜у搧浠e彿', + align:"center", + dataIndex: 'productCode' + }, + { + title: '閮ㄤ欢鍚嶇О', + align:"center", + dataIndex: 'partName' + }, + { + title: '閮ㄤ欢缂栧彿', + align:"center", + dataIndex: 'partNumber' + }, + { + title: '閮ㄤ欢鐗堟湰', + align:"center", + dataIndex: 'partVersion' + }, + { + title: '宸ヨ壓瑙勭▼缂栧彿', + align:"center", + dataIndex: 'planNumber' + }, + { + title: '宸ヨ壓瑙勭▼鐗堟湰', + align:"center", + dataIndex: 'planVersion' + }, + { + title: '鏄惁棰嗗彇', + align:"center", + dataIndex: 'isReceive_dictText' + }, + { + title: '鍙戝竷鏃堕棿', + align:"center", + dataIndex: 'createTime' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/dnc/home/syncProcessSpecificationInfo", + receiveInspectionOrder:"/dnc/home/receiveTree" + }, + } + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + /** + * 棰嗗彇 + * @param id + */ + handleInspection(id) { + var that = this + this.loading = true + getAction(that.url.receiveInspectionOrder, { id }) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + this.loading = false + } + }) + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git "a/src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.Style\043Drawer.vue" "b/src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.Style\043Drawer.vue" new file mode 100644 index 0000000..21a603f --- /dev/null +++ "b/src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.Style\043Drawer.vue" @@ -0,0 +1,158 @@ +<template> + <a-drawer + :title="title" + :width="800" + placement="right" + :closable="false" + @close="close" + :visible="visible"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataType" label="鏁版嵁绫诲瀷"> + <a-input placeholder="璇疯緭鍏ユ暟鎹被鍨�" v-model="model.dataType" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeNo" label="鏇存敼鍗曞彿"> + <a-input placeholder="璇疯緭鍏ユ洿鏀瑰崟鍙�" v-model="model.changeNo" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName" label="閮ㄤ欢鍚嶇О"> + <a-input placeholder="璇疯緭鍏ラ儴浠跺悕绉�" v-model="model.partName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber" label="閮ㄤ欢缂栧彿"> + <a-input placeholder="璇疯緭鍏ラ儴浠剁紪鍙�" v-model="model.partNumber" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partVersion" label="閮ㄤ欢鐗堟湰"> + <a-input placeholder="璇疯緭鍏ラ儴浠剁増鏈�" v-model="model.partVersion" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planNumber" label="宸ヨ壓瑙勭▼缂栧彿"> + <a-input placeholder="璇疯緭鍏ュ伐鑹鸿绋嬬紪鍙�" v-model="model.planNumber" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planVersion" label="宸ヨ壓瑙勭▼鐗堟湰"> + <a-input placeholder="璇疯緭鍏ュ伐鑹鸿绋嬬増鏈�" v-model="model.planVersion" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isReceive" label="鏄惁棰嗗彇"> + <a-input placeholder="璇疯緭鍏ユ槸鍚﹂鍙�" v-model="model.isReceive" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createDate" label="鍙戝竷鏃堕棿"> + <a-date-picker showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="model.createDate" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jsonData" label="json瀛楃涓蹭俊鎭�"> + <a-input placeholder="璇疯緭鍏son瀛楃涓蹭俊鎭�" v-model="model.jsonData" /> + </a-form-model-item> + + </a-form-model> + </a-spin> + + <div class="drawer-bootom-button"> + <a-button type="primary" @click="handleOk">纭畾</a-button> + <a-button type="primary" @click="handleCancel">鍙栨秷</a-button> + </div> + </a-drawer> +</template> + +<script> + import { httpAction } from '@api/manage' + import moment from "moment" + + export default { + name: "SyncProcessSpecificationInfoModal", + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + }, + url: { + add: "/dnc/syncProcessSpecificationInfo/add", + edit: "/dnc/syncProcessSpecificationInfo/edit", + }, + } + }, + created () { + }, + methods: { + add () { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + /**Button鎸夐挳闂磋窛*/ + .ant-btn { + margin-left: 30px; + margin-bottom: 30px; + float: right; + } + /**鎶藉眽鎸夐挳鏍峰紡*/ + .drawer-bootom-button { + position: absolute; + bottom: -8px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file diff --git a/src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue b/src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue new file mode 100644 index 0000000..595772e --- /dev/null +++ b/src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue @@ -0,0 +1,138 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataType" label="鏁版嵁绫诲瀷"> + <a-input placeholder="璇疯緭鍏ユ暟鎹被鍨�" v-model="model.dataType" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeNo" label="鏇存敼鍗曞彿"> + <a-input placeholder="璇疯緭鍏ユ洿鏀瑰崟鍙�" v-model="model.changeNo" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName" label="閮ㄤ欢鍚嶇О"> + <a-input placeholder="璇疯緭鍏ラ儴浠跺悕绉�" v-model="model.partName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber" label="閮ㄤ欢缂栧彿"> + <a-input placeholder="璇疯緭鍏ラ儴浠剁紪鍙�" v-model="model.partNumber" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partVersion" label="閮ㄤ欢鐗堟湰"> + <a-input placeholder="璇疯緭鍏ラ儴浠剁増鏈�" v-model="model.partVersion" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planNumber" label="宸ヨ壓瑙勭▼缂栧彿"> + <a-input placeholder="璇疯緭鍏ュ伐鑹鸿绋嬬紪鍙�" v-model="model.planNumber" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planVersion" label="宸ヨ壓瑙勭▼鐗堟湰"> + <a-input placeholder="璇疯緭鍏ュ伐鑹鸿绋嬬増鏈�" v-model="model.planVersion" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isReceive" label="鏄惁棰嗗彇"> + <a-input placeholder="璇疯緭鍏ユ槸鍚﹂鍙�" v-model="model.isReceive" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createDate" label="鍙戝竷鏃堕棿"> + <a-date-picker showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="model.createDate" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jsonData" label="json瀛楃涓蹭俊鎭�"> + <a-input placeholder="璇疯緭鍏son瀛楃涓蹭俊鎭�" v-model="model.jsonData" /> + </a-form-model-item> + + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { httpAction } from '@api/manage' + import moment from "moment" + + export default { + name: "SyncProcessSpecificationInfoModal", + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + }, + url: { + add: "/dnc/syncProcessSpecificationInfo/add", + edit: "/dnc/syncProcessSpecificationInfo/edit", + }, + } + }, + created () { + }, + methods: { + add () { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file -- Gitblit v1.9.3