Commit b2c391f9212a7cd068be32cd2469c2bf300920c1
1 parent
8906253c
hxd20251113
Showing
37 changed files
with
4246 additions
and
0 deletions
antis-ncc-admin/.env.development
| ... | ... | @@ -3,5 +3,6 @@ |
| 3 | 3 | VUE_CLI_BABEL_TRANSPILE_MODULES = true |
| 4 | 4 | # VUE_APP_BASE_API = 'https://erp.lvqianmeiye.com' |
| 5 | 5 | VUE_APP_BASE_API = 'http://erp_test.lvqianmeiye.com' |
| 6 | +#VUE_APP_BASE_API = 'http://localhost:2011' | |
| 6 | 7 | # VUE_APP_BASE_API = 'http://localhost:2011' |
| 7 | 8 | VUE_APP_BASE_WSS = 'ws://192.168.110.45:2011/websocket' | ... | ... |
antis-ncc-admin/src/views/lqPurchaseRecords/ExportBox.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible" | |
| 3 | + class="NCC-dialog NCC-dialog_center" lock-scroll width="600px"> | |
| 4 | + <el-form label-position="top" label-width="80px"> | |
| 5 | + <el-form-item label="数据选择"> | |
| 6 | + <el-radio-group v-model="type"> | |
| 7 | + <el-radio :label="0">当前页面数据</el-radio> | |
| 8 | + <el-radio :label="1">全部页面数据</el-radio> | |
| 9 | + </el-radio-group> | |
| 10 | + </el-form-item> | |
| 11 | + <el-form-item label="导出字段"> | |
| 12 | + <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" | |
| 13 | + @change="handleCheckAllChange">全选</el-checkbox> | |
| 14 | + <el-checkbox-group v-model="columns" @change="handleCheckedChange"> | |
| 15 | + <el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop"> | |
| 16 | + {{item.label}} | |
| 17 | + </el-checkbox> | |
| 18 | + </el-checkbox-group> | |
| 19 | + </el-form-item> | |
| 20 | + </el-form> | |
| 21 | + <span slot="footer" class="dialog-footer"> | |
| 22 | + <el-button @click="visible=false">取 消</el-button> | |
| 23 | + <el-button type="primary" @click="downLoad">导 出</el-button> | |
| 24 | + </span> | |
| 25 | + </el-dialog> | |
| 26 | +</template> | |
| 27 | + | |
| 28 | +<script> | |
| 29 | +export default { | |
| 30 | + data() { | |
| 31 | + return { | |
| 32 | + visible: false, | |
| 33 | + btnLoading: false, | |
| 34 | + type: 0, | |
| 35 | + columns: [], | |
| 36 | + checkAll: true, | |
| 37 | + isIndeterminate: false, | |
| 38 | + columnList: [] | |
| 39 | + } | |
| 40 | + }, | |
| 41 | + methods: { | |
| 42 | + init(columnList) { | |
| 43 | + this.visible = true | |
| 44 | + this.columnList = columnList | |
| 45 | + this.columns = columnList.map(o => o.prop) | |
| 46 | + }, | |
| 47 | + handleCheckAllChange(val) { | |
| 48 | + this.columns = val ? this.columnList.map(o => o.prop) : []; | |
| 49 | + this.isIndeterminate = false; | |
| 50 | + }, | |
| 51 | + handleCheckedChange(value) { | |
| 52 | + let checkedCount = value.length; | |
| 53 | + this.checkAll = checkedCount === this.columnList.length; | |
| 54 | + this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length; | |
| 55 | + }, | |
| 56 | + downLoad() { | |
| 57 | + this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') }) | |
| 58 | + } | |
| 59 | + } | |
| 60 | +} | |
| 61 | +</script> | |
| 62 | +<style lang="scss" scoped> | |
| 63 | +>>> .el-dialog__body { | |
| 64 | + padding: 20px !important; | |
| 65 | +} | |
| 66 | +</style> | |
| 0 | 67 | \ No newline at end of file | ... | ... |
antis-ncc-admin/src/views/lqPurchaseRecords/Form.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll width="600px"> | |
| 3 | + <el-row :gutter="15" class="" > | |
| 4 | + <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules"> | |
| 5 | + <el-col :span="24"> | |
| 6 | + <el-form-item label="记录编号" prop="id"> | |
| 7 | + <el-input v-model="dataForm.id" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 8 | + </el-input> | |
| 9 | + </el-form-item> | |
| 10 | + </el-col> | |
| 11 | + <el-col :span="24"> | |
| 12 | + <el-form-item label="购买物品" prop="reimbursementCategoryId"> | |
| 13 | + <el-select | |
| 14 | + v-model="dataForm.reimbursementCategoryId" | |
| 15 | + filterable | |
| 16 | + remote | |
| 17 | + reserve-keyword | |
| 18 | + placeholder="请输入一级名称或二级名称搜索" | |
| 19 | + :remote-method="searchReimbursementCategory" | |
| 20 | + :loading="categoryLoading" | |
| 21 | + @change="handleCategoryChange" | |
| 22 | + clearable | |
| 23 | + :style='{"width":"100%"}'> | |
| 24 | + <el-option | |
| 25 | + v-for="item in categoryOptions" | |
| 26 | + :key="item.id" | |
| 27 | + :label="getCategoryLabel(item)" | |
| 28 | + :value="item.level2Code"> | |
| 29 | + <span style="float: left">{{ item.level1Name }} - {{ item.typeName }}</span> | |
| 30 | + <span style="float: right; color: #8492a6; font-size: 13px">({{ item.level2Code }})</span> | |
| 31 | + </el-option> | |
| 32 | + </el-select> | |
| 33 | + </el-form-item> | |
| 34 | + </el-col> | |
| 35 | + <el-col :span="24"> | |
| 36 | + <el-form-item label="单价" prop="unitPrice"> | |
| 37 | + <el-input v-model="dataForm.unitPrice" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 38 | + </el-input> | |
| 39 | + </el-form-item> | |
| 40 | + </el-col> | |
| 41 | + <el-col :span="24"> | |
| 42 | + <el-form-item label="数量" prop="quantity"> | |
| 43 | + <el-input v-model="dataForm.quantity" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 44 | + </el-input> | |
| 45 | + </el-form-item> | |
| 46 | + </el-col> | |
| 47 | + <el-col :span="24"> | |
| 48 | + <el-form-item label="总金额" prop="amount"> | |
| 49 | + <el-input v-model="dataForm.amount" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 50 | + </el-input> | |
| 51 | + </el-form-item> | |
| 52 | + </el-col> | |
| 53 | + <el-col :span="24"> | |
| 54 | + <el-form-item label="备注说明" prop="memo"> | |
| 55 | + <el-input v-model="dataForm.memo" placeholder="请输入" show-word-limit :style='{"width":"100%"}' type='textarea' :autosize='{"minRows":4,"maxRows":4}' > | |
| 56 | + </el-input> | |
| 57 | + </el-form-item> | |
| 58 | + </el-col> | |
| 59 | + <el-col :span="24"> | |
| 60 | + <el-form-item label="附件" prop="attachment"> | |
| 61 | + <NCC-UploadFz v-model="dataForm.attachment" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" > | |
| 62 | + </NCC-UploadFz> | |
| 63 | + </el-form-item> | |
| 64 | + </el-col> | |
| 65 | + <el-col :span="24"> | |
| 66 | + <el-form-item label="购买时间" prop="purchaseTime"> | |
| 67 | + <el-date-picker v-model="dataForm.purchaseTime" placeholder="请选择" clearable :style='{"width":"100%"}' type='date' format="yyyy-MM-dd" value-format="timestamp" > | |
| 68 | + </el-date-picker> | |
| 69 | + </el-form-item> | |
| 70 | + </el-col> | |
| 71 | + <el-col :span="24"> | |
| 72 | + <el-form-item label="创建时间" prop="createTime"> | |
| 73 | + <el-date-picker v-model="dataForm.createTime" placeholder="请选择" clearable :style='{"width":"100%"}' type='date' format="yyyy-MM-dd" value-format="timestamp" > | |
| 74 | + </el-date-picker> | |
| 75 | + </el-form-item> | |
| 76 | + </el-col> | |
| 77 | + <el-col :span="24"> | |
| 78 | + <el-form-item label="创建人" prop="createUser"> | |
| 79 | + <user-select v-model="dataForm.createUser" placeholder="请选择" clearable > | |
| 80 | + </user-select> | |
| 81 | + </el-form-item> | |
| 82 | + </el-col> | |
| 83 | + <el-col :span="24"> | |
| 84 | + <el-form-item label="创建人门店" prop="createUserStoreId"> | |
| 85 | + <el-input v-model="dataForm.createUserStoreId" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 86 | + </el-input> | |
| 87 | + </el-form-item> | |
| 88 | + </el-col> | |
| 89 | + <el-col :span="24"> | |
| 90 | + <el-form-item label="审批状态" prop="approveStatus"> | |
| 91 | + <el-input v-model="dataForm.approveStatus" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 92 | + </el-input> | |
| 93 | + </el-form-item> | |
| 94 | + </el-col> | |
| 95 | + <el-col :span="24"> | |
| 96 | + <el-form-item label="审批人" prop="approveUser"> | |
| 97 | + <user-select v-model="dataForm.approveUser" placeholder="请选择" clearable > | |
| 98 | + </user-select> | |
| 99 | + </el-form-item> | |
| 100 | + </el-col> | |
| 101 | + <el-col :span="24"> | |
| 102 | + <el-form-item label="审批时间" prop="approveTime"> | |
| 103 | + <el-date-picker v-model="dataForm.approveTime" placeholder="请选择" clearable :style='{"width":"100%"}' type='date' format="yyyy-MM-dd" value-format="timestamp" > | |
| 104 | + </el-date-picker> | |
| 105 | + </el-form-item> | |
| 106 | + </el-col> | |
| 107 | + <el-col :span="24"> | |
| 108 | + <el-form-item label="审批单编号" prop="applicationId"> | |
| 109 | + <el-input v-model="dataForm.applicationId" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 110 | + </el-input> | |
| 111 | + </el-form-item> | |
| 112 | + </el-col> | |
| 113 | + </el-form> | |
| 114 | + </el-row> | |
| 115 | + <span slot="footer" class="dialog-footer"> | |
| 116 | + <el-button @click="visible = false">取 消</el-button> | |
| 117 | + <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button> | |
| 118 | + </span> | |
| 119 | + </el-dialog> | |
| 120 | +</template> | |
| 121 | +<script> | |
| 122 | + import request from '@/utils/request' | |
| 123 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 124 | + import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 125 | + import { UserSettingInfo } from '@/api/permission/userSetting' | |
| 126 | + export default { | |
| 127 | + components: {}, | |
| 128 | + props: [], | |
| 129 | + data() { | |
| 130 | + return { | |
| 131 | + loading: false, | |
| 132 | + visible: false, | |
| 133 | + isDetail: false, | |
| 134 | + categoryLoading: false, | |
| 135 | + categoryOptions: [], | |
| 136 | + dataForm: { | |
| 137 | + id:undefined, | |
| 138 | + reimbursementCategoryId:undefined, | |
| 139 | + reimbursementCategoryName:undefined, | |
| 140 | + unitPrice:undefined, | |
| 141 | + quantity:undefined, | |
| 142 | + amount:undefined, | |
| 143 | + memo:undefined, | |
| 144 | + attachment:[], | |
| 145 | + purchaseTime:undefined, | |
| 146 | + createTime:undefined, | |
| 147 | + createUser:undefined, | |
| 148 | + createUserStoreId:undefined, | |
| 149 | + approveStatus:undefined, | |
| 150 | + approveUser:undefined, | |
| 151 | + approveTime:undefined, | |
| 152 | + applicationId:undefined, | |
| 153 | + }, | |
| 154 | + rules: { | |
| 155 | + }, | |
| 156 | + } | |
| 157 | + }, | |
| 158 | + computed: {}, | |
| 159 | + watch: {}, | |
| 160 | + created() { | |
| 161 | + }, | |
| 162 | + mounted() { | |
| 163 | + }, | |
| 164 | + methods: { | |
| 165 | + goBack() { | |
| 166 | + this.$emit('refresh') | |
| 167 | + }, | |
| 168 | + // 获取分类标签显示 | |
| 169 | + getCategoryLabel(item) { | |
| 170 | + if (!item) return ''; | |
| 171 | + return `${item.level1Name || ''} - ${item.typeName || ''} (${item.level2Code || ''})`; | |
| 172 | + }, | |
| 173 | + // 搜索报销分类(支持OR逻辑:一级名称、二级名称或二级编号) | |
| 174 | + searchReimbursementCategory(query) { | |
| 175 | + if (query !== '') { | |
| 176 | + this.categoryLoading = true; | |
| 177 | + // 由于后端是AND逻辑,我们需要分别查询然后合并结果 | |
| 178 | + Promise.all([ | |
| 179 | + request({ | |
| 180 | + url: '/api/Extend/LqReimbursementCategory/Actions/GetNoPagingList', | |
| 181 | + method: 'GET', | |
| 182 | + data: { level1Name: query } | |
| 183 | + }), | |
| 184 | + request({ | |
| 185 | + url: '/api/Extend/LqReimbursementCategory/Actions/GetNoPagingList', | |
| 186 | + method: 'GET', | |
| 187 | + data: { typeName: query } | |
| 188 | + }), | |
| 189 | + request({ | |
| 190 | + url: '/api/Extend/LqReimbursementCategory/Actions/GetNoPagingList', | |
| 191 | + method: 'GET', | |
| 192 | + data: { level2Code: query } | |
| 193 | + }) | |
| 194 | + ]).then(results => { | |
| 195 | + // 合并结果并去重 | |
| 196 | + const allResults = []; | |
| 197 | + results.forEach(result => { | |
| 198 | + if (result.data && Array.isArray(result.data)) { | |
| 199 | + allResults.push(...result.data); | |
| 200 | + } | |
| 201 | + }); | |
| 202 | + // 根据id去重 | |
| 203 | + const uniqueResults = []; | |
| 204 | + const seenIds = new Set(); | |
| 205 | + allResults.forEach(item => { | |
| 206 | + if (!seenIds.has(item.id)) { | |
| 207 | + seenIds.add(item.id); | |
| 208 | + uniqueResults.push(item); | |
| 209 | + } | |
| 210 | + }); | |
| 211 | + this.categoryOptions = uniqueResults; | |
| 212 | + this.categoryLoading = false; | |
| 213 | + }).catch(() => { | |
| 214 | + this.categoryLoading = false; | |
| 215 | + }); | |
| 216 | + } else { | |
| 217 | + this.categoryOptions = []; | |
| 218 | + } | |
| 219 | + }, | |
| 220 | + // 选择分类后自动填充 | |
| 221 | + handleCategoryChange(value) { | |
| 222 | + if (value) { | |
| 223 | + const selectedCategory = this.categoryOptions.find(item => item.level2Code === value); | |
| 224 | + if (selectedCategory) { | |
| 225 | + // value已经是level2Code,直接赋值 | |
| 226 | + this.dataForm.reimbursementCategoryId = value; | |
| 227 | + this.dataForm.reimbursementCategoryName = selectedCategory.typeName; | |
| 228 | + } | |
| 229 | + } else { | |
| 230 | + this.dataForm.reimbursementCategoryId = undefined; | |
| 231 | + this.dataForm.reimbursementCategoryName = undefined; | |
| 232 | + } | |
| 233 | + }, | |
| 234 | + init(id, isDetail) { | |
| 235 | + this.dataForm.id = id || 0; | |
| 236 | + this.visible = true; | |
| 237 | + this.isDetail = isDetail || false; | |
| 238 | + this.categoryOptions = []; | |
| 239 | + this.$nextTick(() => { | |
| 240 | + this.$refs['elForm'].resetFields(); | |
| 241 | + if (this.dataForm.id) { | |
| 242 | + // 编辑模式:加载已有数据 | |
| 243 | + request({ | |
| 244 | + url: '/api/Extend/LqPurchaseRecords/' + this.dataForm.id, | |
| 245 | + method: 'get' | |
| 246 | + }).then(res =>{ | |
| 247 | + this.dataForm = res.data; | |
| 248 | + if(!this.dataForm.attachment)this.dataForm.attachment=[]; | |
| 249 | + // 如果有已选择的分类,加载对应的选项 | |
| 250 | + if (this.dataForm.reimbursementCategoryId) { | |
| 251 | + this.loadCategoryOption(this.dataForm.reimbursementCategoryId); | |
| 252 | + } | |
| 253 | + }) | |
| 254 | + } else { | |
| 255 | + // 新增模式:设置默认值 | |
| 256 | + // 创建时间:当前时间(时间戳) | |
| 257 | + this.dataForm.createTime = new Date().getTime(); | |
| 258 | + // 审批状态:默认"未审批" | |
| 259 | + this.dataForm.approveStatus = '未审批'; | |
| 260 | + // 创建人:获取当前用户信息 | |
| 261 | + UserSettingInfo().then(response => { | |
| 262 | + if (response.data && response.data.id) { | |
| 263 | + this.dataForm.createUser = response.data.id; | |
| 264 | + } | |
| 265 | + }).catch(() => { | |
| 266 | + // 如果API调用失败,尝试从store获取 | |
| 267 | + const userInfo = this.$store.getters.userInfo; | |
| 268 | + if (userInfo) { | |
| 269 | + this.dataForm.createUser = userInfo.userId || userInfo.id; | |
| 270 | + } | |
| 271 | + }); | |
| 272 | + } | |
| 273 | + }) | |
| 274 | + }, | |
| 275 | + // 加载已选择的分类选项(用于编辑时显示) | |
| 276 | + loadCategoryOption(level2Code) { | |
| 277 | + request({ | |
| 278 | + url: '/api/Extend/LqReimbursementCategory/Actions/GetNoPagingList', | |
| 279 | + method: 'GET', | |
| 280 | + data: { | |
| 281 | + level2Code: level2Code | |
| 282 | + } | |
| 283 | + }).then(res => { | |
| 284 | + if (res.data && res.data.length > 0) { | |
| 285 | + this.categoryOptions = res.data; | |
| 286 | + } | |
| 287 | + }); | |
| 288 | + }, | |
| 289 | + dataFormSubmit() { | |
| 290 | + this.$refs['elForm'].validate((valid) => { | |
| 291 | + if (valid) { | |
| 292 | + if (!this.dataForm.id) { | |
| 293 | + request({ | |
| 294 | + url: `/api/Extend/LqPurchaseRecords`, | |
| 295 | + method: 'post', | |
| 296 | + data: this.dataForm, | |
| 297 | + }).then((res) => { | |
| 298 | + this.$message({ | |
| 299 | + message: res.msg, | |
| 300 | + type: 'success', | |
| 301 | + duration: 1000, | |
| 302 | + onClose: () => { | |
| 303 | + this.visible = false, | |
| 304 | + this.$emit('refresh', true) | |
| 305 | + } | |
| 306 | + }) | |
| 307 | + }) | |
| 308 | + } else { | |
| 309 | + request({ | |
| 310 | + url: '/api/Extend/LqPurchaseRecords/' + this.dataForm.id, | |
| 311 | + method: 'PUT', | |
| 312 | + data: this.dataForm | |
| 313 | + }).then((res) => { | |
| 314 | + this.$message({ | |
| 315 | + message: res.msg, | |
| 316 | + type: 'success', | |
| 317 | + duration: 1000, | |
| 318 | + onClose: () => { | |
| 319 | + this.visible = false | |
| 320 | + this.$emit('refresh', true) | |
| 321 | + } | |
| 322 | + }) | |
| 323 | + }) | |
| 324 | + } | |
| 325 | + } | |
| 326 | + }) | |
| 327 | + }, | |
| 328 | + } | |
| 329 | + } | |
| 330 | +</script> | ... | ... |
antis-ncc-admin/src/views/lqPurchaseRecords/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="NCC-common-layout"> | |
| 3 | + <div class="NCC-common-layout-center"> | |
| 4 | + <el-row class="NCC-common-search-box" :gutter="16"> | |
| 5 | + <el-form @submit.native.prevent> | |
| 6 | + <el-col :span="6"> | |
| 7 | + <el-form-item label="记录编号"> | |
| 8 | + <el-input v-model="query.id" placeholder="记录编号" clearable /> | |
| 9 | + </el-form-item> | |
| 10 | + </el-col> | |
| 11 | + <el-col :span="6"> | |
| 12 | + <el-form-item label="购买物品编号"> | |
| 13 | + <el-input v-model="query.reimbursementCategoryId" placeholder="购买物品编号" clearable /> | |
| 14 | + </el-form-item> | |
| 15 | + </el-col> | |
| 16 | + <el-col :span="6"> | |
| 17 | + <el-form-item label="购买物品名称"> | |
| 18 | + <el-input v-model="query.reimbursementCategoryName" 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-input v-model="query.unitPrice" placeholder="单价" clearable /> | |
| 25 | + </el-form-item> | |
| 26 | + </el-col> | |
| 27 | + <el-col :span="6"> | |
| 28 | + <el-form-item label="数量"> | |
| 29 | + <el-input v-model="query.quantity" placeholder="数量" clearable /> | |
| 30 | + </el-form-item> | |
| 31 | + </el-col> | |
| 32 | + <el-col :span="6"> | |
| 33 | + <el-form-item label="总金额"> | |
| 34 | + <el-input v-model="query.amount" placeholder="总金额" clearable /> | |
| 35 | + </el-form-item> | |
| 36 | + </el-col> | |
| 37 | + <el-col :span="6"> | |
| 38 | + <el-form-item label="备注说明"> | |
| 39 | + <el-input v-model="query.memo" placeholder="备注说明" /> | |
| 40 | + </el-form-item> | |
| 41 | + </el-col> | |
| 42 | + <el-col :span="6"> | |
| 43 | + <el-form-item label="购买时间"> | |
| 44 | + <el-date-picker v-model="query.purchaseTime" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | |
| 45 | + </el-date-picker> | |
| 46 | + </el-form-item> | |
| 47 | + </el-col> | |
| 48 | + <el-col :span="6"> | |
| 49 | + <el-form-item label="创建时间"> | |
| 50 | + <el-date-picker v-model="query.createTime" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | |
| 51 | + </el-date-picker> | |
| 52 | + </el-form-item> | |
| 53 | + </el-col> | |
| 54 | + <el-col :span="6"> | |
| 55 | + <el-form-item label="创建人"> | |
| 56 | + <userSelect v-model="query.createUser" placeholder="请选择创建人" /> | |
| 57 | + </el-form-item> | |
| 58 | + </el-col> | |
| 59 | + <el-col :span="6"> | |
| 60 | + <el-form-item label="创建人门店"> | |
| 61 | + <el-input v-model="query.createUserStoreId" placeholder="创建人门店" clearable /> | |
| 62 | + </el-form-item> | |
| 63 | + </el-col> | |
| 64 | + <el-col :span="6"> | |
| 65 | + <el-form-item label="审批状态"> | |
| 66 | + <el-input v-model="query.approveStatus" placeholder="审批状态" clearable /> | |
| 67 | + </el-form-item> | |
| 68 | + </el-col> | |
| 69 | + <el-col :span="6"> | |
| 70 | + <el-form-item label="审批人"> | |
| 71 | + <userSelect v-model="query.approveUser" placeholder="请选择审批人" /> | |
| 72 | + </el-form-item> | |
| 73 | + </el-col> | |
| 74 | + <el-col :span="6"> | |
| 75 | + <el-form-item label="审批时间"> | |
| 76 | + <el-date-picker v-model="query.approveTime" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | |
| 77 | + </el-date-picker> | |
| 78 | + </el-form-item> | |
| 79 | + </el-col> | |
| 80 | + <el-col :span="6"> | |
| 81 | + <el-form-item label="审批单编号"> | |
| 82 | + <el-input v-model="query.applicationId" placeholder="审批单编号" clearable /> | |
| 83 | + </el-form-item> | |
| 84 | + </el-col> | |
| 85 | + </template> | |
| 86 | + <el-col :span="6"> | |
| 87 | + <el-form-item> | |
| 88 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 89 | + <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 90 | + <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">展开</el-button> | |
| 91 | + <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>收起</el-button> | |
| 92 | + </el-form-item> | |
| 93 | + </el-col> | |
| 94 | + </el-form> | |
| 95 | + </el-row> | |
| 96 | + <div class="NCC-common-layout-main NCC-flex-main"> | |
| 97 | + <div class="NCC-common-head"> | |
| 98 | + <div> | |
| 99 | + <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button> | |
| 100 | + <el-button type="text" icon="el-icon-download" @click="exportData()">导出</el-button> | |
| 101 | + <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除</el-button> | |
| 102 | + </div> | |
| 103 | + <div class="NCC-common-head-right"> | |
| 104 | + <el-tooltip effect="dark" content="刷新" placement="top"> | |
| 105 | + <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" /> | |
| 106 | + </el-tooltip> | |
| 107 | + <screenfull isContainer /> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + <NCC-table v-loading="listLoading" :data="list" has-c @selection-change="handleSelectionChange"> | |
| 111 | + <el-table-column prop="id" label="记录编号" align="left" /> | |
| 112 | + <el-table-column prop="reimbursementCategoryId" label="购买物品编号" align="left" /> | |
| 113 | + <el-table-column prop="reimbursementCategoryName" label="购买物品名称" align="left" /> | |
| 114 | + <el-table-column prop="unitPrice" label="单价" align="left" /> | |
| 115 | + <el-table-column prop="quantity" label="数量" align="left" /> | |
| 116 | + <el-table-column prop="amount" label="总金额" align="left" /> | |
| 117 | + <el-table-column prop="memo" label="备注说明" align="left" /> | |
| 118 | + <el-table-column prop="purchaseTime" label="购买时间" align="left" :formatter="ncc.tableDateFormat" /> | |
| 119 | + <el-table-column prop="createTime" label="创建时间" align="left" :formatter="ncc.tableDateFormat" /> | |
| 120 | + <el-table-column prop="createUser" label="创建人" align="left" /> | |
| 121 | + <el-table-column prop="createUserStoreId" label="创建人门店" align="left" /> | |
| 122 | + <el-table-column prop="approveStatus" label="审批状态" align="left" /> | |
| 123 | + <el-table-column prop="approveUser" label="审批人" align="left" /> | |
| 124 | + <el-table-column prop="approveTime" label="审批时间" align="left" :formatter="ncc.tableDateFormat" /> | |
| 125 | + <el-table-column prop="applicationId" label="审批单编号" align="left" /> | |
| 126 | + <el-table-column label="操作" fixed="right" width="100"> | |
| 127 | + <template slot-scope="scope"> | |
| 128 | + <el-button type="text" @click="addOrUpdateHandle(scope.row.id)" >编辑</el-button> | |
| 129 | + <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn" >删除</el-button> | |
| 130 | + </template> | |
| 131 | + </el-table-column> | |
| 132 | + </NCC-table> | |
| 133 | + <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + <NCC-Form v-if="formVisible" ref="NCCForm" @refresh="refresh" /> | |
| 137 | + <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> | |
| 138 | + </div> | |
| 139 | +</template> | |
| 140 | +<script> | |
| 141 | + import request from '@/utils/request' | |
| 142 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 143 | + import NCCForm from './Form' | |
| 144 | + import ExportBox from './ExportBox' | |
| 145 | + import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 146 | + export default { | |
| 147 | + components: { NCCForm, ExportBox }, | |
| 148 | + data() { | |
| 149 | + return { | |
| 150 | + showAll: false, | |
| 151 | + query: { | |
| 152 | + id:undefined, | |
| 153 | + reimbursementCategoryId:undefined, | |
| 154 | + reimbursementCategoryName:undefined, | |
| 155 | + unitPrice:undefined, | |
| 156 | + quantity:undefined, | |
| 157 | + amount:undefined, | |
| 158 | + memo:undefined, | |
| 159 | + purchaseTime:undefined, | |
| 160 | + createTime:undefined, | |
| 161 | + createUser:undefined, | |
| 162 | + createUserStoreId:undefined, | |
| 163 | + approveStatus:undefined, | |
| 164 | + approveUser:undefined, | |
| 165 | + approveTime:undefined, | |
| 166 | + applicationId:undefined, | |
| 167 | + }, | |
| 168 | + list: [], | |
| 169 | + listLoading: true, | |
| 170 | + multipleSelection: [], total: 0, | |
| 171 | + listQuery: { | |
| 172 | + currentPage: 1, | |
| 173 | + pageSize: 20, | |
| 174 | + sort: "desc", | |
| 175 | + sidx: "", | |
| 176 | + }, | |
| 177 | + formVisible: false, | |
| 178 | + exportBoxVisible: false, | |
| 179 | + columnList: [ | |
| 180 | + { prop: 'id', label: '记录编号' }, | |
| 181 | + { prop: 'reimbursementCategoryId', label: '购买物品编号' }, | |
| 182 | + { prop: 'reimbursementCategoryName', label: '购买物品名称' }, | |
| 183 | + { prop: 'unitPrice', label: '单价' }, | |
| 184 | + { prop: 'quantity', label: '数量' }, | |
| 185 | + { prop: 'amount', label: '总金额' }, | |
| 186 | + { prop: 'memo', label: '备注说明' }, | |
| 187 | + { prop: 'purchaseTime', label: '购买时间' }, | |
| 188 | + { prop: 'createTime', label: '创建时间' }, | |
| 189 | + { prop: 'createUser', label: '创建人' }, | |
| 190 | + { prop: 'createUserStoreId', label: '创建人门店' }, | |
| 191 | + { prop: 'approveStatus', label: '审批状态' }, | |
| 192 | + { prop: 'approveUser', label: '审批人' }, | |
| 193 | + { prop: 'approveTime', label: '审批时间' }, | |
| 194 | + { prop: 'applicationId', label: '审批单编号' }, | |
| 195 | + ], | |
| 196 | + } | |
| 197 | + }, | |
| 198 | + computed: {}, | |
| 199 | + created() { | |
| 200 | + this.initData() | |
| 201 | + }, | |
| 202 | + methods: { | |
| 203 | + initData() { | |
| 204 | + this.listLoading = true; | |
| 205 | + let _query = { | |
| 206 | + ...this.listQuery, | |
| 207 | + ...this.query | |
| 208 | + }; | |
| 209 | + let query = {} | |
| 210 | + for (let key in _query) { | |
| 211 | + if (Array.isArray(_query[key])) { | |
| 212 | + query[key] = _query[key].join() | |
| 213 | + } else { | |
| 214 | + query[key] = _query[key] | |
| 215 | + } | |
| 216 | + } | |
| 217 | + request({ | |
| 218 | + url: `/api/Extend/LqPurchaseRecords`, | |
| 219 | + method: 'GET', | |
| 220 | + data: query | |
| 221 | + }).then(res => { | |
| 222 | + this.list = res.data.list | |
| 223 | + this.total = res.data.pagination.total | |
| 224 | + this.listLoading = false | |
| 225 | + }) | |
| 226 | + }, | |
| 227 | + handleDel(id) { | |
| 228 | + this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { | |
| 229 | + type: 'warning' | |
| 230 | + }).then(() => { | |
| 231 | + request({ | |
| 232 | + url: `/api/Extend/LqPurchaseRecords/${id}`, | |
| 233 | + method: 'DELETE' | |
| 234 | + }).then(res => { | |
| 235 | + this.$message({ | |
| 236 | + type: 'success', | |
| 237 | + message: res.msg, | |
| 238 | + onClose: () => { | |
| 239 | + this.initData() | |
| 240 | + } | |
| 241 | + }); | |
| 242 | + }) | |
| 243 | + }).catch(() => { | |
| 244 | + }); | |
| 245 | + }, | |
| 246 | + handleSelectionChange(val) { | |
| 247 | + const res = val.map(item => item.id) | |
| 248 | + this.multipleSelection = res | |
| 249 | + }, | |
| 250 | + handleBatchRemoveDel() { | |
| 251 | + if (!this.multipleSelection.length) { | |
| 252 | + this.$message({ | |
| 253 | + type: 'error', | |
| 254 | + message: '请选择一条数据', | |
| 255 | + duration: 1500, | |
| 256 | + }) | |
| 257 | + return | |
| 258 | + } | |
| 259 | + const ids = this.multipleSelection | |
| 260 | + this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { | |
| 261 | + type: 'warning' | |
| 262 | + }).then(() => { | |
| 263 | + request({ | |
| 264 | + url: `/api/Extend/LqPurchaseRecords/batchRemove`, | |
| 265 | + method: 'POST', | |
| 266 | + data: ids , | |
| 267 | + }).then(res => { | |
| 268 | + this.$message({ | |
| 269 | + type: 'success', | |
| 270 | + message: res.msg, | |
| 271 | + onClose: () => { | |
| 272 | + this.initData() | |
| 273 | + } | |
| 274 | + }); | |
| 275 | + }) | |
| 276 | + }).catch(() => { }) | |
| 277 | + }, | |
| 278 | + addOrUpdateHandle(id, isDetail) { | |
| 279 | + this.formVisible = true | |
| 280 | + this.$nextTick(() => { | |
| 281 | + this.$refs.NCCForm.init(id, isDetail) | |
| 282 | + }) | |
| 283 | + }, | |
| 284 | + exportData() { | |
| 285 | + this.exportBoxVisible = true | |
| 286 | + this.$nextTick(() => { | |
| 287 | + this.$refs.ExportBox.init(this.columnList) | |
| 288 | + }) | |
| 289 | + }, | |
| 290 | + download(data) { | |
| 291 | + let query = { ...data, ...this.listQuery, ...this.query } | |
| 292 | + request({ | |
| 293 | + url: `/api/Extend/LqPurchaseRecords/Actions/Export`, | |
| 294 | + method: 'GET', | |
| 295 | + data: query | |
| 296 | + }).then(res => { | |
| 297 | + if (!res.data.url) return | |
| 298 | + window.location.href = this.define.comUrl + res.data.url | |
| 299 | + this.$refs.ExportBox.visible = false | |
| 300 | + this.exportBoxVisible = false | |
| 301 | + }) | |
| 302 | + }, | |
| 303 | + search() { | |
| 304 | + this.listQuery = { | |
| 305 | + currentPage: 1, | |
| 306 | + pageSize: 20, | |
| 307 | + sort: "desc", | |
| 308 | + sidx: "", | |
| 309 | + } | |
| 310 | + this.initData() | |
| 311 | + }, | |
| 312 | + refresh(isrRefresh) { | |
| 313 | + this.formVisible = false | |
| 314 | + if (isrRefresh) this.reset() | |
| 315 | + }, | |
| 316 | + reset() { | |
| 317 | + for (let key in this.query) { | |
| 318 | + this.query[key] = undefined | |
| 319 | + } | |
| 320 | + this.listQuery = { | |
| 321 | + currentPage: 1, | |
| 322 | + pageSize: 20, | |
| 323 | + sort: "desc", | |
| 324 | + sidx: "", | |
| 325 | + } | |
| 326 | + this.initData() | |
| 327 | + } | |
| 328 | + } | |
| 329 | + } | |
| 330 | +</script> | |
| 0 | 331 | \ No newline at end of file | ... | ... |
antis-ncc-admin/src/views/lqReimbursementApplication/ExportBox.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible" | |
| 3 | + class="NCC-dialog NCC-dialog_center" lock-scroll width="600px"> | |
| 4 | + <el-form label-position="top" label-width="80px"> | |
| 5 | + <el-form-item label="数据选择"> | |
| 6 | + <el-radio-group v-model="type"> | |
| 7 | + <el-radio :label="0">当前页面数据</el-radio> | |
| 8 | + <el-radio :label="1">全部页面数据</el-radio> | |
| 9 | + </el-radio-group> | |
| 10 | + </el-form-item> | |
| 11 | + <el-form-item label="导出字段"> | |
| 12 | + <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" | |
| 13 | + @change="handleCheckAllChange">全选</el-checkbox> | |
| 14 | + <el-checkbox-group v-model="columns" @change="handleCheckedChange"> | |
| 15 | + <el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop"> | |
| 16 | + {{item.label}} | |
| 17 | + </el-checkbox> | |
| 18 | + </el-checkbox-group> | |
| 19 | + </el-form-item> | |
| 20 | + </el-form> | |
| 21 | + <span slot="footer" class="dialog-footer"> | |
| 22 | + <el-button @click="visible=false">取 消</el-button> | |
| 23 | + <el-button type="primary" @click="downLoad">导 出</el-button> | |
| 24 | + </span> | |
| 25 | + </el-dialog> | |
| 26 | +</template> | |
| 27 | + | |
| 28 | +<script> | |
| 29 | +export default { | |
| 30 | + data() { | |
| 31 | + return { | |
| 32 | + visible: false, | |
| 33 | + btnLoading: false, | |
| 34 | + type: 0, | |
| 35 | + columns: [], | |
| 36 | + checkAll: true, | |
| 37 | + isIndeterminate: false, | |
| 38 | + columnList: [] | |
| 39 | + } | |
| 40 | + }, | |
| 41 | + methods: { | |
| 42 | + init(columnList) { | |
| 43 | + this.visible = true | |
| 44 | + this.columnList = columnList | |
| 45 | + this.columns = columnList.map(o => o.prop) | |
| 46 | + }, | |
| 47 | + handleCheckAllChange(val) { | |
| 48 | + this.columns = val ? this.columnList.map(o => o.prop) : []; | |
| 49 | + this.isIndeterminate = false; | |
| 50 | + }, | |
| 51 | + handleCheckedChange(value) { | |
| 52 | + let checkedCount = value.length; | |
| 53 | + this.checkAll = checkedCount === this.columnList.length; | |
| 54 | + this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length; | |
| 55 | + }, | |
| 56 | + downLoad() { | |
| 57 | + this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') }) | |
| 58 | + } | |
| 59 | + } | |
| 60 | +} | |
| 61 | +</script> | |
| 62 | +<style lang="scss" scoped> | |
| 63 | +>>> .el-dialog__body { | |
| 64 | + padding: 20px !important; | |
| 65 | +} | |
| 66 | +</style> | |
| 0 | 67 | \ No newline at end of file | ... | ... |
antis-ncc-admin/src/views/lqReimbursementApplication/Form.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll width="1200px"> | |
| 3 | + <el-row :gutter="15" class="" > | |
| 4 | + <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules"> | |
| 5 | + <!-- 上方表单字段:一行三列 --> | |
| 6 | + <el-col :span="8"> | |
| 7 | + <el-form-item label="申请编号" prop="id"> | |
| 8 | + <el-input v-model="dataForm.id" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 9 | + </el-input> | |
| 10 | + </el-form-item> | |
| 11 | + </el-col> | |
| 12 | + <el-col :span="8"> | |
| 13 | + <el-form-item label="申请人编号" prop="applicationUserId"> | |
| 14 | + <el-input v-model="dataForm.applicationUserId" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 15 | + </el-input> | |
| 16 | + </el-form-item> | |
| 17 | + </el-col> | |
| 18 | + <el-col :span="8"> | |
| 19 | + <el-form-item label="申请人姓名" prop="applicationUserName"> | |
| 20 | + <el-input v-model="dataForm.applicationUserName" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 21 | + </el-input> | |
| 22 | + </el-form-item> | |
| 23 | + </el-col> | |
| 24 | + <el-col :span="8"> | |
| 25 | + <el-form-item label="申请门店" prop="applicationStoreId"> | |
| 26 | + <el-input v-model="dataForm.applicationStoreId" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 27 | + </el-input> | |
| 28 | + </el-form-item> | |
| 29 | + </el-col> | |
| 30 | + <el-col :span="8"> | |
| 31 | + <el-form-item label="申请时间" prop="applicationTime"> | |
| 32 | + <el-date-picker v-model="dataForm.applicationTime" placeholder="请选择" clearable :style='{"width":"100%"}' type='date' format="yyyy-MM-dd" value-format="timestamp" > | |
| 33 | + </el-date-picker> | |
| 34 | + </el-form-item> | |
| 35 | + </el-col> | |
| 36 | + <el-col :span="8"> | |
| 37 | + <el-form-item label="总金额" prop="amount"> | |
| 38 | + <el-input v-model="dataForm.amount" placeholder="自动计算" readonly :style='{"width":"100%"}' > | |
| 39 | + </el-input> | |
| 40 | + </el-form-item> | |
| 41 | + </el-col> | |
| 42 | + <el-col :span="8"> | |
| 43 | + <el-form-item label="审批人" prop="approveUser"> | |
| 44 | + <user-select v-model="dataForm.approveUser" placeholder="请选择" clearable > | |
| 45 | + </user-select> | |
| 46 | + </el-form-item> | |
| 47 | + </el-col> | |
| 48 | + <el-col :span="8"> | |
| 49 | + <el-form-item label="审批结果" prop="approveStatus"> | |
| 50 | + <el-input v-model="dataForm.approveStatus" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 51 | + </el-input> | |
| 52 | + </el-form-item> | |
| 53 | + </el-col> | |
| 54 | + <el-col :span="8"> | |
| 55 | + <el-form-item label="审批时间" prop="approveTime"> | |
| 56 | + <el-date-picker v-model="dataForm.approveTime" placeholder="请选择" clearable :style='{"width":"100%"}' type='date' format="yyyy-MM-dd" value-format="timestamp" > | |
| 57 | + </el-date-picker> | |
| 58 | + </el-form-item> | |
| 59 | + </el-col> | |
| 60 | + | |
| 61 | + <!-- 购买物品清单选择 --> | |
| 62 | + <el-col :span="24"> | |
| 63 | + <el-form-item label="购买物品清单"> | |
| 64 | + <el-button type="primary" @click="openPurchaseDialog" :disabled="!!isDetail">选择购买物品</el-button> | |
| 65 | + <span v-if="selectedPurchaseRecords.length > 0" style="margin-left: 10px;"> | |
| 66 | + 已选择 {{ selectedPurchaseRecords.length }} 条记录 | |
| 67 | + </span> | |
| 68 | + </el-form-item> | |
| 69 | + </el-col> | |
| 70 | + | |
| 71 | + <!-- 已选择的购买物品清单 --> | |
| 72 | + <el-col :span="24" v-if="selectedPurchaseRecords.length > 0"> | |
| 73 | + <el-form-item label="已选清单"> | |
| 74 | + <el-table | |
| 75 | + :data="selectedPurchaseRecords" | |
| 76 | + :max-height="200" | |
| 77 | + border | |
| 78 | + size="small"> | |
| 79 | + <el-table-column type="index" label="序号" width="60" align="center" /> | |
| 80 | + <el-table-column prop="id" label="记录编号" width="150" align="left" /> | |
| 81 | + <el-table-column prop="reimbursementCategoryId" label="购买物品编号" width="150" align="left" /> | |
| 82 | + <el-table-column prop="reimbursementCategoryName" label="购买物品名称" width="150" align="left" /> | |
| 83 | + <el-table-column prop="unitPrice" label="单价" width="100" align="right" /> | |
| 84 | + <el-table-column prop="quantity" label="数量" width="80" align="right" /> | |
| 85 | + <el-table-column prop="amount" label="总金额" width="100" align="right" /> | |
| 86 | + <el-table-column prop="purchaseTime" label="购买时间" width="120" align="left"> | |
| 87 | + <template slot-scope="scope"> | |
| 88 | + {{ scope.row.purchaseTime ? formatDate(scope.row.purchaseTime) : '' }} | |
| 89 | + </template> | |
| 90 | + </el-table-column> | |
| 91 | + <el-table-column prop="memo" label="备注说明" min-width="150" align="left" show-overflow-tooltip /> | |
| 92 | + <el-table-column label="操作" width="80" align="center" v-if="!isDetail"> | |
| 93 | + <template slot-scope="scope"> | |
| 94 | + <el-button type="text" size="small" @click="removePurchaseRecord(scope.$index)" style="color: #F56C6C;">移除</el-button> | |
| 95 | + </template> | |
| 96 | + </el-table-column> | |
| 97 | + </el-table> | |
| 98 | + </el-form-item> | |
| 99 | + </el-col> | |
| 100 | + | |
| 101 | + <!-- 购买物品选择弹窗 --> | |
| 102 | + <el-dialog | |
| 103 | + title="选择购买物品" | |
| 104 | + :visible.sync="purchaseDialogVisible" | |
| 105 | + width="1000px" | |
| 106 | + :close-on-click-modal="false" | |
| 107 | + append-to-body | |
| 108 | + :modal-append-to-body="false" | |
| 109 | + class="NCC-dialog NCC-dialog_center"> | |
| 110 | + <el-table | |
| 111 | + ref="purchaseDialogTable" | |
| 112 | + v-loading="purchaseListLoading" | |
| 113 | + :data="purchaseList" | |
| 114 | + @selection-change="handlePurchaseSelectionChange" | |
| 115 | + :max-height="400" | |
| 116 | + border> | |
| 117 | + <el-table-column type="selection" width="55" /> | |
| 118 | + <el-table-column prop="id" label="记录编号" width="120" align="left" /> | |
| 119 | + <el-table-column prop="reimbursementCategoryId" label="购买物品编号" width="150" align="left" /> | |
| 120 | + <el-table-column prop="reimbursementCategoryName" label="购买物品名称" width="150" align="left" /> | |
| 121 | + <el-table-column prop="unitPrice" label="单价" width="100" align="right" /> | |
| 122 | + <el-table-column prop="quantity" label="数量" width="80" align="right" /> | |
| 123 | + <el-table-column prop="amount" label="总金额" width="100" align="right" /> | |
| 124 | + <el-table-column prop="purchaseTime" label="购买时间" width="120" align="left"> | |
| 125 | + <template slot-scope="scope"> | |
| 126 | + {{ scope.row.purchaseTime ? formatDate(scope.row.purchaseTime) : '' }} | |
| 127 | + </template> | |
| 128 | + </el-table-column> | |
| 129 | + <el-table-column prop="memo" label="备注说明" min-width="150" align="left" show-overflow-tooltip /> | |
| 130 | + </el-table> | |
| 131 | + <span slot="footer" class="dialog-footer"> | |
| 132 | + <el-button @click="purchaseDialogVisible = false">取 消</el-button> | |
| 133 | + <el-button type="primary" @click="confirmPurchaseSelection">确 定</el-button> | |
| 134 | + </span> | |
| 135 | + </el-dialog> | |
| 136 | + </el-form> | |
| 137 | + </el-row> | |
| 138 | + <span slot="footer" class="dialog-footer"> | |
| 139 | + <el-button @click="visible = false">取 消</el-button> | |
| 140 | + <el-button type="success" @click="handleApprove" v-if="dataForm.id && !isDetail">通过审批</el-button> | |
| 141 | + <el-button type="danger" @click="handleReject" v-if="dataForm.id && !isDetail">拒绝审批</el-button> | |
| 142 | + <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button> | |
| 143 | + </span> | |
| 144 | + </el-dialog> | |
| 145 | +</template> | |
| 146 | +<script> | |
| 147 | + import request from '@/utils/request' | |
| 148 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 149 | + import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 150 | + import { UserSettingInfo } from '@/api/permission/userSetting' | |
| 151 | + export default { | |
| 152 | + components: {}, | |
| 153 | + props: [], | |
| 154 | + data() { | |
| 155 | + return { | |
| 156 | + loading: false, | |
| 157 | + visible: false, | |
| 158 | + isDetail: false, | |
| 159 | + purchaseDialogVisible: false, | |
| 160 | + purchaseListLoading: false, | |
| 161 | + purchaseList: [], | |
| 162 | + selectedPurchaseRecords: [], | |
| 163 | + tempSelectedPurchaseRecords: [], // 弹窗中临时选中的记录 | |
| 164 | + dataForm: { | |
| 165 | + id:undefined, | |
| 166 | + applicationUserId:undefined, | |
| 167 | + applicationUserName:undefined, | |
| 168 | + applicationStoreId:undefined, | |
| 169 | + applicationTime:undefined, | |
| 170 | + amount:undefined, | |
| 171 | + approveUser:undefined, | |
| 172 | + approveStatus:undefined, | |
| 173 | + approveTime:undefined, | |
| 174 | + purchaseRecordsId:undefined, | |
| 175 | + selectedPurchaseRecordIds: [], // 选中的购买记录ID列表 | |
| 176 | + }, | |
| 177 | + rules: { | |
| 178 | + }, | |
| 179 | + } | |
| 180 | + }, | |
| 181 | + computed: {}, | |
| 182 | + watch: {}, | |
| 183 | + created() { | |
| 184 | + }, | |
| 185 | + mounted() { | |
| 186 | + }, | |
| 187 | + methods: { | |
| 188 | + goBack() { | |
| 189 | + this.$emit('refresh') | |
| 190 | + }, | |
| 191 | + // 格式化日期 | |
| 192 | + formatDate(timestamp) { | |
| 193 | + if (!timestamp) return ''; | |
| 194 | + const date = new Date(timestamp); | |
| 195 | + const year = date.getFullYear(); | |
| 196 | + const month = String(date.getMonth() + 1).padStart(2, '0'); | |
| 197 | + const day = String(date.getDate()).padStart(2, '0'); | |
| 198 | + return `${year}-${month}-${day}`; | |
| 199 | + }, | |
| 200 | + // 打开购买物品选择弹窗 | |
| 201 | + openPurchaseDialog() { | |
| 202 | + this.purchaseDialogVisible = true; | |
| 203 | + // 初始化临时选中列表为当前已选中的记录(用于追加选择) | |
| 204 | + this.tempSelectedPurchaseRecords = [...this.selectedPurchaseRecords]; | |
| 205 | + // 加载当前用户的未报销购买记录 | |
| 206 | + this.loadCurrentUserPurchaseRecords(); | |
| 207 | + }, | |
| 208 | + // 加载当前用户的未报销购买记录 | |
| 209 | + loadCurrentUserPurchaseRecords() { | |
| 210 | + this.purchaseListLoading = true; | |
| 211 | + // 先获取当前用户信息 | |
| 212 | + UserSettingInfo().then(userRes => { | |
| 213 | + const currentUserId = userRes.data && userRes.data.id; | |
| 214 | + if (!currentUserId) { | |
| 215 | + this.$message.warning('无法获取当前用户信息'); | |
| 216 | + this.purchaseListLoading = false; | |
| 217 | + return; | |
| 218 | + } | |
| 219 | + // 加载购买记录 | |
| 220 | + request({ | |
| 221 | + url: '/api/Extend/LqPurchaseRecords/Actions/GetNoPagingList', | |
| 222 | + method: 'GET', | |
| 223 | + data: { | |
| 224 | + createUser: currentUserId | |
| 225 | + } | |
| 226 | + }).then(res => { | |
| 227 | + // 过滤出未报销的记录(ApplicationId为空) | |
| 228 | + const allRecords = res.data || []; | |
| 229 | + this.purchaseList = allRecords.filter(item => { | |
| 230 | + return !item.applicationId || item.applicationId === ''; | |
| 231 | + }); | |
| 232 | + // 如果已有选中的记录,在弹窗中选中它们(用于追加选择) | |
| 233 | + this.$nextTick(() => { | |
| 234 | + if (this.tempSelectedPurchaseRecords.length > 0 && this.$refs.purchaseDialogTable) { | |
| 235 | + this.tempSelectedPurchaseRecords.forEach(record => { | |
| 236 | + const found = this.purchaseList.find(item => item.id === record.id); | |
| 237 | + if (found) { | |
| 238 | + this.$refs.purchaseDialogTable.toggleRowSelection(found, true); | |
| 239 | + } | |
| 240 | + }); | |
| 241 | + } | |
| 242 | + }); | |
| 243 | + this.purchaseListLoading = false; | |
| 244 | + }).catch(() => { | |
| 245 | + this.purchaseListLoading = false; | |
| 246 | + }); | |
| 247 | + }).catch(() => { | |
| 248 | + this.purchaseListLoading = false; | |
| 249 | + this.$message.error('获取用户信息失败'); | |
| 250 | + }); | |
| 251 | + }, | |
| 252 | + // 购买记录选择变化(弹窗中) | |
| 253 | + handlePurchaseSelectionChange(selection) { | |
| 254 | + this.tempSelectedPurchaseRecords = selection; | |
| 255 | + }, | |
| 256 | + // 确认选择购买物品 | |
| 257 | + confirmPurchaseSelection() { | |
| 258 | + // 追加选择:将弹窗中选中的记录追加到已选记录中(去重) | |
| 259 | + const existingIds = new Set(this.selectedPurchaseRecords.map(item => item.id)); | |
| 260 | + const newRecords = this.tempSelectedPurchaseRecords.filter(item => !existingIds.has(item.id)); | |
| 261 | + | |
| 262 | + // 追加新选中的记录 | |
| 263 | + this.selectedPurchaseRecords = [...this.selectedPurchaseRecords, ...newRecords]; | |
| 264 | + | |
| 265 | + // 更新ID列表 | |
| 266 | + this.dataForm.selectedPurchaseRecordIds = this.selectedPurchaseRecords.map(item => item.id); | |
| 267 | + | |
| 268 | + // 自动计算总金额 | |
| 269 | + const totalAmount = this.selectedPurchaseRecords.reduce((sum, item) => { | |
| 270 | + return sum + (parseFloat(item.amount) || 0); | |
| 271 | + }, 0); | |
| 272 | + this.dataForm.amount = totalAmount.toFixed(2); | |
| 273 | + this.purchaseDialogVisible = false; | |
| 274 | + }, | |
| 275 | + // 移除已选中的购买记录 | |
| 276 | + removePurchaseRecord(index) { | |
| 277 | + this.selectedPurchaseRecords.splice(index, 1); | |
| 278 | + this.dataForm.selectedPurchaseRecordIds = this.selectedPurchaseRecords.map(item => item.id); | |
| 279 | + // 重新计算总金额 | |
| 280 | + const totalAmount = this.selectedPurchaseRecords.reduce((sum, item) => { | |
| 281 | + return sum + (parseFloat(item.amount) || 0); | |
| 282 | + }, 0); | |
| 283 | + this.dataForm.amount = totalAmount.toFixed(2); | |
| 284 | + }, | |
| 285 | + init(id, isDetail) { | |
| 286 | + this.dataForm.id = id || 0; | |
| 287 | + this.visible = true; | |
| 288 | + this.isDetail = isDetail || false; | |
| 289 | + this.selectedPurchaseRecords = []; | |
| 290 | + this.purchaseList = []; | |
| 291 | + this.$nextTick(() => { | |
| 292 | + this.$refs['elForm'].resetFields(); | |
| 293 | + if (this.dataForm.id) { | |
| 294 | + // 编辑模式:加载已有数据 | |
| 295 | + request({ | |
| 296 | + url: '/api/Extend/LqReimbursementApplication/' + this.dataForm.id, | |
| 297 | + method: 'get' | |
| 298 | + }).then(res =>{ | |
| 299 | + this.dataForm = res.data; | |
| 300 | + // 如果有关联的购买记录,加载并选中 | |
| 301 | + if (this.dataForm.purchaseRecordsId) { | |
| 302 | + this.loadSelectedPurchaseRecords(this.dataForm.purchaseRecordsId); | |
| 303 | + } | |
| 304 | + }) | |
| 305 | + } else { | |
| 306 | + // 新增模式:设置默认值 | |
| 307 | + UserSettingInfo().then(response => { | |
| 308 | + if (response.data) { | |
| 309 | + this.dataForm.applicationUserId = response.data.id; | |
| 310 | + this.dataForm.applicationUserName = response.data.realName || response.data.userName; | |
| 311 | + } | |
| 312 | + }).catch(() => { | |
| 313 | + const userInfo = this.$store.getters.userInfo; | |
| 314 | + if (userInfo) { | |
| 315 | + this.dataForm.applicationUserId = userInfo.userId || userInfo.id; | |
| 316 | + this.dataForm.applicationUserName = userInfo.userName; | |
| 317 | + } | |
| 318 | + }); | |
| 319 | + this.dataForm.applicationTime = new Date().getTime(); | |
| 320 | + } | |
| 321 | + }) | |
| 322 | + }, | |
| 323 | + // 加载已选中的购买记录(编辑时使用) | |
| 324 | + loadSelectedPurchaseRecords(purchaseRecordsId) { | |
| 325 | + if (!purchaseRecordsId) { | |
| 326 | + this.selectedPurchaseRecords = []; | |
| 327 | + this.dataForm.selectedPurchaseRecordIds = []; | |
| 328 | + return; | |
| 329 | + } | |
| 330 | + // 处理逗号分隔的ID字符串,去除空格、换行符和空值 | |
| 331 | + // 先替换所有换行符和回车符为逗号,然后按逗号分割 | |
| 332 | + const normalizedStr = purchaseRecordsId.replace(/[\r\n]+/g, ',').replace(/\s+/g, ''); | |
| 333 | + const ids = normalizedStr.split(',').map(id => id.trim()).filter(id => id && id !== ''); | |
| 334 | + | |
| 335 | + if (ids.length === 0) { | |
| 336 | + this.selectedPurchaseRecords = []; | |
| 337 | + this.dataForm.selectedPurchaseRecordIds = []; | |
| 338 | + return; | |
| 339 | + } | |
| 340 | + | |
| 341 | + console.log('解析的购买记录ID列表:', ids); | |
| 342 | + | |
| 343 | + // 加载所有购买记录 | |
| 344 | + request({ | |
| 345 | + url: '/api/Extend/LqPurchaseRecords/Actions/GetNoPagingList', | |
| 346 | + method: 'GET', | |
| 347 | + data: {} | |
| 348 | + }).then(res => { | |
| 349 | + const allRecords = res.data || []; | |
| 350 | + console.log('加载的所有购买记录数量:', allRecords.length); | |
| 351 | + | |
| 352 | + // 清空已选记录列表 | |
| 353 | + this.selectedPurchaseRecords = []; | |
| 354 | + this.dataForm.selectedPurchaseRecordIds = []; | |
| 355 | + | |
| 356 | + // 按照ID顺序选中已关联的记录 | |
| 357 | + const foundIds = []; | |
| 358 | + const notFoundIds = []; | |
| 359 | + ids.forEach(id => { | |
| 360 | + const record = allRecords.find(item => item.id === id); | |
| 361 | + if (record) { | |
| 362 | + this.selectedPurchaseRecords.push(record); | |
| 363 | + this.dataForm.selectedPurchaseRecordIds.push(id); | |
| 364 | + foundIds.push(id); | |
| 365 | + } else { | |
| 366 | + notFoundIds.push(id); | |
| 367 | + console.warn('未找到购买记录,ID:', id); | |
| 368 | + } | |
| 369 | + }); | |
| 370 | + | |
| 371 | + console.log('找到的记录数量:', foundIds.length, '未找到的ID:', notFoundIds); | |
| 372 | + | |
| 373 | + // 计算总金额 | |
| 374 | + const totalAmount = this.selectedPurchaseRecords.reduce((sum, item) => { | |
| 375 | + return sum + (parseFloat(item.amount) || 0); | |
| 376 | + }, 0); | |
| 377 | + this.dataForm.amount = totalAmount.toFixed(2); | |
| 378 | + | |
| 379 | + // 如果有未找到的记录,提示用户 | |
| 380 | + if (notFoundIds.length > 0) { | |
| 381 | + this.$message.warning(`有 ${notFoundIds.length} 条购买记录未找到,可能已被删除`); | |
| 382 | + } | |
| 383 | + }).catch((error) => { | |
| 384 | + console.error('加载购买记录失败:', error); | |
| 385 | + this.$message.error('加载购买记录失败'); | |
| 386 | + }); | |
| 387 | + }, | |
| 388 | + dataFormSubmit() { | |
| 389 | + this.$refs['elForm'].validate((valid) => { | |
| 390 | + if (valid) { | |
| 391 | + // 验证是否选择了购买记录 | |
| 392 | + if (!this.dataForm.id && (!this.dataForm.selectedPurchaseRecordIds || this.dataForm.selectedPurchaseRecordIds.length === 0)) { | |
| 393 | + this.$message({ | |
| 394 | + message: '请至少选择一条购买记录', | |
| 395 | + type: 'warning', | |
| 396 | + duration: 2000 | |
| 397 | + }); | |
| 398 | + return; | |
| 399 | + } | |
| 400 | + | |
| 401 | + // 设置关联购买编号(多个ID用逗号分隔) | |
| 402 | + this.dataForm.purchaseRecordsId = this.dataForm.selectedPurchaseRecordIds.join(','); | |
| 403 | + | |
| 404 | + if (!this.dataForm.id) { | |
| 405 | + request({ | |
| 406 | + url: `/api/Extend/LqReimbursementApplication`, | |
| 407 | + method: 'post', | |
| 408 | + data: this.dataForm, | |
| 409 | + }).then((res) => { | |
| 410 | + this.$message({ | |
| 411 | + message: res.msg, | |
| 412 | + type: 'success', | |
| 413 | + duration: 1000, | |
| 414 | + onClose: () => { | |
| 415 | + this.visible = false, | |
| 416 | + this.$emit('refresh', true) | |
| 417 | + } | |
| 418 | + }) | |
| 419 | + }) | |
| 420 | + } else { | |
| 421 | + request({ | |
| 422 | + url: '/api/Extend/LqReimbursementApplication/' + this.dataForm.id, | |
| 423 | + method: 'PUT', | |
| 424 | + data: this.dataForm | |
| 425 | + }).then((res) => { | |
| 426 | + this.$message({ | |
| 427 | + message: res.msg, | |
| 428 | + type: 'success', | |
| 429 | + duration: 1000, | |
| 430 | + onClose: () => { | |
| 431 | + this.visible = false | |
| 432 | + this.$emit('refresh', true) | |
| 433 | + } | |
| 434 | + }) | |
| 435 | + }) | |
| 436 | + } | |
| 437 | + } | |
| 438 | + }) | |
| 439 | + }, | |
| 440 | + handleApprove() { | |
| 441 | + this.$confirm('确定要通过审批吗?', '提示', { | |
| 442 | + type: 'warning' | |
| 443 | + }).then(() => { | |
| 444 | + request({ | |
| 445 | + url: `/api/Extend/LqReimbursementApplication/${this.dataForm.id}/Actions/Approve`, | |
| 446 | + method: 'POST' | |
| 447 | + }).then(res => { | |
| 448 | + this.$message({ | |
| 449 | + type: 'success', | |
| 450 | + message: res.msg || '审批通过成功', | |
| 451 | + onClose: () => { | |
| 452 | + this.visible = false; | |
| 453 | + this.$emit('refresh', true); | |
| 454 | + } | |
| 455 | + }); | |
| 456 | + }) | |
| 457 | + }).catch(() => { | |
| 458 | + }); | |
| 459 | + }, | |
| 460 | + handleReject() { | |
| 461 | + this.$confirm('确定要拒绝审批吗?', '提示', { | |
| 462 | + type: 'warning' | |
| 463 | + }).then(() => { | |
| 464 | + request({ | |
| 465 | + url: `/api/Extend/LqReimbursementApplication/${this.dataForm.id}/Actions/Reject`, | |
| 466 | + method: 'POST' | |
| 467 | + }).then(res => { | |
| 468 | + this.$message({ | |
| 469 | + type: 'success', | |
| 470 | + message: res.msg || '拒绝审批成功', | |
| 471 | + onClose: () => { | |
| 472 | + this.visible = false; | |
| 473 | + this.$emit('refresh', true); | |
| 474 | + } | |
| 475 | + }); | |
| 476 | + }) | |
| 477 | + }).catch(() => { | |
| 478 | + }); | |
| 479 | + }, | |
| 480 | + } | |
| 481 | + } | |
| 482 | +</script> | ... | ... |
antis-ncc-admin/src/views/lqReimbursementApplication/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="NCC-common-layout"> | |
| 3 | + <div class="NCC-common-layout-center"> | |
| 4 | + <el-row class="NCC-common-search-box" :gutter="16"> | |
| 5 | + <el-form @submit.native.prevent> | |
| 6 | + <el-col :span="6"> | |
| 7 | + <el-form-item label="申请编号"> | |
| 8 | + <el-input v-model="query.id" placeholder="申请编号" clearable /> | |
| 9 | + </el-form-item> | |
| 10 | + </el-col> | |
| 11 | + <el-col :span="6"> | |
| 12 | + <el-form-item label="申请人编号"> | |
| 13 | + <el-input v-model="query.applicationUserId" placeholder="申请人编号" clearable /> | |
| 14 | + </el-form-item> | |
| 15 | + </el-col> | |
| 16 | + <el-col :span="6"> | |
| 17 | + <el-form-item label="申请人姓名"> | |
| 18 | + <el-input v-model="query.applicationUserName" 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-input v-model="query.applicationStoreId" placeholder="申请门店" clearable /> | |
| 25 | + </el-form-item> | |
| 26 | + </el-col> | |
| 27 | + <el-col :span="6"> | |
| 28 | + <el-form-item label="申请时间"> | |
| 29 | + <el-date-picker v-model="query.applicationTime" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | |
| 30 | + </el-date-picker> | |
| 31 | + </el-form-item> | |
| 32 | + </el-col> | |
| 33 | + <el-col :span="6"> | |
| 34 | + <el-form-item label="总金额"> | |
| 35 | + <el-input v-model="query.amount" placeholder="总金额" clearable /> | |
| 36 | + </el-form-item> | |
| 37 | + </el-col> | |
| 38 | + <el-col :span="6"> | |
| 39 | + <el-form-item label="审批人"> | |
| 40 | + <userSelect v-model="query.approveUser" placeholder="请选择审批人" /> | |
| 41 | + </el-form-item> | |
| 42 | + </el-col> | |
| 43 | + <el-col :span="6"> | |
| 44 | + <el-form-item label="审批结果"> | |
| 45 | + <el-input v-model="query.approveStatus" placeholder="审批结果" clearable /> | |
| 46 | + </el-form-item> | |
| 47 | + </el-col> | |
| 48 | + <el-col :span="6"> | |
| 49 | + <el-form-item label="审批时间"> | |
| 50 | + <el-date-picker v-model="query.approveTime" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | |
| 51 | + </el-date-picker> | |
| 52 | + </el-form-item> | |
| 53 | + </el-col> | |
| 54 | + <el-col :span="6"> | |
| 55 | + <el-form-item label="关联购买编号"> | |
| 56 | + <el-input v-model="query.purchaseRecordsId" placeholder="关联购买编号" clearable /> | |
| 57 | + </el-form-item> | |
| 58 | + </el-col> | |
| 59 | + </template> | |
| 60 | + <el-col :span="6"> | |
| 61 | + <el-form-item> | |
| 62 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 63 | + <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 64 | + <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">展开</el-button> | |
| 65 | + <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>收起</el-button> | |
| 66 | + </el-form-item> | |
| 67 | + </el-col> | |
| 68 | + </el-form> | |
| 69 | + </el-row> | |
| 70 | + <div class="NCC-common-layout-main NCC-flex-main"> | |
| 71 | + <div class="NCC-common-head"> | |
| 72 | + <div> | |
| 73 | + <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button> | |
| 74 | + <el-button type="text" icon="el-icon-download" @click="exportData()">导出</el-button> | |
| 75 | + <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除</el-button> | |
| 76 | + </div> | |
| 77 | + <div class="NCC-common-head-right"> | |
| 78 | + <el-tooltip effect="dark" content="刷新" placement="top"> | |
| 79 | + <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" /> | |
| 80 | + </el-tooltip> | |
| 81 | + <screenfull isContainer /> | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + <NCC-table v-loading="listLoading" :data="list" has-c @selection-change="handleSelectionChange"> | |
| 85 | + <el-table-column prop="id" label="申请编号" align="left" /> | |
| 86 | + <el-table-column prop="applicationUserId" label="申请人编号" align="left" /> | |
| 87 | + <el-table-column prop="applicationUserName" label="申请人姓名" align="left" /> | |
| 88 | + <el-table-column prop="applicationStoreId" label="申请门店" align="left" /> | |
| 89 | + <el-table-column prop="applicationTime" label="申请时间" align="left" :formatter="ncc.tableDateFormat" /> | |
| 90 | + <el-table-column prop="amount" label="总金额" align="left" /> | |
| 91 | + <el-table-column prop="approveUser" label="审批人" align="left" /> | |
| 92 | + <el-table-column prop="approveStatus" label="审批结果" align="left" /> | |
| 93 | + <el-table-column prop="approveTime" label="审批时间" align="left" :formatter="ncc.tableDateFormat" /> | |
| 94 | + <el-table-column prop="purchaseRecordsId" label="关联购买编号" align="left" /> | |
| 95 | + <el-table-column label="操作" fixed="right" width="100"> | |
| 96 | + <template slot-scope="scope"> | |
| 97 | + <el-button type="text" @click="addOrUpdateHandle(scope.row.id)" >编辑</el-button> | |
| 98 | + <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn" >删除</el-button> | |
| 99 | + </template> | |
| 100 | + </el-table-column> | |
| 101 | + </NCC-table> | |
| 102 | + <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> | |
| 103 | + </div> | |
| 104 | + </div> | |
| 105 | + <NCC-Form v-if="formVisible" ref="NCCForm" @refresh="refresh" /> | |
| 106 | + <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> | |
| 107 | + </div> | |
| 108 | +</template> | |
| 109 | +<script> | |
| 110 | + import request from '@/utils/request' | |
| 111 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 112 | + import NCCForm from './Form' | |
| 113 | + import ExportBox from './ExportBox' | |
| 114 | + import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 115 | + export default { | |
| 116 | + components: { NCCForm, ExportBox }, | |
| 117 | + data() { | |
| 118 | + return { | |
| 119 | + showAll: false, | |
| 120 | + query: { | |
| 121 | + id:undefined, | |
| 122 | + applicationUserId:undefined, | |
| 123 | + applicationUserName:undefined, | |
| 124 | + applicationStoreId:undefined, | |
| 125 | + applicationTime:undefined, | |
| 126 | + amount:undefined, | |
| 127 | + approveUser:undefined, | |
| 128 | + approveStatus:undefined, | |
| 129 | + approveTime:undefined, | |
| 130 | + purchaseRecordsId:undefined, | |
| 131 | + }, | |
| 132 | + list: [], | |
| 133 | + listLoading: true, | |
| 134 | + multipleSelection: [], total: 0, | |
| 135 | + listQuery: { | |
| 136 | + currentPage: 1, | |
| 137 | + pageSize: 20, | |
| 138 | + sort: "desc", | |
| 139 | + sidx: "", | |
| 140 | + }, | |
| 141 | + formVisible: false, | |
| 142 | + exportBoxVisible: false, | |
| 143 | + columnList: [ | |
| 144 | + { prop: 'id', label: '申请编号' }, | |
| 145 | + { prop: 'applicationUserId', label: '申请人编号' }, | |
| 146 | + { prop: 'applicationUserName', label: '申请人姓名' }, | |
| 147 | + { prop: 'applicationStoreId', label: '申请门店' }, | |
| 148 | + { prop: 'applicationTime', label: '申请时间' }, | |
| 149 | + { prop: 'amount', label: '总金额' }, | |
| 150 | + { prop: 'approveUser', label: '审批人' }, | |
| 151 | + { prop: 'approveStatus', label: '审批结果' }, | |
| 152 | + { prop: 'approveTime', label: '审批时间' }, | |
| 153 | + { prop: 'purchaseRecordsId', label: '关联购买编号' }, | |
| 154 | + ], | |
| 155 | + } | |
| 156 | + }, | |
| 157 | + computed: {}, | |
| 158 | + created() { | |
| 159 | + this.initData() | |
| 160 | + }, | |
| 161 | + methods: { | |
| 162 | + initData() { | |
| 163 | + this.listLoading = true; | |
| 164 | + let _query = { | |
| 165 | + ...this.listQuery, | |
| 166 | + ...this.query | |
| 167 | + }; | |
| 168 | + let query = {} | |
| 169 | + for (let key in _query) { | |
| 170 | + if (Array.isArray(_query[key])) { | |
| 171 | + query[key] = _query[key].join() | |
| 172 | + } else { | |
| 173 | + query[key] = _query[key] | |
| 174 | + } | |
| 175 | + } | |
| 176 | + request({ | |
| 177 | + url: `/api/Extend/LqReimbursementApplication`, | |
| 178 | + method: 'GET', | |
| 179 | + data: query | |
| 180 | + }).then(res => { | |
| 181 | + this.list = res.data.list | |
| 182 | + this.total = res.data.pagination.total | |
| 183 | + this.listLoading = false | |
| 184 | + }) | |
| 185 | + }, | |
| 186 | + handleDel(id) { | |
| 187 | + this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { | |
| 188 | + type: 'warning' | |
| 189 | + }).then(() => { | |
| 190 | + request({ | |
| 191 | + url: `/api/Extend/LqReimbursementApplication/${id}`, | |
| 192 | + method: 'DELETE' | |
| 193 | + }).then(res => { | |
| 194 | + this.$message({ | |
| 195 | + type: 'success', | |
| 196 | + message: res.msg, | |
| 197 | + onClose: () => { | |
| 198 | + this.initData() | |
| 199 | + } | |
| 200 | + }); | |
| 201 | + }) | |
| 202 | + }).catch(() => { | |
| 203 | + }); | |
| 204 | + }, | |
| 205 | + handleSelectionChange(val) { | |
| 206 | + const res = val.map(item => item.id) | |
| 207 | + this.multipleSelection = res | |
| 208 | + }, | |
| 209 | + handleBatchRemoveDel() { | |
| 210 | + if (!this.multipleSelection.length) { | |
| 211 | + this.$message({ | |
| 212 | + type: 'error', | |
| 213 | + message: '请选择一条数据', | |
| 214 | + duration: 1500, | |
| 215 | + }) | |
| 216 | + return | |
| 217 | + } | |
| 218 | + const ids = this.multipleSelection | |
| 219 | + this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { | |
| 220 | + type: 'warning' | |
| 221 | + }).then(() => { | |
| 222 | + request({ | |
| 223 | + url: `/api/Extend/LqReimbursementApplication/batchRemove`, | |
| 224 | + method: 'POST', | |
| 225 | + data: ids , | |
| 226 | + }).then(res => { | |
| 227 | + this.$message({ | |
| 228 | + type: 'success', | |
| 229 | + message: res.msg, | |
| 230 | + onClose: () => { | |
| 231 | + this.initData() | |
| 232 | + } | |
| 233 | + }); | |
| 234 | + }) | |
| 235 | + }).catch(() => { }) | |
| 236 | + }, | |
| 237 | + addOrUpdateHandle(id, isDetail) { | |
| 238 | + this.formVisible = true | |
| 239 | + this.$nextTick(() => { | |
| 240 | + this.$refs.NCCForm.init(id, isDetail) | |
| 241 | + }) | |
| 242 | + }, | |
| 243 | + exportData() { | |
| 244 | + this.exportBoxVisible = true | |
| 245 | + this.$nextTick(() => { | |
| 246 | + this.$refs.ExportBox.init(this.columnList) | |
| 247 | + }) | |
| 248 | + }, | |
| 249 | + download(data) { | |
| 250 | + let query = { ...data, ...this.listQuery, ...this.query } | |
| 251 | + request({ | |
| 252 | + url: `/api/Extend/LqReimbursementApplication/Actions/Export`, | |
| 253 | + method: 'GET', | |
| 254 | + data: query | |
| 255 | + }).then(res => { | |
| 256 | + if (!res.data.url) return | |
| 257 | + window.location.href = this.define.comUrl + res.data.url | |
| 258 | + this.$refs.ExportBox.visible = false | |
| 259 | + this.exportBoxVisible = false | |
| 260 | + }) | |
| 261 | + }, | |
| 262 | + search() { | |
| 263 | + this.listQuery = { | |
| 264 | + currentPage: 1, | |
| 265 | + pageSize: 20, | |
| 266 | + sort: "desc", | |
| 267 | + sidx: "", | |
| 268 | + } | |
| 269 | + this.initData() | |
| 270 | + }, | |
| 271 | + refresh(isrRefresh) { | |
| 272 | + this.formVisible = false | |
| 273 | + if (isrRefresh) this.reset() | |
| 274 | + }, | |
| 275 | + reset() { | |
| 276 | + for (let key in this.query) { | |
| 277 | + this.query[key] = undefined | |
| 278 | + } | |
| 279 | + this.listQuery = { | |
| 280 | + currentPage: 1, | |
| 281 | + pageSize: 20, | |
| 282 | + sort: "desc", | |
| 283 | + sidx: "", | |
| 284 | + } | |
| 285 | + this.initData() | |
| 286 | + } | |
| 287 | + } | |
| 288 | + } | |
| 289 | +</script> | |
| 0 | 290 | \ No newline at end of file | ... | ... |
antis-ncc-admin/src/views/lqReimbursementCategory/ExportBox.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible" | |
| 3 | + class="NCC-dialog NCC-dialog_center" lock-scroll width="600px"> | |
| 4 | + <el-form label-position="top" label-width="80px"> | |
| 5 | + <el-form-item label="数据选择"> | |
| 6 | + <el-radio-group v-model="type"> | |
| 7 | + <el-radio :label="0">当前页面数据</el-radio> | |
| 8 | + <el-radio :label="1">全部页面数据</el-radio> | |
| 9 | + </el-radio-group> | |
| 10 | + </el-form-item> | |
| 11 | + <el-form-item label="导出字段"> | |
| 12 | + <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" | |
| 13 | + @change="handleCheckAllChange">全选</el-checkbox> | |
| 14 | + <el-checkbox-group v-model="columns" @change="handleCheckedChange"> | |
| 15 | + <el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop"> | |
| 16 | + {{item.label}} | |
| 17 | + </el-checkbox> | |
| 18 | + </el-checkbox-group> | |
| 19 | + </el-form-item> | |
| 20 | + </el-form> | |
| 21 | + <span slot="footer" class="dialog-footer"> | |
| 22 | + <el-button @click="visible=false">取 消</el-button> | |
| 23 | + <el-button type="primary" @click="downLoad">导 出</el-button> | |
| 24 | + </span> | |
| 25 | + </el-dialog> | |
| 26 | +</template> | |
| 27 | + | |
| 28 | +<script> | |
| 29 | +export default { | |
| 30 | + data() { | |
| 31 | + return { | |
| 32 | + visible: false, | |
| 33 | + btnLoading: false, | |
| 34 | + type: 0, | |
| 35 | + columns: [], | |
| 36 | + checkAll: true, | |
| 37 | + isIndeterminate: false, | |
| 38 | + columnList: [] | |
| 39 | + } | |
| 40 | + }, | |
| 41 | + methods: { | |
| 42 | + init(columnList) { | |
| 43 | + this.visible = true | |
| 44 | + this.columnList = columnList | |
| 45 | + this.columns = columnList.map(o => o.prop) | |
| 46 | + }, | |
| 47 | + handleCheckAllChange(val) { | |
| 48 | + this.columns = val ? this.columnList.map(o => o.prop) : []; | |
| 49 | + this.isIndeterminate = false; | |
| 50 | + }, | |
| 51 | + handleCheckedChange(value) { | |
| 52 | + let checkedCount = value.length; | |
| 53 | + this.checkAll = checkedCount === this.columnList.length; | |
| 54 | + this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length; | |
| 55 | + }, | |
| 56 | + downLoad() { | |
| 57 | + this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') }) | |
| 58 | + } | |
| 59 | + } | |
| 60 | +} | |
| 61 | +</script> | |
| 62 | +<style lang="scss" scoped> | |
| 63 | +>>> .el-dialog__body { | |
| 64 | + padding: 20px !important; | |
| 65 | +} | |
| 66 | +</style> | |
| 0 | 67 | \ No newline at end of file | ... | ... |
antis-ncc-admin/src/views/lqReimbursementCategory/Form.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll width="600px"> | |
| 3 | + <el-row :gutter="15" class="" > | |
| 4 | + <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules"> | |
| 5 | + <el-col :span="24"> | |
| 6 | + <el-form-item label="分类编号" prop="id"> | |
| 7 | + <el-input v-model="dataForm.id" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 8 | + </el-input> | |
| 9 | + </el-form-item> | |
| 10 | + </el-col> | |
| 11 | + <el-col :span="24"> | |
| 12 | + <el-form-item label="一级名称" prop="level1Name"> | |
| 13 | + <el-input v-model="dataForm.level1Name" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 14 | + </el-input> | |
| 15 | + </el-form-item> | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="24"> | |
| 18 | + <el-form-item label="二级名称" prop="typeName"> | |
| 19 | + <el-input v-model="dataForm.typeName" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 20 | + </el-input> | |
| 21 | + </el-form-item> | |
| 22 | + </el-col> | |
| 23 | + <el-col :span="24"> | |
| 24 | + <el-form-item label="权责收付实现" prop="implement"> | |
| 25 | + <el-input v-model="dataForm.implement" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 26 | + </el-input> | |
| 27 | + </el-form-item> | |
| 28 | + </el-col> | |
| 29 | + <el-col :span="24"> | |
| 30 | + <el-form-item label="费用计入" prop="costsRecorded"> | |
| 31 | + <el-input v-model="dataForm.costsRecorded" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 32 | + </el-input> | |
| 33 | + </el-form-item> | |
| 34 | + </el-col> | |
| 35 | + <el-col :span="24"> | |
| 36 | + <el-form-item label="一级编号" prop="level1Code"> | |
| 37 | + <el-input v-model="dataForm.level1Code" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 38 | + </el-input> | |
| 39 | + </el-form-item> | |
| 40 | + </el-col> | |
| 41 | + <el-col :span="24"> | |
| 42 | + <el-form-item label="二级编号" prop="level2Code"> | |
| 43 | + <el-input v-model="dataForm.level2Code" placeholder="请输入" clearable :style='{"width":"100%"}' > | |
| 44 | + </el-input> | |
| 45 | + </el-form-item> | |
| 46 | + </el-col> | |
| 47 | + </el-form> | |
| 48 | + </el-row> | |
| 49 | + <span slot="footer" class="dialog-footer"> | |
| 50 | + <el-button @click="visible = false">取 消</el-button> | |
| 51 | + <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button> | |
| 52 | + </span> | |
| 53 | + </el-dialog> | |
| 54 | +</template> | |
| 55 | +<script> | |
| 56 | + import request from '@/utils/request' | |
| 57 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 58 | + import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 59 | + export default { | |
| 60 | + components: {}, | |
| 61 | + props: [], | |
| 62 | + data() { | |
| 63 | + return { | |
| 64 | + loading: false, | |
| 65 | + visible: false, | |
| 66 | + isDetail: false, | |
| 67 | + dataForm: { | |
| 68 | + id:undefined, | |
| 69 | + level1Name:undefined, | |
| 70 | + typeName:undefined, | |
| 71 | + implement:undefined, | |
| 72 | + costsRecorded:undefined, | |
| 73 | + level1Code:undefined, | |
| 74 | + level2Code:undefined, | |
| 75 | + }, | |
| 76 | + rules: { | |
| 77 | + }, | |
| 78 | + } | |
| 79 | + }, | |
| 80 | + computed: {}, | |
| 81 | + watch: {}, | |
| 82 | + created() { | |
| 83 | + }, | |
| 84 | + mounted() { | |
| 85 | + }, | |
| 86 | + methods: { | |
| 87 | + goBack() { | |
| 88 | + this.$emit('refresh') | |
| 89 | + }, | |
| 90 | + init(id, isDetail) { | |
| 91 | + this.dataForm.id = id || 0; | |
| 92 | + this.visible = true; | |
| 93 | + this.isDetail = isDetail || false; | |
| 94 | + this.$nextTick(() => { | |
| 95 | + this.$refs['elForm'].resetFields(); | |
| 96 | + if (this.dataForm.id) { | |
| 97 | + request({ | |
| 98 | + url: '/api/Extend/LqReimbursementCategory/' + this.dataForm.id, | |
| 99 | + method: 'get' | |
| 100 | + }).then(res =>{ | |
| 101 | + this.dataForm = res.data; | |
| 102 | + }) | |
| 103 | + } | |
| 104 | + }) | |
| 105 | + }, | |
| 106 | + dataFormSubmit() { | |
| 107 | + this.$refs['elForm'].validate((valid) => { | |
| 108 | + if (valid) { | |
| 109 | + if (!this.dataForm.id) { | |
| 110 | + request({ | |
| 111 | + url: `/api/Extend/LqReimbursementCategory`, | |
| 112 | + method: 'post', | |
| 113 | + data: this.dataForm, | |
| 114 | + }).then((res) => { | |
| 115 | + this.$message({ | |
| 116 | + message: res.msg, | |
| 117 | + type: 'success', | |
| 118 | + duration: 1000, | |
| 119 | + onClose: () => { | |
| 120 | + this.visible = false, | |
| 121 | + this.$emit('refresh', true) | |
| 122 | + } | |
| 123 | + }) | |
| 124 | + }) | |
| 125 | + } else { | |
| 126 | + request({ | |
| 127 | + url: '/api/Extend/LqReimbursementCategory/' + this.dataForm.id, | |
| 128 | + method: 'PUT', | |
| 129 | + data: this.dataForm | |
| 130 | + }).then((res) => { | |
| 131 | + this.$message({ | |
| 132 | + message: res.msg, | |
| 133 | + type: 'success', | |
| 134 | + duration: 1000, | |
| 135 | + onClose: () => { | |
| 136 | + this.visible = false | |
| 137 | + this.$emit('refresh', true) | |
| 138 | + } | |
| 139 | + }) | |
| 140 | + }) | |
| 141 | + } | |
| 142 | + } | |
| 143 | + }) | |
| 144 | + }, | |
| 145 | + } | |
| 146 | + } | |
| 147 | +</script> | ... | ... |
antis-ncc-admin/src/views/lqReimbursementCategory/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="NCC-common-layout"> | |
| 3 | + <div class="NCC-common-layout-center"> | |
| 4 | + <el-row class="NCC-common-search-box" :gutter="16"> | |
| 5 | + <el-form @submit.native.prevent> | |
| 6 | + <el-col :span="6"> | |
| 7 | + <el-form-item label="分类编号"> | |
| 8 | + <el-input v-model="query.id" placeholder="分类编号" clearable /> | |
| 9 | + </el-form-item> | |
| 10 | + </el-col> | |
| 11 | + <el-col :span="6"> | |
| 12 | + <el-form-item label="一级名称"> | |
| 13 | + <el-input v-model="query.level1Name" placeholder="一级名称" clearable /> | |
| 14 | + </el-form-item> | |
| 15 | + </el-col> | |
| 16 | + <el-col :span="6"> | |
| 17 | + <el-form-item label="二级名称"> | |
| 18 | + <el-input v-model="query.typeName" placeholder="二级名称" clearable /> | |
| 19 | + </el-form-item> | |
| 20 | + </el-col> | |
| 21 | + <el-col :span="6"> | |
| 22 | + <el-form-item label="一级编号"> | |
| 23 | + <el-input v-model="query.level1Code" placeholder="一级编号" clearable /> | |
| 24 | + </el-form-item> | |
| 25 | + </el-col> | |
| 26 | + <template v-if="showAll"> | |
| 27 | + <el-col :span="6"> | |
| 28 | + <el-form-item label="二级编号"> | |
| 29 | + <el-input v-model="query.level2Code" placeholder="二级编号" clearable /> | |
| 30 | + </el-form-item> | |
| 31 | + </el-col> | |
| 32 | + <el-col :span="6"> | |
| 33 | + <el-form-item label="权责收付实现"> | |
| 34 | + <el-input v-model="query.implement" placeholder="权责收付实现" clearable /> | |
| 35 | + </el-form-item> | |
| 36 | + </el-col> | |
| 37 | + <el-col :span="6"> | |
| 38 | + <el-form-item label="费用计入"> | |
| 39 | + <el-input v-model="query.costsRecorded" placeholder="费用计入" clearable /> | |
| 40 | + </el-form-item> | |
| 41 | + </el-col> | |
| 42 | + </template> | |
| 43 | + <el-col :span="6"> | |
| 44 | + <el-form-item> | |
| 45 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 46 | + <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 47 | + <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">展开</el-button> | |
| 48 | + <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>收起</el-button> | |
| 49 | + </el-form-item> | |
| 50 | + </el-col> | |
| 51 | + </el-form> | |
| 52 | + </el-row> | |
| 53 | + <div class="NCC-common-layout-main NCC-flex-main"> | |
| 54 | + <div class="NCC-common-head"> | |
| 55 | + <div> | |
| 56 | + <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button> | |
| 57 | + <el-button type="text" icon="el-icon-download" @click="exportData()">导出</el-button> | |
| 58 | + <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除</el-button> | |
| 59 | + </div> | |
| 60 | + <div class="NCC-common-head-right"> | |
| 61 | + <el-tooltip effect="dark" content="刷新" placement="top"> | |
| 62 | + <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" /> | |
| 63 | + </el-tooltip> | |
| 64 | + <screenfull isContainer /> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + <NCC-table v-loading="listLoading" :data="list" has-c @selection-change="handleSelectionChange"> | |
| 68 | + <el-table-column prop="id" label="分类编号" align="left" /> | |
| 69 | + <el-table-column prop="level1Name" label="一级名称" align="left" /> | |
| 70 | + <el-table-column prop="typeName" label="二级名称" align="left" /> | |
| 71 | + <el-table-column prop="level1Code" label="一级编号" align="left" /> | |
| 72 | + <el-table-column prop="level2Code" label="二级编号" align="left" /> | |
| 73 | + <el-table-column prop="implement" label="权责收付实现" align="left" /> | |
| 74 | + <el-table-column prop="costsRecorded" label="费用计入" align="left" /> | |
| 75 | + <el-table-column label="操作" fixed="right" width="100"> | |
| 76 | + <template slot-scope="scope"> | |
| 77 | + <el-button type="text" @click="addOrUpdateHandle(scope.row.id)" >编辑</el-button> | |
| 78 | + <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn" >删除</el-button> | |
| 79 | + </template> | |
| 80 | + </el-table-column> | |
| 81 | + </NCC-table> | |
| 82 | + <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + <NCC-Form v-if="formVisible" ref="NCCForm" @refresh="refresh" /> | |
| 86 | + <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> | |
| 87 | + </div> | |
| 88 | +</template> | |
| 89 | +<script> | |
| 90 | + import request from '@/utils/request' | |
| 91 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 92 | + import NCCForm from './Form' | |
| 93 | + import ExportBox from './ExportBox' | |
| 94 | + import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 95 | + export default { | |
| 96 | + components: { NCCForm, ExportBox }, | |
| 97 | + data() { | |
| 98 | + return { | |
| 99 | + showAll: false, | |
| 100 | + query: { | |
| 101 | + id:undefined, | |
| 102 | + level1Name:undefined, | |
| 103 | + typeName:undefined, | |
| 104 | + implement:undefined, | |
| 105 | + costsRecorded:undefined, | |
| 106 | + level1Code:undefined, | |
| 107 | + level2Code:undefined, | |
| 108 | + }, | |
| 109 | + list: [], | |
| 110 | + listLoading: true, | |
| 111 | + multipleSelection: [], total: 0, | |
| 112 | + listQuery: { | |
| 113 | + currentPage: 1, | |
| 114 | + pageSize: 20, | |
| 115 | + sort: "desc", | |
| 116 | + sidx: "", | |
| 117 | + }, | |
| 118 | + formVisible: false, | |
| 119 | + exportBoxVisible: false, | |
| 120 | + columnList: [ | |
| 121 | + { prop: 'id', label: '分类编号' }, | |
| 122 | + { prop: 'level1Name', label: '一级名称' }, | |
| 123 | + { prop: 'typeName', label: '二级名称' }, | |
| 124 | + { prop: 'level1Code', label: '一级编号' }, | |
| 125 | + { prop: 'level2Code', label: '二级编号' }, | |
| 126 | + { prop: 'implement', label: '权责收付实现' }, | |
| 127 | + { prop: 'costsRecorded', label: '费用计入' }, | |
| 128 | + ], | |
| 129 | + } | |
| 130 | + }, | |
| 131 | + computed: {}, | |
| 132 | + created() { | |
| 133 | + this.initData() | |
| 134 | + }, | |
| 135 | + methods: { | |
| 136 | + initData() { | |
| 137 | + this.listLoading = true; | |
| 138 | + let _query = { | |
| 139 | + ...this.listQuery, | |
| 140 | + ...this.query | |
| 141 | + }; | |
| 142 | + let query = {} | |
| 143 | + for (let key in _query) { | |
| 144 | + if (Array.isArray(_query[key])) { | |
| 145 | + query[key] = _query[key].join() | |
| 146 | + } else { | |
| 147 | + query[key] = _query[key] | |
| 148 | + } | |
| 149 | + } | |
| 150 | + request({ | |
| 151 | + url: `/api/Extend/LqReimbursementCategory`, | |
| 152 | + method: 'GET', | |
| 153 | + data: query | |
| 154 | + }).then(res => { | |
| 155 | + this.list = res.data.list | |
| 156 | + this.total = res.data.pagination.total | |
| 157 | + this.listLoading = false | |
| 158 | + }) | |
| 159 | + }, | |
| 160 | + handleDel(id) { | |
| 161 | + this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { | |
| 162 | + type: 'warning' | |
| 163 | + }).then(() => { | |
| 164 | + request({ | |
| 165 | + url: `/api/Extend/LqReimbursementCategory/${id}`, | |
| 166 | + method: 'DELETE' | |
| 167 | + }).then(res => { | |
| 168 | + this.$message({ | |
| 169 | + type: 'success', | |
| 170 | + message: res.msg, | |
| 171 | + onClose: () => { | |
| 172 | + this.initData() | |
| 173 | + } | |
| 174 | + }); | |
| 175 | + }) | |
| 176 | + }).catch(() => { | |
| 177 | + }); | |
| 178 | + }, | |
| 179 | + handleSelectionChange(val) { | |
| 180 | + const res = val.map(item => item.id) | |
| 181 | + this.multipleSelection = res | |
| 182 | + }, | |
| 183 | + handleBatchRemoveDel() { | |
| 184 | + if (!this.multipleSelection.length) { | |
| 185 | + this.$message({ | |
| 186 | + type: 'error', | |
| 187 | + message: '请选择一条数据', | |
| 188 | + duration: 1500, | |
| 189 | + }) | |
| 190 | + return | |
| 191 | + } | |
| 192 | + const ids = this.multipleSelection | |
| 193 | + this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { | |
| 194 | + type: 'warning' | |
| 195 | + }).then(() => { | |
| 196 | + request({ | |
| 197 | + url: `/api/Extend/LqReimbursementCategory/batchRemove`, | |
| 198 | + method: 'POST', | |
| 199 | + data: ids , | |
| 200 | + }).then(res => { | |
| 201 | + this.$message({ | |
| 202 | + type: 'success', | |
| 203 | + message: res.msg, | |
| 204 | + onClose: () => { | |
| 205 | + this.initData() | |
| 206 | + } | |
| 207 | + }); | |
| 208 | + }) | |
| 209 | + }).catch(() => { }) | |
| 210 | + }, | |
| 211 | + addOrUpdateHandle(id, isDetail) { | |
| 212 | + this.formVisible = true | |
| 213 | + this.$nextTick(() => { | |
| 214 | + this.$refs.NCCForm.init(id, isDetail) | |
| 215 | + }) | |
| 216 | + }, | |
| 217 | + exportData() { | |
| 218 | + this.exportBoxVisible = true | |
| 219 | + this.$nextTick(() => { | |
| 220 | + this.$refs.ExportBox.init(this.columnList) | |
| 221 | + }) | |
| 222 | + }, | |
| 223 | + download(data) { | |
| 224 | + let query = { ...data, ...this.listQuery, ...this.query } | |
| 225 | + request({ | |
| 226 | + url: `/api/Extend/LqReimbursementCategory/Actions/Export`, | |
| 227 | + method: 'GET', | |
| 228 | + data: query | |
| 229 | + }).then(res => { | |
| 230 | + if (!res.data.url) return | |
| 231 | + window.location.href = this.define.comUrl + res.data.url | |
| 232 | + this.$refs.ExportBox.visible = false | |
| 233 | + this.exportBoxVisible = false | |
| 234 | + }) | |
| 235 | + }, | |
| 236 | + search() { | |
| 237 | + this.listQuery = { | |
| 238 | + currentPage: 1, | |
| 239 | + pageSize: 20, | |
| 240 | + sort: "desc", | |
| 241 | + sidx: "", | |
| 242 | + } | |
| 243 | + this.initData() | |
| 244 | + }, | |
| 245 | + refresh(isrRefresh) { | |
| 246 | + this.formVisible = false | |
| 247 | + if (isrRefresh) this.reset() | |
| 248 | + }, | |
| 249 | + reset() { | |
| 250 | + for (let key in this.query) { | |
| 251 | + this.query[key] = undefined | |
| 252 | + } | |
| 253 | + this.listQuery = { | |
| 254 | + currentPage: 1, | |
| 255 | + pageSize: 20, | |
| 256 | + sort: "desc", | |
| 257 | + sidx: "", | |
| 258 | + } | |
| 259 | + this.initData() | |
| 260 | + } | |
| 261 | + } | |
| 262 | + } | |
| 263 | +</script> | |
| 0 | 264 | \ No newline at end of file | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqPurchaseRecordsCrInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using NCC.Common.Model; | |
| 4 | + | |
| 5 | +namespace NCC.Extend.Entitys.Dto.LqPurchaseRecords | |
| 6 | +{ | |
| 7 | + /// <summary> | |
| 8 | + /// 购买记录表修改输入参数 | |
| 9 | + /// </summary> | |
| 10 | + public class LqPurchaseRecordsCrInput | |
| 11 | + { | |
| 12 | + /// <summary> | |
| 13 | + /// 记录编号 | |
| 14 | + /// </summary> | |
| 15 | + public string id { get; set; } | |
| 16 | + | |
| 17 | + /// <summary> | |
| 18 | + /// 购买物品编号 | |
| 19 | + /// </summary> | |
| 20 | + public string reimbursementCategoryId { get; set; } | |
| 21 | + | |
| 22 | + /// <summary> | |
| 23 | + /// 购买物品名称 | |
| 24 | + /// </summary> | |
| 25 | + public string reimbursementCategoryName { get; set; } | |
| 26 | + | |
| 27 | + /// <summary> | |
| 28 | + /// 单价 | |
| 29 | + /// </summary> | |
| 30 | + public decimal unitPrice { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 数量 | |
| 34 | + /// </summary> | |
| 35 | + public int? quantity { get; set; } | |
| 36 | + | |
| 37 | + /// <summary> | |
| 38 | + /// 总金额 | |
| 39 | + /// </summary> | |
| 40 | + public decimal amount { get; set; } | |
| 41 | + | |
| 42 | + /// <summary> | |
| 43 | + /// 备注说明 | |
| 44 | + /// </summary> | |
| 45 | + public string memo { get; set; } | |
| 46 | + | |
| 47 | + /// <summary> | |
| 48 | + /// 附件 | |
| 49 | + /// </summary> | |
| 50 | + public List<FileControlsModel> attachment { get; set; } | |
| 51 | + | |
| 52 | + /// <summary> | |
| 53 | + /// 购买时间 | |
| 54 | + /// </summary> | |
| 55 | + public DateTime? purchaseTime { get; set; } | |
| 56 | + | |
| 57 | + /// <summary> | |
| 58 | + /// 创建时间 | |
| 59 | + /// </summary> | |
| 60 | + public DateTime? createTime { get; set; } | |
| 61 | + | |
| 62 | + /// <summary> | |
| 63 | + /// 创建人 | |
| 64 | + /// </summary> | |
| 65 | + public string createUser { get; set; } | |
| 66 | + | |
| 67 | + /// <summary> | |
| 68 | + /// 创建人门店 | |
| 69 | + /// </summary> | |
| 70 | + public string createUserStoreId { get; set; } | |
| 71 | + | |
| 72 | + /// <summary> | |
| 73 | + /// 审批状态 | |
| 74 | + /// </summary> | |
| 75 | + public string approveStatus { get; set; } | |
| 76 | + | |
| 77 | + /// <summary> | |
| 78 | + /// 审批人 | |
| 79 | + /// </summary> | |
| 80 | + public string approveUser { get; set; } | |
| 81 | + | |
| 82 | + /// <summary> | |
| 83 | + /// 审批时间 | |
| 84 | + /// </summary> | |
| 85 | + public DateTime? approveTime { get; set; } | |
| 86 | + | |
| 87 | + /// <summary> | |
| 88 | + /// 审批单编号 | |
| 89 | + /// </summary> | |
| 90 | + public string applicationId { get; set; } | |
| 91 | + | |
| 92 | + } | |
| 93 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqPurchaseRecordsInfoOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using NCC.Common.Model; | |
| 4 | + | |
| 5 | +namespace NCC.Extend.Entitys.Dto.LqPurchaseRecords | |
| 6 | +{ | |
| 7 | + /// <summary> | |
| 8 | + /// 购买记录表输出参数 | |
| 9 | + /// </summary> | |
| 10 | + public class LqPurchaseRecordsInfoOutput | |
| 11 | + { | |
| 12 | + /// <summary> | |
| 13 | + /// 记录编号 | |
| 14 | + /// </summary> | |
| 15 | + public string id { get; set; } | |
| 16 | + | |
| 17 | + /// <summary> | |
| 18 | + /// 购买物品编号 | |
| 19 | + /// </summary> | |
| 20 | + public string reimbursementCategoryId { get; set; } | |
| 21 | + | |
| 22 | + /// <summary> | |
| 23 | + /// 购买物品名称 | |
| 24 | + /// </summary> | |
| 25 | + public string reimbursementCategoryName { get; set; } | |
| 26 | + | |
| 27 | + /// <summary> | |
| 28 | + /// 单价 | |
| 29 | + /// </summary> | |
| 30 | + public decimal unitPrice { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 数量 | |
| 34 | + /// </summary> | |
| 35 | + public int? quantity { get; set; } | |
| 36 | + | |
| 37 | + /// <summary> | |
| 38 | + /// 总金额 | |
| 39 | + /// </summary> | |
| 40 | + public decimal amount { get; set; } | |
| 41 | + | |
| 42 | + /// <summary> | |
| 43 | + /// 备注说明 | |
| 44 | + /// </summary> | |
| 45 | + public string memo { get; set; } | |
| 46 | + | |
| 47 | + /// <summary> | |
| 48 | + /// 附件 | |
| 49 | + /// </summary> | |
| 50 | + public List<FileControlsModel> attachment { get; set; } | |
| 51 | + | |
| 52 | + /// <summary> | |
| 53 | + /// 购买时间 | |
| 54 | + /// </summary> | |
| 55 | + public DateTime? purchaseTime { get; set; } | |
| 56 | + | |
| 57 | + /// <summary> | |
| 58 | + /// 创建时间 | |
| 59 | + /// </summary> | |
| 60 | + public DateTime? createTime { get; set; } | |
| 61 | + | |
| 62 | + /// <summary> | |
| 63 | + /// 创建人 | |
| 64 | + /// </summary> | |
| 65 | + public string createUser { get; set; } | |
| 66 | + | |
| 67 | + /// <summary> | |
| 68 | + /// 创建人门店 | |
| 69 | + /// </summary> | |
| 70 | + public string createUserStoreId { get; set; } | |
| 71 | + | |
| 72 | + /// <summary> | |
| 73 | + /// 审批状态 | |
| 74 | + /// </summary> | |
| 75 | + public string approveStatus { get; set; } | |
| 76 | + | |
| 77 | + /// <summary> | |
| 78 | + /// 审批人 | |
| 79 | + /// </summary> | |
| 80 | + public string approveUser { get; set; } | |
| 81 | + | |
| 82 | + /// <summary> | |
| 83 | + /// 审批时间 | |
| 84 | + /// </summary> | |
| 85 | + public DateTime? approveTime { get; set; } | |
| 86 | + | |
| 87 | + /// <summary> | |
| 88 | + /// 审批单编号 | |
| 89 | + /// </summary> | |
| 90 | + public string applicationId { get; set; } | |
| 91 | + | |
| 92 | + } | |
| 93 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqPurchaseRecordsListOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqPurchaseRecords | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 购买记录表输入参数 | |
| 7 | + /// </summary> | |
| 8 | + public class LqPurchaseRecordsListOutput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 记录编号 | |
| 12 | + /// </summary> | |
| 13 | + public string id { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 购买物品编号 | |
| 17 | + /// </summary> | |
| 18 | + public string reimbursementCategoryId { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 购买物品名称 | |
| 22 | + /// </summary> | |
| 23 | + public string reimbursementCategoryName { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 26 | + /// 单价 | |
| 27 | + /// </summary> | |
| 28 | + public decimal unitPrice { get; set; } | |
| 29 | + | |
| 30 | + /// <summary> | |
| 31 | + /// 数量 | |
| 32 | + /// </summary> | |
| 33 | + public int? quantity { get; set; } | |
| 34 | + | |
| 35 | + /// <summary> | |
| 36 | + /// 总金额 | |
| 37 | + /// </summary> | |
| 38 | + public decimal amount { get; set; } | |
| 39 | + | |
| 40 | + /// <summary> | |
| 41 | + /// 备注说明 | |
| 42 | + /// </summary> | |
| 43 | + public string memo { get; set; } | |
| 44 | + | |
| 45 | + /// <summary> | |
| 46 | + /// 购买时间 | |
| 47 | + /// </summary> | |
| 48 | + public DateTime? purchaseTime { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 创建时间 | |
| 52 | + /// </summary> | |
| 53 | + public DateTime? createTime { get; set; } | |
| 54 | + | |
| 55 | + /// <summary> | |
| 56 | + /// 创建人 | |
| 57 | + /// </summary> | |
| 58 | + public string createUser { get; set; } | |
| 59 | + | |
| 60 | + /// <summary> | |
| 61 | + /// 创建人门店 | |
| 62 | + /// </summary> | |
| 63 | + public string createUserStoreId { get; set; } | |
| 64 | + | |
| 65 | + /// <summary> | |
| 66 | + /// 审批状态 | |
| 67 | + /// </summary> | |
| 68 | + public string approveStatus { get; set; } | |
| 69 | + | |
| 70 | + /// <summary> | |
| 71 | + /// 审批人 | |
| 72 | + /// </summary> | |
| 73 | + public string approveUser { get; set; } | |
| 74 | + | |
| 75 | + /// <summary> | |
| 76 | + /// 审批时间 | |
| 77 | + /// </summary> | |
| 78 | + public DateTime? approveTime { get; set; } | |
| 79 | + | |
| 80 | + /// <summary> | |
| 81 | + /// 审批单编号 | |
| 82 | + /// </summary> | |
| 83 | + public string applicationId { get; set; } | |
| 84 | + | |
| 85 | + } | |
| 86 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqPurchaseRecordsListQueryInput.cs
0 → 100644
| 1 | +using NCC.Common.Filter; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqPurchaseRecords | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 购买记录表列表查询输入 | |
| 8 | + /// </summary> | |
| 9 | + public class LqPurchaseRecordsListQueryInput : PageInputBase | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 选择导出数据key | |
| 13 | + /// </summary> | |
| 14 | + public string selectKey { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// | |
| 18 | + /// </summary> | |
| 19 | + public int dataType { get; set; } | |
| 20 | + | |
| 21 | + | |
| 22 | + /// <summary> | |
| 23 | + /// 记录编号 | |
| 24 | + /// </summary> | |
| 25 | + public string id { get; set; } | |
| 26 | + | |
| 27 | + /// <summary> | |
| 28 | + /// 购买物品编号 | |
| 29 | + /// </summary> | |
| 30 | + public string reimbursementCategoryId { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 购买物品名称 | |
| 34 | + /// </summary> | |
| 35 | + public string reimbursementCategoryName { get; set; } | |
| 36 | + | |
| 37 | + /// <summary> | |
| 38 | + /// 单价 | |
| 39 | + /// </summary> | |
| 40 | + public string unitPrice { get; set; } | |
| 41 | + | |
| 42 | + /// <summary> | |
| 43 | + /// 数量 | |
| 44 | + /// </summary> | |
| 45 | + public string quantity { get; set; } | |
| 46 | + | |
| 47 | + /// <summary> | |
| 48 | + /// 总金额 | |
| 49 | + /// </summary> | |
| 50 | + public string amount { get; set; } | |
| 51 | + | |
| 52 | + /// <summary> | |
| 53 | + /// 备注说明 | |
| 54 | + /// </summary> | |
| 55 | + public string memo { get; set; } | |
| 56 | + | |
| 57 | + /// <summary> | |
| 58 | + /// 购买时间 | |
| 59 | + /// </summary> | |
| 60 | + public string purchaseTime { get; set; } | |
| 61 | + | |
| 62 | + /// <summary> | |
| 63 | + /// 创建时间 | |
| 64 | + /// </summary> | |
| 65 | + public string createTime { get; set; } | |
| 66 | + | |
| 67 | + /// <summary> | |
| 68 | + /// 创建人 | |
| 69 | + /// </summary> | |
| 70 | + public string createUser { get; set; } | |
| 71 | + | |
| 72 | + /// <summary> | |
| 73 | + /// 创建人门店 | |
| 74 | + /// </summary> | |
| 75 | + public string createUserStoreId { get; set; } | |
| 76 | + | |
| 77 | + /// <summary> | |
| 78 | + /// 审批状态 | |
| 79 | + /// </summary> | |
| 80 | + public string approveStatus { get; set; } | |
| 81 | + | |
| 82 | + /// <summary> | |
| 83 | + /// 审批人 | |
| 84 | + /// </summary> | |
| 85 | + public string approveUser { get; set; } | |
| 86 | + | |
| 87 | + /// <summary> | |
| 88 | + /// 审批时间 | |
| 89 | + /// </summary> | |
| 90 | + public string approveTime { get; set; } | |
| 91 | + | |
| 92 | + /// <summary> | |
| 93 | + /// 审批单编号 | |
| 94 | + /// </summary> | |
| 95 | + public string applicationId { get; set; } | |
| 96 | + | |
| 97 | + } | |
| 98 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqPurchaseRecordsUpInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqPurchaseRecords | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 购买记录表更新输入参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqPurchaseRecordsUpInput : LqPurchaseRecordsCrInput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 记录编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + } | |
| 17 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementApplicationCrInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementApplication | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销申请表修改输入参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementApplicationCrInput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 申请编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// 申请人编号 | |
| 18 | + /// </summary> | |
| 19 | + public string applicationUserId { get; set; } | |
| 20 | + | |
| 21 | + /// <summary> | |
| 22 | + /// 申请人姓名 | |
| 23 | + /// </summary> | |
| 24 | + public string applicationUserName { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 申请门店 | |
| 28 | + /// </summary> | |
| 29 | + public string applicationStoreId { get; set; } | |
| 30 | + | |
| 31 | + /// <summary> | |
| 32 | + /// 申请时间 | |
| 33 | + /// </summary> | |
| 34 | + public DateTime? applicationTime { get; set; } | |
| 35 | + | |
| 36 | + /// <summary> | |
| 37 | + /// 总金额 | |
| 38 | + /// </summary> | |
| 39 | + public string amount { get; set; } | |
| 40 | + | |
| 41 | + /// <summary> | |
| 42 | + /// 审批人 | |
| 43 | + /// </summary> | |
| 44 | + public string approveUser { get; set; } | |
| 45 | + | |
| 46 | + /// <summary> | |
| 47 | + /// 审批结果 | |
| 48 | + /// </summary> | |
| 49 | + public string approveStatus { get; set; } | |
| 50 | + | |
| 51 | + /// <summary> | |
| 52 | + /// 审批时间 | |
| 53 | + /// </summary> | |
| 54 | + public string approveTime { get; set; } | |
| 55 | + | |
| 56 | + /// <summary> | |
| 57 | + /// 关联购买编号 | |
| 58 | + /// </summary> | |
| 59 | + public string purchaseRecordsId { get; set; } | |
| 60 | + | |
| 61 | + /// <summary> | |
| 62 | + /// 选中的购买记录ID列表(用于更新购买记录的审批单编号) | |
| 63 | + /// </summary> | |
| 64 | + public List<string> selectedPurchaseRecordIds { get; set; } | |
| 65 | + | |
| 66 | + } | |
| 67 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementApplicationInfoOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementApplication | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销申请表输出参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementApplicationInfoOutput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 申请编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// 申请人编号 | |
| 18 | + /// </summary> | |
| 19 | + public string applicationUserId { get; set; } | |
| 20 | + | |
| 21 | + /// <summary> | |
| 22 | + /// 申请人姓名 | |
| 23 | + /// </summary> | |
| 24 | + public string applicationUserName { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 申请门店 | |
| 28 | + /// </summary> | |
| 29 | + public string applicationStoreId { get; set; } | |
| 30 | + | |
| 31 | + /// <summary> | |
| 32 | + /// 申请时间 | |
| 33 | + /// </summary> | |
| 34 | + public DateTime? applicationTime { get; set; } | |
| 35 | + | |
| 36 | + /// <summary> | |
| 37 | + /// 总金额 | |
| 38 | + /// </summary> | |
| 39 | + public string amount { get; set; } | |
| 40 | + | |
| 41 | + /// <summary> | |
| 42 | + /// 审批人 | |
| 43 | + /// </summary> | |
| 44 | + public string approveUser { get; set; } | |
| 45 | + | |
| 46 | + /// <summary> | |
| 47 | + /// 审批结果 | |
| 48 | + /// </summary> | |
| 49 | + public string approveStatus { get; set; } | |
| 50 | + | |
| 51 | + /// <summary> | |
| 52 | + /// 审批时间 | |
| 53 | + /// </summary> | |
| 54 | + public string approveTime { get; set; } | |
| 55 | + | |
| 56 | + /// <summary> | |
| 57 | + /// 关联购买编号 | |
| 58 | + /// </summary> | |
| 59 | + public string purchaseRecordsId { get; set; } | |
| 60 | + | |
| 61 | + } | |
| 62 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementApplicationListOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementApplication | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 报销申请表输入参数 | |
| 7 | + /// </summary> | |
| 8 | + public class LqReimbursementApplicationListOutput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 申请编号 | |
| 12 | + /// </summary> | |
| 13 | + public string id { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 申请人编号 | |
| 17 | + /// </summary> | |
| 18 | + public string applicationUserId { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 申请人姓名 | |
| 22 | + /// </summary> | |
| 23 | + public string applicationUserName { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 26 | + /// 申请门店 | |
| 27 | + /// </summary> | |
| 28 | + public string applicationStoreId { get; set; } | |
| 29 | + | |
| 30 | + /// <summary> | |
| 31 | + /// 申请时间 | |
| 32 | + /// </summary> | |
| 33 | + public DateTime? applicationTime { get; set; } | |
| 34 | + | |
| 35 | + /// <summary> | |
| 36 | + /// 总金额 | |
| 37 | + /// </summary> | |
| 38 | + public string amount { get; set; } | |
| 39 | + | |
| 40 | + /// <summary> | |
| 41 | + /// 审批人 | |
| 42 | + /// </summary> | |
| 43 | + public string approveUser { get; set; } | |
| 44 | + | |
| 45 | + /// <summary> | |
| 46 | + /// 审批结果 | |
| 47 | + /// </summary> | |
| 48 | + public string approveStatus { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 审批时间 | |
| 52 | + /// </summary> | |
| 53 | + public string approveTime { get; set; } | |
| 54 | + | |
| 55 | + /// <summary> | |
| 56 | + /// 关联购买编号 | |
| 57 | + /// </summary> | |
| 58 | + public string purchaseRecordsId { get; set; } | |
| 59 | + | |
| 60 | + } | |
| 61 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementApplicationListQueryInput.cs
0 → 100644
| 1 | +using NCC.Common.Filter; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementApplication | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销申请表列表查询输入 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementApplicationListQueryInput : PageInputBase | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 选择导出数据key | |
| 13 | + /// </summary> | |
| 14 | + public string selectKey { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// | |
| 18 | + /// </summary> | |
| 19 | + public int dataType { get; set; } | |
| 20 | + | |
| 21 | + | |
| 22 | + /// <summary> | |
| 23 | + /// 申请编号 | |
| 24 | + /// </summary> | |
| 25 | + public string id { get; set; } | |
| 26 | + | |
| 27 | + /// <summary> | |
| 28 | + /// 申请人编号 | |
| 29 | + /// </summary> | |
| 30 | + public string applicationUserId { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 申请人姓名 | |
| 34 | + /// </summary> | |
| 35 | + public string applicationUserName { get; set; } | |
| 36 | + | |
| 37 | + /// <summary> | |
| 38 | + /// 申请门店 | |
| 39 | + /// </summary> | |
| 40 | + public string applicationStoreId { get; set; } | |
| 41 | + | |
| 42 | + /// <summary> | |
| 43 | + /// 申请时间 | |
| 44 | + /// </summary> | |
| 45 | + public string applicationTime { get; set; } | |
| 46 | + | |
| 47 | + /// <summary> | |
| 48 | + /// 总金额 | |
| 49 | + /// </summary> | |
| 50 | + public string amount { get; set; } | |
| 51 | + | |
| 52 | + /// <summary> | |
| 53 | + /// 审批人 | |
| 54 | + /// </summary> | |
| 55 | + public string approveUser { get; set; } | |
| 56 | + | |
| 57 | + /// <summary> | |
| 58 | + /// 审批结果 | |
| 59 | + /// </summary> | |
| 60 | + public string approveStatus { get; set; } | |
| 61 | + | |
| 62 | + /// <summary> | |
| 63 | + /// 审批时间 | |
| 64 | + /// </summary> | |
| 65 | + public string approveTime { get; set; } | |
| 66 | + | |
| 67 | + /// <summary> | |
| 68 | + /// 关联购买编号 | |
| 69 | + /// </summary> | |
| 70 | + public string purchaseRecordsId { get; set; } | |
| 71 | + | |
| 72 | + } | |
| 73 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementApplicationUpInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementApplication | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销申请表更新输入参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementApplicationUpInput : LqReimbursementApplicationCrInput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 申请编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + } | |
| 17 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementCategoryCrInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementCategory | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销分类表修改输入参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementCategoryCrInput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 分类编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// 一级名称 | |
| 18 | + /// </summary> | |
| 19 | + public string level1Name { get; set; } | |
| 20 | + | |
| 21 | + /// <summary> | |
| 22 | + /// 二级名称 | |
| 23 | + /// </summary> | |
| 24 | + public string typeName { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 权责收付实现 | |
| 28 | + /// </summary> | |
| 29 | + public string implement { get; set; } | |
| 30 | + | |
| 31 | + /// <summary> | |
| 32 | + /// 费用计入 | |
| 33 | + /// </summary> | |
| 34 | + public string costsRecorded { get; set; } | |
| 35 | + | |
| 36 | + /// <summary> | |
| 37 | + /// 一级编号 | |
| 38 | + /// </summary> | |
| 39 | + public string level1Code { get; set; } | |
| 40 | + | |
| 41 | + /// <summary> | |
| 42 | + /// 二级编号 | |
| 43 | + /// </summary> | |
| 44 | + public string level2Code { get; set; } | |
| 45 | + | |
| 46 | + } | |
| 47 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementCategoryInfoOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementCategory | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销分类表输出参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementCategoryInfoOutput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 分类编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// 一级名称 | |
| 18 | + /// </summary> | |
| 19 | + public string level1Name { get; set; } | |
| 20 | + | |
| 21 | + /// <summary> | |
| 22 | + /// 二级名称 | |
| 23 | + /// </summary> | |
| 24 | + public string typeName { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 权责收付实现 | |
| 28 | + /// </summary> | |
| 29 | + public string implement { get; set; } | |
| 30 | + | |
| 31 | + /// <summary> | |
| 32 | + /// 费用计入 | |
| 33 | + /// </summary> | |
| 34 | + public string costsRecorded { get; set; } | |
| 35 | + | |
| 36 | + /// <summary> | |
| 37 | + /// 一级编号 | |
| 38 | + /// </summary> | |
| 39 | + public string level1Code { get; set; } | |
| 40 | + | |
| 41 | + /// <summary> | |
| 42 | + /// 二级编号 | |
| 43 | + /// </summary> | |
| 44 | + public string level2Code { get; set; } | |
| 45 | + | |
| 46 | + } | |
| 47 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementCategoryListOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementCategory | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 报销分类表输入参数 | |
| 7 | + /// </summary> | |
| 8 | + public class LqReimbursementCategoryListOutput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 分类编号 | |
| 12 | + /// </summary> | |
| 13 | + public string id { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 一级名称 | |
| 17 | + /// </summary> | |
| 18 | + public string level1Name { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 二级名称 | |
| 22 | + /// </summary> | |
| 23 | + public string typeName { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 26 | + /// 权责收付实现 | |
| 27 | + /// </summary> | |
| 28 | + public string implement { get; set; } | |
| 29 | + | |
| 30 | + /// <summary> | |
| 31 | + /// 费用计入 | |
| 32 | + /// </summary> | |
| 33 | + public string costsRecorded { get; set; } | |
| 34 | + | |
| 35 | + /// <summary> | |
| 36 | + /// 一级编号 | |
| 37 | + /// </summary> | |
| 38 | + public string level1Code { get; set; } | |
| 39 | + | |
| 40 | + /// <summary> | |
| 41 | + /// 二级编号 | |
| 42 | + /// </summary> | |
| 43 | + public string level2Code { get; set; } | |
| 44 | + | |
| 45 | + } | |
| 46 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementCategoryListQueryInput.cs
0 → 100644
| 1 | +using NCC.Common.Filter; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementCategory | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销分类表列表查询输入 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementCategoryListQueryInput : PageInputBase | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 选择导出数据key | |
| 13 | + /// </summary> | |
| 14 | + public string selectKey { get; set; } | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// | |
| 18 | + /// </summary> | |
| 19 | + public int dataType { get; set; } | |
| 20 | + | |
| 21 | + | |
| 22 | + /// <summary> | |
| 23 | + /// 分类编号 | |
| 24 | + /// </summary> | |
| 25 | + public string id { get; set; } | |
| 26 | + | |
| 27 | + /// <summary> | |
| 28 | + /// 一级名称 | |
| 29 | + /// </summary> | |
| 30 | + public string level1Name { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 二级名称 | |
| 34 | + /// </summary> | |
| 35 | + public string typeName { get; set; } | |
| 36 | + | |
| 37 | + /// <summary> | |
| 38 | + /// 权责收付实现 | |
| 39 | + /// </summary> | |
| 40 | + public string implement { get; set; } | |
| 41 | + | |
| 42 | + /// <summary> | |
| 43 | + /// 费用计入 | |
| 44 | + /// </summary> | |
| 45 | + public string costsRecorded { get; set; } | |
| 46 | + | |
| 47 | + /// <summary> | |
| 48 | + /// 一级编号 | |
| 49 | + /// </summary> | |
| 50 | + public string level1Code { get; set; } | |
| 51 | + | |
| 52 | + /// <summary> | |
| 53 | + /// 二级编号 | |
| 54 | + /// </summary> | |
| 55 | + public string level2Code { get; set; } | |
| 56 | + | |
| 57 | + } | |
| 58 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReimbursementCategoryUpInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqReimbursementCategory | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 报销分类表更新输入参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqReimbursementCategoryUpInput : LqReimbursementCategoryCrInput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 分类编号 | |
| 13 | + /// </summary> | |
| 14 | + public string id { get; set; } | |
| 15 | + | |
| 16 | + } | |
| 17 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/LqPurchaseRecordsEntity.cs
0 → 100644
| 1 | +using NCC.Common.Const; | |
| 2 | +using SqlSugar; | |
| 3 | +using System; | |
| 4 | + | |
| 5 | +namespace NCC.Extend.Entitys | |
| 6 | +{ | |
| 7 | + /// <summary> | |
| 8 | + /// 购买记录表 | |
| 9 | + /// </summary> | |
| 10 | + [SugarTable("lq_purchase_records")] | |
| 11 | + [Tenant(ClaimConst.TENANT_ID)] | |
| 12 | + public class LqPurchaseRecordsEntity | |
| 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 = "F_ReimbursementCategoryId")] | |
| 24 | + public string ReimbursementCategoryId { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 购买物品名称 | |
| 28 | + /// </summary> | |
| 29 | + [SugarColumn(ColumnName = "F_ReimbursementCategoryName")] | |
| 30 | + public string ReimbursementCategoryName { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 单价 | |
| 34 | + /// </summary> | |
| 35 | + [SugarColumn(ColumnName = "F_UnitPrice")] | |
| 36 | + public decimal UnitPrice { get; set; } | |
| 37 | + | |
| 38 | + /// <summary> | |
| 39 | + /// 数量 | |
| 40 | + /// </summary> | |
| 41 | + [SugarColumn(ColumnName = "F_Quantity")] | |
| 42 | + public int? Quantity { get; set; } | |
| 43 | + | |
| 44 | + /// <summary> | |
| 45 | + /// 总金额 | |
| 46 | + /// </summary> | |
| 47 | + [SugarColumn(ColumnName = "F_Amount")] | |
| 48 | + public decimal Amount { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 备注说明 | |
| 52 | + /// </summary> | |
| 53 | + [SugarColumn(ColumnName = "F_Memo")] | |
| 54 | + public string Memo { get; set; } | |
| 55 | + | |
| 56 | + /// <summary> | |
| 57 | + /// 附件 | |
| 58 | + /// </summary> | |
| 59 | + [SugarColumn(ColumnName = "F_Attachment")] | |
| 60 | + public string Attachment { get; set; } | |
| 61 | + | |
| 62 | + /// <summary> | |
| 63 | + /// 购买时间 | |
| 64 | + /// </summary> | |
| 65 | + [SugarColumn(ColumnName = "F_PurchaseTime")] | |
| 66 | + public DateTime? PurchaseTime { get; set; } | |
| 67 | + | |
| 68 | + /// <summary> | |
| 69 | + /// 创建时间 | |
| 70 | + /// </summary> | |
| 71 | + [SugarColumn(ColumnName = "F_CreateTime")] | |
| 72 | + public DateTime? CreateTime { get; set; } | |
| 73 | + | |
| 74 | + /// <summary> | |
| 75 | + /// 创建人 | |
| 76 | + /// </summary> | |
| 77 | + [SugarColumn(ColumnName = "F_CreateUser")] | |
| 78 | + public string CreateUser { get; set; } | |
| 79 | + | |
| 80 | + /// <summary> | |
| 81 | + /// 创建人门店 | |
| 82 | + /// </summary> | |
| 83 | + [SugarColumn(ColumnName = "F_CreateUserStoreId")] | |
| 84 | + public string CreateUserStoreId { get; set; } | |
| 85 | + | |
| 86 | + /// <summary> | |
| 87 | + /// 审批状态 | |
| 88 | + /// </summary> | |
| 89 | + [SugarColumn(ColumnName = "F_ApproveStatus")] | |
| 90 | + public string ApproveStatus { get; set; } | |
| 91 | + | |
| 92 | + /// <summary> | |
| 93 | + /// 审批人 | |
| 94 | + /// </summary> | |
| 95 | + [SugarColumn(ColumnName = "F_ApproveUser")] | |
| 96 | + public string ApproveUser { get; set; } | |
| 97 | + | |
| 98 | + /// <summary> | |
| 99 | + /// 审批时间 | |
| 100 | + /// </summary> | |
| 101 | + [SugarColumn(ColumnName = "F_ApproveTime")] | |
| 102 | + public DateTime? ApproveTime { get; set; } | |
| 103 | + | |
| 104 | + /// <summary> | |
| 105 | + /// 审批单编号 | |
| 106 | + /// </summary> | |
| 107 | + [SugarColumn(ColumnName = "F_ApplicationId")] | |
| 108 | + public string ApplicationId { get; set; } | |
| 109 | + | |
| 110 | + } | |
| 111 | +} | |
| 0 | 112 | \ No newline at end of file | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/LqReimbursementApplicationEntity.cs
0 → 100644
| 1 | +using NCC.Common.Const; | |
| 2 | +using SqlSugar; | |
| 3 | +using System; | |
| 4 | + | |
| 5 | +namespace NCC.Extend.Entitys | |
| 6 | +{ | |
| 7 | + /// <summary> | |
| 8 | + /// 报销申请表 | |
| 9 | + /// </summary> | |
| 10 | + [SugarTable("lq_reimbursement_application")] | |
| 11 | + [Tenant(ClaimConst.TENANT_ID)] | |
| 12 | + public class LqReimbursementApplicationEntity | |
| 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 = "F_ApplicationUserId")] | |
| 24 | + public string ApplicationUserId { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 申请人姓名 | |
| 28 | + /// </summary> | |
| 29 | + [SugarColumn(ColumnName = "F_ApplicationUserName")] | |
| 30 | + public string ApplicationUserName { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 申请门店 | |
| 34 | + /// </summary> | |
| 35 | + [SugarColumn(ColumnName = "F_ApplicationStoreId")] | |
| 36 | + public string ApplicationStoreId { get; set; } | |
| 37 | + | |
| 38 | + /// <summary> | |
| 39 | + /// 申请时间 | |
| 40 | + /// </summary> | |
| 41 | + [SugarColumn(ColumnName = "F_ApplicationTime")] | |
| 42 | + public DateTime? ApplicationTime { get; set; } | |
| 43 | + | |
| 44 | + /// <summary> | |
| 45 | + /// 总金额 | |
| 46 | + /// </summary> | |
| 47 | + [SugarColumn(ColumnName = "F_Amount")] | |
| 48 | + public string Amount { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 审批人 | |
| 52 | + /// </summary> | |
| 53 | + [SugarColumn(ColumnName = "F_ApproveUser")] | |
| 54 | + public string ApproveUser { get; set; } | |
| 55 | + | |
| 56 | + /// <summary> | |
| 57 | + /// 审批结果 | |
| 58 | + /// </summary> | |
| 59 | + [SugarColumn(ColumnName = "F_ApproveStatus")] | |
| 60 | + public string ApproveStatus { get; set; } | |
| 61 | + | |
| 62 | + /// <summary> | |
| 63 | + /// 审批时间 | |
| 64 | + /// </summary> | |
| 65 | + [SugarColumn(ColumnName = "F_ApproveTime")] | |
| 66 | + public string ApproveTime { get; set; } | |
| 67 | + | |
| 68 | + /// <summary> | |
| 69 | + /// 关联购买编号 | |
| 70 | + /// </summary> | |
| 71 | + [SugarColumn(ColumnName = "F_PurchaseRecordsId")] | |
| 72 | + public string PurchaseRecordsId { get; set; } | |
| 73 | + | |
| 74 | + } | |
| 75 | +} | |
| 0 | 76 | \ No newline at end of file | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/LqReimbursementCategoryEntity.cs
0 → 100644
| 1 | +using NCC.Common.Const; | |
| 2 | +using SqlSugar; | |
| 3 | +using System; | |
| 4 | + | |
| 5 | +namespace NCC.Extend.Entitys | |
| 6 | +{ | |
| 7 | + /// <summary> | |
| 8 | + /// 报销分类表 | |
| 9 | + /// </summary> | |
| 10 | + [SugarTable("lq_reimbursement_category")] | |
| 11 | + [Tenant(ClaimConst.TENANT_ID)] | |
| 12 | + public class LqReimbursementCategoryEntity | |
| 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 = "F_Level1Name")] | |
| 24 | + public string Level1Name { get; set; } | |
| 25 | + | |
| 26 | + /// <summary> | |
| 27 | + /// 二级名称 | |
| 28 | + /// </summary> | |
| 29 | + [SugarColumn(ColumnName = "F_TypeName")] | |
| 30 | + public string TypeName { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 33 | + /// 权责收付实现 | |
| 34 | + /// </summary> | |
| 35 | + [SugarColumn(ColumnName = "F_Implement")] | |
| 36 | + public string Implement { get; set; } | |
| 37 | + | |
| 38 | + /// <summary> | |
| 39 | + /// 费用计入 | |
| 40 | + /// </summary> | |
| 41 | + [SugarColumn(ColumnName = "F_CostsRecorded")] | |
| 42 | + public string CostsRecorded { get; set; } | |
| 43 | + | |
| 44 | + /// <summary> | |
| 45 | + /// 一级编号 | |
| 46 | + /// </summary> | |
| 47 | + [SugarColumn(ColumnName = "F_Level1Code")] | |
| 48 | + public string Level1Code { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 二级编号 | |
| 52 | + /// </summary> | |
| 53 | + [SugarColumn(ColumnName = "F_Level2Code")] | |
| 54 | + public string Level2Code { get; set; } | |
| 55 | + | |
| 56 | + } | |
| 57 | +} | |
| 0 | 58 | \ No newline at end of file | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Mapper/LqPurchaseRecordsMapper.cs
0 → 100644
| 1 | +using NCC.Common.Helper; | |
| 2 | +using NCC.Common.Model; | |
| 3 | +using NCC.Extend.Entitys.Dto.LqPurchaseRecords; | |
| 4 | +using Mapster; | |
| 5 | +using System.Collections.Generic; | |
| 6 | + | |
| 7 | +namespace NCC.Extend.Entitys.Mapper.LqPurchaseRecords | |
| 8 | +{ | |
| 9 | + public class Mapper : IRegister | |
| 10 | + { | |
| 11 | + public void Register(TypeAdapterConfig config) | |
| 12 | + { | |
| 13 | + config.ForType<LqPurchaseRecordsCrInput, LqPurchaseRecordsEntity>() | |
| 14 | + .Map(dest => dest.Attachment, src => src.attachment.ToJson()) | |
| 15 | + ; | |
| 16 | + config.ForType<LqPurchaseRecordsEntity, LqPurchaseRecordsInfoOutput>() | |
| 17 | + .Map(dest => dest.attachment, src => src.Attachment.ToObject<List<FileControlsModel>>()) | |
| 18 | + ; | |
| 19 | + } | |
| 20 | + } | |
| 21 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Mapper/LqReimbursementApplicationMapper.cs
0 → 100644
| 1 | +using NCC.Common.Helper; | |
| 2 | +using NCC.Extend.Entitys.Dto.LqReimbursementApplication; | |
| 3 | +using Mapster; | |
| 4 | +using System.Collections.Generic; | |
| 5 | + | |
| 6 | +namespace NCC.Extend.Entitys.Mapper.LqReimbursementApplication | |
| 7 | +{ | |
| 8 | + public class Mapper : IRegister | |
| 9 | + { | |
| 10 | + public void Register(TypeAdapterConfig config) | |
| 11 | + { | |
| 12 | + } | |
| 13 | + } | |
| 14 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Mapper/LqReimbursementCategoryMapper.cs
0 → 100644
| 1 | +using NCC.Common.Helper; | |
| 2 | +using NCC.Extend.Entitys.Dto.LqReimbursementCategory; | |
| 3 | +using Mapster; | |
| 4 | +using System.Collections.Generic; | |
| 5 | + | |
| 6 | +namespace NCC.Extend.Entitys.Mapper.LqReimbursementCategory | |
| 7 | +{ | |
| 8 | + public class Mapper : IRegister | |
| 9 | + { | |
| 10 | + public void Register(TypeAdapterConfig config) | |
| 11 | + { | |
| 12 | + } | |
| 13 | + } | |
| 14 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Interfaces/ILqPurchaseRecordsService.cs
0 → 100644
netcore/src/Modularity/Extend/NCC.Extend.Interfaces/ILqReimbursementApplicationService.cs
0 → 100644
netcore/src/Modularity/Extend/NCC.Extend.Interfaces/ILqReimbursementCategoryService.cs
0 → 100644
netcore/src/Modularity/Extend/NCC.Extend/LqPurchaseRecordsService.cs
0 → 100644
| 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.LqPurchaseRecords; | |
| 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; | |
| 17 | +using NCC.Extend.Entitys.Dto.LqPurchaseRecords; | |
| 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.LqPurchaseRecords | |
| 27 | +{ | |
| 28 | + /// <summary> | |
| 29 | + /// 购买记录表服务 | |
| 30 | + /// </summary> | |
| 31 | + [ApiDescriptionSettings(Tag = "Extend",Name = "LqPurchaseRecords", Order = 200)] | |
| 32 | + [Route("api/Extend/[controller]")] | |
| 33 | + public class LqPurchaseRecordsService : ILqPurchaseRecordsService, IDynamicApiController, ITransient | |
| 34 | + { | |
| 35 | + private readonly ISqlSugarRepository<LqPurchaseRecordsEntity> _lqPurchaseRecordsRepository; | |
| 36 | + private readonly SqlSugarScope _db; | |
| 37 | + private readonly IUserManager _userManager; | |
| 38 | + | |
| 39 | + /// <summary> | |
| 40 | + /// 初始化一个<see cref="LqPurchaseRecordsService"/>类型的新实例 | |
| 41 | + /// </summary> | |
| 42 | + public LqPurchaseRecordsService( | |
| 43 | + ISqlSugarRepository<LqPurchaseRecordsEntity> lqPurchaseRecordsRepository, | |
| 44 | + IUserManager userManager) | |
| 45 | + { | |
| 46 | + _lqPurchaseRecordsRepository = lqPurchaseRecordsRepository; | |
| 47 | + _db = _lqPurchaseRecordsRepository.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<LqPurchaseRecordsEntity>().FirstAsync(p => p.Id == id); | |
| 60 | + var output = entity.Adapt<LqPurchaseRecordsInfoOutput>(); | |
| 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] LqPurchaseRecordsListQueryInput input) | |
| 71 | + { | |
| 72 | + var sidx = input.sidx == null ? "id" : input.sidx; | |
| 73 | + List<string> queryPurchaseTime = input.purchaseTime != null ? input.purchaseTime.Split(',').ToObeject<List<string>>() : null; | |
| 74 | + DateTime? startPurchaseTime = queryPurchaseTime != null ? Ext.GetDateTime(queryPurchaseTime.First()) : null; | |
| 75 | + DateTime? endPurchaseTime = queryPurchaseTime != null ? Ext.GetDateTime(queryPurchaseTime.Last()) : null; | |
| 76 | + List<string> queryCreateTime = input.createTime != null ? input.createTime.Split(',').ToObeject<List<string>>() : null; | |
| 77 | + DateTime? startCreateTime = queryCreateTime != null ? Ext.GetDateTime(queryCreateTime.First()) : null; | |
| 78 | + DateTime? endCreateTime = queryCreateTime != null ? Ext.GetDateTime(queryCreateTime.Last()) : null; | |
| 79 | + List<string> queryApproveTime = input.approveTime != null ? input.approveTime.Split(',').ToObeject<List<string>>() : null; | |
| 80 | + DateTime? startApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.First()) : null; | |
| 81 | + DateTime? endApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.Last()) : null; | |
| 82 | + var data = await _db.Queryable<LqPurchaseRecordsEntity>() | |
| 83 | + .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | |
| 84 | + .WhereIF(!string.IsNullOrEmpty(input.reimbursementCategoryId), p => p.ReimbursementCategoryId.Contains(input.reimbursementCategoryId)) | |
| 85 | + .WhereIF(!string.IsNullOrEmpty(input.reimbursementCategoryName), p => p.ReimbursementCategoryName.Contains(input.reimbursementCategoryName)) | |
| 86 | + .WhereIF(!string.IsNullOrEmpty(input.unitPrice), p => p.UnitPrice.Equals(input.unitPrice)) | |
| 87 | + .WhereIF(!string.IsNullOrEmpty(input.quantity), p => p.Quantity.Equals(input.quantity)) | |
| 88 | + .WhereIF(!string.IsNullOrEmpty(input.amount), p => p.Amount.Equals(input.amount)) | |
| 89 | + .WhereIF(!string.IsNullOrEmpty(input.memo), p => p.Memo.Contains(input.memo)) | |
| 90 | + .WhereIF(queryPurchaseTime != null, p => p.PurchaseTime >= new DateTime(startPurchaseTime.ToDate().Year, startPurchaseTime.ToDate().Month, startPurchaseTime.ToDate().Day, 0, 0, 0)) | |
| 91 | + .WhereIF(queryPurchaseTime != null, p => p.PurchaseTime <= new DateTime(endPurchaseTime.ToDate().Year, endPurchaseTime.ToDate().Month, endPurchaseTime.ToDate().Day, 23, 59, 59)) | |
| 92 | + .WhereIF(queryCreateTime != null, p => p.CreateTime >= new DateTime(startCreateTime.ToDate().Year, startCreateTime.ToDate().Month, startCreateTime.ToDate().Day, 0, 0, 0)) | |
| 93 | + .WhereIF(queryCreateTime != null, p => p.CreateTime <= new DateTime(endCreateTime.ToDate().Year, endCreateTime.ToDate().Month, endCreateTime.ToDate().Day, 23, 59, 59)) | |
| 94 | + .WhereIF(!string.IsNullOrEmpty(input.createUser), p => p.CreateUser.Equals(input.createUser)) | |
| 95 | + .WhereIF(!string.IsNullOrEmpty(input.createUserStoreId), p => p.CreateUserStoreId.Contains(input.createUserStoreId)) | |
| 96 | + .WhereIF(!string.IsNullOrEmpty(input.approveStatus), p => p.ApproveStatus.Contains(input.approveStatus)) | |
| 97 | + .WhereIF(!string.IsNullOrEmpty(input.approveUser), p => p.ApproveUser.Equals(input.approveUser)) | |
| 98 | + .WhereIF(queryApproveTime != null, p => p.ApproveTime >= new DateTime(startApproveTime.ToDate().Year, startApproveTime.ToDate().Month, startApproveTime.ToDate().Day, 0, 0, 0)) | |
| 99 | + .WhereIF(queryApproveTime != null, p => p.ApproveTime <= new DateTime(endApproveTime.ToDate().Year, endApproveTime.ToDate().Month, endApproveTime.ToDate().Day, 23, 59, 59)) | |
| 100 | + .WhereIF(!string.IsNullOrEmpty(input.applicationId), p => p.ApplicationId.Contains(input.applicationId)) | |
| 101 | + .Select(it=> new LqPurchaseRecordsListOutput | |
| 102 | + { | |
| 103 | + id = it.Id, | |
| 104 | + reimbursementCategoryId=it.ReimbursementCategoryId, | |
| 105 | + reimbursementCategoryName=it.ReimbursementCategoryName, | |
| 106 | + unitPrice=it.UnitPrice, | |
| 107 | + quantity=it.Quantity, | |
| 108 | + amount=it.Amount, | |
| 109 | + memo=it.Memo, | |
| 110 | + purchaseTime=it.PurchaseTime, | |
| 111 | + createTime=it.CreateTime, | |
| 112 | + createUser=it.CreateUser, | |
| 113 | + createUserStoreId=it.CreateUserStoreId, | |
| 114 | + approveStatus=it.ApproveStatus, | |
| 115 | + approveUser=it.ApproveUser, | |
| 116 | + approveTime=it.ApproveTime, | |
| 117 | + applicationId=it.ApplicationId, | |
| 118 | + }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | |
| 119 | + return PageResult<LqPurchaseRecordsListOutput>.SqlSugarPageResult(data); | |
| 120 | + } | |
| 121 | + | |
| 122 | + /// <summary> | |
| 123 | + /// 新建购买记录表 | |
| 124 | + /// </summary> | |
| 125 | + /// <param name="input">参数</param> | |
| 126 | + /// <returns></returns> | |
| 127 | + [HttpPost("")] | |
| 128 | + public async Task Create([FromBody] LqPurchaseRecordsCrInput input) | |
| 129 | + { | |
| 130 | + var userInfo = await _userManager.GetUserInfo(); | |
| 131 | + var entity = input.Adapt<LqPurchaseRecordsEntity>(); | |
| 132 | + entity.Id = YitIdHelper.NextId().ToString(); | |
| 133 | + var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | |
| 134 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | |
| 135 | + } | |
| 136 | + | |
| 137 | + /// <summary> | |
| 138 | + /// 获取购买记录表无分页列表 | |
| 139 | + /// </summary> | |
| 140 | + /// <param name="input">请求参数</param> | |
| 141 | + /// <returns></returns> | |
| 142 | + [HttpGet("Actions/GetNoPagingList")] | |
| 143 | + public async Task<dynamic> GetNoPagingList([FromQuery] LqPurchaseRecordsListQueryInput input) | |
| 144 | + { | |
| 145 | + var sidx = input.sidx == null ? "id" : input.sidx; | |
| 146 | + List<string> queryPurchaseTime = input.purchaseTime != null ? input.purchaseTime.Split(',').ToObeject<List<string>>() : null; | |
| 147 | + DateTime? startPurchaseTime = queryPurchaseTime != null ? Ext.GetDateTime(queryPurchaseTime.First()) : null; | |
| 148 | + DateTime? endPurchaseTime = queryPurchaseTime != null ? Ext.GetDateTime(queryPurchaseTime.Last()) : null; | |
| 149 | + List<string> queryCreateTime = input.createTime != null ? input.createTime.Split(',').ToObeject<List<string>>() : null; | |
| 150 | + DateTime? startCreateTime = queryCreateTime != null ? Ext.GetDateTime(queryCreateTime.First()) : null; | |
| 151 | + DateTime? endCreateTime = queryCreateTime != null ? Ext.GetDateTime(queryCreateTime.Last()) : null; | |
| 152 | + List<string> queryApproveTime = input.approveTime != null ? input.approveTime.Split(',').ToObeject<List<string>>() : null; | |
| 153 | + DateTime? startApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.First()) : null; | |
| 154 | + DateTime? endApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.Last()) : null; | |
| 155 | + var data = await _db.Queryable<LqPurchaseRecordsEntity>() | |
| 156 | + .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | |
| 157 | + .WhereIF(!string.IsNullOrEmpty(input.reimbursementCategoryId), p => p.ReimbursementCategoryId.Contains(input.reimbursementCategoryId)) | |
| 158 | + .WhereIF(!string.IsNullOrEmpty(input.reimbursementCategoryName), p => p.ReimbursementCategoryName.Contains(input.reimbursementCategoryName)) | |
| 159 | + .WhereIF(!string.IsNullOrEmpty(input.unitPrice), p => p.UnitPrice.Equals(input.unitPrice)) | |
| 160 | + .WhereIF(!string.IsNullOrEmpty(input.quantity), p => p.Quantity.Equals(input.quantity)) | |
| 161 | + .WhereIF(!string.IsNullOrEmpty(input.amount), p => p.Amount.Equals(input.amount)) | |
| 162 | + .WhereIF(!string.IsNullOrEmpty(input.memo), p => p.Memo.Contains(input.memo)) | |
| 163 | + .WhereIF(queryPurchaseTime != null, p => p.PurchaseTime >= new DateTime(startPurchaseTime.ToDate().Year, startPurchaseTime.ToDate().Month, startPurchaseTime.ToDate().Day, 0, 0, 0)) | |
| 164 | + .WhereIF(queryPurchaseTime != null, p => p.PurchaseTime <= new DateTime(endPurchaseTime.ToDate().Year, endPurchaseTime.ToDate().Month, endPurchaseTime.ToDate().Day, 23, 59, 59)) | |
| 165 | + .WhereIF(queryCreateTime != null, p => p.CreateTime >= new DateTime(startCreateTime.ToDate().Year, startCreateTime.ToDate().Month, startCreateTime.ToDate().Day, 0, 0, 0)) | |
| 166 | + .WhereIF(queryCreateTime != null, p => p.CreateTime <= new DateTime(endCreateTime.ToDate().Year, endCreateTime.ToDate().Month, endCreateTime.ToDate().Day, 23, 59, 59)) | |
| 167 | + .WhereIF(!string.IsNullOrEmpty(input.createUser), p => p.CreateUser.Equals(input.createUser)) | |
| 168 | + .WhereIF(!string.IsNullOrEmpty(input.createUserStoreId), p => p.CreateUserStoreId.Contains(input.createUserStoreId)) | |
| 169 | + .WhereIF(!string.IsNullOrEmpty(input.approveStatus), p => p.ApproveStatus.Contains(input.approveStatus)) | |
| 170 | + .WhereIF(!string.IsNullOrEmpty(input.approveUser), p => p.ApproveUser.Equals(input.approveUser)) | |
| 171 | + .WhereIF(queryApproveTime != null, p => p.ApproveTime >= new DateTime(startApproveTime.ToDate().Year, startApproveTime.ToDate().Month, startApproveTime.ToDate().Day, 0, 0, 0)) | |
| 172 | + .WhereIF(queryApproveTime != null, p => p.ApproveTime <= new DateTime(endApproveTime.ToDate().Year, endApproveTime.ToDate().Month, endApproveTime.ToDate().Day, 23, 59, 59)) | |
| 173 | + .WhereIF(!string.IsNullOrEmpty(input.applicationId), p => p.ApplicationId.Contains(input.applicationId)) | |
| 174 | + .Select(it=> new LqPurchaseRecordsListOutput | |
| 175 | + { | |
| 176 | + id = it.Id, | |
| 177 | + reimbursementCategoryId=it.ReimbursementCategoryId, | |
| 178 | + reimbursementCategoryName=it.ReimbursementCategoryName, | |
| 179 | + unitPrice=it.UnitPrice, | |
| 180 | + quantity=it.Quantity, | |
| 181 | + amount=it.Amount, | |
| 182 | + memo=it.Memo, | |
| 183 | + purchaseTime=it.PurchaseTime, | |
| 184 | + createTime=it.CreateTime, | |
| 185 | + createUser=it.CreateUser, | |
| 186 | + createUserStoreId=it.CreateUserStoreId, | |
| 187 | + approveStatus=it.ApproveStatus, | |
| 188 | + approveUser=it.ApproveUser, | |
| 189 | + approveTime=it.ApproveTime, | |
| 190 | + applicationId=it.ApplicationId, | |
| 191 | + }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | |
| 192 | + return data; | |
| 193 | + } | |
| 194 | + | |
| 195 | + /// <summary> | |
| 196 | + /// 导出购买记录表 | |
| 197 | + /// </summary> | |
| 198 | + /// <param name="input">请求参数</param> | |
| 199 | + /// <returns></returns> | |
| 200 | + [HttpGet("Actions/Export")] | |
| 201 | + public async Task<dynamic> Export([FromQuery] LqPurchaseRecordsListQueryInput input) | |
| 202 | + { | |
| 203 | + var userInfo = await _userManager.GetUserInfo(); | |
| 204 | + var exportData = new List<LqPurchaseRecordsListOutput>(); | |
| 205 | + if (input.dataType == 0) | |
| 206 | + { | |
| 207 | + var data = Clay.Object(await this.GetList(input)); | |
| 208 | + exportData = data.Solidify<PageResult<LqPurchaseRecordsListOutput>>().list; | |
| 209 | + } | |
| 210 | + else | |
| 211 | + { | |
| 212 | + exportData = await this.GetNoPagingList(input); | |
| 213 | + } | |
| 214 | + List<ParamsModel> paramList = "[{\"value\":\"记录编号\",\"field\":\"id\"},{\"value\":\"购买物品编号\",\"field\":\"reimbursementCategoryId\"},{\"value\":\"购买物品名称\",\"field\":\"reimbursementCategoryName\"},{\"value\":\"单价\",\"field\":\"unitPrice\"},{\"value\":\"数量\",\"field\":\"quantity\"},{\"value\":\"总金额\",\"field\":\"amount\"},{\"value\":\"备注说明\",\"field\":\"memo\"},{\"value\":\"购买时间\",\"field\":\"purchaseTime\"},{\"value\":\"创建时间\",\"field\":\"createTime\"},{\"value\":\"创建人\",\"field\":\"createUser\"},{\"value\":\"创建人门店\",\"field\":\"createUserStoreId\"},{\"value\":\"审批状态\",\"field\":\"approveStatus\"},{\"value\":\"审批人\",\"field\":\"approveUser\"},{\"value\":\"审批时间\",\"field\":\"approveTime\"},{\"value\":\"审批单编号\",\"field\":\"applicationId\"},]".ToList<ParamsModel>(); | |
| 215 | + ExcelConfig excelconfig = new ExcelConfig(); | |
| 216 | + excelconfig.FileName = "购买记录表.xls"; | |
| 217 | + excelconfig.HeadFont = "微软雅黑"; | |
| 218 | + excelconfig.HeadPoint = 10; | |
| 219 | + excelconfig.IsAllSizeColumn = true; | |
| 220 | + excelconfig.ColumnModel = new List<ExcelColumnModel>(); | |
| 221 | + List<string> selectKeyList = input.selectKey.Split(',').ToList(); | |
| 222 | + foreach (var item in selectKeyList) | |
| 223 | + { | |
| 224 | + var isExist = paramList.Find(p => p.field == item); | |
| 225 | + if (isExist != null) | |
| 226 | + { | |
| 227 | + excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | |
| 228 | + } | |
| 229 | + } | |
| 230 | + var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | |
| 231 | + ExcelExportHelper<LqPurchaseRecordsListOutput>.Export(exportData, excelconfig, addPath); | |
| 232 | + var fileName = _userManager.UserId + "|" + addPath + "|xls"; | |
| 233 | + var output = new | |
| 234 | + { | |
| 235 | + name = excelconfig.FileName, | |
| 236 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 237 | + }; | |
| 238 | + return output; | |
| 239 | + } | |
| 240 | + | |
| 241 | + /// <summary> | |
| 242 | + /// 批量删除购买记录表 | |
| 243 | + /// </summary> | |
| 244 | + /// <param name="ids">主键数组</param> | |
| 245 | + /// <returns></returns> | |
| 246 | + [HttpPost("batchRemove")] | |
| 247 | + public async Task BatchRemove([FromBody] List<string> ids) | |
| 248 | + { | |
| 249 | + var entitys = await _db.Queryable<LqPurchaseRecordsEntity>().In(it => it.Id, ids).ToListAsync(); | |
| 250 | + if (entitys.Count > 0) | |
| 251 | + { | |
| 252 | + try | |
| 253 | + { | |
| 254 | + //开启事务 | |
| 255 | + _db.BeginTran(); | |
| 256 | + //批量删除购买记录表 | |
| 257 | + await _db.Deleteable<LqPurchaseRecordsEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | |
| 258 | + //关闭事务 | |
| 259 | + _db.CommitTran(); | |
| 260 | + } | |
| 261 | + catch (Exception) | |
| 262 | + { | |
| 263 | + //回滚事务 | |
| 264 | + _db.RollbackTran(); | |
| 265 | + throw NCCException.Oh(ErrorCode.COM1002); | |
| 266 | + } | |
| 267 | + } | |
| 268 | + } | |
| 269 | + | |
| 270 | + /// <summary> | |
| 271 | + /// 更新购买记录表 | |
| 272 | + /// </summary> | |
| 273 | + /// <param name="id">主键</param> | |
| 274 | + /// <param name="input">参数</param> | |
| 275 | + /// <returns></returns> | |
| 276 | + [HttpPut("{id}")] | |
| 277 | + public async Task Update(string id, [FromBody] LqPurchaseRecordsUpInput input) | |
| 278 | + { | |
| 279 | + var entity = input.Adapt<LqPurchaseRecordsEntity>(); | |
| 280 | + var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | |
| 281 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | |
| 282 | + } | |
| 283 | + | |
| 284 | + /// <summary> | |
| 285 | + /// 删除购买记录表 | |
| 286 | + /// </summary> | |
| 287 | + /// <returns></returns> | |
| 288 | + [HttpDelete("{id}")] | |
| 289 | + public async Task Delete(string id) | |
| 290 | + { | |
| 291 | + var entity = await _db.Queryable<LqPurchaseRecordsEntity>().FirstAsync(p => p.Id == id); | |
| 292 | + _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | |
| 293 | + var isOk = await _db.Deleteable<LqPurchaseRecordsEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | |
| 294 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | |
| 295 | + } | |
| 296 | + } | |
| 297 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqReimbursementApplicationService.cs
0 → 100644
| 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.LqReimbursementApplication; | |
| 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; | |
| 17 | +using NCC.Extend.Entitys.Dto.LqReimbursementApplication; | |
| 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.LqReimbursementApplication | |
| 27 | +{ | |
| 28 | + /// <summary> | |
| 29 | + /// 报销申请表服务 | |
| 30 | + /// </summary> | |
| 31 | + [ApiDescriptionSettings(Tag = "Extend",Name = "LqReimbursementApplication", Order = 200)] | |
| 32 | + [Route("api/Extend/[controller]")] | |
| 33 | + public class LqReimbursementApplicationService : ILqReimbursementApplicationService, IDynamicApiController, ITransient | |
| 34 | + { | |
| 35 | + private readonly ISqlSugarRepository<LqReimbursementApplicationEntity> _lqReimbursementApplicationRepository; | |
| 36 | + private readonly SqlSugarScope _db; | |
| 37 | + private readonly IUserManager _userManager; | |
| 38 | + | |
| 39 | + /// <summary> | |
| 40 | + /// 初始化一个<see cref="LqReimbursementApplicationService"/>类型的新实例 | |
| 41 | + /// </summary> | |
| 42 | + public LqReimbursementApplicationService( | |
| 43 | + ISqlSugarRepository<LqReimbursementApplicationEntity> lqReimbursementApplicationRepository, | |
| 44 | + IUserManager userManager) | |
| 45 | + { | |
| 46 | + _lqReimbursementApplicationRepository = lqReimbursementApplicationRepository; | |
| 47 | + _db = _lqReimbursementApplicationRepository.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<LqReimbursementApplicationEntity>().FirstAsync(p => p.Id == id); | |
| 60 | + var output = entity.Adapt<LqReimbursementApplicationInfoOutput>(); | |
| 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] LqReimbursementApplicationListQueryInput input) | |
| 71 | + { | |
| 72 | + var sidx = input.sidx == null ? "id" : input.sidx; | |
| 73 | + List<string> queryApplicationTime = input.applicationTime != null ? input.applicationTime.Split(',').ToObeject<List<string>>() : null; | |
| 74 | + DateTime? startApplicationTime = queryApplicationTime != null ? Ext.GetDateTime(queryApplicationTime.First()) : null; | |
| 75 | + DateTime? endApplicationTime = queryApplicationTime != null ? Ext.GetDateTime(queryApplicationTime.Last()) : null; | |
| 76 | + List<string> queryApproveTime = input.approveTime != null ? input.approveTime.Split(',').ToObeject<List<string>>() : null; | |
| 77 | + DateTime? startApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.First()) : null; | |
| 78 | + DateTime? endApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.Last()) : null; | |
| 79 | + var data = await _db.Queryable<LqReimbursementApplicationEntity>() | |
| 80 | + .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | |
| 81 | + .WhereIF(!string.IsNullOrEmpty(input.applicationUserId), p => p.ApplicationUserId.Contains(input.applicationUserId)) | |
| 82 | + .WhereIF(!string.IsNullOrEmpty(input.applicationUserName), p => p.ApplicationUserName.Contains(input.applicationUserName)) | |
| 83 | + .WhereIF(!string.IsNullOrEmpty(input.applicationStoreId), p => p.ApplicationStoreId.Contains(input.applicationStoreId)) | |
| 84 | + .WhereIF(queryApplicationTime != null, p => p.ApplicationTime >= new DateTime(startApplicationTime.ToDate().Year, startApplicationTime.ToDate().Month, startApplicationTime.ToDate().Day, 0, 0, 0)) | |
| 85 | + .WhereIF(queryApplicationTime != null, p => p.ApplicationTime <= new DateTime(endApplicationTime.ToDate().Year, endApplicationTime.ToDate().Month, endApplicationTime.ToDate().Day, 23, 59, 59)) | |
| 86 | + .WhereIF(!string.IsNullOrEmpty(input.amount), p => p.Amount.Contains(input.amount)) | |
| 87 | + .WhereIF(!string.IsNullOrEmpty(input.approveUser), p => p.ApproveUser.Equals(input.approveUser)) | |
| 88 | + .WhereIF(!string.IsNullOrEmpty(input.approveStatus), p => p.ApproveStatus.Contains(input.approveStatus)) | |
| 89 | + // .WhereIF(queryApproveTime != null, p => p.ApproveTime >= new DateTime(startApproveTime.ToDate().Year, startApproveTime.ToDate().Month, startApproveTime.ToDate().Day, 0, 0, 0)) | |
| 90 | + //.WhereIF(queryApproveTime != null, p => p.ApproveTime <= new DateTime(endApproveTime.ToDate().Year, endApproveTime.ToDate().Month, endApproveTime.ToDate().Day, 23, 59, 59)) | |
| 91 | + .WhereIF(!string.IsNullOrEmpty(input.purchaseRecordsId), p => p.PurchaseRecordsId.Contains(input.purchaseRecordsId)) | |
| 92 | + .Select(it=> new LqReimbursementApplicationListOutput | |
| 93 | + { | |
| 94 | + id = it.Id, | |
| 95 | + applicationUserId=it.ApplicationUserId, | |
| 96 | + applicationUserName=it.ApplicationUserName, | |
| 97 | + applicationStoreId=it.ApplicationStoreId, | |
| 98 | + applicationTime=it.ApplicationTime, | |
| 99 | + amount=it.Amount, | |
| 100 | + approveUser=it.ApproveUser, | |
| 101 | + approveStatus=it.ApproveStatus, | |
| 102 | + approveTime=it.ApproveTime, | |
| 103 | + purchaseRecordsId=it.PurchaseRecordsId, | |
| 104 | + }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | |
| 105 | + return PageResult<LqReimbursementApplicationListOutput>.SqlSugarPageResult(data); | |
| 106 | + } | |
| 107 | + | |
| 108 | + /// <summary> | |
| 109 | + /// 新建报销申请表 | |
| 110 | + /// </summary> | |
| 111 | + /// <param name="input">参数</param> | |
| 112 | + /// <returns></returns> | |
| 113 | + [HttpPost("")] | |
| 114 | + public async Task Create([FromBody] LqReimbursementApplicationCrInput input) | |
| 115 | + { | |
| 116 | + var userInfo = await _userManager.GetUserInfo(); | |
| 117 | + var entity = input.Adapt<LqReimbursementApplicationEntity>(); | |
| 118 | + entity.Id = YitIdHelper.NextId().ToString(); | |
| 119 | + | |
| 120 | + try | |
| 121 | + { | |
| 122 | + //开启事务 | |
| 123 | + _db.BeginTran(); | |
| 124 | + | |
| 125 | + // 保存报销申请表 | |
| 126 | + var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | |
| 127 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | |
| 128 | + | |
| 129 | + // 更新购买记录的审批单编号和审批状态为"待审批" | |
| 130 | + if (input.selectedPurchaseRecordIds != null && input.selectedPurchaseRecordIds.Count > 0) | |
| 131 | + { | |
| 132 | + // 先更新ApplicationId | |
| 133 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 134 | + .SetColumns(it => it.ApplicationId == entity.Id) | |
| 135 | + .Where(it => input.selectedPurchaseRecordIds.Contains(it.Id)) | |
| 136 | + .ExecuteCommandAsync(); | |
| 137 | + | |
| 138 | + // 再更新ApproveStatus(分开更新确保都能执行) | |
| 139 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 140 | + .SetColumns(it => it.ApproveStatus == "待审批") | |
| 141 | + .Where(it => input.selectedPurchaseRecordIds.Contains(it.Id)) | |
| 142 | + .ExecuteCommandAsync(); | |
| 143 | + } | |
| 144 | + | |
| 145 | + //关闭事务 | |
| 146 | + _db.CommitTran(); | |
| 147 | + } | |
| 148 | + catch (Exception) | |
| 149 | + { | |
| 150 | + //回滚事务 | |
| 151 | + _db.RollbackTran(); | |
| 152 | + throw; | |
| 153 | + } | |
| 154 | + } | |
| 155 | + | |
| 156 | + /// <summary> | |
| 157 | + /// 获取报销申请表无分页列表 | |
| 158 | + /// </summary> | |
| 159 | + /// <param name="input">请求参数</param> | |
| 160 | + /// <returns></returns> | |
| 161 | + [NonAction] | |
| 162 | + public async Task<dynamic> GetNoPagingList([FromQuery] LqReimbursementApplicationListQueryInput input) | |
| 163 | + { | |
| 164 | + var sidx = input.sidx == null ? "id" : input.sidx; | |
| 165 | + List<string> queryApplicationTime = input.applicationTime != null ? input.applicationTime.Split(',').ToObeject<List<string>>() : null; | |
| 166 | + DateTime? startApplicationTime = queryApplicationTime != null ? Ext.GetDateTime(queryApplicationTime.First()) : null; | |
| 167 | + DateTime? endApplicationTime = queryApplicationTime != null ? Ext.GetDateTime(queryApplicationTime.Last()) : null; | |
| 168 | + List<string> queryApproveTime = input.approveTime != null ? input.approveTime.Split(',').ToObeject<List<string>>() : null; | |
| 169 | + DateTime? startApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.First()) : null; | |
| 170 | + DateTime? endApproveTime = queryApproveTime != null ? Ext.GetDateTime(queryApproveTime.Last()) : null; | |
| 171 | + var data = await _db.Queryable<LqReimbursementApplicationEntity>() | |
| 172 | + .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | |
| 173 | + .WhereIF(!string.IsNullOrEmpty(input.applicationUserId), p => p.ApplicationUserId.Contains(input.applicationUserId)) | |
| 174 | + .WhereIF(!string.IsNullOrEmpty(input.applicationUserName), p => p.ApplicationUserName.Contains(input.applicationUserName)) | |
| 175 | + .WhereIF(!string.IsNullOrEmpty(input.applicationStoreId), p => p.ApplicationStoreId.Contains(input.applicationStoreId)) | |
| 176 | + .WhereIF(queryApplicationTime != null, p => p.ApplicationTime >= new DateTime(startApplicationTime.ToDate().Year, startApplicationTime.ToDate().Month, startApplicationTime.ToDate().Day, 0, 0, 0)) | |
| 177 | + .WhereIF(queryApplicationTime != null, p => p.ApplicationTime <= new DateTime(endApplicationTime.ToDate().Year, endApplicationTime.ToDate().Month, endApplicationTime.ToDate().Day, 23, 59, 59)) | |
| 178 | + .WhereIF(!string.IsNullOrEmpty(input.amount), p => p.Amount.Contains(input.amount)) | |
| 179 | + .WhereIF(!string.IsNullOrEmpty(input.approveUser), p => p.ApproveUser.Equals(input.approveUser)) | |
| 180 | + .WhereIF(!string.IsNullOrEmpty(input.approveStatus), p => p.ApproveStatus.Contains(input.approveStatus)) | |
| 181 | + // .WhereIF(queryApproveTime != null, p => p.ApproveTime >= new DateTime(startApproveTime.ToDate().Year, startApproveTime.ToDate().Month, startApproveTime.ToDate().Day, 0, 0, 0)) | |
| 182 | + // .WhereIF(queryApproveTime != null, p => p.ApproveTime <= new DateTime(endApproveTime.ToDate().Year, endApproveTime.ToDate().Month, endApproveTime.ToDate().Day, 23, 59, 59)) | |
| 183 | + .WhereIF(!string.IsNullOrEmpty(input.purchaseRecordsId), p => p.PurchaseRecordsId.Contains(input.purchaseRecordsId)) | |
| 184 | + .Select(it=> new LqReimbursementApplicationListOutput | |
| 185 | + { | |
| 186 | + id = it.Id, | |
| 187 | + applicationUserId=it.ApplicationUserId, | |
| 188 | + applicationUserName=it.ApplicationUserName, | |
| 189 | + applicationStoreId=it.ApplicationStoreId, | |
| 190 | + applicationTime=it.ApplicationTime, | |
| 191 | + amount=it.Amount, | |
| 192 | + approveUser=it.ApproveUser, | |
| 193 | + approveStatus=it.ApproveStatus, | |
| 194 | + approveTime=it.ApproveTime, | |
| 195 | + purchaseRecordsId=it.PurchaseRecordsId, | |
| 196 | + }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | |
| 197 | + return data; | |
| 198 | + } | |
| 199 | + | |
| 200 | + /// <summary> | |
| 201 | + /// 导出报销申请表 | |
| 202 | + /// </summary> | |
| 203 | + /// <param name="input">请求参数</param> | |
| 204 | + /// <returns></returns> | |
| 205 | + [HttpGet("Actions/Export")] | |
| 206 | + public async Task<dynamic> Export([FromQuery] LqReimbursementApplicationListQueryInput input) | |
| 207 | + { | |
| 208 | + var userInfo = await _userManager.GetUserInfo(); | |
| 209 | + var exportData = new List<LqReimbursementApplicationListOutput>(); | |
| 210 | + if (input.dataType == 0) | |
| 211 | + { | |
| 212 | + var data = Clay.Object(await this.GetList(input)); | |
| 213 | + exportData = data.Solidify<PageResult<LqReimbursementApplicationListOutput>>().list; | |
| 214 | + } | |
| 215 | + else | |
| 216 | + { | |
| 217 | + exportData = await this.GetNoPagingList(input); | |
| 218 | + } | |
| 219 | + List<ParamsModel> paramList = "[{\"value\":\"申请编号\",\"field\":\"id\"},{\"value\":\"申请人编号\",\"field\":\"applicationUserId\"},{\"value\":\"申请人姓名\",\"field\":\"applicationUserName\"},{\"value\":\"申请门店\",\"field\":\"applicationStoreId\"},{\"value\":\"申请时间\",\"field\":\"applicationTime\"},{\"value\":\"总金额\",\"field\":\"amount\"},{\"value\":\"审批人\",\"field\":\"approveUser\"},{\"value\":\"审批结果\",\"field\":\"approveStatus\"},{\"value\":\"审批时间\",\"field\":\"approveTime\"},{\"value\":\"关联购买编号\",\"field\":\"purchaseRecordsId\"},]".ToList<ParamsModel>(); | |
| 220 | + ExcelConfig excelconfig = new ExcelConfig(); | |
| 221 | + excelconfig.FileName = "报销申请表.xls"; | |
| 222 | + excelconfig.HeadFont = "微软雅黑"; | |
| 223 | + excelconfig.HeadPoint = 10; | |
| 224 | + excelconfig.IsAllSizeColumn = true; | |
| 225 | + excelconfig.ColumnModel = new List<ExcelColumnModel>(); | |
| 226 | + List<string> selectKeyList = input.selectKey.Split(',').ToList(); | |
| 227 | + foreach (var item in selectKeyList) | |
| 228 | + { | |
| 229 | + var isExist = paramList.Find(p => p.field == item); | |
| 230 | + if (isExist != null) | |
| 231 | + { | |
| 232 | + excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | |
| 233 | + } | |
| 234 | + } | |
| 235 | + var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | |
| 236 | + ExcelExportHelper<LqReimbursementApplicationListOutput>.Export(exportData, excelconfig, addPath); | |
| 237 | + var fileName = _userManager.UserId + "|" + addPath + "|xls"; | |
| 238 | + var output = new | |
| 239 | + { | |
| 240 | + name = excelconfig.FileName, | |
| 241 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 242 | + }; | |
| 243 | + return output; | |
| 244 | + } | |
| 245 | + | |
| 246 | + /// <summary> | |
| 247 | + /// 批量删除报销申请表 | |
| 248 | + /// </summary> | |
| 249 | + /// <param name="ids">主键数组</param> | |
| 250 | + /// <returns></returns> | |
| 251 | + [HttpPost("batchRemove")] | |
| 252 | + public async Task BatchRemove([FromBody] List<string> ids) | |
| 253 | + { | |
| 254 | + var entitys = await _db.Queryable<LqReimbursementApplicationEntity>().In(it => it.Id, ids).ToListAsync(); | |
| 255 | + if (entitys.Count > 0) | |
| 256 | + { | |
| 257 | + try | |
| 258 | + { | |
| 259 | + //开启事务 | |
| 260 | + _db.BeginTran(); | |
| 261 | + //批量删除报销申请表 | |
| 262 | + await _db.Deleteable<LqReimbursementApplicationEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | |
| 263 | + //关闭事务 | |
| 264 | + _db.CommitTran(); | |
| 265 | + } | |
| 266 | + catch (Exception) | |
| 267 | + { | |
| 268 | + //回滚事务 | |
| 269 | + _db.RollbackTran(); | |
| 270 | + throw NCCException.Oh(ErrorCode.COM1002); | |
| 271 | + } | |
| 272 | + } | |
| 273 | + } | |
| 274 | + | |
| 275 | + /// <summary> | |
| 276 | + /// 更新报销申请表 | |
| 277 | + /// </summary> | |
| 278 | + /// <param name="id">主键</param> | |
| 279 | + /// <param name="input">参数</param> | |
| 280 | + /// <returns></returns> | |
| 281 | + [HttpPut("{id}")] | |
| 282 | + public async Task Update(string id, [FromBody] LqReimbursementApplicationUpInput input) | |
| 283 | + { | |
| 284 | + try | |
| 285 | + { | |
| 286 | + //开启事务 | |
| 287 | + _db.BeginTran(); | |
| 288 | + | |
| 289 | + // 获取原有的关联购买记录ID | |
| 290 | + var oldEntity = await _db.Queryable<LqReimbursementApplicationEntity>().FirstAsync(p => p.Id == id); | |
| 291 | + var oldIds = new List<string>(); | |
| 292 | + if (oldEntity != null && !string.IsNullOrEmpty(oldEntity.PurchaseRecordsId)) | |
| 293 | + { | |
| 294 | + // 获取原有购买记录ID列表 | |
| 295 | + oldIds = oldEntity.PurchaseRecordsId.Split(',').Where(x => !string.IsNullOrEmpty(x)).ToList(); | |
| 296 | + } | |
| 297 | + | |
| 298 | + // 获取新的购买记录ID列表 | |
| 299 | + var newIds = input.selectedPurchaseRecordIds ?? new List<string>(); | |
| 300 | + | |
| 301 | + // 确保 purchaseRecordsId 字段包含所有选中的记录ID(逗号分隔) | |
| 302 | + if (newIds.Count > 0) | |
| 303 | + { | |
| 304 | + input.purchaseRecordsId = string.Join(",", newIds); | |
| 305 | + } | |
| 306 | + else | |
| 307 | + { | |
| 308 | + input.purchaseRecordsId = null; | |
| 309 | + } | |
| 310 | + | |
| 311 | + // 找出需要移除关联的记录(在旧列表中但不在新列表中) | |
| 312 | + var idsToRemove = oldIds.Where(x => !newIds.Contains(x)).ToList(); | |
| 313 | + if (idsToRemove.Count > 0) | |
| 314 | + { | |
| 315 | + // 清除这些购买记录的审批单编号和审批状态 | |
| 316 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 317 | + .SetColumns(it => new LqPurchaseRecordsEntity | |
| 318 | + { | |
| 319 | + ApplicationId = null, | |
| 320 | + ApproveStatus = "未审批" | |
| 321 | + }) | |
| 322 | + .Where(it => idsToRemove.Contains(it.Id)) | |
| 323 | + .ExecuteCommandAsync(); | |
| 324 | + } | |
| 325 | + | |
| 326 | + // 更新报销申请表(确保 purchaseRecordsId 字段被正确更新) | |
| 327 | + var entity = input.Adapt<LqReimbursementApplicationEntity>(); | |
| 328 | + var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | |
| 329 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | |
| 330 | + | |
| 331 | + // 更新所有选中的购买记录的审批单编号和审批状态为"待审批" | |
| 332 | + // 包括新追加的记录和已存在的记录(确保状态正确) | |
| 333 | + if (newIds.Count > 0) | |
| 334 | + { | |
| 335 | + // 先更新ApplicationId | |
| 336 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 337 | + .SetColumns(it => it.ApplicationId == id) | |
| 338 | + .Where(it => newIds.Contains(it.Id)) | |
| 339 | + .ExecuteCommandAsync(); | |
| 340 | + | |
| 341 | + // 再更新ApproveStatus(分开更新确保都能执行) | |
| 342 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 343 | + .SetColumns(it => it.ApproveStatus == "待审批") | |
| 344 | + .Where(it => newIds.Contains(it.Id)) | |
| 345 | + .ExecuteCommandAsync(); | |
| 346 | + } | |
| 347 | + | |
| 348 | + //关闭事务 | |
| 349 | + _db.CommitTran(); | |
| 350 | + } | |
| 351 | + catch (Exception) | |
| 352 | + { | |
| 353 | + //回滚事务 | |
| 354 | + _db.RollbackTran(); | |
| 355 | + throw; | |
| 356 | + } | |
| 357 | + } | |
| 358 | + | |
| 359 | + /// <summary> | |
| 360 | + /// 删除报销申请表 | |
| 361 | + /// </summary> | |
| 362 | + /// <returns></returns> | |
| 363 | + [HttpDelete("{id}")] | |
| 364 | + public async Task Delete(string id) | |
| 365 | + { | |
| 366 | + var entity = await _db.Queryable<LqReimbursementApplicationEntity>().FirstAsync(p => p.Id == id); | |
| 367 | + _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | |
| 368 | + var isOk = await _db.Deleteable<LqReimbursementApplicationEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | |
| 369 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | |
| 370 | + } | |
| 371 | + | |
| 372 | + /// <summary> | |
| 373 | + /// 通过审批 | |
| 374 | + /// </summary> | |
| 375 | + /// <param name="id">申请编号</param> | |
| 376 | + /// <returns></returns> | |
| 377 | + [HttpPost("{id}/Actions/Approve")] | |
| 378 | + public async Task Approve(string id) | |
| 379 | + { | |
| 380 | + var userInfo = await _userManager.GetUserInfo(); | |
| 381 | + var entity = await _db.Queryable<LqReimbursementApplicationEntity>().FirstAsync(p => p.Id == id); | |
| 382 | + _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | |
| 383 | + | |
| 384 | + try | |
| 385 | + { | |
| 386 | + //开启事务 | |
| 387 | + _db.BeginTran(); | |
| 388 | + | |
| 389 | + // 更新申请表的审批状态 | |
| 390 | + entity.ApproveStatus = "已审批"; | |
| 391 | + entity.ApproveTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | |
| 392 | + entity.ApproveUser = userInfo.userId; | |
| 393 | + await _db.Updateable(entity).ExecuteCommandAsync(); | |
| 394 | + | |
| 395 | + // 更新关联的购买记录 | |
| 396 | + if (!string.IsNullOrEmpty(entity.PurchaseRecordsId)) | |
| 397 | + { | |
| 398 | + var purchaseIds = entity.PurchaseRecordsId.Split(',').Where(x => !string.IsNullOrEmpty(x)).ToList(); | |
| 399 | + if (purchaseIds.Count > 0) | |
| 400 | + { | |
| 401 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 402 | + .SetColumns(it => new LqPurchaseRecordsEntity | |
| 403 | + { | |
| 404 | + ApproveStatus = "已审批", | |
| 405 | + ApproveTime = DateTime.Now, | |
| 406 | + ApproveUser = userInfo.userId | |
| 407 | + }) | |
| 408 | + .Where(it => purchaseIds.Contains(it.Id)) | |
| 409 | + .ExecuteCommandAsync(); | |
| 410 | + } | |
| 411 | + } | |
| 412 | + | |
| 413 | + //关闭事务 | |
| 414 | + _db.CommitTran(); | |
| 415 | + } | |
| 416 | + catch (Exception) | |
| 417 | + { | |
| 418 | + //回滚事务 | |
| 419 | + _db.RollbackTran(); | |
| 420 | + throw; | |
| 421 | + } | |
| 422 | + } | |
| 423 | + | |
| 424 | + /// <summary> | |
| 425 | + /// 拒绝审批 | |
| 426 | + /// </summary> | |
| 427 | + /// <param name="id">申请编号</param> | |
| 428 | + /// <returns></returns> | |
| 429 | + [HttpPost("{id}/Actions/Reject")] | |
| 430 | + public async Task Reject(string id) | |
| 431 | + { | |
| 432 | + var userInfo = await _userManager.GetUserInfo(); | |
| 433 | + var entity = await _db.Queryable<LqReimbursementApplicationEntity>().FirstAsync(p => p.Id == id); | |
| 434 | + _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | |
| 435 | + | |
| 436 | + try | |
| 437 | + { | |
| 438 | + //开启事务 | |
| 439 | + _db.BeginTran(); | |
| 440 | + | |
| 441 | + // 更新申请表的审批状态 | |
| 442 | + entity.ApproveStatus = "未通过"; | |
| 443 | + entity.ApproveTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | |
| 444 | + entity.ApproveUser = userInfo.userId; | |
| 445 | + await _db.Updateable(entity).ExecuteCommandAsync(); | |
| 446 | + | |
| 447 | + // 更新关联的购买记录 | |
| 448 | + if (!string.IsNullOrEmpty(entity.PurchaseRecordsId)) | |
| 449 | + { | |
| 450 | + var purchaseIds = entity.PurchaseRecordsId.Split(',').Where(x => !string.IsNullOrEmpty(x)).ToList(); | |
| 451 | + if (purchaseIds.Count > 0) | |
| 452 | + { | |
| 453 | + await _db.Updateable<LqPurchaseRecordsEntity>() | |
| 454 | + .SetColumns(it => new LqPurchaseRecordsEntity | |
| 455 | + { | |
| 456 | + ApproveStatus = "未通过", | |
| 457 | + ApproveTime = DateTime.Now, | |
| 458 | + ApproveUser = userInfo.userId | |
| 459 | + }) | |
| 460 | + .Where(it => purchaseIds.Contains(it.Id)) | |
| 461 | + .ExecuteCommandAsync(); | |
| 462 | + } | |
| 463 | + } | |
| 464 | + | |
| 465 | + //关闭事务 | |
| 466 | + _db.CommitTran(); | |
| 467 | + } | |
| 468 | + catch (Exception) | |
| 469 | + { | |
| 470 | + //回滚事务 | |
| 471 | + _db.RollbackTran(); | |
| 472 | + throw; | |
| 473 | + } | |
| 474 | + } | |
| 475 | + } | |
| 476 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqReimbursementCategoryService.cs
0 → 100644
| 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.LqReimbursementCategory; | |
| 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; | |
| 17 | +using NCC.Extend.Entitys.Dto.LqReimbursementCategory; | |
| 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.LqReimbursementCategory | |
| 27 | +{ | |
| 28 | + /// <summary> | |
| 29 | + /// 报销分类表服务 | |
| 30 | + /// </summary> | |
| 31 | + [ApiDescriptionSettings(Tag = "Extend",Name = "LqReimbursementCategory", Order = 200)] | |
| 32 | + [Route("api/Extend/[controller]")] | |
| 33 | + public class LqReimbursementCategoryService : ILqReimbursementCategoryService, IDynamicApiController, ITransient | |
| 34 | + { | |
| 35 | + private readonly ISqlSugarRepository<LqReimbursementCategoryEntity> _lqReimbursementCategoryRepository; | |
| 36 | + private readonly SqlSugarScope _db; | |
| 37 | + private readonly IUserManager _userManager; | |
| 38 | + | |
| 39 | + /// <summary> | |
| 40 | + /// 初始化一个<see cref="LqReimbursementCategoryService"/>类型的新实例 | |
| 41 | + /// </summary> | |
| 42 | + public LqReimbursementCategoryService( | |
| 43 | + ISqlSugarRepository<LqReimbursementCategoryEntity> lqReimbursementCategoryRepository, | |
| 44 | + IUserManager userManager) | |
| 45 | + { | |
| 46 | + _lqReimbursementCategoryRepository = lqReimbursementCategoryRepository; | |
| 47 | + _db = _lqReimbursementCategoryRepository.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<LqReimbursementCategoryEntity>().FirstAsync(p => p.Id == id); | |
| 60 | + var output = entity.Adapt<LqReimbursementCategoryInfoOutput>(); | |
| 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] LqReimbursementCategoryListQueryInput input) | |
| 71 | + { | |
| 72 | + var sidx = input.sidx == null ? "id" : input.sidx; | |
| 73 | + var data = await _db.Queryable<LqReimbursementCategoryEntity>() | |
| 74 | + .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | |
| 75 | + .WhereIF(!string.IsNullOrEmpty(input.level1Name), p => p.Level1Name.Contains(input.level1Name)) | |
| 76 | + .WhereIF(!string.IsNullOrEmpty(input.typeName), p => p.TypeName.Contains(input.typeName)) | |
| 77 | + .WhereIF(!string.IsNullOrEmpty(input.implement), p => p.Implement.Contains(input.implement)) | |
| 78 | + .WhereIF(!string.IsNullOrEmpty(input.costsRecorded), p => p.CostsRecorded.Contains(input.costsRecorded)) | |
| 79 | + .WhereIF(!string.IsNullOrEmpty(input.level1Code), p => p.Level1Code.Contains(input.level1Code)) | |
| 80 | + .WhereIF(!string.IsNullOrEmpty(input.level2Code), p => p.Level2Code.Contains(input.level2Code)) | |
| 81 | + .Select(it=> new LqReimbursementCategoryListOutput | |
| 82 | + { | |
| 83 | + id = it.Id, | |
| 84 | + level1Name=it.Level1Name, | |
| 85 | + typeName=it.TypeName, | |
| 86 | + implement=it.Implement, | |
| 87 | + costsRecorded=it.CostsRecorded, | |
| 88 | + level1Code=it.Level1Code, | |
| 89 | + level2Code=it.Level2Code, | |
| 90 | + }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | |
| 91 | + return PageResult<LqReimbursementCategoryListOutput>.SqlSugarPageResult(data); | |
| 92 | + } | |
| 93 | + | |
| 94 | + /// <summary> | |
| 95 | + /// 新建报销分类表 | |
| 96 | + /// </summary> | |
| 97 | + /// <param name="input">参数</param> | |
| 98 | + /// <returns></returns> | |
| 99 | + [HttpPost("")] | |
| 100 | + public async Task Create([FromBody] LqReimbursementCategoryCrInput input) | |
| 101 | + { | |
| 102 | + var userInfo = await _userManager.GetUserInfo(); | |
| 103 | + var entity = input.Adapt<LqReimbursementCategoryEntity>(); | |
| 104 | + entity.Id = YitIdHelper.NextId().ToString(); | |
| 105 | + var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | |
| 106 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | |
| 107 | + } | |
| 108 | + | |
| 109 | + /// <summary> | |
| 110 | + /// 获取报销分类表无分页列表(用于下拉选择) | |
| 111 | + /// </summary> | |
| 112 | + /// <param name="input">请求参数</param> | |
| 113 | + /// <returns></returns> | |
| 114 | + [HttpGet("Actions/GetNoPagingList")] | |
| 115 | + public async Task<dynamic> GetNoPagingList([FromQuery] LqReimbursementCategoryListQueryInput input) | |
| 116 | + { | |
| 117 | + var sidx = input.sidx == null ? "id" : input.sidx; | |
| 118 | + var data = await _db.Queryable<LqReimbursementCategoryEntity>() | |
| 119 | + .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) | |
| 120 | + .WhereIF(!string.IsNullOrEmpty(input.level1Name), p => p.Level1Name.Contains(input.level1Name)) | |
| 121 | + .WhereIF(!string.IsNullOrEmpty(input.typeName), p => p.TypeName.Contains(input.typeName)) | |
| 122 | + .WhereIF(!string.IsNullOrEmpty(input.implement), p => p.Implement.Contains(input.implement)) | |
| 123 | + .WhereIF(!string.IsNullOrEmpty(input.costsRecorded), p => p.CostsRecorded.Contains(input.costsRecorded)) | |
| 124 | + .WhereIF(!string.IsNullOrEmpty(input.level1Code), p => p.Level1Code.Contains(input.level1Code)) | |
| 125 | + .WhereIF(!string.IsNullOrEmpty(input.level2Code), p => p.Level2Code.Contains(input.level2Code)) | |
| 126 | + .Select(it=> new LqReimbursementCategoryListOutput | |
| 127 | + { | |
| 128 | + id = it.Id, | |
| 129 | + level1Name=it.Level1Name, | |
| 130 | + typeName=it.TypeName, | |
| 131 | + implement=it.Implement, | |
| 132 | + costsRecorded=it.CostsRecorded, | |
| 133 | + level1Code=it.Level1Code, | |
| 134 | + level2Code=it.Level2Code, | |
| 135 | + }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | |
| 136 | + return data; | |
| 137 | + } | |
| 138 | + | |
| 139 | + /// <summary> | |
| 140 | + /// 导出报销分类表 | |
| 141 | + /// </summary> | |
| 142 | + /// <param name="input">请求参数</param> | |
| 143 | + /// <returns></returns> | |
| 144 | + [HttpGet("Actions/Export")] | |
| 145 | + public async Task<dynamic> Export([FromQuery] LqReimbursementCategoryListQueryInput input) | |
| 146 | + { | |
| 147 | + var userInfo = await _userManager.GetUserInfo(); | |
| 148 | + var exportData = new List<LqReimbursementCategoryListOutput>(); | |
| 149 | + if (input.dataType == 0) | |
| 150 | + { | |
| 151 | + var data = Clay.Object(await this.GetList(input)); | |
| 152 | + exportData = data.Solidify<PageResult<LqReimbursementCategoryListOutput>>().list; | |
| 153 | + } | |
| 154 | + else | |
| 155 | + { | |
| 156 | + exportData = await this.GetNoPagingList(input); | |
| 157 | + } | |
| 158 | + List<ParamsModel> paramList = "[{\"value\":\"分类编号\",\"field\":\"id\"},{\"value\":\"一级名称\",\"field\":\"level1Name\"},{\"value\":\"二级名称\",\"field\":\"typeName\"},{\"value\":\"权责收付实现\",\"field\":\"implement\"},{\"value\":\"费用计入\",\"field\":\"costsRecorded\"},{\"value\":\"一级编号\",\"field\":\"level1Code\"},{\"value\":\"二级编号\",\"field\":\"level2Code\"},]".ToList<ParamsModel>(); | |
| 159 | + ExcelConfig excelconfig = new ExcelConfig(); | |
| 160 | + excelconfig.FileName = "报销分类表.xls"; | |
| 161 | + excelconfig.HeadFont = "微软雅黑"; | |
| 162 | + excelconfig.HeadPoint = 10; | |
| 163 | + excelconfig.IsAllSizeColumn = true; | |
| 164 | + excelconfig.ColumnModel = new List<ExcelColumnModel>(); | |
| 165 | + List<string> selectKeyList = input.selectKey.Split(',').ToList(); | |
| 166 | + foreach (var item in selectKeyList) | |
| 167 | + { | |
| 168 | + var isExist = paramList.Find(p => p.field == item); | |
| 169 | + if (isExist != null) | |
| 170 | + { | |
| 171 | + excelconfig.ColumnModel.Add(new ExcelColumnModel() { Column = isExist.field, ExcelColumn = isExist.value }); | |
| 172 | + } | |
| 173 | + } | |
| 174 | + var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; | |
| 175 | + ExcelExportHelper<LqReimbursementCategoryListOutput>.Export(exportData, excelconfig, addPath); | |
| 176 | + var fileName = _userManager.UserId + "|" + addPath + "|xls"; | |
| 177 | + var output = new | |
| 178 | + { | |
| 179 | + name = excelconfig.FileName, | |
| 180 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 181 | + }; | |
| 182 | + return output; | |
| 183 | + } | |
| 184 | + | |
| 185 | + /// <summary> | |
| 186 | + /// 批量删除报销分类表 | |
| 187 | + /// </summary> | |
| 188 | + /// <param name="ids">主键数组</param> | |
| 189 | + /// <returns></returns> | |
| 190 | + [HttpPost("batchRemove")] | |
| 191 | + public async Task BatchRemove([FromBody] List<string> ids) | |
| 192 | + { | |
| 193 | + var entitys = await _db.Queryable<LqReimbursementCategoryEntity>().In(it => it.Id, ids).ToListAsync(); | |
| 194 | + if (entitys.Count > 0) | |
| 195 | + { | |
| 196 | + try | |
| 197 | + { | |
| 198 | + //开启事务 | |
| 199 | + _db.BeginTran(); | |
| 200 | + //批量删除报销分类表 | |
| 201 | + await _db.Deleteable<LqReimbursementCategoryEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | |
| 202 | + //关闭事务 | |
| 203 | + _db.CommitTran(); | |
| 204 | + } | |
| 205 | + catch (Exception) | |
| 206 | + { | |
| 207 | + //回滚事务 | |
| 208 | + _db.RollbackTran(); | |
| 209 | + throw NCCException.Oh(ErrorCode.COM1002); | |
| 210 | + } | |
| 211 | + } | |
| 212 | + } | |
| 213 | + | |
| 214 | + /// <summary> | |
| 215 | + /// 更新报销分类表 | |
| 216 | + /// </summary> | |
| 217 | + /// <param name="id">主键</param> | |
| 218 | + /// <param name="input">参数</param> | |
| 219 | + /// <returns></returns> | |
| 220 | + [HttpPut("{id}")] | |
| 221 | + public async Task Update(string id, [FromBody] LqReimbursementCategoryUpInput input) | |
| 222 | + { | |
| 223 | + var entity = input.Adapt<LqReimbursementCategoryEntity>(); | |
| 224 | + var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | |
| 225 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | |
| 226 | + } | |
| 227 | + | |
| 228 | + /// <summary> | |
| 229 | + /// 删除报销分类表 | |
| 230 | + /// </summary> | |
| 231 | + /// <returns></returns> | |
| 232 | + [HttpDelete("{id}")] | |
| 233 | + public async Task Delete(string id) | |
| 234 | + { | |
| 235 | + var entity = await _db.Queryable<LqReimbursementCategoryEntity>().FirstAsync(p => p.Id == id); | |
| 236 | + _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); | |
| 237 | + var isOk = await _db.Deleteable<LqReimbursementCategoryEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); | |
| 238 | + if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | |
| 239 | + } | |
| 240 | + } | |
| 241 | +} | ... | ... |