From 432bbf252ffc66393ac10e14958a8c412b3e401c Mon Sep 17 00:00:00 2001
From: zhangxp <zhangxp@chicecm.com>
Date: 星期三, 07 六月 2023 16:06:55 +0800
Subject: [PATCH] 申领单页面只缺一个申领单状态接口

---
 Source/UBCS-WEB/src/components/transfer/index.vue             |    2 
 Source/UBCS-WEB/src/views/integration/applicationForm.vue     |  146 +++++++++++++++++++++++++++++
 Source/UBCS-WEB/src/api/integration/application.js            |   10 ++
 Source/UBCS-WEB/src/api/integration/integration.js            |    4 
 Source/UBCS-WEB/vue.config.js                                 |    4 
 Source/UBCS-WEB/src/views/integration/integrationIndex.vue    |   78 +++++++++------
 Source/UBCS-WEB/src/views/integration/integrationTransfer.vue |   27 ++++-
 7 files changed, 226 insertions(+), 45 deletions(-)

diff --git a/Source/UBCS-WEB/src/api/integration/application.js b/Source/UBCS-WEB/src/api/integration/application.js
new file mode 100644
index 0000000..d95b8a2
--- /dev/null
+++ b/Source/UBCS-WEB/src/api/integration/application.js
@@ -0,0 +1,10 @@
+import request from '@/router/axios';
+
+// 鐢抽鍗曟暟鎹�
+export const getList = (params) => {
+    return request({
+      url: '/api/ubcs-applyjtcodeservice/DockingPreApplyCode/page',
+      method: 'get',
+      params: params
+    })
+  }
\ No newline at end of file
diff --git a/Source/UBCS-WEB/src/api/integration/integration.js b/Source/UBCS-WEB/src/api/integration/integration.js
index 64339d1..5700480 100644
--- a/Source/UBCS-WEB/src/api/integration/integration.js
+++ b/Source/UBCS-WEB/src/api/integration/integration.js
@@ -35,7 +35,7 @@
 // 灞炴�ф槧灏�
 export const gridAttrMapping = (params) => {
   return request({
-    url: '/api//ubcs-applyjtcodeservice/DockingPreApplyCode/gridAttrMapping',
+    url: '/api/ubcs-applyjtcodeservice/DockingPreApplyCode/gridAttrMapping',
     method: 'get',
     params: params
   })
@@ -63,6 +63,6 @@
   return request({
     url: '/api/ubcs-applyjtcodeservice/DockingPreApplyCode/syncClassifyModel',
     method: 'post',
-    data: params
+    params: params
   })
 }
