Commit a571fb027fa3d875deb25c8bc39f1ba1bcb208d7
1 parent
5ca571fe
更新门店归属管理功能,删除不再使用的LqMdMdgs相关服务、DTO和实体类,优化LqMdxx服务以支持新字段,调整前端表单以适应新结构,确保代码整洁和功能完整性。
Showing
21 changed files
with
1424 additions
and
841 deletions
antis-ncc-admin/src/views/lqMdMdgs/index.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="NCC-common-layout"> | 2 | <div class="NCC-common-layout"> |
| 3 | <div class="NCC-common-layout-center"> | 3 | <div class="NCC-common-layout-center"> |
| 4 | + <!-- 搜索区域 --> | ||
| 4 | <el-row class="NCC-common-search-box" :gutter="16"> | 5 | <el-row class="NCC-common-search-box" :gutter="16"> |
| 5 | <el-form @submit.native.prevent> | 6 | <el-form @submit.native.prevent> |
| 6 | - <el-col :span="6"> | 7 | + <el-col :span="5"> |
| 7 | <el-form-item label="门店编码"> | 8 | <el-form-item label="门店编码"> |
| 8 | - <el-input v-model="query.id" placeholder="门店编码" clearable /> | 9 | + <el-input |
| 10 | + v-model="query.mdbm" | ||
| 11 | + placeholder="请输入门店编码" | ||
| 12 | + clearable | ||
| 13 | + prefix-icon="el-icon-search" | ||
| 14 | + style="border-radius: 6px;" | ||
| 15 | + /> | ||
| 9 | </el-form-item> | 16 | </el-form-item> |
| 10 | </el-col> | 17 | </el-col> |
| 11 | - <el-col :span="6"> | ||
| 12 | - <el-form-item label="单据门店编号"> | ||
| 13 | - <el-input v-model="query.djmdbh" placeholder="单据门店编号" clearable /> | 18 | + <el-col :span="5"> |
| 19 | + <el-form-item label="门店名称"> | ||
| 20 | + <el-input | ||
| 21 | + v-model="query.dm" | ||
| 22 | + placeholder="请输入门店名称" | ||
| 23 | + clearable | ||
| 24 | + prefix-icon="el-icon-search" | ||
| 25 | + style="border-radius: 6px;" | ||
| 26 | + /> | ||
| 14 | </el-form-item> | 27 | </el-form-item> |
| 15 | </el-col> | 28 | </el-col> |
| 16 | - <el-col :span="6"> | 29 | + <el-col :span="5"> |
| 17 | <el-form-item label="单据门店"> | 30 | <el-form-item label="单据门店"> |
| 18 | - <el-input v-model="query.djmd" placeholder="单据门店" clearable /> | ||
| 19 | - </el-form-item> | ||
| 20 | - </el-col> | ||
| 21 | - <template v-if="showAll"> | ||
| 22 | - <el-col :span="6"> | ||
| 23 | - <el-form-item label="事业部"> | ||
| 24 | - <el-select v-model="query.syb" placeholder="事业部" clearable > | ||
| 25 | - <el-option v-for="(item, index) in sybOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 26 | - </el-select> | ||
| 27 | - </el-form-item> | ||
| 28 | - </el-col> | ||
| 29 | - <el-col :span="6"> | ||
| 30 | - <el-form-item label="教育部"> | ||
| 31 | - <el-select v-model="query.jyb" placeholder="教育部" clearable > | ||
| 32 | - <el-option v-for="(item, index) in jybOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 33 | - </el-select> | ||
| 34 | - </el-form-item> | ||
| 35 | - </el-col> | ||
| 36 | - <el-col :span="6"> | ||
| 37 | - <el-form-item label="科技部"> | ||
| 38 | - <el-select v-model="query.kjb" placeholder="科技部" clearable > | ||
| 39 | - <el-option v-for="(item, index) in kjbOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 40 | - </el-select> | ||
| 41 | - </el-form-item> | ||
| 42 | - </el-col> | ||
| 43 | - <el-col :span="6"> | ||
| 44 | - <el-form-item label="大项目部"> | ||
| 45 | - <el-select v-model="query.dxmb" placeholder="大项目部" clearable > | ||
| 46 | - <el-option v-for="(item, index) in dxmbOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 47 | - </el-select> | ||
| 48 | - </el-form-item> | ||
| 49 | - </el-col> | ||
| 50 | - <el-col :span="6"> | ||
| 51 | - <el-form-item label="归属起始时间"> | ||
| 52 | - <el-date-picker v-model="query.gsqssj" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | ||
| 53 | - </el-date-picker> | ||
| 54 | - </el-form-item> | ||
| 55 | - </el-col> | ||
| 56 | - <el-col :span="6"> | ||
| 57 | - <el-form-item label="归属终止时间"> | ||
| 58 | - <el-date-picker v-model="query.gszzsj" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | ||
| 59 | - </el-date-picker> | 31 | + <el-input |
| 32 | + v-model="query.djmd" | ||
| 33 | + placeholder="请输入单据门店" | ||
| 34 | + clearable | ||
| 35 | + prefix-icon="el-icon-search" | ||
| 36 | + style="border-radius: 6px;" | ||
| 37 | + /> | ||
| 60 | </el-form-item> | 38 | </el-form-item> |
| 61 | </el-col> | 39 | </el-col> |
| 62 | - <el-col :span="6"> | ||
| 63 | - <el-form-item label="修改信息"> | ||
| 64 | - <el-input v-model="query.xgxx" placeholder="修改信息" /> | ||
| 65 | - </el-form-item> | ||
| 66 | - </el-col> | ||
| 67 | - <el-col :span="6"> | ||
| 68 | - <el-form-item label="门店名称"> | ||
| 69 | - <el-select v-model="query.mdmc" placeholder="门店名称" clearable > | ||
| 70 | - <el-option v-for="(item, index) in mdmcOptions" :key="index" :label="item.fullName" :value="item.id" /> | 40 | + <el-col :span="5"> |
| 41 | + <el-form-item label="新店状态"> | ||
| 42 | + <el-select | ||
| 43 | + v-model="query.isNewStore" | ||
| 44 | + placeholder="请选择新店状态" | ||
| 45 | + clearable | ||
| 46 | + style="width: 100%; border-radius: 6px;" | ||
| 47 | + > | ||
| 48 | + <el-option label="新店" :value="true" /> | ||
| 49 | + <el-option label="老店" :value="false" /> | ||
| 71 | </el-select> | 50 | </el-select> |
| 72 | </el-form-item> | 51 | </el-form-item> |
| 73 | </el-col> | 52 | </el-col> |
| 74 | - </template> | ||
| 75 | - <el-col :span="6"> | 53 | + <el-col :span="4"> |
| 76 | <el-form-item> | 54 | <el-form-item> |
| 77 | - <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | ||
| 78 | - <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | ||
| 79 | - <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">展开</el-button> | ||
| 80 | - <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>收起</el-button> | 55 | + <div class="search-buttons" style="height: 32px;"> |
| 56 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | ||
| 57 | + <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | ||
| 58 | + </div> | ||
| 81 | </el-form-item> | 59 | </el-form-item> |
| 82 | </el-col> | 60 | </el-col> |
| 83 | </el-form> | 61 | </el-form> |
| 84 | </el-row> | 62 | </el-row> |
| 85 | <div class="NCC-common-layout-main NCC-flex-main"> | 63 | <div class="NCC-common-layout-main NCC-flex-main"> |
| 86 | <div class="NCC-common-head"> | 64 | <div class="NCC-common-head"> |
| 87 | - <div> | ||
| 88 | - <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button> | ||
| 89 | - <el-button type="text" icon="el-icon-download" @click="exportData()">导出</el-button> | ||
| 90 | - <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除</el-button> | 65 | + <div class="NCC-common-head-left"> |
| 66 | + <h3 class="NCC-common-head-title"> | ||
| 67 | + <i class="el-icon-office-building"></i> | ||
| 68 | + 门店归属管理 | ||
| 69 | + </h3> | ||
| 70 | + <span class="NCC-common-head-subtitle">共 {{ total }} 条记录</span> | ||
| 91 | </div> | 71 | </div> |
| 92 | <div class="NCC-common-head-right"> | 72 | <div class="NCC-common-head-right"> |
| 73 | + <el-button | ||
| 74 | + type="success" | ||
| 75 | + icon="el-icon-edit" | ||
| 76 | + :disabled="multipleSelection.length === 0" | ||
| 77 | + @click="batchEditHandle" | ||
| 78 | + > | ||
| 79 | + 批量编辑 ({{ multipleSelection.length }}) | ||
| 80 | + </el-button> | ||
| 81 | + <el-button | ||
| 82 | + type="warning" | ||
| 83 | + icon="el-icon-download" | ||
| 84 | + @click="exportData" | ||
| 85 | + > | ||
| 86 | + 导出数据 | ||
| 87 | + </el-button> | ||
| 93 | <el-tooltip effect="dark" content="刷新" placement="top"> | 88 | <el-tooltip effect="dark" content="刷新" placement="top"> |
| 94 | <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" /> | 89 | <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" /> |
| 95 | </el-tooltip> | 90 | </el-tooltip> |
| 96 | <screenfull isContainer /> | 91 | <screenfull isContainer /> |
| 97 | </div> | 92 | </div> |
| 98 | </div> | 93 | </div> |
| 99 | - <NCC-table v-loading="listLoading" :data="list" has-c @selection-change="handleSelectionChange"> | ||
| 100 | - <el-table-column prop="id" label="门店编码" align="left" /> | ||
| 101 | - <el-table-column prop="djmdbh" label="单据门店编号" align="left" /> | ||
| 102 | - <el-table-column prop="djmd" label="单据门店" align="left" /> | ||
| 103 | - <el-table-column label="事业部" prop="syb" align="left"> | ||
| 104 | - <template slot-scope="scope">{{ scope.row.syb | dynamicText(sybOptions) }}</template> | 94 | + <NCC-table |
| 95 | + v-loading="listLoading" | ||
| 96 | + :data="list" | ||
| 97 | + @selection-change="handleSelectionChange" | ||
| 98 | + :row-key="row => row.id" | ||
| 99 | + > | ||
| 100 | + <el-table-column type="selection" width="55" align="center" /> | ||
| 101 | + <el-table-column prop="mdbm" label="门店编码" align="left" width="120" show-overflow-tooltip> | ||
| 102 | + <template slot-scope="scope"> | ||
| 103 | + <el-tag size="small" type="primary">{{ scope.row.mdbm }}</el-tag> | ||
| 104 | + </template> | ||
| 105 | </el-table-column> | 105 | </el-table-column> |
| 106 | - <el-table-column label="教育部" prop="jyb" align="left"> | ||
| 107 | - <template slot-scope="scope">{{ scope.row.jyb | dynamicText(jybOptions) }}</template> | 106 | + <el-table-column prop="dm" label="门店名称" align="left" min-width="150" show-overflow-tooltip> |
| 107 | + <template slot-scope="scope"> | ||
| 108 | + <span class="store-name">{{ scope.row.dm }}</span> | ||
| 109 | + </template> | ||
| 108 | </el-table-column> | 110 | </el-table-column> |
| 109 | - <el-table-column label="科技部" prop="kjb" align="left"> | ||
| 110 | - <template slot-scope="scope">{{ scope.row.kjb | dynamicText(kjbOptions) }}</template> | 111 | + <el-table-column prop="djmd" label="单据门店" align="left" width="150" show-overflow-tooltip /> |
| 112 | + <el-table-column label="事业部" prop="syb" align="left" width="120"> | ||
| 113 | + <template slot-scope="scope"> | ||
| 114 | + <el-tag v-if="scope.row.syb" size="small" type="success"> | ||
| 115 | + {{ getDepartmentName(scope.row.syb, sybOptions) }} | ||
| 116 | + </el-tag> | ||
| 117 | + <span v-else class="empty-text">无</span> | ||
| 118 | + </template> | ||
| 119 | + </el-table-column> | ||
| 120 | + <el-table-column label="教育部" prop="jyb" align="left" width="120"> | ||
| 121 | + <template slot-scope="scope"> | ||
| 122 | + <el-tag v-if="scope.row.jyb" size="small" type="warning"> | ||
| 123 | + {{ getDepartmentName(scope.row.jyb, jybOptions) }} | ||
| 124 | + </el-tag> | ||
| 125 | + <span v-else class="empty-text">无</span> | ||
| 126 | + </template> | ||
| 111 | </el-table-column> | 127 | </el-table-column> |
| 112 | - <el-table-column label="大项目部" prop="dxmb" align="left"> | ||
| 113 | - <template slot-scope="scope">{{ scope.row.dxmb | dynamicText(dxmbOptions) }}</template> | 128 | + <el-table-column label="科技部" prop="kjb" align="left" width="120"> |
| 129 | + <template slot-scope="scope"> | ||
| 130 | + <el-tag v-if="scope.row.kjb" size="small" type="info"> | ||
| 131 | + {{ getDepartmentName(scope.row.kjb, kjbOptions) }} | ||
| 132 | + </el-tag> | ||
| 133 | + <span v-else class="empty-text">无</span> | ||
| 134 | + </template> | ||
| 114 | </el-table-column> | 135 | </el-table-column> |
| 115 | - <el-table-column prop="gsqssj" label="归属起始时间" align="left" /> | ||
| 116 | - <el-table-column prop="gszzsj" label="归属终止时间" align="left" /> | ||
| 117 | - <el-table-column prop="xgxx" label="修改信息" align="left" /> | ||
| 118 | - <el-table-column label="门店名称" prop="mdmc" align="left"> | ||
| 119 | - <template slot-scope="scope">{{ scope.row.mdmc | dynamicText(mdmcOptions) }}</template> | 136 | + <el-table-column label="大项目部" prop="dxmb" align="left" width="120"> |
| 137 | + <template slot-scope="scope"> | ||
| 138 | + <el-tag v-if="scope.row.dxmb" size="small" type="danger"> | ||
| 139 | + {{ getDepartmentName(scope.row.dxmb, dxmbOptions) }} | ||
| 140 | + </el-tag> | ||
| 141 | + <span v-else class="empty-text">无</span> | ||
| 142 | + </template> | ||
| 120 | </el-table-column> | 143 | </el-table-column> |
| 121 | - <el-table-column label="操作" fixed="right" width="100"> | ||
| 122 | - <template slot-scope="scope"> | ||
| 123 | - <el-button type="text" @click="addOrUpdateHandle(scope.row.id)" >编辑</el-button> | ||
| 124 | - <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn" >删除</el-button> | 144 | + <el-table-column label="新店状态" align="center" width="100"> |
| 145 | + <template slot-scope="scope"> | ||
| 146 | + <el-tag v-if="scope.row.isNewStore" type="success" size="small"> | ||
| 147 | + <i class="el-icon-star-on"></i> 新店 | ||
| 148 | + </el-tag> | ||
| 149 | + <el-tag v-else type="info" size="small"> | ||
| 150 | + <i class="el-icon-star-off"></i> 老店 | ||
| 151 | + </el-tag> | ||
| 152 | + </template> | ||
| 153 | + </el-table-column> | ||
| 154 | + <el-table-column label="操作" fixed="right" width="120" align="center"> | ||
| 155 | + <template slot-scope="scope"> | ||
| 156 | + <el-button | ||
| 157 | + type="text" | ||
| 158 | + icon="el-icon-edit" | ||
| 159 | + @click="editHandle(scope.row)" | ||
| 160 | + class="action-btn" | ||
| 161 | + > | ||
| 162 | + 编辑 | ||
| 163 | + </el-button> | ||
| 164 | + <el-button | ||
| 165 | + type="text" | ||
| 166 | + icon="el-icon-view" | ||
| 167 | + @click="viewHandle(scope.row)" | ||
| 168 | + class="action-btn" | ||
| 169 | + > | ||
| 170 | + 查看 | ||
| 171 | + </el-button> | ||
| 125 | </template> | 172 | </template> |
| 126 | </el-table-column> | 173 | </el-table-column> |
| 127 | </NCC-table> | 174 | </NCC-table> |
| 128 | <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> | 175 | <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> |
| 129 | </div> | 176 | </div> |
| 130 | </div> | 177 | </div> |
| 131 | - <NCC-Form v-if="formVisible" ref="NCCForm" @refresh="refresh" /> | 178 | + <!-- 编辑弹窗 --> |
| 179 | + <el-dialog | ||
| 180 | + :title="dialogTitle" | ||
| 181 | + :visible.sync="dialogVisible" | ||
| 182 | + width="700px" | ||
| 183 | + :close-on-click-modal="false" | ||
| 184 | + :before-close="handleClose" | ||
| 185 | + class="store-dialog" | ||
| 186 | + > | ||
| 187 | + <div class="dialog-header"> | ||
| 188 | + <div class="store-info"> | ||
| 189 | + <i class="el-icon-office-building"></i> | ||
| 190 | + <span class="store-name">{{ editForm.dm }}</span> | ||
| 191 | + <el-tag size="small" type="primary">{{ editForm.mdbm }}</el-tag> | ||
| 192 | + </div> | ||
| 193 | + </div> | ||
| 194 | + <el-form :model="editForm" :rules="editRules" ref="editForm" label-width="120px" class="edit-form"> | ||
| 195 | + <el-row :gutter="20"> | ||
| 196 | + <el-col :span="12"> | ||
| 197 | + <el-form-item label="事业部" prop="syb"> | ||
| 198 | + <el-select | ||
| 199 | + v-model="editForm.syb" | ||
| 200 | + placeholder="请选择事业部" | ||
| 201 | + clearable | ||
| 202 | + style="width: 100%;" | ||
| 203 | + filterable | ||
| 204 | + > | ||
| 205 | + <el-option | ||
| 206 | + v-for="item in sybOptions" | ||
| 207 | + :key="item.Id" | ||
| 208 | + :label="item.FullName" | ||
| 209 | + :value="item.Id" | ||
| 210 | + > | ||
| 211 | + <span style="float: left">{{ item.FullName }}</span> | ||
| 212 | + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.EnCode }}</span> | ||
| 213 | + </el-option> | ||
| 214 | + </el-select> | ||
| 215 | + </el-form-item> | ||
| 216 | + </el-col> | ||
| 217 | + <el-col :span="12"> | ||
| 218 | + <el-form-item label="教育部" prop="jyb"> | ||
| 219 | + <el-select | ||
| 220 | + v-model="editForm.jyb" | ||
| 221 | + placeholder="请选择教育部" | ||
| 222 | + clearable | ||
| 223 | + style="width: 100%;" | ||
| 224 | + filterable | ||
| 225 | + > | ||
| 226 | + <el-option | ||
| 227 | + v-for="item in jybOptions" | ||
| 228 | + :key="item.Id" | ||
| 229 | + :label="item.FullName" | ||
| 230 | + :value="item.Id" | ||
| 231 | + > | ||
| 232 | + <span style="float: left">{{ item.FullName }}</span> | ||
| 233 | + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.EnCode }}</span> | ||
| 234 | + </el-option> | ||
| 235 | + </el-select> | ||
| 236 | + </el-form-item> | ||
| 237 | + </el-col> | ||
| 238 | + </el-row> | ||
| 239 | + <el-row :gutter="20"> | ||
| 240 | + <el-col :span="12"> | ||
| 241 | + <el-form-item label="科技部" prop="kjb"> | ||
| 242 | + <el-select | ||
| 243 | + v-model="editForm.kjb" | ||
| 244 | + placeholder="请选择科技部" | ||
| 245 | + clearable | ||
| 246 | + style="width: 100%;" | ||
| 247 | + filterable | ||
| 248 | + > | ||
| 249 | + <el-option | ||
| 250 | + v-for="item in kjbOptions" | ||
| 251 | + :key="item.Id" | ||
| 252 | + :label="item.FullName" | ||
| 253 | + :value="item.Id" | ||
| 254 | + > | ||
| 255 | + <span style="float: left">{{ item.FullName }}</span> | ||
| 256 | + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.EnCode }}</span> | ||
| 257 | + </el-option> | ||
| 258 | + </el-select> | ||
| 259 | + </el-form-item> | ||
| 260 | + </el-col> | ||
| 261 | + <el-col :span="12"> | ||
| 262 | + <el-form-item label="大项目部" prop="dxmb"> | ||
| 263 | + <el-select | ||
| 264 | + v-model="editForm.dxmb" | ||
| 265 | + placeholder="请选择大项目部" | ||
| 266 | + clearable | ||
| 267 | + style="width: 100%;" | ||
| 268 | + filterable | ||
| 269 | + > | ||
| 270 | + <el-option | ||
| 271 | + v-for="item in dxmbOptions" | ||
| 272 | + :key="item.Id" | ||
| 273 | + :label="item.FullName" | ||
| 274 | + :value="item.Id" | ||
| 275 | + > | ||
| 276 | + <span style="float: left">{{ item.FullName }}</span> | ||
| 277 | + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.EnCode }}</span> | ||
| 278 | + </el-option> | ||
| 279 | + </el-select> | ||
| 280 | + </el-form-item> | ||
| 281 | + </el-col> | ||
| 282 | + </el-row> | ||
| 283 | + </el-form> | ||
| 284 | + <div slot="footer" class="dialog-footer"> | ||
| 285 | + <el-button @click="handleClose" :disabled="saveLoading">取消</el-button> | ||
| 286 | + <el-button type="primary" @click="saveEdit" :loading="saveLoading"> | ||
| 287 | + <i class="el-icon-check"></i> 保存 | ||
| 288 | + </el-button> | ||
| 289 | + </div> | ||
| 290 | + </el-dialog> | ||
| 291 | + | ||
| 292 | + <!-- 批量编辑弹窗 --> | ||
| 293 | + <el-dialog | ||
| 294 | + title="批量编辑门店归属" | ||
| 295 | + :visible.sync="batchDialogVisible" | ||
| 296 | + width="600px" | ||
| 297 | + :close-on-click-modal="false" | ||
| 298 | + > | ||
| 299 | + <div class="batch-edit-header"> | ||
| 300 | + <i class="el-icon-warning"></i> | ||
| 301 | + <span>已选择 {{ multipleSelection.length }} 个门店进行批量编辑</span> | ||
| 302 | + </div> | ||
| 303 | + <el-form :model="batchForm" :rules="batchRules" ref="batchForm" label-width="120px"> | ||
| 304 | + <el-form-item label="事业部" prop="syb"> | ||
| 305 | + <el-select v-model="batchForm.syb" placeholder="请选择事业部" clearable style="width: 100%;"> | ||
| 306 | + <el-option v-for="item in sybOptions" :key="item.Id" :label="item.FullName" :value="item.Id" /> | ||
| 307 | + </el-select> | ||
| 308 | + </el-form-item> | ||
| 309 | + <el-form-item label="教育部" prop="jyb"> | ||
| 310 | + <el-select v-model="batchForm.jyb" placeholder="请选择教育部" clearable style="width: 100%;"> | ||
| 311 | + <el-option v-for="item in jybOptions" :key="item.Id" :label="item.FullName" :value="item.Id" /> | ||
| 312 | + </el-select> | ||
| 313 | + </el-form-item> | ||
| 314 | + <el-form-item label="科技部" prop="kjb"> | ||
| 315 | + <el-select v-model="batchForm.kjb" placeholder="请选择科技部" clearable style="width: 100%;"> | ||
| 316 | + <el-option v-for="item in kjbOptions" :key="item.Id" :label="item.FullName" :value="item.Id" /> | ||
| 317 | + </el-select> | ||
| 318 | + </el-form-item> | ||
| 319 | + <el-form-item label="大项目部" prop="dxmb"> | ||
| 320 | + <el-select v-model="batchForm.dxmb" placeholder="请选择大项目部" clearable style="width: 100%;"> | ||
| 321 | + <el-option v-for="item in dxmbOptions" :key="item.Id" :label="item.FullName" :value="item.Id" /> | ||
| 322 | + </el-select> | ||
| 323 | + </el-form-item> | ||
| 324 | + </el-form> | ||
| 325 | + <div slot="footer" class="dialog-footer"> | ||
| 326 | + <el-button @click="batchDialogVisible = false">取消</el-button> | ||
| 327 | + <el-button type="primary" @click="saveBatchEdit" :loading="batchSaveLoading"> | ||
| 328 | + <i class="el-icon-check"></i> 批量保存 | ||
| 329 | + </el-button> | ||
| 330 | + </div> | ||
| 331 | + </el-dialog> | ||
| 132 | <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> | 332 | <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> |
| 133 | </div> | 333 | </div> |
| 134 | </template> | 334 | </template> |
| 135 | <script> | 335 | <script> |
| 136 | import request from '@/utils/request' | 336 | import request from '@/utils/request' |
| 137 | - import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | ||
| 138 | - import NCCForm from './Form' | ||
| 139 | import ExportBox from './ExportBox' | 337 | import ExportBox from './ExportBox' |
| 140 | - import { previewDataInterface } from '@/api/systemData/dataInterface' | ||
| 141 | export default { | 338 | export default { |
| 142 | - components: { NCCForm, ExportBox }, | 339 | + components: { ExportBox }, |
| 143 | data() { | 340 | data() { |
| 144 | return { | 341 | return { |
| 145 | - showAll: false, | ||
| 146 | query: { | 342 | query: { |
| 147 | - id:undefined, | ||
| 148 | - djmdbh:undefined, | ||
| 149 | - djmd:undefined, | ||
| 150 | - syb:undefined, | ||
| 151 | - jyb:undefined, | ||
| 152 | - kjb:undefined, | ||
| 153 | - dxmb:undefined, | ||
| 154 | - gsqssj:undefined, | ||
| 155 | - gszzsj:undefined, | ||
| 156 | - xgxx:undefined, | ||
| 157 | - mdmc:undefined, | 343 | + mdbm: undefined, |
| 344 | + dm: undefined, | ||
| 345 | + djmd: undefined, | ||
| 346 | + isNewStore: undefined | ||
| 158 | }, | 347 | }, |
| 159 | list: [], | 348 | list: [], |
| 160 | listLoading: true, | 349 | listLoading: true, |
| 161 | - multipleSelection: [], total: 0, | 350 | + total: 0, |
| 162 | listQuery: { | 351 | listQuery: { |
| 163 | currentPage: 1, | 352 | currentPage: 1, |
| 164 | pageSize: 20, | 353 | pageSize: 20, |
| 165 | sort: "desc", | 354 | sort: "desc", |
| 166 | sidx: "", | 355 | sidx: "", |
| 167 | }, | 356 | }, |
| 168 | - formVisible: false, | ||
| 169 | exportBoxVisible: false, | 357 | exportBoxVisible: false, |
| 358 | + dialogVisible: false, | ||
| 359 | + batchDialogVisible: false, | ||
| 360 | + saveLoading: false, | ||
| 361 | + batchSaveLoading: false, | ||
| 362 | + multipleSelection: [], | ||
| 363 | + dialogTitle: '编辑门店归属', | ||
| 364 | + editForm: { | ||
| 365 | + id: '', | ||
| 366 | + mdbm: '', | ||
| 367 | + dm: '', | ||
| 368 | + syb: '', | ||
| 369 | + jyb: '', | ||
| 370 | + kjb: '', | ||
| 371 | + dxmb: '' | ||
| 372 | + }, | ||
| 373 | + batchForm: { | ||
| 374 | + syb: '', | ||
| 375 | + jyb: '', | ||
| 376 | + kjb: '', | ||
| 377 | + dxmb: '' | ||
| 378 | + }, | ||
| 379 | + editRules: { | ||
| 380 | + syb: [{ required: false, message: '请选择事业部', trigger: 'change' }], | ||
| 381 | + jyb: [{ required: false, message: '请选择教育部', trigger: 'change' }], | ||
| 382 | + kjb: [{ required: false, message: '请选择科技部', trigger: 'change' }], | ||
| 383 | + dxmb: [{ required: false, message: '请选择大项目部', trigger: 'change' }] | ||
| 384 | + }, | ||
| 385 | + batchRules: { | ||
| 386 | + syb: [{ required: false, message: '请选择事业部', trigger: 'change' }], | ||
| 387 | + jyb: [{ required: false, message: '请选择教育部', trigger: 'change' }], | ||
| 388 | + kjb: [{ required: false, message: '请选择科技部', trigger: 'change' }], | ||
| 389 | + dxmb: [{ required: false, message: '请选择大项目部', trigger: 'change' }] | ||
| 390 | + }, | ||
| 170 | columnList: [ | 391 | columnList: [ |
| 171 | - { prop: 'id', label: '门店编码' }, | ||
| 172 | - { prop: 'djmdbh', label: '单据门店编号' }, | 392 | + { prop: 'mdbm', label: '门店编码' }, |
| 393 | + { prop: 'dm', label: '门店名称' }, | ||
| 173 | { prop: 'djmd', label: '单据门店' }, | 394 | { prop: 'djmd', label: '单据门店' }, |
| 174 | { prop: 'syb', label: '事业部' }, | 395 | { prop: 'syb', label: '事业部' }, |
| 175 | { prop: 'jyb', label: '教育部' }, | 396 | { prop: 'jyb', label: '教育部' }, |
| 176 | { prop: 'kjb', label: '科技部' }, | 397 | { prop: 'kjb', label: '科技部' }, |
| 177 | { prop: 'dxmb', label: '大项目部' }, | 398 | { prop: 'dxmb', label: '大项目部' }, |
| 178 | - { prop: 'gsqssj', label: '归属起始时间' }, | ||
| 179 | - { prop: 'gszzsj', label: '归属终止时间' }, | ||
| 180 | - { prop: 'xgxx', label: '修改信息' }, | ||
| 181 | - { prop: 'mdmc', label: '门店名称' }, | 399 | + { prop: 'isNewStore', label: '是否新店' } |
| 182 | ], | 400 | ], |
| 183 | - mdmcOptions : [], | ||
| 184 | - sybOptions : [], | ||
| 185 | - jybOptions : [], | ||
| 186 | - kjbOptions : [], | ||
| 187 | - dxmbOptions : [], | 401 | + sybOptions: [], |
| 402 | + jybOptions: [], | ||
| 403 | + kjbOptions: [], | ||
| 404 | + dxmbOptions: [], | ||
| 188 | } | 405 | } |
| 189 | }, | 406 | }, |
| 190 | computed: {}, | 407 | computed: {}, |
| 191 | created() { | 408 | created() { |
| 192 | this.initData() | 409 | this.initData() |
| 193 | - this.getmdmcOptions(); | ||
| 194 | - this.getsybOptions(); | ||
| 195 | - this.getjybOptions(); | ||
| 196 | - this.getkjbOptions(); | ||
| 197 | - this.getdxmbOptions(); | 410 | + this.loadDepartmentOptions() |
| 198 | }, | 411 | }, |
| 199 | methods: { | 412 | methods: { |
| 200 | - getmdmcOptions(){ | ||
| 201 | - previewDataInterface('730960205902251269').then(res => { | ||
| 202 | - this.mdmcOptions = res.data | ||
| 203 | - }); | 413 | + // 加载部门选项 |
| 414 | + loadDepartmentOptions() { | ||
| 415 | + // 加载事业部 | ||
| 416 | + request({ | ||
| 417 | + url: '/api/Extend/Organize/GetByName', | ||
| 418 | + method: 'GET', | ||
| 419 | + data: { organizeName: '事业部' } | ||
| 420 | + }).then(res => { | ||
| 421 | + this.sybOptions = res.data || [] | ||
| 422 | + }).catch(() => { | ||
| 423 | + this.sybOptions = [] | ||
| 424 | + }) | ||
| 425 | + | ||
| 426 | + // 加载教育部 | ||
| 427 | + request({ | ||
| 428 | + url: '/api/Extend/Organize/GetByName', | ||
| 429 | + method: 'GET', | ||
| 430 | + data: { organizeName: '教育部' } | ||
| 431 | + }).then(res => { | ||
| 432 | + this.jybOptions = res.data || [] | ||
| 433 | + }).catch(() => { | ||
| 434 | + this.jybOptions = [] | ||
| 435 | + }) | ||
| 436 | + | ||
| 437 | + // 加载科技部 | ||
| 438 | + request({ | ||
| 439 | + url: '/api/Extend/Organize/GetByName', | ||
| 440 | + method: 'GET', | ||
| 441 | + data: { organizeName: '科技部' } | ||
| 442 | + }).then(res => { | ||
| 443 | + this.kjbOptions = res.data || [] | ||
| 444 | + }).catch(() => { | ||
| 445 | + this.kjbOptions = [] | ||
| 446 | + }) | ||
| 447 | + | ||
| 448 | + // 加载大项目部 | ||
| 449 | + request({ | ||
| 450 | + url: '/api/Extend/Organize/GetByName', | ||
| 451 | + method: 'GET', | ||
| 452 | + data: { organizeName: '大项目部' } | ||
| 453 | + }).then(res => { | ||
| 454 | + this.dxmbOptions = res.data || [] | ||
| 455 | + }).catch(() => { | ||
| 456 | + this.dxmbOptions = [] | ||
| 457 | + }) | ||
| 204 | }, | 458 | }, |
| 205 | - getsybOptions(){ | ||
| 206 | - previewDataInterface('731056988015822085').then(res => { | ||
| 207 | - this.sybOptions = res.data | ||
| 208 | - }); | 459 | + |
| 460 | + // 获取部门名称 | ||
| 461 | + getDepartmentName(id, options) { | ||
| 462 | + const option = options.find(item => item.Id === id) | ||
| 463 | + return option ? option.FullName : '未知' | ||
| 209 | }, | 464 | }, |
| 210 | - getjybOptions(){ | ||
| 211 | - previewDataInterface('731056988015822085').then(res => { | ||
| 212 | - this.jybOptions = res.data | ||
| 213 | - }); | 465 | + |
| 466 | + // 加载所有门店的新店保护状态 | ||
| 467 | + async loadNewStoreStatus() { | ||
| 468 | + if (!this.list || this.list.length === 0) return | ||
| 469 | + | ||
| 470 | + // 并行查询所有门店的保护状态 | ||
| 471 | + const promises = this.list.map(async (row) => { | ||
| 472 | + if (!row.id) { | ||
| 473 | + this.$set(row, 'isNewStore', false) | ||
| 474 | + return | ||
| 475 | + } | ||
| 476 | + | ||
| 477 | + try { | ||
| 478 | + const res = await request({ | ||
| 479 | + url: `/api/Extend/LqMdXdbhsj/GetByStoreId/${row.id}`, | ||
| 480 | + method: 'GET' | ||
| 481 | + }) | ||
| 482 | + | ||
| 483 | + this.$set(row, 'isNewStore', res.data && res.data.hasProtection === true) | ||
| 484 | + | ||
| 485 | + } catch (error) { | ||
| 486 | + console.error(`查询门店 ${row.dm} 保护时间失败:`, error) | ||
| 487 | + this.$set(row, 'isNewStore', false) | ||
| 488 | + } | ||
| 489 | + }) | ||
| 490 | + | ||
| 491 | + await Promise.all(promises) | ||
| 214 | }, | 492 | }, |
| 215 | - getkjbOptions(){ | ||
| 216 | - previewDataInterface('731056988015822085').then(res => { | ||
| 217 | - this.kjbOptions = res.data | ||
| 218 | - }); | 493 | + |
| 494 | + // 判断是否为新店(通过门店新店保护时间表查询) | ||
| 495 | + async isNewStore(row) { | ||
| 496 | + if (!row.id) return false | ||
| 497 | + | ||
| 498 | + try { | ||
| 499 | + const res = await request({ | ||
| 500 | + url: `/api/Extend/LqMdXdbhsj/GetByStoreId/${row.id}`, | ||
| 501 | + method: 'GET' | ||
| 502 | + }) | ||
| 503 | + | ||
| 504 | + const isNew = res.data && res.data.hasProtection === true | ||
| 505 | + this.$set(row, 'isNewStore', isNew) | ||
| 506 | + return isNew | ||
| 507 | + } catch (error) { | ||
| 508 | + console.error(`查询门店 ${row.dm} 保护时间失败:`, error) | ||
| 509 | + this.$set(row, 'isNewStore', false) | ||
| 510 | + return false | ||
| 511 | + } | ||
| 219 | }, | 512 | }, |
| 220 | - getdxmbOptions(){ | ||
| 221 | - previewDataInterface('731056988015822085').then(res => { | ||
| 222 | - this.dxmbOptions = res.data | ||
| 223 | - }); | 513 | + |
| 514 | + // 编辑处理 | ||
| 515 | + editHandle(row) { | ||
| 516 | + this.dialogTitle = '编辑门店归属' | ||
| 517 | + this.editForm = { | ||
| 518 | + id: row.id, | ||
| 519 | + mdbm: row.mdbm, | ||
| 520 | + dm: row.dm, | ||
| 521 | + syb: row.syb || '', | ||
| 522 | + jyb: row.jyb || '', | ||
| 523 | + kjb: row.kjb || '', | ||
| 524 | + dxmb: row.dxmb || '' | ||
| 525 | + } | ||
| 526 | + this.dialogVisible = true | ||
| 224 | }, | 527 | }, |
| 225 | - initData() { | 528 | + |
| 529 | + // 查看处理 | ||
| 530 | + viewHandle(row) { | ||
| 531 | + this.dialogTitle = '查看门店归属' | ||
| 532 | + this.editForm = { | ||
| 533 | + id: row.id, | ||
| 534 | + mdbm: row.mdbm, | ||
| 535 | + dm: row.dm, | ||
| 536 | + syb: row.syb || '', | ||
| 537 | + jyb: row.jyb || '', | ||
| 538 | + kjb: row.kjb || '', | ||
| 539 | + dxmb: row.dxmb || '' | ||
| 540 | + } | ||
| 541 | + this.dialogVisible = true | ||
| 542 | + }, | ||
| 543 | + | ||
| 544 | + // 批量编辑处理 | ||
| 545 | + batchEditHandle() { | ||
| 546 | + if (this.multipleSelection.length === 0) { | ||
| 547 | + this.$message.warning('请先选择要编辑的门店') | ||
| 548 | + return | ||
| 549 | + } | ||
| 550 | + this.batchForm = { | ||
| 551 | + syb: '', | ||
| 552 | + jyb: '', | ||
| 553 | + kjb: '', | ||
| 554 | + dxmb: '' | ||
| 555 | + } | ||
| 556 | + this.batchDialogVisible = true | ||
| 557 | + }, | ||
| 558 | + | ||
| 559 | + // 多选处理 | ||
| 560 | + handleSelectionChange(val) { | ||
| 561 | + this.multipleSelection = val | ||
| 562 | + }, | ||
| 563 | + | ||
| 564 | + // 弹窗关闭处理 | ||
| 565 | + handleClose() { | ||
| 566 | + if (this.saveLoading) { | ||
| 567 | + this.$message.warning('正在保存中,请稍候...') | ||
| 568 | + return | ||
| 569 | + } | ||
| 570 | + this.dialogVisible = false | ||
| 571 | + this.$refs.editForm && this.$refs.editForm.resetFields() | ||
| 572 | + }, | ||
| 573 | + | ||
| 574 | + // 保存编辑 | ||
| 575 | + saveEdit() { | ||
| 576 | + this.$refs.editForm.validate((valid) => { | ||
| 577 | + if (valid) { | ||
| 578 | + this.saveLoading = true | ||
| 579 | + request({ | ||
| 580 | + url: `/api/Extend/LqMdxx/${this.editForm.id}`, | ||
| 581 | + method: 'PUT', | ||
| 582 | + data: { | ||
| 583 | + syb: this.editForm.syb, | ||
| 584 | + jyb: this.editForm.jyb, | ||
| 585 | + kjb: this.editForm.kjb, | ||
| 586 | + dxmb: this.editForm.dxmb | ||
| 587 | + } | ||
| 588 | + }).then(res => { | ||
| 589 | + this.$message.success('保存成功') | ||
| 590 | + this.dialogVisible = false | ||
| 591 | + this.initData() | ||
| 592 | + }).catch(() => { | ||
| 593 | + this.$message.error('保存失败') | ||
| 594 | + }).finally(() => { | ||
| 595 | + this.saveLoading = false | ||
| 596 | + }) | ||
| 597 | + } | ||
| 598 | + }) | ||
| 599 | + }, | ||
| 600 | + | ||
| 601 | + // 批量保存编辑 | ||
| 602 | + saveBatchEdit() { | ||
| 603 | + this.$refs.batchForm.validate((valid) => { | ||
| 604 | + if (valid) { | ||
| 605 | + this.batchSaveLoading = true | ||
| 606 | + const updateData = this.multipleSelection.map(item => ({ | ||
| 607 | + id: item.id, | ||
| 608 | + syb: this.batchForm.syb, | ||
| 609 | + jyb: this.batchForm.jyb, | ||
| 610 | + kjb: this.batchForm.kjb, | ||
| 611 | + dxmb: this.batchForm.dxmb | ||
| 612 | + })) | ||
| 613 | + | ||
| 614 | + // 批量更新 | ||
| 615 | + Promise.all(updateData.map(data => | ||
| 616 | + request({ | ||
| 617 | + url: `/api/Extend/LqMdxx/${data.id}`, | ||
| 618 | + method: 'PUT', | ||
| 619 | + data: { | ||
| 620 | + syb: data.syb, | ||
| 621 | + jyb: data.jyb, | ||
| 622 | + kjb: data.kjb, | ||
| 623 | + dxmb: data.dxmb | ||
| 624 | + } | ||
| 625 | + }) | ||
| 626 | + )).then(() => { | ||
| 627 | + this.$message.success(`成功更新 ${updateData.length} 个门店的归属信息`) | ||
| 628 | + this.batchDialogVisible = false | ||
| 629 | + this.multipleSelection = [] | ||
| 630 | + this.initData() | ||
| 631 | + }).catch(() => { | ||
| 632 | + this.$message.error('批量更新失败') | ||
| 633 | + }).finally(() => { | ||
| 634 | + this.batchSaveLoading = false | ||
| 635 | + }) | ||
| 636 | + } | ||
| 637 | + }) | ||
| 638 | + }, | ||
| 639 | + | ||
| 640 | + async initData() { | ||
| 226 | this.listLoading = true; | 641 | this.listLoading = true; |
| 227 | let _query = { | 642 | let _query = { |
| 228 | ...this.listQuery, | 643 | ...this.listQuery, |
| @@ -236,83 +651,31 @@ | @@ -236,83 +651,31 @@ | ||
| 236 | query[key] = _query[key] | 651 | query[key] = _query[key] |
| 237 | } | 652 | } |
| 238 | } | 653 | } |
| 239 | - request({ | ||
| 240 | - url: `/api/Extend/LqMdMdgs`, | ||
| 241 | - method: 'GET', | ||
| 242 | - data: query | ||
| 243 | - }).then(res => { | 654 | + |
| 655 | + try { | ||
| 656 | + const res = await request({ | ||
| 657 | + url: `/api/Extend/LqMdxx`, | ||
| 658 | + method: 'GET', | ||
| 659 | + data: query | ||
| 660 | + }) | ||
| 661 | + | ||
| 244 | this.list = res.data.list | 662 | this.list = res.data.list |
| 245 | this.total = res.data.pagination.total | 663 | this.total = res.data.pagination.total |
| 664 | + | ||
| 665 | + // 为每个门店查询新店保护状态 | ||
| 666 | + await this.loadNewStoreStatus() | ||
| 667 | + | ||
| 668 | + } catch (error) { | ||
| 669 | + console.error('加载门店数据失败:', error) | ||
| 670 | + } finally { | ||
| 246 | this.listLoading = false | 671 | this.listLoading = false |
| 247 | - }) | ||
| 248 | - }, | ||
| 249 | - handleDel(id) { | ||
| 250 | - this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { | ||
| 251 | - type: 'warning' | ||
| 252 | - }).then(() => { | ||
| 253 | - request({ | ||
| 254 | - url: `/api/Extend/LqMdMdgs/${id}`, | ||
| 255 | - method: 'DELETE' | ||
| 256 | - }).then(res => { | ||
| 257 | - this.$message({ | ||
| 258 | - type: 'success', | ||
| 259 | - message: res.msg, | ||
| 260 | - onClose: () => { | ||
| 261 | - this.initData() | ||
| 262 | - } | ||
| 263 | - }); | ||
| 264 | - }) | ||
| 265 | - }).catch(() => { | ||
| 266 | - }); | ||
| 267 | - }, | ||
| 268 | - handleSelectionChange(val) { | ||
| 269 | - const res = val.map(item => item.id) | ||
| 270 | - this.multipleSelection = res | ||
| 271 | - }, | ||
| 272 | - handleBatchRemoveDel() { | ||
| 273 | - if (!this.multipleSelection.length) { | ||
| 274 | - this.$message({ | ||
| 275 | - type: 'error', | ||
| 276 | - message: '请选择一条数据', | ||
| 277 | - duration: 1500, | ||
| 278 | - }) | ||
| 279 | - return | ||
| 280 | } | 672 | } |
| 281 | - const ids = this.multipleSelection | ||
| 282 | - this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { | ||
| 283 | - type: 'warning' | ||
| 284 | - }).then(() => { | ||
| 285 | - request({ | ||
| 286 | - url: `/api/Extend/LqMdMdgs/batchRemove`, | ||
| 287 | - method: 'POST', | ||
| 288 | - data: ids , | ||
| 289 | - }).then(res => { | ||
| 290 | - this.$message({ | ||
| 291 | - type: 'success', | ||
| 292 | - message: res.msg, | ||
| 293 | - onClose: () => { | ||
| 294 | - this.initData() | ||
| 295 | - } | ||
| 296 | - }); | ||
| 297 | - }) | ||
| 298 | - }).catch(() => { }) | ||
| 299 | - }, | ||
| 300 | - addOrUpdateHandle(id, isDetail) { | ||
| 301 | - this.formVisible = true | ||
| 302 | - this.$nextTick(() => { | ||
| 303 | - this.$refs.NCCForm.init(id, isDetail) | ||
| 304 | - }) | ||
| 305 | - }, | ||
| 306 | - exportData() { | ||
| 307 | - this.exportBoxVisible = true | ||
| 308 | - this.$nextTick(() => { | ||
| 309 | - this.$refs.ExportBox.init(this.columnList) | ||
| 310 | - }) | ||
| 311 | }, | 673 | }, |
| 674 | + | ||
| 312 | download(data) { | 675 | download(data) { |
| 313 | let query = { ...data, ...this.listQuery, ...this.query } | 676 | let query = { ...data, ...this.listQuery, ...this.query } |
| 314 | request({ | 677 | request({ |
| 315 | - url: `/api/Extend/LqMdMdgs/Actions/Export`, | 678 | + url: `/api/Extend/LqMdxx/Actions/Export`, |
| 316 | method: 'GET', | 679 | method: 'GET', |
| 317 | data: query | 680 | data: query |
| 318 | }).then(res => { | 681 | }).then(res => { |
| @@ -331,10 +694,6 @@ | @@ -331,10 +694,6 @@ | ||
| 331 | } | 694 | } |
| 332 | this.initData() | 695 | this.initData() |
| 333 | }, | 696 | }, |
| 334 | - refresh(isrRefresh) { | ||
| 335 | - this.formVisible = false | ||
| 336 | - if (isrRefresh) this.reset() | ||
| 337 | - }, | ||
| 338 | reset() { | 697 | reset() { |
| 339 | for (let key in this.query) { | 698 | for (let key in this.query) { |
| 340 | this.query[key] = undefined | 699 | this.query[key] = undefined |
| @@ -348,5 +707,149 @@ | @@ -348,5 +707,149 @@ | ||
| 348 | this.initData() | 707 | this.initData() |
| 349 | } | 708 | } |
| 350 | } | 709 | } |
| 351 | - } | ||
| 352 | -</script> | ||
| 353 | \ No newline at end of file | 710 | \ No newline at end of file |
| 711 | + } | ||
| 712 | +</script> | ||
| 713 | + | ||
| 714 | +<style lang="scss" scoped> | ||
| 715 | + // 页面头部样式 | ||
| 716 | + .NCC-common-head-left { | ||
| 717 | + display: flex; | ||
| 718 | + align-items: center; | ||
| 719 | + gap: 12px; | ||
| 720 | + } | ||
| 721 | + | ||
| 722 | + .NCC-common-head-title { | ||
| 723 | + margin: 0; | ||
| 724 | + font-size: 18px; | ||
| 725 | + font-weight: 600; | ||
| 726 | + color: #303133; | ||
| 727 | + display: flex; | ||
| 728 | + align-items: center; | ||
| 729 | + gap: 8px; | ||
| 730 | + | ||
| 731 | + i { | ||
| 732 | + color: #409EFF; | ||
| 733 | + font-size: 20px; | ||
| 734 | + } | ||
| 735 | + } | ||
| 736 | + | ||
| 737 | + .NCC-common-head-subtitle { | ||
| 738 | + color: #909399; | ||
| 739 | + font-size: 14px; | ||
| 740 | + } | ||
| 741 | + | ||
| 742 | + // 表格样式 | ||
| 743 | + .store-name { | ||
| 744 | + font-weight: 500; | ||
| 745 | + color: #303133; | ||
| 746 | + } | ||
| 747 | + | ||
| 748 | + .empty-text { | ||
| 749 | + color: #C0C4CC; | ||
| 750 | + font-style: italic; | ||
| 751 | + } | ||
| 752 | + | ||
| 753 | + .action-btn { | ||
| 754 | + padding: 4px 8px; | ||
| 755 | + margin: 0 2px; | ||
| 756 | + | ||
| 757 | + &:hover { | ||
| 758 | + background-color: #f5f7fa; | ||
| 759 | + } | ||
| 760 | + } | ||
| 761 | + | ||
| 762 | + // 弹窗样式 | ||
| 763 | + .store-dialog { | ||
| 764 | + .dialog-header { | ||
| 765 | + padding: 16px 0; | ||
| 766 | + border-bottom: 1px solid #EBEEF5; | ||
| 767 | + margin-bottom: 20px; | ||
| 768 | + | ||
| 769 | + .store-info { | ||
| 770 | + display: flex; | ||
| 771 | + align-items: center; | ||
| 772 | + gap: 12px; | ||
| 773 | + | ||
| 774 | + i { | ||
| 775 | + font-size: 20px; | ||
| 776 | + color: #409EFF; | ||
| 777 | + } | ||
| 778 | + | ||
| 779 | + .store-name { | ||
| 780 | + font-size: 16px; | ||
| 781 | + font-weight: 600; | ||
| 782 | + color: #303133; | ||
| 783 | + } | ||
| 784 | + } | ||
| 785 | + } | ||
| 786 | + | ||
| 787 | + .edit-form { | ||
| 788 | + .el-form-item { | ||
| 789 | + margin-bottom: 20px; | ||
| 790 | + } | ||
| 791 | + } | ||
| 792 | + } | ||
| 793 | + | ||
| 794 | + // 批量编辑样式 | ||
| 795 | + .batch-edit-header { | ||
| 796 | + display: flex; | ||
| 797 | + align-items: center; | ||
| 798 | + gap: 8px; | ||
| 799 | + padding: 12px 16px; | ||
| 800 | + background-color: #fdf6ec; | ||
| 801 | + border: 1px solid #f5dab1; | ||
| 802 | + border-radius: 4px; | ||
| 803 | + margin-bottom: 20px; | ||
| 804 | + | ||
| 805 | + i { | ||
| 806 | + color: #e6a23c; | ||
| 807 | + font-size: 16px; | ||
| 808 | + } | ||
| 809 | + | ||
| 810 | + span { | ||
| 811 | + color: #e6a23c; | ||
| 812 | + font-weight: 500; | ||
| 813 | + } | ||
| 814 | + } | ||
| 815 | + | ||
| 816 | + // 搜索区域样式 | ||
| 817 | + .search-buttons { | ||
| 818 | + display: flex; | ||
| 819 | + align-items: center; | ||
| 820 | + gap: 8px; | ||
| 821 | + } | ||
| 822 | + | ||
| 823 | + // 响应式设计 | ||
| 824 | + @media (max-width: 768px) { | ||
| 825 | + .NCC-common-head { | ||
| 826 | + flex-direction: column; | ||
| 827 | + align-items: flex-start; | ||
| 828 | + gap: 12px; | ||
| 829 | + | ||
| 830 | + .NCC-common-head-right { | ||
| 831 | + width: 100%; | ||
| 832 | + justify-content: flex-start; | ||
| 833 | + } | ||
| 834 | + } | ||
| 835 | + | ||
| 836 | + .el-col { | ||
| 837 | + margin-bottom: 16px; | ||
| 838 | + } | ||
| 839 | + | ||
| 840 | + .store-dialog { | ||
| 841 | + .el-dialog { | ||
| 842 | + width: 95% !important; | ||
| 843 | + margin: 0 auto; | ||
| 844 | + } | ||
| 845 | + } | ||
| 846 | + } | ||
| 847 | + | ||
| 848 | + // 表格响应式 | ||
| 849 | + @media (max-width: 1200px) { | ||
| 850 | + .NCC-table { | ||
| 851 | + .el-table { | ||
| 852 | + font-size: 12px; | ||
| 853 | + } | ||
| 854 | + } | ||
| 855 | + } | ||
| 856 | +</style> | ||
| 354 | \ No newline at end of file | 857 | \ No newline at end of file |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdMdgs/LqMdMdgsInfoOutput.cs deleted
| 1 | -using System; | ||
| 2 | -using System.Collections.Generic; | ||
| 3 | - | ||
| 4 | -namespace NCC.Extend.Entitys.Dto.LqMdMdgs | ||
| 5 | -{ | ||
| 6 | - /// <summary> | ||
| 7 | - /// 门店归属输出参数 | ||
| 8 | - /// </summary> | ||
| 9 | - public class LqMdMdgsInfoOutput | ||
| 10 | - { | ||
| 11 | - /// <summary> | ||
| 12 | - /// 门店编码 | ||
| 13 | - /// </summary> | ||
| 14 | - public string id { get; set; } | ||
| 15 | - | ||
| 16 | - /// <summary> | ||
| 17 | - /// 单据门店编号 | ||
| 18 | - /// </summary> | ||
| 19 | - public string djmdbh { get; set; } | ||
| 20 | - | ||
| 21 | - /// <summary> | ||
| 22 | - /// 单据门店 | ||
| 23 | - /// </summary> | ||
| 24 | - public string djmd { get; set; } | ||
| 25 | - | ||
| 26 | - /// <summary> | ||
| 27 | - /// 门店名称 | ||
| 28 | - /// </summary> | ||
| 29 | - public string mdmc { get; set; } | ||
| 30 | - | ||
| 31 | - /// <summary> | ||
| 32 | - /// 事业部 | ||
| 33 | - /// </summary> | ||
| 34 | - public string syb { get; set; } | ||
| 35 | - | ||
| 36 | - /// <summary> | ||
| 37 | - /// 教育部 | ||
| 38 | - /// </summary> | ||
| 39 | - public string jyb { get; set; } | ||
| 40 | - | ||
| 41 | - /// <summary> | ||
| 42 | - /// 科技部 | ||
| 43 | - /// </summary> | ||
| 44 | - public string kjb { get; set; } | ||
| 45 | - | ||
| 46 | - /// <summary> | ||
| 47 | - /// 大项目部 | ||
| 48 | - /// </summary> | ||
| 49 | - public string dxmb { get; set; } | ||
| 50 | - | ||
| 51 | - /// <summary> | ||
| 52 | - /// 归属起始时间 | ||
| 53 | - /// </summary> | ||
| 54 | - public DateTime? gsqssj { get; set; } | ||
| 55 | - | ||
| 56 | - /// <summary> | ||
| 57 | - /// 归属终止时间 | ||
| 58 | - /// </summary> | ||
| 59 | - public DateTime? gszzsj { get; set; } | ||
| 60 | - | ||
| 61 | - /// <summary> | ||
| 62 | - /// 修改信息 | ||
| 63 | - /// </summary> | ||
| 64 | - public string xgxx { get; set; } | ||
| 65 | - | ||
| 66 | - } | ||
| 67 | -} |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdMdgs/LqMdMdgsListOutput.cs deleted
| 1 | -using System; | ||
| 2 | - | ||
| 3 | -namespace NCC.Extend.Entitys.Dto.LqMdMdgs | ||
| 4 | -{ | ||
| 5 | - /// <summary> | ||
| 6 | - /// 门店归属输入参数 | ||
| 7 | - /// </summary> | ||
| 8 | - public class LqMdMdgsListOutput | ||
| 9 | - { | ||
| 10 | - /// <summary> | ||
| 11 | - /// 门店编码 | ||
| 12 | - /// </summary> | ||
| 13 | - public string id { get; set; } | ||
| 14 | - | ||
| 15 | - /// <summary> | ||
| 16 | - /// 单据门店编号 | ||
| 17 | - /// </summary> | ||
| 18 | - public string djmdbh { get; set; } | ||
| 19 | - | ||
| 20 | - /// <summary> | ||
| 21 | - /// 单据门店 | ||
| 22 | - /// </summary> | ||
| 23 | - public string djmd { get; set; } | ||
| 24 | - | ||
| 25 | - /// <summary> | ||
| 26 | - /// 门店名称 | ||
| 27 | - /// </summary> | ||
| 28 | - public string mdmc { get; set; } | ||
| 29 | - | ||
| 30 | - /// <summary> | ||
| 31 | - /// 事业部 | ||
| 32 | - /// </summary> | ||
| 33 | - public string syb { get; set; } | ||
| 34 | - | ||
| 35 | - /// <summary> | ||
| 36 | - /// 教育部 | ||
| 37 | - /// </summary> | ||
| 38 | - public string jyb { get; set; } | ||
| 39 | - | ||
| 40 | - /// <summary> | ||
| 41 | - /// 科技部 | ||
| 42 | - /// </summary> | ||
| 43 | - public string kjb { get; set; } | ||
| 44 | - | ||
| 45 | - /// <summary> | ||
| 46 | - /// 大项目部 | ||
| 47 | - /// </summary> | ||
| 48 | - public string dxmb { get; set; } | ||
| 49 | - | ||
| 50 | - /// <summary> | ||
| 51 | - /// 归属起始时间 | ||
| 52 | - /// </summary> | ||
| 53 | - public DateTime? gsqssj { get; set; } | ||
| 54 | - | ||
| 55 | - /// <summary> | ||
| 56 | - /// 归属终止时间 | ||
| 57 | - /// </summary> | ||
| 58 | - public DateTime? gszzsj { get; set; } | ||
| 59 | - | ||
| 60 | - /// <summary> | ||
| 61 | - /// 修改信息 | ||
| 62 | - /// </summary> | ||
| 63 | - public string xgxx { get; set; } | ||
| 64 | - | ||
| 65 | - } | ||
| 66 | -} |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdMdgs/LqMdMdgsUpInput.cs deleted
| 1 | -using System; | ||
| 2 | -using System.Collections.Generic; | ||
| 3 | - | ||
| 4 | -namespace NCC.Extend.Entitys.Dto.LqMdMdgs | ||
| 5 | -{ | ||
| 6 | - /// <summary> | ||
| 7 | - /// 门店归属更新输入参数 | ||
| 8 | - /// </summary> | ||
| 9 | - public class LqMdMdgsUpInput : LqMdMdgsCrInput | ||
| 10 | - { | ||
| 11 | - /// <summary> | ||
| 12 | - /// 门店编码 | ||
| 13 | - /// </summary> | ||
| 14 | - public string id { get; set; } | ||
| 15 | - | ||
| 16 | - } | ||
| 17 | -} |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxCrInput.cs
| @@ -83,5 +83,40 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx | @@ -83,5 +83,40 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx | ||
| 83 | /// </summary> | 83 | /// </summary> |
| 84 | public string ywsb { get; set; } | 84 | public string ywsb { get; set; } |
| 85 | 85 | ||
| 86 | + /// <summary> | ||
| 87 | + /// 事业部 | ||
| 88 | + /// </summary> | ||
| 89 | + public string syb { get; set; } | ||
| 90 | + | ||
| 91 | + /// <summary> | ||
| 92 | + /// 教育部 | ||
| 93 | + /// </summary> | ||
| 94 | + public string jyb { get; set; } | ||
| 95 | + | ||
| 96 | + /// <summary> | ||
| 97 | + /// 科技部 | ||
| 98 | + /// </summary> | ||
| 99 | + public string kjb { get; set; } | ||
| 100 | + | ||
| 101 | + /// <summary> | ||
| 102 | + /// 大项目部 | ||
| 103 | + /// </summary> | ||
| 104 | + public string dxmb { get; set; } | ||
| 105 | + | ||
| 106 | + /// <summary> | ||
| 107 | + /// 归属起始时间 | ||
| 108 | + /// </summary> | ||
| 109 | + public DateTime? gsqssj { get; set; } | ||
| 110 | + | ||
| 111 | + /// <summary> | ||
| 112 | + /// 归属终止时间 | ||
| 113 | + /// </summary> | ||
| 114 | + public DateTime? gszzsj { get; set; } | ||
| 115 | + | ||
| 116 | + /// <summary> | ||
| 117 | + /// 状态 | ||
| 118 | + /// </summary> | ||
| 119 | + public int? status { get; set; } | ||
| 120 | + | ||
| 86 | } | 121 | } |
| 87 | } | 122 | } |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxInfoOutput.cs
| @@ -83,5 +83,40 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx | @@ -83,5 +83,40 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx | ||
| 83 | /// </summary> | 83 | /// </summary> |
| 84 | public string ywsb { get; set; } | 84 | public string ywsb { get; set; } |
| 85 | 85 | ||
| 86 | + /// <summary> | ||
| 87 | + /// 事业部 | ||
| 88 | + /// </summary> | ||
| 89 | + public string syb { get; set; } | ||
| 90 | + | ||
| 91 | + /// <summary> | ||
| 92 | + /// 教育部 | ||
| 93 | + /// </summary> | ||
| 94 | + public string jyb { get; set; } | ||
| 95 | + | ||
| 96 | + /// <summary> | ||
| 97 | + /// 科技部 | ||
| 98 | + /// </summary> | ||
| 99 | + public string kjb { get; set; } | ||
| 100 | + | ||
| 101 | + /// <summary> | ||
| 102 | + /// 大项目部 | ||
| 103 | + /// </summary> | ||
| 104 | + public string dxmb { get; set; } | ||
| 105 | + | ||
| 106 | + /// <summary> | ||
| 107 | + /// 归属起始时间 | ||
| 108 | + /// </summary> | ||
| 109 | + public DateTime? gsqssj { get; set; } | ||
| 110 | + | ||
| 111 | + /// <summary> | ||
| 112 | + /// 归属终止时间 | ||
| 113 | + /// </summary> | ||
| 114 | + public DateTime? gszzsj { get; set; } | ||
| 115 | + | ||
| 116 | + /// <summary> | ||
| 117 | + /// 状态 | ||
| 118 | + /// </summary> | ||
| 119 | + public int? status { get; set; } | ||
| 120 | + | ||
| 86 | } | 121 | } |
| 87 | } | 122 | } |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdxx/LqMdxxListOutput.cs
| @@ -82,5 +82,40 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx | @@ -82,5 +82,40 @@ namespace NCC.Extend.Entitys.Dto.LqMdxx | ||
| 82 | /// </summary> | 82 | /// </summary> |
| 83 | public string ywsb { get; set; } | 83 | public string ywsb { get; set; } |
| 84 | 84 | ||
| 85 | + /// <summary> | ||
| 86 | + /// 事业部 | ||
| 87 | + /// </summary> | ||
| 88 | + public string syb { get; set; } | ||
| 89 | + | ||
| 90 | + /// <summary> | ||
| 91 | + /// 教育部 | ||
| 92 | + /// </summary> | ||
| 93 | + public string jyb { get; set; } | ||
| 94 | + | ||
| 95 | + /// <summary> | ||
| 96 | + /// 科技部 | ||
| 97 | + /// </summary> | ||
| 98 | + public string kjb { get; set; } | ||
| 99 | + | ||
| 100 | + /// <summary> | ||
| 101 | + /// 大项目部 | ||
| 102 | + /// </summary> | ||
| 103 | + public string dxmb { get; set; } | ||
| 104 | + | ||
| 105 | + /// <summary> | ||
| 106 | + /// 归属起始时间 | ||
| 107 | + /// </summary> | ||
| 108 | + public DateTime? gsqssj { get; set; } | ||
| 109 | + | ||
| 110 | + /// <summary> | ||
| 111 | + /// 归属终止时间 | ||
| 112 | + /// </summary> | ||
| 113 | + public DateTime? gszzsj { get; set; } | ||
| 114 | + | ||
| 115 | + /// <summary> | ||
| 116 | + /// 状态 | ||
| 117 | + /// </summary> | ||
| 118 | + public int? status { get; set; } | ||
| 119 | + | ||
| 85 | } | 120 | } |
| 86 | } | 121 | } |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdMdgs/LqMdMdgsListQueryInput.cs renamed to netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/Organize/OrganizeListOutput.cs
| 1 | -using NCC.Common.Filter; | ||
| 2 | -using System.Collections.Generic; | 1 | +using System; |
| 3 | 2 | ||
| 4 | -namespace NCC.Extend.Entitys.Dto.LqMdMdgs | 3 | +namespace NCC.Extend.Entitys.Dto.Organize |
| 5 | { | 4 | { |
| 6 | /// <summary> | 5 | /// <summary> |
| 7 | - /// 门店归属列表查询输入 | 6 | + /// 组织架构列表输出 |
| 8 | /// </summary> | 7 | /// </summary> |
| 9 | - public class LqMdMdgsListQueryInput : PageInputBase | 8 | + public class OrganizeListOutput |
| 10 | { | 9 | { |
| 11 | /// <summary> | 10 | /// <summary> |
| 12 | - /// 选择导出数据key | 11 | + /// 主键 |
| 13 | /// </summary> | 12 | /// </summary> |
| 14 | - public string selectKey { get; set; } | 13 | + public string Id { get; set; } |
| 15 | 14 | ||
| 16 | /// <summary> | 15 | /// <summary> |
| 17 | - /// | 16 | + /// 组织名称 |
| 18 | /// </summary> | 17 | /// </summary> |
| 19 | - public int dataType { get; set; } | ||
| 20 | - | 18 | + public string FullName { get; set; } |
| 21 | 19 | ||
| 22 | /// <summary> | 20 | /// <summary> |
| 23 | - /// 门店编码 | 21 | + /// 组织编码 |
| 24 | /// </summary> | 22 | /// </summary> |
| 25 | - public string id { get; set; } | ||
| 26 | - | 23 | + public string EnCode { get; set; } |
| 24 | + | ||
| 27 | /// <summary> | 25 | /// <summary> |
| 28 | - /// 单据门店编号 | 26 | + /// 组织分类【company-公司、department-部门】 |
| 29 | /// </summary> | 27 | /// </summary> |
| 30 | - public string djmdbh { get; set; } | ||
| 31 | - | 28 | + public string Category { get; set; } |
| 29 | + | ||
| 32 | /// <summary> | 30 | /// <summary> |
| 33 | - /// 单据门店 | 31 | + /// 父级组织ID |
| 34 | /// </summary> | 32 | /// </summary> |
| 35 | - public string djmd { get; set; } | ||
| 36 | - | 33 | + public string ParentId { get; set; } |
| 34 | + | ||
| 37 | /// <summary> | 35 | /// <summary> |
| 38 | - /// 门店名称 | 36 | + /// 父级组织名称 |
| 39 | /// </summary> | 37 | /// </summary> |
| 40 | - public string mdmc { get; set; } | ||
| 41 | - | 38 | + public string ParentName { get; set; } |
| 39 | + | ||
| 42 | /// <summary> | 40 | /// <summary> |
| 43 | - /// 事业部 | 41 | + /// 组织主管ID |
| 44 | /// </summary> | 42 | /// </summary> |
| 45 | - public string syb { get; set; } | ||
| 46 | - | 43 | + public string ManagerId { get; set; } |
| 44 | + | ||
| 47 | /// <summary> | 45 | /// <summary> |
| 48 | - /// 教育部 | 46 | + /// 组织主管姓名 |
| 49 | /// </summary> | 47 | /// </summary> |
| 50 | - public string jyb { get; set; } | ||
| 51 | - | 48 | + public string ManagerName { get; set; } |
| 49 | + | ||
| 52 | /// <summary> | 50 | /// <summary> |
| 53 | - /// 科技部 | 51 | + /// 描述 |
| 54 | /// </summary> | 52 | /// </summary> |
| 55 | - public string kjb { get; set; } | ||
| 56 | - | 53 | + public string Description { get; set; } |
| 54 | + | ||
| 57 | /// <summary> | 55 | /// <summary> |
| 58 | - /// 大项目部 | 56 | + /// 排序码 |
| 59 | /// </summary> | 57 | /// </summary> |
| 60 | - public string dxmb { get; set; } | ||
| 61 | - | 58 | + public long? SortCode { get; set; } |
| 59 | + | ||
| 62 | /// <summary> | 60 | /// <summary> |
| 63 | - /// 归属起始时间 | 61 | + /// 是否启用 |
| 64 | /// </summary> | 62 | /// </summary> |
| 65 | - public string gsqssj { get; set; } | ||
| 66 | - | 63 | + public int? EnabledMark { get; set; } |
| 64 | + | ||
| 67 | /// <summary> | 65 | /// <summary> |
| 68 | - /// 归属终止时间 | 66 | + /// 创建时间 |
| 69 | /// </summary> | 67 | /// </summary> |
| 70 | - public string gszzsj { get; set; } | ||
| 71 | - | 68 | + public DateTime? CreatorTime { get; set; } |
| 69 | + | ||
| 72 | /// <summary> | 70 | /// <summary> |
| 73 | - /// 修改信息 | 71 | + /// 子组织数量 |
| 74 | /// </summary> | 72 | /// </summary> |
| 75 | - public string xgxx { get; set; } | ||
| 76 | - | 73 | + public int ChildrenCount { get; set; } |
| 77 | } | 74 | } |
| 78 | } | 75 | } |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/Organize/OrganizeListQueryInput.cs
0 → 100644
| 1 | +using NCC.Common.Filter; | ||
| 2 | + | ||
| 3 | +namespace NCC.Extend.Entitys.Dto.Organize | ||
| 4 | +{ | ||
| 5 | + /// <summary> | ||
| 6 | + /// 组织架构查询输入参数 | ||
| 7 | + /// </summary> | ||
| 8 | + public class OrganizeListQueryInput : PageInputBase | ||
| 9 | + { | ||
| 10 | + /// <summary> | ||
| 11 | + /// 组织名称(模糊查询) | ||
| 12 | + /// </summary> | ||
| 13 | + public string FullName { get; set; } | ||
| 14 | + | ||
| 15 | + /// <summary> | ||
| 16 | + /// 组织编码 | ||
| 17 | + /// </summary> | ||
| 18 | + public string EnCode { get; set; } | ||
| 19 | + | ||
| 20 | + /// <summary> | ||
| 21 | + /// 组织分类【company-公司、department-部门】 | ||
| 22 | + /// </summary> | ||
| 23 | + public string Category { get; set; } | ||
| 24 | + | ||
| 25 | + /// <summary> | ||
| 26 | + /// 父级组织ID | ||
| 27 | + /// </summary> | ||
| 28 | + public string ParentId { get; set; } | ||
| 29 | + | ||
| 30 | + /// <summary> | ||
| 31 | + /// 是否启用 | ||
| 32 | + /// </summary> | ||
| 33 | + public int? EnabledMark { get; set; } | ||
| 34 | + } | ||
| 35 | +} |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMdMdgs/LqMdMdgsCrInput.cs renamed to netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/Organize/OrganizeTreeOutput.cs
| 1 | -using System; | ||
| 2 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
| 3 | 2 | ||
| 4 | -namespace NCC.Extend.Entitys.Dto.LqMdMdgs | 3 | +namespace NCC.Extend.Entitys.Dto.Organize |
| 5 | { | 4 | { |
| 6 | /// <summary> | 5 | /// <summary> |
| 7 | - /// 门店归属修改输入参数 | 6 | + /// 组织架构树形输出 |
| 8 | /// </summary> | 7 | /// </summary> |
| 9 | - public class LqMdMdgsCrInput | 8 | + public class OrganizeTreeOutput |
| 10 | { | 9 | { |
| 11 | /// <summary> | 10 | /// <summary> |
| 12 | - /// 门店编码 | 11 | + /// 主键 |
| 13 | /// </summary> | 12 | /// </summary> |
| 14 | - public string id { get; set; } | ||
| 15 | - | ||
| 16 | - /// <summary> | ||
| 17 | - /// 单据门店编号 | ||
| 18 | - /// </summary> | ||
| 19 | - public string djmdbh { get; set; } | ||
| 20 | - | 13 | + public string Id { get; set; } |
| 14 | + | ||
| 21 | /// <summary> | 15 | /// <summary> |
| 22 | - /// 单据门店 | 16 | + /// 组织名称 |
| 23 | /// </summary> | 17 | /// </summary> |
| 24 | - public string djmd { get; set; } | ||
| 25 | - | 18 | + public string FullName { get; set; } |
| 19 | + | ||
| 26 | /// <summary> | 20 | /// <summary> |
| 27 | - /// 门店名称 | 21 | + /// 组织编码 |
| 28 | /// </summary> | 22 | /// </summary> |
| 29 | - public string mdmc { get; set; } | ||
| 30 | - | 23 | + public string EnCode { get; set; } |
| 24 | + | ||
| 31 | /// <summary> | 25 | /// <summary> |
| 32 | - /// 事业部 | 26 | + /// 组织分类【company-公司、department-部门】 |
| 33 | /// </summary> | 27 | /// </summary> |
| 34 | - public string syb { get; set; } | ||
| 35 | - | 28 | + public string Category { get; set; } |
| 29 | + | ||
| 36 | /// <summary> | 30 | /// <summary> |
| 37 | - /// 教育部 | 31 | + /// 父级组织ID |
| 38 | /// </summary> | 32 | /// </summary> |
| 39 | - public string jyb { get; set; } | ||
| 40 | - | 33 | + public string ParentId { get; set; } |
| 34 | + | ||
| 41 | /// <summary> | 35 | /// <summary> |
| 42 | - /// 科技部 | 36 | + /// 组织主管ID |
| 43 | /// </summary> | 37 | /// </summary> |
| 44 | - public string kjb { get; set; } | ||
| 45 | - | 38 | + public string ManagerId { get; set; } |
| 39 | + | ||
| 46 | /// <summary> | 40 | /// <summary> |
| 47 | - /// 大项目部 | 41 | + /// 描述 |
| 48 | /// </summary> | 42 | /// </summary> |
| 49 | - public string dxmb { get; set; } | ||
| 50 | - | 43 | + public string Description { get; set; } |
| 44 | + | ||
| 51 | /// <summary> | 45 | /// <summary> |
| 52 | - /// 归属起始时间 | 46 | + /// 排序码 |
| 53 | /// </summary> | 47 | /// </summary> |
| 54 | - public DateTime? gsqssj { get; set; } | ||
| 55 | - | 48 | + public long? SortCode { get; set; } |
| 49 | + | ||
| 56 | /// <summary> | 50 | /// <summary> |
| 57 | - /// 归属终止时间 | 51 | + /// 是否启用 |
| 58 | /// </summary> | 52 | /// </summary> |
| 59 | - public DateTime? gszzsj { get; set; } | ||
| 60 | - | 53 | + public int? EnabledMark { get; set; } |
| 54 | + | ||
| 61 | /// <summary> | 55 | /// <summary> |
| 62 | - /// 修改信息 | 56 | + /// 子组织列表 |
| 63 | /// </summary> | 57 | /// </summary> |
| 64 | - public string xgxx { get; set; } | ||
| 65 | - | 58 | + public List<OrganizeTreeOutput> Children { get; set; } = new List<OrganizeTreeOutput>(); |
| 66 | } | 59 | } |
| 67 | } | 60 | } |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_md_mdgs/LqMdMdgsEntity.cs deleted
| 1 | -using NCC.Common.Const; | ||
| 2 | -using SqlSugar; | ||
| 3 | -using System; | ||
| 4 | - | ||
| 5 | -namespace NCC.Extend.Entitys.lq_md_mdgs | ||
| 6 | -{ | ||
| 7 | - /// <summary> | ||
| 8 | - /// 门店归属 | ||
| 9 | - /// </summary> | ||
| 10 | - [SugarTable("lq_md_mdgs")] | ||
| 11 | - [Tenant(ClaimConst.TENANT_ID)] | ||
| 12 | - public class LqMdMdgsEntity | ||
| 13 | - { | ||
| 14 | - /// <summary> | ||
| 15 | - /// 门店编码 | ||
| 16 | - /// </summary> | ||
| 17 | - [SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)] | ||
| 18 | - public string Id { get; set; } | ||
| 19 | - | ||
| 20 | - /// <summary> | ||
| 21 | - /// 单据门店编号 | ||
| 22 | - /// </summary> | ||
| 23 | - [SugarColumn(ColumnName = "djmdbh")] | ||
| 24 | - public string Djmdbh { get; set; } | ||
| 25 | - | ||
| 26 | - /// <summary> | ||
| 27 | - /// 单据门店 | ||
| 28 | - /// </summary> | ||
| 29 | - [SugarColumn(ColumnName = "djmd")] | ||
| 30 | - public string Djmd { get; set; } | ||
| 31 | - | ||
| 32 | - /// <summary> | ||
| 33 | - /// 门店名称 | ||
| 34 | - /// </summary> | ||
| 35 | - [SugarColumn(ColumnName = "mdmc")] | ||
| 36 | - public string Mdmc { get; set; } | ||
| 37 | - | ||
| 38 | - /// <summary> | ||
| 39 | - /// 事业部 | ||
| 40 | - /// </summary> | ||
| 41 | - [SugarColumn(ColumnName = "syb")] | ||
| 42 | - public string Syb { get; set; } | ||
| 43 | - | ||
| 44 | - /// <summary> | ||
| 45 | - /// 教育部 | ||
| 46 | - /// </summary> | ||
| 47 | - [SugarColumn(ColumnName = "jyb")] | ||
| 48 | - public string Jyb { get; set; } | ||
| 49 | - | ||
| 50 | - /// <summary> | ||
| 51 | - /// 科技部 | ||
| 52 | - /// </summary> | ||
| 53 | - [SugarColumn(ColumnName = "kjb")] | ||
| 54 | - public string Kjb { get; set; } | ||
| 55 | - | ||
| 56 | - /// <summary> | ||
| 57 | - /// 大项目部 | ||
| 58 | - /// </summary> | ||
| 59 | - [SugarColumn(ColumnName = "dxmb")] | ||
| 60 | - public string Dxmb { get; set; } | ||
| 61 | - | ||
| 62 | - /// <summary> | ||
| 63 | - /// 归属起始时间 | ||
| 64 | - /// </summary> | ||
| 65 | - [SugarColumn(ColumnName = "gsqssj")] | ||
| 66 | - public DateTime? Gsqssj { get; set; } | ||
| 67 | - | ||
| 68 | - /// <summary> | ||
| 69 | - /// 归属终止时间 | ||
| 70 | - /// </summary> | ||
| 71 | - [SugarColumn(ColumnName = "gszzsj")] | ||
| 72 | - public DateTime? Gszzsj { get; set; } | ||
| 73 | - | ||
| 74 | - /// <summary> | ||
| 75 | - /// 修改信息 | ||
| 76 | - /// </summary> | ||
| 77 | - [SugarColumn(ColumnName = "xgxx")] | ||
| 78 | - public string Xgxx { get; set; } | ||
| 79 | - | ||
| 80 | - } | ||
| 81 | -} | ||
| 82 | \ No newline at end of file | 0 | \ No newline at end of file |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_mdxx/LqMdxxEntity.cs
| @@ -101,5 +101,47 @@ namespace NCC.Extend.Entitys.lq_mdxx | @@ -101,5 +101,47 @@ namespace NCC.Extend.Entitys.lq_mdxx | ||
| 101 | [SugarColumn(ColumnName = "ywsb")] | 101 | [SugarColumn(ColumnName = "ywsb")] |
| 102 | public string Ywsb { get; set; } | 102 | public string Ywsb { get; set; } |
| 103 | 103 | ||
| 104 | + /// <summary> | ||
| 105 | + /// 事业部 | ||
| 106 | + /// </summary> | ||
| 107 | + [SugarColumn(ColumnName = "syb")] | ||
| 108 | + public string Syb { get; set; } | ||
| 109 | + | ||
| 110 | + /// <summary> | ||
| 111 | + /// 教育部 | ||
| 112 | + /// </summary> | ||
| 113 | + [SugarColumn(ColumnName = "jyb")] | ||
| 114 | + public string Jyb { get; set; } | ||
| 115 | + | ||
| 116 | + /// <summary> | ||
| 117 | + /// 科技部 | ||
| 118 | + /// </summary> | ||
| 119 | + [SugarColumn(ColumnName = "kjb")] | ||
| 120 | + public string Kjb { get; set; } | ||
| 121 | + | ||
| 122 | + /// <summary> | ||
| 123 | + /// 大项目部 | ||
| 124 | + /// </summary> | ||
| 125 | + [SugarColumn(ColumnName = "dxmb")] | ||
| 126 | + public string Dxmb { get; set; } | ||
| 127 | + | ||
| 128 | + /// <summary> | ||
| 129 | + /// 归属起始时间 | ||
| 130 | + /// </summary> | ||
| 131 | + [SugarColumn(ColumnName = "gsqssj")] | ||
| 132 | + public DateTime? Gsqssj { get; set; } | ||
| 133 | + | ||
| 134 | + /// <summary> | ||
| 135 | + /// 归属终止时间 | ||
| 136 | + /// </summary> | ||
| 137 | + [SugarColumn(ColumnName = "gszzsj")] | ||
| 138 | + public DateTime? Gszzsj { get; set; } | ||
| 139 | + | ||
| 140 | + /// <summary> | ||
| 141 | + /// 状态 | ||
| 142 | + /// </summary> | ||
| 143 | + [SugarColumn(ColumnName = "status")] | ||
| 144 | + public int? Status { get; set; } | ||
| 145 | + | ||
| 104 | } | 146 | } |
| 105 | } | 147 | } |
| 106 | \ No newline at end of file | 148 | \ No newline at end of file |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Mapper/LqMdMdgsMapper.cs deleted
| 1 | -using NCC.Common.Helper; | ||
| 2 | -using NCC.Extend.Entitys.Dto.LqMdMdgs; | ||
| 3 | -using Mapster; | ||
| 4 | -using System.Collections.Generic; | ||
| 5 | - | ||
| 6 | -namespace NCC.Extend.Entitys.Mapper.LqMdMdgs | ||
| 7 | -{ | ||
| 8 | - public class Mapper : IRegister | ||
| 9 | - { | ||
| 10 | - public void Register(TypeAdapterConfig config) | ||
| 11 | - { | ||
| 12 | - } | ||
| 13 | - } | ||
| 14 | -} |
netcore/src/Modularity/Extend/NCC.Extend.Interfaces/ILqMdMdgsService.cs deleted
netcore/src/Modularity/Extend/NCC.Extend.Interfaces/Organize/IOrganizeService.cs
0 → 100644
| 1 | +using NCC.Common.Entity; | ||
| 2 | +using NCC.Extend.Entitys.Dto.Organize; | ||
| 3 | +using System.Collections.Generic; | ||
| 4 | +using System.Threading.Tasks; | ||
| 5 | + | ||
| 6 | +namespace NCC.Extend.Interfaces.Organize | ||
| 7 | +{ | ||
| 8 | + /// <summary> | ||
| 9 | + /// 组织架构服务接口 | ||
| 10 | + /// </summary> | ||
| 11 | + public interface IOrganizeService | ||
| 12 | + { | ||
| 13 | + #region 组织架构查询 | ||
| 14 | + | ||
| 15 | + /// <summary> | ||
| 16 | + /// 获取组织架构列表 | ||
| 17 | + /// </summary> | ||
| 18 | + /// <remarks> | ||
| 19 | + /// 根据查询条件获取组织架构列表,支持分页查询 | ||
| 20 | + /// | ||
| 21 | + /// 示例请求: | ||
| 22 | + /// ```json | ||
| 23 | + /// { | ||
| 24 | + /// "fullName": "技术部", | ||
| 25 | + /// "category": "department", | ||
| 26 | + /// "parentId": "ORG001", | ||
| 27 | + /// "currentPage": 1, | ||
| 28 | + /// "pageSize": 20 | ||
| 29 | + /// } | ||
| 30 | + /// ``` | ||
| 31 | + /// | ||
| 32 | + /// 参数说明: | ||
| 33 | + /// - fullName: 组织名称(模糊查询) | ||
| 34 | + /// - category: 组织分类(company-公司、department-部门) | ||
| 35 | + /// - parentId: 父级组织ID | ||
| 36 | + /// - currentPage: 当前页码 | ||
| 37 | + /// - pageSize: 每页大小 | ||
| 38 | + /// </remarks> | ||
| 39 | + /// <param name="input">查询参数</param> | ||
| 40 | + /// <returns>组织架构列表</returns> | ||
| 41 | + /// <response code="200">成功返回组织架构列表</response> | ||
| 42 | + /// <response code="400">查询参数错误</response> | ||
| 43 | + /// <response code="500">服务器内部错误</response> | ||
| 44 | + Task<dynamic> GetList(OrganizeListQueryInput input); | ||
| 45 | + | ||
| 46 | + /// <summary> | ||
| 47 | + /// 获取组织架构树形结构 | ||
| 48 | + /// </summary> | ||
| 49 | + /// <remarks> | ||
| 50 | + /// 获取完整的组织架构树形结构,包含所有子组织 | ||
| 51 | + /// | ||
| 52 | + /// 示例请求: | ||
| 53 | + /// ```json | ||
| 54 | + /// { | ||
| 55 | + /// "parentId": "ORG001" | ||
| 56 | + /// } | ||
| 57 | + /// ``` | ||
| 58 | + /// | ||
| 59 | + /// 参数说明: | ||
| 60 | + /// - parentId: 根节点组织ID(可选,不传则从顶级开始) | ||
| 61 | + /// </remarks> | ||
| 62 | + /// <param name="parentId">父级组织ID(可选)</param> | ||
| 63 | + /// <returns>组织架构树形结构</returns> | ||
| 64 | + /// <response code="200">成功返回组织架构树</response> | ||
| 65 | + /// <response code="500">服务器内部错误</response> | ||
| 66 | + Task<List<OrganizeTreeOutput>> GetTree(string parentId = null); | ||
| 67 | + | ||
| 68 | + /// <summary> | ||
| 69 | + /// 根据组织名称获取该机构下面的所有组织 | ||
| 70 | + /// </summary> | ||
| 71 | + /// <remarks> | ||
| 72 | + /// 通过组织名称查找组织,并返回该组织及其所有子组织 | ||
| 73 | + /// | ||
| 74 | + /// 示例请求: | ||
| 75 | + /// ```json | ||
| 76 | + /// { | ||
| 77 | + /// "organizeName": "技术部" | ||
| 78 | + /// } | ||
| 79 | + /// ``` | ||
| 80 | + /// | ||
| 81 | + /// 参数说明: | ||
| 82 | + /// - organizeName: 组织名称(支持模糊查询) | ||
| 83 | + /// </remarks> | ||
| 84 | + /// <param name="organizeName">组织名称</param> | ||
| 85 | + /// <returns>组织及其子组织列表</returns> | ||
| 86 | + /// <response code="200">成功返回组织列表</response> | ||
| 87 | + /// <response code="400">组织名称不能为空</response> | ||
| 88 | + /// <response code="404">未找到指定组织</response> | ||
| 89 | + /// <response code="500">服务器内部错误</response> | ||
| 90 | + Task<dynamic> GetOrganizationsByName(string organizeName); | ||
| 91 | + | ||
| 92 | + /// <summary> | ||
| 93 | + /// 获取组织选择器数据 | ||
| 94 | + /// </summary> | ||
| 95 | + /// <remarks> | ||
| 96 | + /// 获取组织选择器所需的数据,用于下拉选择 | ||
| 97 | + /// | ||
| 98 | + /// 示例请求: | ||
| 99 | + /// ```json | ||
| 100 | + /// { | ||
| 101 | + /// "parentId": "ORG001" | ||
| 102 | + /// } | ||
| 103 | + /// ``` | ||
| 104 | + /// | ||
| 105 | + /// 参数说明: | ||
| 106 | + /// - parentId: 父级组织ID(可选) | ||
| 107 | + /// </remarks> | ||
| 108 | + /// <param name="parentId">父级组织ID(可选)</param> | ||
| 109 | + /// <returns>组织选择器数据</returns> | ||
| 110 | + /// <response code="200">成功返回组织选择器数据</response> | ||
| 111 | + /// <response code="500">服务器内部错误</response> | ||
| 112 | + Task<dynamic> GetSelector(string parentId = null); | ||
| 113 | + | ||
| 114 | + #endregion | ||
| 115 | + } | ||
| 116 | +} |
netcore/src/Modularity/Extend/NCC.Extend/LqMdMdgsService.cs deleted
| 1 | -using NCC.Common.Core.Manager; | ||
| 2 | -using NCC.Common.Enum; | ||
| 3 | -using NCC.Common.Extension; | ||
| 4 | -using NCC.Common.Filter; | ||
| 5 | -using NCC.Dependency; | ||
| 6 | -using NCC.DynamicApiController; | ||
| 7 | -using NCC.FriendlyException; | ||
| 8 | -using NCC.Extend.Interfaces.LqMdMdgs; | ||
| 9 | -using Mapster; | ||
| 10 | -using Microsoft.AspNetCore.Mvc; | ||
| 11 | -using SqlSugar; | ||
| 12 | -using System; | ||
| 13 | -using System.Collections.Generic; | ||
| 14 | -using System.Linq; | ||
| 15 | -using System.Threading.Tasks; | ||
| 16 | -using NCC.Extend.Entitys.lq_md_mdgs; | ||
| 17 | -using NCC.Extend.Entitys.Dto.LqMdMdgs; | ||
| 18 | -using Yitter.IdGenerator; | ||
| 19 | -using NCC.Common.Helper; | ||
| 20 | -using NCC.JsonSerialization; | ||
| 21 | -using NCC.Common.Model.NPOI; | ||
| 22 | -using NCC.Common.Configuration; | ||
| 23 | -using NCC.DataEncryption; | ||
| 24 | -using NCC.ClayObject; | ||
| 25 | - | ||
| 26 | -namespace NCC.Extend.LqMdMdgs | ||
| 27 | -{ | ||
| 28 | - /// <summary> | ||
| 29 | - /// 门店归属服务 | ||
| 30 | - /// </summary> | ||
| 31 | - [ApiDescriptionSettings(Tag = "Extend",Name = "LqMdMdgs", Order = 200)] | ||
| 32 | - [Route("api/Extend/[controller]")] | ||
| 33 | - public class LqMdMdgsService : ILqMdMdgsService, IDynamicApiController, ITransient | ||
| 34 | - { | ||
| 35 | - private readonly ISqlSugarRepository<LqMdMdgsEntity> _lqMdMdgsRepository; | ||
| 36 | - private readonly SqlSugarScope _db; | ||
| 37 | - private readonly IUserManager _userManager; | ||
| 38 | - | ||
| 39 | - /// <summary> | ||
| 40 | - /// 初始化一个<see cref="LqMdMdgsService"/>类型的新实例 | ||
| 41 | - /// </summary> | ||
| 42 | - public LqMdMdgsService( | ||
| 43 | - ISqlSugarRepository<LqMdMdgsEntity> lqMdMdgsRepository, | ||
| 44 | - IUserManager userManager) | ||
| 45 | - { | ||
| 46 | - _lqMdMdgsRepository = lqMdMdgsRepository; | ||
| 47 | - _db = _lqMdMdgsRepository.Context; | ||
| 48 | - _userManager = userManager; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - /// <summary> | ||
| 52 | - /// 获取门店归属 | ||
| 53 | - /// </summary> | ||
| 54 | - /// <param name="id">参数</param> | ||
| 55 | - /// <returns></returns> | ||
| 56 | - [HttpGet("{id}")] | ||
| 57 | - public async Task<dynamic> GetInfo(string id) | ||
| 58 | - { | ||
| 59 | - var entity = await _db.Queryable<LqMdMdgsEntity>().FirstAsync(p => p.Id == id); | ||
| 60 | - var output = entity.Adapt<LqMdMdgsInfoOutput>(); | ||
| 61 | - return output; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - /// <summary> | ||
| 65 | - /// 获取门店归属列表 | ||
| 66 | - /// </summary> | ||
| 67 | - /// <param name="input">请求参数</param> | ||
| 68 | - /// <returns></returns> | ||
| 69 | - [HttpGet("")] | ||
| 70 | - public async Task<dynamic> GetList([FromQuery] LqMdMdgsListQueryInput input) | ||
| 71 | - { | ||
| 72 | - var sidx = input.sidx == null ? "id" : input.sidx; | ||
| 73 | - List<string> queryGsqssj = input.gsqssj != null ? input.gsqssj.Split(',').ToObeject<List<string>>() : null; | ||
| 74 | - DateTime? startGsqssj = queryGsqssj != null ? Ext.GetDateTime(queryGsqssj.First()) : null; | ||
| 75 | - DateTime? endGsqssj = queryGsqssj != null ? Ext.GetDateTime(queryGsqssj.Last()) : null; | ||
| 76 | - List<string> queryGszzsj = input.gszzsj != null ? input.gszzsj.Split(',').ToObeject<List<string>>() : null; | ||
| 77 | - DateTime? startGszzsj = queryGszzsj != null ? Ext.GetDateTime(queryGszzsj.First()) : null; | ||
| 78 | - DateTime? endGszzsj = queryGszzsj != null ? Ext.GetDateTime(queryGszzsj.Last()) : null; | ||
| 79 | - var data = await _db.Queryable<LqMdMdgsEntity>() | ||
| 80 | - .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | ||
| 81 | - .WhereIF(!string.IsNullOrEmpty(input.djmdbh), p => p.Djmdbh.Contains(input.djmdbh)) | ||
| 82 | - .WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Contains(input.djmd)) | ||
| 83 | - .WhereIF(!string.IsNullOrEmpty(input.mdmc), p => p.Mdmc.Equals(input.mdmc)) | ||
| 84 | - .WhereIF(!string.IsNullOrEmpty(input.syb), p => p.Syb.Equals(input.syb)) | ||
| 85 | - .WhereIF(!string.IsNullOrEmpty(input.jyb), p => p.Jyb.Equals(input.jyb)) | ||
| 86 | - .WhereIF(!string.IsNullOrEmpty(input.kjb), p => p.Kjb.Equals(input.kjb)) | ||
| 87 | - .WhereIF(!string.IsNullOrEmpty(input.dxmb), p => p.Dxmb.Equals(input.dxmb)) | ||
| 88 | - .WhereIF(queryGsqssj != null, p => p.Gsqssj >= new DateTime(startGsqssj.ToDate().Year, startGsqssj.ToDate().Month, startGsqssj.ToDate().Day, 0, 0, 0)) | ||
| 89 | - .WhereIF(queryGsqssj != null, p => p.Gsqssj <= new DateTime(endGsqssj.ToDate().Year, endGsqssj.ToDate().Month, endGsqssj.ToDate().Day, 23, 59, 59)) | ||
| 90 | - .WhereIF(queryGszzsj != null, p => p.Gszzsj >= new DateTime(startGszzsj.ToDate().Year, startGszzsj.ToDate().Month, startGszzsj.ToDate().Day, 0, 0, 0)) | ||
| 91 | - .WhereIF(queryGszzsj != null, p => p.Gszzsj <= new DateTime(endGszzsj.ToDate().Year, endGszzsj.ToDate().Month, endGszzsj.ToDate().Day, 23, 59, 59)) | ||
| 92 | - .WhereIF(!string.IsNullOrEmpty(input.xgxx), p => p.Xgxx.Contains(input.xgxx)) | ||
| 93 | - .Select(it=> new LqMdMdgsListOutput | ||
| 94 | - { | ||
| 95 | - id = it.Id, | ||
| 96 | - djmdbh=it.Djmdbh, | ||
| 97 | - djmd=it.Djmd, | ||
| 98 | - mdmc=it.Mdmc, | ||
| 99 | - syb=it.Syb, | ||
| 100 | - jyb=it.Jyb, | ||
| 101 | - kjb=it.Kjb, | ||
| 102 | - dxmb=it.Dxmb, | ||
| 103 | - gsqssj=it.Gsqssj, | ||
| 104 | - gszzsj=it.Gszzsj, | ||
| 105 | - xgxx=it.Xgxx, | ||
| 106 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 107 | - return PageResult<LqMdMdgsListOutput>.SqlSugarPageResult(data); | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - /// <summary> | ||
| 111 | - /// 新建门店归属 | ||
| 112 | - /// </summary> | ||
| 113 | - /// <param name="input">参数</param> | ||
| 114 | - /// <returns></returns> | ||
| 115 | - [HttpPost("")] | ||
| 116 | - public async Task Create([FromBody] LqMdMdgsCrInput input) | ||
| 117 | - { | ||
| 118 | - var userInfo = await _userManager.GetUserInfo(); | ||
| 119 | - var entity = input.Adapt<LqMdMdgsEntity>(); | ||
| 120 | - entity.Id = YitIdHelper.NextId().ToString(); | ||
| 121 | - var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | ||
| 122 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | ||
| 123 | - } | ||
| 124 | - | ||
| 125 | - /// <summary> | ||
| 126 | - /// 获取门店归属无分页列表 | ||
| 127 | - /// </summary> | ||
| 128 | - /// <param name="input">请求参数</param> | ||
| 129 | - /// <returns></returns> | ||
| 130 | - [NonAction] | ||
| 131 | - public async Task<dynamic> GetNoPagingList([FromQuery] LqMdMdgsListQueryInput input) | ||
| 132 | - { | ||
| 133 | - var sidx = input.sidx == null ? "id" : input.sidx; | ||
| 134 | - List<string> queryGsqssj = input.gsqssj != null ? input.gsqssj.Split(',').ToObeject<List<string>>() : null; | ||
| 135 | - DateTime? startGsqssj = queryGsqssj != null ? Ext.GetDateTime(queryGsqssj.First()) : null; | ||
| 136 | - DateTime? endGsqssj = queryGsqssj != null ? Ext.GetDateTime(queryGsqssj.Last()) : null; | ||
| 137 | - List<string> queryGszzsj = input.gszzsj != null ? input.gszzsj.Split(',').ToObeject<List<string>>() : null; | ||
| 138 | - DateTime? startGszzsj = queryGszzsj != null ? Ext.GetDateTime(queryGszzsj.First()) : null; | ||
| 139 | - DateTime? endGszzsj = queryGszzsj != null ? Ext.GetDateTime(queryGszzsj.Last()) : null; | ||
| 140 | - var data = await _db.Queryable<LqMdMdgsEntity>() | ||
| 141 | - .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | ||
| 142 | - .WhereIF(!string.IsNullOrEmpty(input.djmdbh), p => p.Djmdbh.Contains(input.djmdbh)) | ||
| 143 | - .WhereIF(!string.IsNullOrEmpty(input.djmd), p => p.Djmd.Contains(input.djmd)) | ||
| 144 | - .WhereIF(!string.IsNullOrEmpty(input.mdmc), p => p.Mdmc.Equals(input.mdmc)) | ||
| 145 | - .WhereIF(!string.IsNullOrEmpty(input.syb), p => p.Syb.Equals(input.syb)) | ||
| 146 | - .WhereIF(!string.IsNullOrEmpty(input.jyb), p => p.Jyb.Equals(input.jyb)) | ||
| 147 | - .WhereIF(!string.IsNullOrEmpty(input.kjb), p => p.Kjb.Equals(input.kjb)) | ||
| 148 | - .WhereIF(!string.IsNullOrEmpty(input.dxmb), p => p.Dxmb.Equals(input.dxmb)) | ||
| 149 | - .WhereIF(queryGsqssj != null, p => p.Gsqssj >= new DateTime(startGsqssj.ToDate().Year, startGsqssj.ToDate().Month, startGsqssj.ToDate().Day, 0, 0, 0)) | ||
| 150 | - .WhereIF(queryGsqssj != null, p => p.Gsqssj <= new DateTime(endGsqssj.ToDate().Year, endGsqssj.ToDate().Month, endGsqssj.ToDate().Day, 23, 59, 59)) | ||
| 151 | - .WhereIF(queryGszzsj != null, p => p.Gszzsj >= new DateTime(startGszzsj.ToDate().Year, startGszzsj.ToDate().Month, startGszzsj.ToDate().Day, 0, 0, 0)) | ||
| 152 | - .WhereIF(queryGszzsj != null, p => p.Gszzsj <= new DateTime(endGszzsj.ToDate().Year, endGszzsj.ToDate().Month, endGszzsj.ToDate().Day, 23, 59, 59)) | ||
| 153 | - .WhereIF(!string.IsNullOrEmpty(input.xgxx), p => p.Xgxx.Contains(input.xgxx)) | ||
| 154 | - .Select(it=> new LqMdMdgsListOutput | ||
| 155 | - { | ||
| 156 | - id = it.Id, | ||
| 157 | - djmdbh=it.Djmdbh, | ||
| 158 | - djmd=it.Djmd, | ||
| 159 | - mdmc=it.Mdmc, | ||
| 160 | - syb=it.Syb, | ||
| 161 | - jyb=it.Jyb, | ||
| 162 | - kjb=it.Kjb, | ||
| 163 | - dxmb=it.Dxmb, | ||
| 164 | - gsqssj=it.Gsqssj, | ||
| 165 | - gszzsj=it.Gszzsj, | ||
| 166 | - xgxx=it.Xgxx, | ||
| 167 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | ||
| 168 | - return data; | ||
| 169 | - } | ||
| 170 | - | ||
| 171 | - /// <summary> | ||
| 172 | - /// 导出门店归属 | ||
| 173 | - /// </summary> | ||
| 174 | - /// <param name="input">请求参数</param> | ||
| 175 | - /// <returns></returns> | ||
| 176 | - [HttpGet("Actions/Export")] | ||
| 177 | - public async Task<dynamic> Export([FromQuery] LqMdMdgsListQueryInput input) | ||
| 178 | - { | ||
| 179 | - var userInfo = await _userManager.GetUserInfo(); | ||
| 180 | - var exportData = new List<LqMdMdgsListOutput>(); | ||
| 181 | - if (input.dataType == 0) | ||
| 182 | - { | ||
| 183 | - var data = Clay.Object(await this.GetList(input)); | ||
| 184 | - exportData = data.Solidify<PageResult<LqMdMdgsListOutput>>().list; | ||
| 185 | - } | ||
| 186 | - else | ||
| 187 | - { | ||
| 188 | - exportData = await this.GetNoPagingList(input); | ||
| 189 | - } | ||
| 190 | - List<ParamsModel> paramList = "[{\"value\":\"门店编码\",\"field\":\"id\"},{\"value\":\"单据门店编号\",\"field\":\"djmdbh\"},{\"value\":\"单据门店\",\"field\":\"djmd\"},{\"value\":\"事业部\",\"field\":\"syb\"},{\"value\":\"教育部\",\"field\":\"jyb\"},{\"value\":\"科技部\",\"field\":\"kjb\"},{\"value\":\"大项目部\",\"field\":\"dxmb\"},{\"value\":\"归属起始时间\",\"field\":\"gsqssj\"},{\"value\":\"归属终止时间\",\"field\":\"gszzsj\"},{\"value\":\"修改信息\",\"field\":\"xgxx\"},{\"value\":\"门店名称\",\"field\":\"mdmc\"},]".ToList<ParamsModel>(); | ||
| 191 | - ExcelConfig excelconfig = new ExcelConfig(); | ||
| 192 | - excelconfig.FileName = "门店归属.xls"; | ||
| 193 | - excelconfig.HeadFont = "微软雅黑"; | ||
| 194 | - excelconfig.HeadPoint = 10; | ||
| 195 | - excelconfig.IsAllSizeColumn = true; | ||
| 196 | - excelconfig.ColumnModel = new List<ExcelColumnModel>(); | ||
| 197 | - List<string> selectKeyList = input.selectKey.Split(',').ToList(); | ||
| 198 | - foreach (var item in selectKeyList) | ||
| 199 | - { | ||
| 200 | - var isExist = paramList.Find(p => p.field == item); | ||
| 201 | - if (isExist != null) | ||
| 202 | - { | ||
| 203 | - excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | ||
| 204 | - } | ||
| 205 | - } | ||
| 206 | - var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | ||
| 207 | - ExcelExportHelper<LqMdMdgsListOutput>.Export(exportData, excelconfig, addPath); | ||
| 208 | - var fileName = _userManager.UserId + "|" + addPath + "|xls"; | ||
| 209 | - var output = new | ||
| 210 | - { | ||
| 211 | - name = excelconfig.FileName, | ||
| 212 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | ||
| 213 | - }; | ||
| 214 | - return output; | ||
| 215 | - } | ||
| 216 | - | ||
| 217 | - /// <summary> | ||
| 218 | - /// 批量删除门店归属 | ||
| 219 | - /// </summary> | ||
| 220 | - /// <param name="ids">主键数组</param> | ||
| 221 | - /// <returns></returns> | ||
| 222 | - [HttpPost("batchRemove")] | ||
| 223 | - public async Task BatchRemove([FromBody] List<string> ids) | ||
| 224 | - { | ||
| 225 | - var entitys = await _db.Queryable<LqMdMdgsEntity>().In(it => it.Id, ids).ToListAsync(); | ||
| 226 | - if (entitys.Count > 0) | ||
| 227 | - { | ||
| 228 | - try | ||
| 229 | - { | ||
| 230 | - //开启事务 | ||
| 231 | - _db.BeginTran(); | ||
| 232 | - //批量删除门店归属 | ||
| 233 | - await _db.Deleteable<LqMdMdgsEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | ||
| 234 | - //关闭事务 | ||
| 235 | - _db.CommitTran(); | ||
| 236 | - } | ||
| 237 | - catch (Exception) | ||
| 238 | - { | ||
| 239 | - //回滚事务 | ||
| 240 | - _db.RollbackTran(); | ||
| 241 | - throw NCCException.Oh(ErrorCode.COM1002); | ||
| 242 | - } | ||
| 243 | - } | ||
| 244 | - } | ||
| 245 | - | ||
| 246 | - /// <summary> | ||
| 247 | - /// 更新门店归属 | ||
| 248 | - /// </summary> | ||
| 249 | - /// <param name="id">主键</param> | ||
| 250 | - /// <param name="input">参数</param> | ||
| 251 | - /// <returns></returns> | ||
| 252 | - [HttpPut("{id}")] | ||
| 253 | - public async Task Update(string id, [FromBody] LqMdMdgsUpInput input) | ||
| 254 | - { | ||
| 255 | - var entity = input.Adapt<LqMdMdgsEntity>(); | ||
| 256 | - var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | ||
| 257 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | ||
| 258 | - } | ||
| 259 | - | ||
| 260 | - /// <summary> | ||
| 261 | - /// 删除门店归属 | ||
| 262 | - /// </summary> | ||
| 263 | - /// <returns></returns> | ||
| 264 | - [HttpDelete("{id}")] | ||
| 265 | - public async Task Delete(string id) | ||
| 266 | - { | ||
| 267 | - var entity = await _db.Queryable<LqMdMdgsEntity>().FirstAsync(p => p.Id == id); | ||
| 268 | - _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | ||
| 269 | - var isOk = await _db.Deleteable<LqMdMdgsEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | ||
| 270 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | ||
| 271 | - } | ||
| 272 | - } | ||
| 273 | -} |
netcore/src/Modularity/Extend/NCC.Extend/LqMdxxService.cs
| @@ -107,6 +107,10 @@ namespace NCC.Extend.LqMdxx | @@ -107,6 +107,10 @@ namespace NCC.Extend.LqMdxx | ||
| 107 | gsmc=it.Gsmc, | 107 | gsmc=it.Gsmc, |
| 108 | fr=it.Fr, | 108 | fr=it.Fr, |
| 109 | ywsb=it.Ywsb, | 109 | ywsb=it.Ywsb, |
| 110 | + jyb=it.Jyb, | ||
| 111 | + kjb=it.Kjb, | ||
| 112 | + dxmb=it.Dxmb, | ||
| 113 | + syb=it.Syb, | ||
| 110 | }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | 114 | }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); |
| 111 | return PageResult<LqMdxxListOutput>.SqlSugarPageResult(data); | 115 | return PageResult<LqMdxxListOutput>.SqlSugarPageResult(data); |
| 112 | } | 116 | } |
| @@ -261,6 +265,7 @@ namespace NCC.Extend.LqMdxx | @@ -261,6 +265,7 @@ namespace NCC.Extend.LqMdxx | ||
| 261 | public async Task Update(string id, [FromBody] LqMdxxUpInput input) | 265 | public async Task Update(string id, [FromBody] LqMdxxUpInput input) |
| 262 | { | 266 | { |
| 263 | var entity = input.Adapt<LqMdxxEntity>(); | 267 | var entity = input.Adapt<LqMdxxEntity>(); |
| 268 | + entity.Id = id; // 设置主键ID | ||
| 264 | var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | 269 | var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); |
| 265 | if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | 270 | if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); |
| 266 | } | 271 | } |
netcore/src/Modularity/Extend/NCC.Extend/OrganizeService.cs
0 → 100644
| 1 | +using NCC.Common.Entity; | ||
| 2 | +using NCC.Extend.Entitys.Dto.Organize; | ||
| 3 | +using NCC.Extend.Interfaces.Organize; | ||
| 4 | +using NCC.System.Entitys.Permission; | ||
| 5 | +using NCC.Dependency; | ||
| 6 | +using NCC.DynamicApiController; | ||
| 7 | +using Microsoft.AspNetCore.Mvc; | ||
| 8 | +using SqlSugar; | ||
| 9 | +using System; | ||
| 10 | +using System.Collections.Generic; | ||
| 11 | +using System.Linq; | ||
| 12 | +using System.Threading.Tasks; | ||
| 13 | + | ||
| 14 | +namespace NCC.Extend | ||
| 15 | +{ | ||
| 16 | + /// <summary> | ||
| 17 | + /// 组织架构服务实现 | ||
| 18 | + /// </summary> | ||
| 19 | + [ApiDescriptionSettings(Tag = "绿纤组织架构服务", Name = "Organize", Order = 201)] | ||
| 20 | + [Route("api/Extend/[controller]")] | ||
| 21 | + public class OrganizeService : IOrganizeService, IDynamicApiController, ITransient | ||
| 22 | + { | ||
| 23 | + private readonly ISqlSugarClient _db; | ||
| 24 | + | ||
| 25 | + /// <summary> | ||
| 26 | + /// 初始化组织架构服务 | ||
| 27 | + /// </summary> | ||
| 28 | + /// <param name="db">数据库客户端</param> | ||
| 29 | + public OrganizeService(ISqlSugarClient db) | ||
| 30 | + { | ||
| 31 | + _db = db; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + #region 组织架构查询 | ||
| 35 | + | ||
| 36 | + /// <summary> | ||
| 37 | + /// 获取组织架构列表 | ||
| 38 | + /// </summary> | ||
| 39 | + /// <param name="input">查询参数</param> | ||
| 40 | + /// <returns>组织架构列表</returns> | ||
| 41 | + [HttpGet("")] | ||
| 42 | + public async Task<dynamic> GetList([FromQuery] OrganizeListQueryInput input) | ||
| 43 | + { | ||
| 44 | + var query = _db.Queryable<OrganizeEntity>() | ||
| 45 | + .WhereIF(!string.IsNullOrEmpty(input.FullName), x => x.FullName.Contains(input.FullName)) | ||
| 46 | + .WhereIF(!string.IsNullOrEmpty(input.EnCode), x => x.EnCode.Contains(input.EnCode)) | ||
| 47 | + .WhereIF(!string.IsNullOrEmpty(input.Category), x => x.Category == input.Category) | ||
| 48 | + .WhereIF(!string.IsNullOrEmpty(input.ParentId), x => x.ParentId == input.ParentId) | ||
| 49 | + .WhereIF(input.EnabledMark.HasValue, x => x.EnabledMark == input.EnabledMark) | ||
| 50 | + .Where(x => x.DeleteMark == null) | ||
| 51 | + .OrderBy(x => x.SortCode, OrderByType.Asc) | ||
| 52 | + .OrderBy(x => x.CreatorTime, OrderByType.Desc); | ||
| 53 | + | ||
| 54 | + var total = await query.CountAsync(); | ||
| 55 | + var list = await query | ||
| 56 | + .Select(x => new OrganizeListOutput | ||
| 57 | + { | ||
| 58 | + Id = x.Id, | ||
| 59 | + FullName = x.FullName, | ||
| 60 | + EnCode = x.EnCode, | ||
| 61 | + Category = x.Category, | ||
| 62 | + ParentId = x.ParentId, | ||
| 63 | + ManagerId = x.ManagerId, | ||
| 64 | + Description = x.Description, | ||
| 65 | + SortCode = x.SortCode, | ||
| 66 | + EnabledMark = x.EnabledMark, | ||
| 67 | + CreatorTime = x.CreatorTime | ||
| 68 | + }) | ||
| 69 | + .ToPagedListAsync(input.currentPage, input.pageSize); | ||
| 70 | + | ||
| 71 | + // 获取父级组织名称和主管姓名 | ||
| 72 | + var parentIds = list.list.Where(x => !string.IsNullOrEmpty(x.ParentId)).Select(x => x.ParentId).Distinct().ToList(); | ||
| 73 | + var managerIds = list.list.Where(x => !string.IsNullOrEmpty(x.ManagerId)).Select(x => x.ManagerId).Distinct().ToList(); | ||
| 74 | + | ||
| 75 | + var parentMap = new Dictionary<string, string>(); | ||
| 76 | + var managerMap = new Dictionary<string, string>(); | ||
| 77 | + | ||
| 78 | + if (parentIds.Any()) | ||
| 79 | + { | ||
| 80 | + var parents = await _db.Queryable<OrganizeEntity>() | ||
| 81 | + .Where(x => parentIds.Contains(x.Id)) | ||
| 82 | + .Select(x => new { x.Id, x.FullName }) | ||
| 83 | + .ToListAsync(); | ||
| 84 | + parentMap = parents.ToDictionary(x => x.Id, x => x.FullName); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + if (managerIds.Any()) | ||
| 88 | + { | ||
| 89 | + var managers = await _db.Queryable<UserEntity>() | ||
| 90 | + .Where(x => managerIds.Contains(x.Id)) | ||
| 91 | + .Select(x => new { x.Id, x.RealName }) | ||
| 92 | + .ToListAsync(); | ||
| 93 | + managerMap = managers.ToDictionary(x => x.Id, x => x.RealName); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + // 填充父级组织名称和主管姓名 | ||
| 97 | + foreach (var item in list.list) | ||
| 98 | + { | ||
| 99 | + if (!string.IsNullOrEmpty(item.ParentId) && parentMap.ContainsKey(item.ParentId)) | ||
| 100 | + { | ||
| 101 | + item.ParentName = parentMap[item.ParentId]; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + if (!string.IsNullOrEmpty(item.ManagerId) && managerMap.ContainsKey(item.ManagerId)) | ||
| 105 | + { | ||
| 106 | + item.ManagerName = managerMap[item.ManagerId]; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + // 获取子组织数量 | ||
| 110 | + item.ChildrenCount = await _db.Queryable<OrganizeEntity>() | ||
| 111 | + .Where(x => x.ParentId == item.Id && x.DeleteMark == null) | ||
| 112 | + .CountAsync(); | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + return new { list = list.list, total }; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + /// <summary> | ||
| 119 | + /// 获取组织架构树形结构 | ||
| 120 | + /// </summary> | ||
| 121 | + /// <param name="parentId">父级组织ID(可选)</param> | ||
| 122 | + /// <returns>组织架构树形结构</returns> | ||
| 123 | + [HttpGet("Tree")] | ||
| 124 | + public async Task<List<OrganizeTreeOutput>> GetTree([FromQuery] string parentId = null) | ||
| 125 | + { | ||
| 126 | + var query = _db.Queryable<OrganizeEntity>() | ||
| 127 | + .Where(x => x.DeleteMark == null) | ||
| 128 | + .WhereIF(!string.IsNullOrEmpty(parentId), x => x.ParentId == parentId) | ||
| 129 | + .WhereIF(string.IsNullOrEmpty(parentId), x => string.IsNullOrEmpty(x.ParentId)) | ||
| 130 | + .OrderBy(x => x.SortCode, OrderByType.Asc) | ||
| 131 | + .OrderBy(x => x.CreatorTime, OrderByType.Desc); | ||
| 132 | + | ||
| 133 | + var list = await query | ||
| 134 | + .Select(x => new OrganizeTreeOutput | ||
| 135 | + { | ||
| 136 | + Id = x.Id, | ||
| 137 | + FullName = x.FullName, | ||
| 138 | + EnCode = x.EnCode, | ||
| 139 | + Category = x.Category, | ||
| 140 | + ParentId = x.ParentId, | ||
| 141 | + ManagerId = x.ManagerId, | ||
| 142 | + Description = x.Description, | ||
| 143 | + SortCode = x.SortCode, | ||
| 144 | + EnabledMark = x.EnabledMark | ||
| 145 | + }) | ||
| 146 | + .ToListAsync(); | ||
| 147 | + | ||
| 148 | + | ||
| 149 | + // 构建树形结构 | ||
| 150 | + return BuildTree(list, parentId); | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + /// <summary> | ||
| 154 | + /// 根据组织名称获取该机构下面的所有组织 | ||
| 155 | + /// </summary> | ||
| 156 | + /// <param name="organizeName">组织名称</param> | ||
| 157 | + /// <returns>组织及其子组织列表</returns> | ||
| 158 | + [HttpGet("GetByName")] | ||
| 159 | + public async Task<dynamic> GetOrganizationsByName([FromQuery] string organizeName) | ||
| 160 | + { | ||
| 161 | + if (string.IsNullOrEmpty(organizeName)) | ||
| 162 | + { | ||
| 163 | + throw new ArgumentException("组织名称不能为空", nameof(organizeName)); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + // 查找匹配的组织 | ||
| 167 | + var matchedOrganizes = await _db.Queryable<OrganizeEntity>().Where(x => x.FullName == organizeName && x.DeleteMark == null).FirstAsync(); | ||
| 168 | + if (matchedOrganizes == null) | ||
| 169 | + { | ||
| 170 | + throw new ArgumentException("未找到指定组织", nameof(organizeName)); | ||
| 171 | + } | ||
| 172 | + var result = await _db.Queryable<OrganizeEntity>().Where(x => x.ParentId == matchedOrganizes.Id && x.DeleteMark == null).Select(x => new OrganizeTreeOutput | ||
| 173 | + { | ||
| 174 | + Id = x.Id, | ||
| 175 | + FullName = x.FullName, | ||
| 176 | + EnCode = x.EnCode, | ||
| 177 | + Category = x.Category, | ||
| 178 | + }).ToListAsync(); | ||
| 179 | + return result; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + /// <summary> | ||
| 183 | + /// 获取组织选择器数据 | ||
| 184 | + /// </summary> | ||
| 185 | + /// <param name="parentId">父级组织ID(可选)</param> | ||
| 186 | + /// <returns>组织选择器数据</returns> | ||
| 187 | + [HttpGet("Selector")] | ||
| 188 | + public async Task<dynamic> GetSelector([FromQuery] string parentId = null) | ||
| 189 | + { | ||
| 190 | + var query = _db.Queryable<OrganizeEntity>() | ||
| 191 | + .Where(x => x.DeleteMark == null && x.EnabledMark == 1) | ||
| 192 | + .WhereIF(!string.IsNullOrEmpty(parentId), x => x.ParentId == parentId) | ||
| 193 | + .WhereIF(string.IsNullOrEmpty(parentId), x => string.IsNullOrEmpty(x.ParentId)) | ||
| 194 | + .OrderBy(x => x.SortCode, OrderByType.Asc) | ||
| 195 | + .OrderBy(x => x.CreatorTime, OrderByType.Desc); | ||
| 196 | + | ||
| 197 | + var list = await query | ||
| 198 | + .Select(x => new | ||
| 199 | + { | ||
| 200 | + id = x.Id, | ||
| 201 | + fullName = x.FullName, | ||
| 202 | + enCode = x.EnCode, | ||
| 203 | + category = x.Category, | ||
| 204 | + parentId = x.ParentId | ||
| 205 | + }) | ||
| 206 | + .ToListAsync(); | ||
| 207 | + | ||
| 208 | + return new { list }; | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + #endregion | ||
| 212 | + | ||
| 213 | + #region 私有方法 | ||
| 214 | + | ||
| 215 | + /// <summary> | ||
| 216 | + /// 构建树形结构 | ||
| 217 | + /// </summary> | ||
| 218 | + /// <param name="list">组织列表</param> | ||
| 219 | + /// <param name="parentId">父级ID</param> | ||
| 220 | + /// <returns>树形结构</returns> | ||
| 221 | + private List<OrganizeTreeOutput> BuildTree(List<OrganizeTreeOutput> list, string parentId) | ||
| 222 | + { | ||
| 223 | + var result = new List<OrganizeTreeOutput>(); | ||
| 224 | + var parentIdValue = parentId ?? ""; | ||
| 225 | + | ||
| 226 | + foreach (var item in list.Where(x => x.ParentId == parentIdValue)) | ||
| 227 | + { | ||
| 228 | + var children = BuildTree(list, item.Id); | ||
| 229 | + item.Children = children; | ||
| 230 | + result.Add(item); | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + return result; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + /// <summary> | ||
| 237 | + /// 获取所有子组织 | ||
| 238 | + /// </summary> | ||
| 239 | + /// <param name="parentId">父级组织ID</param> | ||
| 240 | + /// <returns>子组织列表</returns> | ||
| 241 | + private async Task<List<OrganizeTreeOutput>> GetAllChildren(string parentId) | ||
| 242 | + { | ||
| 243 | + var children = await _db.Queryable<OrganizeEntity>() | ||
| 244 | + .Where(x => x.ParentId == parentId && x.DeleteMark == null) | ||
| 245 | + .Select(x => new OrganizeTreeOutput | ||
| 246 | + { | ||
| 247 | + Id = x.Id, | ||
| 248 | + FullName = x.FullName, | ||
| 249 | + EnCode = x.EnCode, | ||
| 250 | + Category = x.Category, | ||
| 251 | + ParentId = x.ParentId, | ||
| 252 | + ManagerId = x.ManagerId, | ||
| 253 | + Description = x.Description, | ||
| 254 | + SortCode = x.SortCode, | ||
| 255 | + EnabledMark = x.EnabledMark | ||
| 256 | + }) | ||
| 257 | + .ToListAsync(); | ||
| 258 | + | ||
| 259 | + var allChildren = new List<OrganizeTreeOutput>(children); | ||
| 260 | + | ||
| 261 | + foreach (var child in children) | ||
| 262 | + { | ||
| 263 | + var grandChildren = await GetAllChildren(child.Id); | ||
| 264 | + allChildren.AddRange(grandChildren); | ||
| 265 | + } | ||
| 266 | + | ||
| 267 | + return allChildren; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + #endregion | ||
| 271 | + } | ||
| 272 | + | ||
| 273 | + /// <summary> | ||
| 274 | + /// 组织比较器 | ||
| 275 | + /// </summary> | ||
| 276 | + public class OrganizeComparer : IEqualityComparer<OrganizeTreeOutput> | ||
| 277 | + { | ||
| 278 | + /// <summary> | ||
| 279 | + /// 比较两个组织是否相等 | ||
| 280 | + /// </summary> | ||
| 281 | + /// <param name="x">组织1</param> | ||
| 282 | + /// <param name="y">组织2</param> | ||
| 283 | + /// <returns>是否相等</returns> | ||
| 284 | + public bool Equals(OrganizeTreeOutput x, OrganizeTreeOutput y) | ||
| 285 | + { | ||
| 286 | + return x?.Id == y?.Id; | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + /// <summary> | ||
| 290 | + /// 获取组织的哈希码 | ||
| 291 | + /// </summary> | ||
| 292 | + /// <param name="obj">组织对象</param> | ||
| 293 | + /// <returns>哈希码</returns> | ||
| 294 | + public int GetHashCode(OrganizeTreeOutput obj) | ||
| 295 | + { | ||
| 296 | + return obj?.Id?.GetHashCode() ?? 0; | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | +} |
参考资料/.DS_Store
No preview for this file type
参考资料/整体-8.15/.DS_Store
No preview for this file type
数据库说明.md
| @@ -26,9 +26,14 @@ | @@ -26,9 +26,14 @@ | ||
| 26 | - **业务字段**:使用拼音首字母缩写 | 26 | - **业务字段**:使用拼音首字母缩写 |
| 27 | - **时间字段**:统一使用 `datetime` 类型 | 27 | - **时间字段**:统一使用 `datetime` 类型 |
| 28 | - **金额字段**:统一使用 `decimal` 类型 | 28 | - **金额字段**:统一使用 `decimal` 类型 |
| 29 | +- **删除标记**:`DeleteMark` 字段为 `null` 表示未删除,为 `0` 或其他值表示已删除 | ||
| 30 | + | ||
| 31 | +### 重要字段规则 | ||
| 32 | +- **base_organize 表删除标记**:`DeleteMark` 字段为 `null` 表示未删除,为 `0` 或其他值表示已删除 | ||
| 29 | 33 | ||
| 30 | ### 已弃用表 | 34 | ### 已弃用表 |
| 31 | - **lq_ryzl (人员资料表)** - 已弃用,人员信息现在使用系统用户表 `BASE_USER` 管理 | 35 | - **lq_ryzl (人员资料表)** - 已弃用,人员信息现在使用系统用户表 `BASE_USER` 管理 |
| 36 | +- **lq_mdxx_mdgs (门店归属表)** - 已弃用,门店归属信息已整合到 `lq_mdxx` 表中 | ||
| 32 | 37 | ||
| 33 | --- | 38 | --- |
| 34 | 39 | ||
| @@ -39,27 +44,34 @@ | @@ -39,27 +44,34 @@ | ||
| 39 | #### lq_mdxx (门店资料) | 44 | #### lq_mdxx (门店资料) |
| 40 | | 字段名 | 数据类型 | 是否可空 | 字段说明 | 主键 | | 45 | | 字段名 | 数据类型 | 是否可空 | 字段说明 | 主键 | |
| 41 | |--------|----------|----------|----------|------| | 46 | |--------|----------|----------|----------|------| |
| 42 | -| F_Id | varchar | NO | 主键 | PRI | | ||
| 43 | -| mdbm | varchar | YES | 门店编码 | | | ||
| 44 | -| djmdbh | varchar | YES | 单据门店编号 | | | ||
| 45 | -| djmd | varchar | YES | 单据门店 | | | ||
| 46 | -| dm | varchar | YES | 店名 | | | ||
| 47 | -| cs | varchar | YES | 城市 | | | ||
| 48 | -| dz | varchar | YES | 地址 | | | ||
| 49 | -| xm | varchar | YES | 姓名 | | | ||
| 50 | -| dhhm | varchar | YES | 电话号码 | | | ||
| 51 | -| zj | varchar | YES | 座机 | | | 47 | +| F_Id | varchar(50) | NO | 主键 | PRI | |
| 48 | +| mdbm | varchar(50) | YES | 门店编码 | | | ||
| 49 | +| djmdbh | varchar(50) | YES | 单据门店编号 | | | ||
| 50 | +| djmd | varchar(50) | YES | 单据门店 | | | ||
| 51 | +| dm | varchar(50) | YES | 店名 | | | ||
| 52 | +| cs | varchar(50) | YES | 城市 | | | ||
| 53 | +| dz | varchar(50) | YES | 地址 | | | ||
| 54 | +| xm | varchar(50) | YES | 姓名 | | | ||
| 55 | +| dhhm | varchar(50) | YES | 电话号码 | | | ||
| 56 | +| zj | varchar(50) | YES | 座机 | | | ||
| 52 | | kysj | datetime | YES | 开业时间 | | | 57 | | kysj | datetime | YES | 开业时间 | | |
| 53 | -| zxzt | varchar | YES | 最新状态 | | | ||
| 54 | -| gsmc | varchar | YES | 工商名称 | | | ||
| 55 | -| fr | varchar | YES | 法人 | | | ||
| 56 | -| ywsb | varchar | YES | 有无社保 | | | 58 | +| zxzt | varchar(50) | YES | 最新状态 | | |
| 59 | +| gsmc | varchar(50) | YES | 工商名称 | | | ||
| 60 | +| fr | varchar(50) | YES | 法人 | | | ||
| 61 | +| ywsb | varchar(50) | YES | 有无社保 | | | ||
| 62 | +| syb | varchar(50) | YES | 事业部 | | | ||
| 63 | +| jyb | varchar(50) | YES | 教育部 | | | ||
| 64 | +| kjb | varchar(50) | YES | 科技部 | | | ||
| 65 | +| dxmb | varchar(50) | YES | 大项目部 | | | ||
| 66 | +| gsqssj | datetime | YES | 归属起始时间 | | | ||
| 67 | +| gszzsj | datetime | YES | 归属终止时间 | | | ||
| 68 | +| status | int(11) | YES | 状态 | | | ||
| 57 | 69 | ||
| 58 | #### lq_md_mdlbjhsxx (门店类别及核算信息) | 70 | #### lq_md_mdlbjhsxx (门店类别及核算信息) |
| 59 | - 用于存储门店的分类信息和核算相关配置 | 71 | - 用于存储门店的分类信息和核算相关配置 |
| 60 | 72 | ||
| 61 | -#### lq_md_mdgs (门店归属) | ||
| 62 | -- 用于存储门店的归属关系 | 73 | +#### ~~lq_md_mdgs (门店归属)~~ - 已弃用 |
| 74 | +- ~~用于存储门店的归属关系~~ - 已整合到 `lq_mdxx` 表中 | ||
| 63 | 75 | ||
| 64 | #### lq_md_mdwy (门店物业) | 76 | #### lq_md_mdwy (门店物业) |
| 65 | - 用于存储门店物业相关信息 | 77 | - 用于存储门店物业相关信息 |