\ No newline at end of file
diff --git a/Source/UBCS-WEB/src/components/transfer/index.vue b/Source/UBCS-WEB/src/components/transfer/index.vue
index 99639fd..cb2c5cc 100644
--- a/Source/UBCS-WEB/src/components/transfer/index.vue
+++ b/Source/UBCS-WEB/src/components/transfer/index.vue
@@ -128,11 +128,9 @@
 
         targetData() {
             if (this.targetOrder === 'original') {
-                console.log('11111')
                 return this.data.filter(item =>  this.value.indexOf(item) > -1
                 );
             } else {
-                console.log('22222')
                 return this.value.reduce((arr, cur) => {
                     const val = this.dataObj[cur];
                     if (val) {
diff --git a/Source/UBCS-WEB/src/views/integration/applicationForm.vue b/Source/UBCS-WEB/src/views/integration/applicationForm.vue
index e69de29..7a3c48b 100644
--- a/Source/UBCS-WEB/src/views/integration/applicationForm.vue
+++ b/Source/UBCS-WEB/src/views/integration/applicationForm.vue
@@ -0,0 +1,146 @@
+<template>
+    <basic-container>
+        <avue-crud :table-loading="loading" :data="data" :option="option" :search.sync="searchParam" :page.sync="page"
+            ref="crud" @refresh-change="getDataList" @search-change="handleSearch" @search-reset="handleReset"
+            @size-change="handleSizePage" @current-change="handleCurrentPage" @on-load="getDataList">
+            <template slot="menuLeft">
+                <el-button icon="el-icon-document" size="small" type="primary" @click="handleStatus">闆嗗洟鐢宠鐘舵��
+                </el-button>
+            </template>
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import { getList } from '@/api/integration/application.js'
+import { dateFormat } from '@/util/date.js'
+export default {
+    data() {
+        return {
+            loading: false,
+            data: [],
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0
+            },
+            searchParam: {},
+            option: {
+                height: "auto",
+                index: true,
+                border: true,
+                addBtn: false,
+                columnBtn: false,
+                searchMenuSpan: 8,
+                highlightCurrentRow: true,
+                menu:false,
+                column: [
+                    {
+                        label: '鐢宠鍗曞彿',
+                        prop: 'id',
+                        width: 300,
+                        fixed: true,
+                        search: true,
+                    }, {
+                        label: '闆嗗洟鐮�',
+                        width: 200,
+                        prop: 'groupCode',
+                        search: true,
+                    }, {
+                        label: '鎿嶄綔绫诲瀷',
+                        width: 200,
+                        prop: 'operationType',
+                        type: 'select',
+                        search: true,
+                        dicData: [{
+                            label: '鐢宠',
+                            value: 1
+                        }, {
+                            label: '鏇存敼',
+                            value: 2
+                        }]
+                    }, {
+                        label: '鐢宠鍗曟暟鎹俊鎭�',
+                        width: 300,
+                        prop: 'description'
+                    },
+                    {
+                        label: '鍒涘缓鏃堕棿',
+                        width: 200,
+                        prop: 'createTime',
+                        type: 'datetime',
+                        search: true,
+                    },
+                    {
+                        label: '鏇存敼鏃堕棿',
+                        width: 200,
+                        prop: 'lastModifyTime',
+                        type: 'datetime',
+                        search: true,
+                        formatter: () => {
+
+                        }
+                    }, {
+                        label: '杩斿洖鏍囪瘑',
+                        width: 100,
+                        prop: 'code'
+                    },
+                    {
+                        label: '杩斿洖淇℃伅',
+                        width: 300,
+                        prop: 'content'
+                    },
+                    {
+                        label: '娑堟伅淇℃伅',
+                        width: 300,
+                        prop: 'msg'
+                    }
+                ]
+            }
+        }
+    },
+    methods: {
+        handleStatus() {
+
+        },
+        async getDataList() {
+            this.loading = true
+            console.log(this.searchParam)
+            const { pageSize, currentPage, total } = this.page
+            let param = { size: pageSize, current: currentPage }
+            const response = await getList({ ...param, ...this.searchParam })
+            if (response.status === 200) {
+                this.loading = false
+                console.log(response)
+                const data = response.data.data
+                this.data = data.records
+                this.page.total = data.total
+            } else this.loading = false
+        },
+        handleSizePage(event) {
+            this.page.pageSize = event
+        },
+        handleCurrentPage(event) {
+            this.page.currentPage = event
+        },
+        handleReset() {
+            this.searchParam = {}
+        },
+        handleSearch(form, done) {
+            const { id, groupCode, operationType } = form
+            let dataTime = { id, groupCode, operationType }
+            if (form.hasOwnProperty('createTime')) {
+                dataTime = { createTime: dateFormat(form.createTime), ...dataTime }
+            }
+            if (form.hasOwnProperty('lastModifyTime')) {
+                dataTime = { lastModifyTime: dateFormat(form.lastModifyTime), ...dataTime }
+            }
+            console.log(dataTime)
+            this.searchParam = dataTime
+            this.page.currentPage = 1
+            this.getDataList()
+            done()
+        }
+    }
+}
+</script>
\ No newline at end of file
diff --git a/Source/UBCS-WEB/src/views/integration/integrationIndex.vue b/Source/UBCS-WEB/src/views/integration/integrationIndex.vue
index b3ae9fc..1c3a45a 100644
--- a/Source/UBCS-WEB/src/views/integration/integrationIndex.vue
+++ b/Source/UBCS-WEB/src/views/integration/integrationIndex.vue
@@ -16,7 +16,7 @@
                 <el-card>
                     <el-form :model="form">
                         <el-form-item label="闆嗗洟鍒嗙被" label-width="70px" size="small">
-                            <el-select clearable ref="selectTree" v-model="form.groupValue" placeholder="璇烽�夋嫨"
+                            <el-select clearable ref="selectTree" v-model="groupVal" placeholder="璇烽�夋嫨"
                                 popper-class="popperTreeSelect">
                                 <el-option :value="groupVal" :label="groupVal">
                                     <el-tree ref="groupTree" :data="groupTreeData" empty-text="鏆傛棤鏁版嵁" :props="defaultProps"
@@ -33,11 +33,16 @@
                             @row-dblclick="handleMapingRowClick" @selection-change="selectionChange" @select="setCurrentRow"
                             @select-all="handleSelectAll">
                             <template slot="menuLeft">
-                                <el-button icon="el-icon-plus" size="small" type="primary" :disabled="disabledPush" @click="dialogPush = true">鏂� 澧�
+                                <el-button icon="el-icon-plus" size="small" type="primary" :disabled="disabledPush"
+                                    @click="dialogPush = true">鏂� 澧�
                                 </el-button>
                                 <el-button icon="el-icon-check" size="small" type="primary" @click="handleSave">淇� 瀛�
                                 </el-button>
-                                <el-button icon="el-icon-connection" size="small" type="primary" @click="handleSync">鍚屾妯″瀷
+                                <el-button icon="el-icon-connection" size="small" type="primary"
+                                    @click="handleSync('all')">鍚屾涓绘ā鍨�
+                                </el-button>
+                                <el-button icon="el-icon-connection" size="small" type="primary"
+                                    @click="handleSync('one')">鍚屾璇︾粏妯″瀷
                                 </el-button>
                             </template>
                         </avue-crud>
@@ -50,23 +55,8 @@
                 </el-card>
             </el-main>
         </el-container>
-        <!-- <el-dialog title="缂栫爜灞炴��" :visible.sync="dialogPush" append-to-body="true" destroy-on-close width="30%"
-            :before-close="handleClose">
-            <el-form :model="form">
-                <el-form-item label="鏌ヨ鏉′欢" label-width="70px" size="small">
-                    <el-input v-model="form.name" autocomplete="off" @change="handleQuery"></el-input>
-                </el-form-item>
-            </el-form>
-            <p class="text_tip">*閫夋嫨鍒嗙被杩涜灞炴�ц繃婊�, 鎴栬�呰緭鍏ュ睘鎬х殑鍏ㄦ嫾鎴栬�呯畝鎷艰繘琛屾煡璇�! 濡�: 濮撳悕 (鍙緭鍏m鎴杧inming )</p>
-            <transfer v-model="transferValue" :data="transferData" :filter-method="filterMethod"
-                filter-placeholder="璇疯緭鍏ユ嫾闊冲叏鎷兼垨鑰呮嫾闊崇缉鍐�" :props="transferProps"></transfer>
-            <span slot="footer" class="dialog-footer">
-                <el-button @click="dialogPush = false">鍙� 娑�</el-button>
-                <el-button type="primary" @click="handelTransferSave">淇� 瀛�</el-button>
-            </span>
-        </el-dialog> -->
-        <integration-transfer :visible.sync="dialogPush" :data="transferData" :props="transferProps"
-            @save="handelTransferSave"></integration-transfer>
+        <integration-transfer :visible.sync="dialogPush" :data="transferData" :disabledData="filtermapping"
+            :props="transferProps" @save="handelTransferSave"></integration-transfer>
     </div>
 </template>
 <script>
@@ -196,6 +186,17 @@
         window.handleBlur = that.handleBlur
 
     },
+    computed: {
+        filtermapping() {
+            const data = this.mappingData.filter(item => {
+                return !(Object.prototype.hasOwnProperty.call(item, 'targetAttrName') && (item.targetAttrName === null || item.targetAttrName === undefined || item.targetAttrName === ""))
+            })
+            const transfer = data.map(obj => {
+                return obj.targetAttrName
+            })
+            return transfer
+        }
+    },
     methods: {
         // 鎺ュ彛宸︿晶鏍�
         async getReferCodeClassifyTree() {
@@ -220,6 +221,7 @@
             if (response.status === 200) {
                 this.loading = false
                 this.mappingData = response.data.data
+                console.log(this.filtermapping)
             }
         },
         // 鎺ュ彛鑾峰彇灞炴�ф槧灏勫彇鍊艰寖鍥�
@@ -276,11 +278,25 @@
                     message: "淇濆瓨鎴愬姛!"
                 });
             }
-
         },
         // 鍚屾鏁版嵁
-        async handleSync() {
-            const response = await syncClassifyModel({ dockingPreAttrMappingVOList: this.tableData })
+        async handleSync(type = 'all') {
+            let param = { operationType: type }
+            if (type === 'one') {
+                param.classifyId = this.form.groupValue
+            }
+            if (this.form.groupValue === '' && type === 'one') {
+                this.$message({
+                    type: "error",
+                    message: "璇烽�夋嫨涓�鏉¢泦鍥㈠垎绫�"
+                });
+            } else {
+                console.log(param)
+                const response = await syncClassifyModel(param)
+                if (response.status === 200) {
+                    console.log(response)
+                }
+            }
         },
         handelTransferSave(event) {
             let that = this
@@ -295,7 +311,7 @@
                 const findRow = that.mappingData.findIndex(item => item.metaListId === that.mappingForm.metaListId)
                 that.mappingData[findRow].targetAttrName = transferValue[0].name
                 that.mappingData[findRow].targetAttrId = transferValue[0].oid
-                this.dialogPush =false
+                this.dialogPush = false
             }
 
         },
@@ -312,7 +328,7 @@
         },
         // 闆嗗洟鍒嗙被鏍戠偣鍑�
         handleNodeClick(data) {
-            this.form.groupValue = data.name
+            this.form.groupValue = data.oid
             this.groupVal = data.name
             this.$refs.selectTree.blur()
             this.getGridAttrMapping(data.oid)
@@ -328,14 +344,13 @@
             if (event === 'mapping') this.$refs.crudMapping.rowCell(this.mappingForm, this.mappingForm.$index)
         },
         // 闆嗗洟鏄犲皠灞炴�ц閫夋嫨鍗曞厓鏍肩紪杈戯紙鍙屽嚮锛�
-        handleMapingRowClick(row, column, cell, event) {
-            console.log(row)
+        handleMapingRowClick(row, column) {
             clearTimeout(this.times)
             this.mappingForm = row
             if (column.label === '榛樿鍊�' || column.label === '灞炴�у悕绉�') this.$refs.crudMapping.rowCell(row, row.$index)
         },
         // 闆嗗洟鏄犲皠灞炴�ц閫夋嫨锛堝崟鍑伙級
-        handleMapingClick(row, column, cell, event) {
+        handleMapingClick(row) {
             clearTimeout(this.times)
             this.mappingForm = row
             this.times = setTimeout(() => {
@@ -343,15 +358,14 @@
             }, 300)
         },
         // 灞炴�у彇鍊艰寖鍥村崟鍏冩牸缂栬緫锛堝弻鍑伙級
-        handleRowClick(row, column, cell, event) {
+        handleRowClick(row) {
             this.rangeForm = row
             this.$refs.crudRange.rowCell(row, row.$index)
         },
         // 灞炴�у彇鍊艰寖鍥村崟鍏冩牸缂栬緫鍚�
-        handleUpdate(row, index, done, loading) {
+        handleUpdate(row, index, done) {
             console.log(row)
             console.log(index)
-            let data = []
             const findRow = this.mappingData.findIndex(item => item.metaListId === row.metaListId)
             this.rangeData[index] = row
             console.log(this.rangeData)
@@ -365,7 +379,7 @@
             done();
         },
         // 灞炴�у彇鍊艰寖鍥村崟鍏冩牸缂栬緫鍚�
-        handleMapingUpdate(row, index, done, loading) {
+        handleMapingUpdate(row, index, done) {
             console.log(row)
             console.log('淇敼鍚�', row)
             this.$message({
diff --git a/Source/UBCS-WEB/src/views/integration/integrationTransfer.vue b/Source/UBCS-WEB/src/views/integration/integrationTransfer.vue
index 6b311ce..892bd7a 100644
--- a/Source/UBCS-WEB/src/views/integration/integrationTransfer.vue
+++ b/Source/UBCS-WEB/src/views/integration/integrationTransfer.vue
@@ -22,13 +22,14 @@
     components: {
         transfer
     },
-    name: 'Integration',
+    name: 'IntegrationTransfer',
     props: {
         // 鏄惁鎵撳紑
         visible: {
             typeof: Boolean,
             default: false
         },
+        // 寮圭獥鏍囬
         title: {
             typeof: String,
             default: '缂栫爜灞炴��'
@@ -48,6 +49,11 @@
                     disabled: 'disabled'
                 };
             }
+        },
+        // 濡傛灉鏈夌壒娈婃搷浣滐紝涓�鏉℃暟鎹彧鑳界敤涓�娆$殑鎿嶄綔锛屽氨闇�瑕佹妸绂佺敤鐨勬暟鎹瓧娈电敤lebel瀵瑰簲鐨勫�间紶閫掕繃鏉�
+        disabledData: {
+            typeof: Array,
+            default: () => []
         },
         // 鏌ヨ鏂囨湰妗嗙殑placeholder
         filterPlaceholder: {
@@ -75,14 +81,21 @@
             pinyin.setOptions({ checkPolyphone: false, charCase: 1 });
             let name = this.props.label
             let key = this.props.key
-            let objs = this.data.map(item => {
+            let data = this.data.map(item => {
+                let objitem = { disabled: false, ...item }
+                if (this.disabledData.length !== 0) {
+                    this.disabledData.forEach(element => {
+                        if (objitem[name] === element)  objitem.disabled = true
+                    });
+                }
+                return objitem
+            })
+            return data.map(item => {
                 let pinYin = pinyin.getFullChars(item[this.props.label])
                 let renPing = pinyin.getCamelChars(item[this.props.label])
-                const obj = { pinyins: pinYin, renPing: renPing, disabled: false, [name]: item[this.props.label], [key]: item[this.props.key] }
+                const obj = { pinyins: pinYin, renPing: renPing, [name]: item[this.props.label], [key]: item[this.props.key], disabled: item.disabled }
                 return obj
             })
-            console.log(objs)
-            return objs
         }
     },
     methods: {
@@ -102,8 +115,8 @@
         },
         // 纭畾鎸夐挳锛岃繑鍥炲綋鍓嶆暟鎹拰淇敼鍚庣殑鏁版嵁
         handelTransferSave() {
-            let that =this
-            let datas= that.newdata
+            let that = this
+            let datas = that.newdata
             const findtra = datas.findIndex(item => item.oid === that.transferValue[0].oid)
             datas[findtra].disabled = true
             const obj = {
diff --git a/Source/UBCS-WEB/vue.config.js b/Source/UBCS-WEB/vue.config.js
index 99a052c..9beaffe 100644
--- a/Source/UBCS-WEB/vue.config.js
+++ b/Source/UBCS-WEB/vue.config.js
@@ -26,11 +26,11 @@
     proxy: {
       '/api': {
         //鏈湴鏈嶅姟鎺ュ彛鍦板潃
-        target: 'http://localhost:37000',
+        // target: 'http://localhost:37000',
         // target: 'http://192.168.1.63:37000',
         //target: 'http://192.168.3.7:37000',
         // target: 'http://dev.vci-tech.com:37000',
-        //target: 'http://dev.vci-tech.com:37000',
+        target: 'http://dev.vci-tech.com:37000',
         // target: 'http://192.168.1.51:37000/',
         //杩滅▼婕旂ず鏈嶅姟鍦板潃,鍙敤浜庣洿鎺ュ惎鍔ㄩ」鐩�
         // target: 'https://saber.bladex.vip/api',

--
Gitblit v1.9.3