|
@@ -52,6 +52,19 @@
|
|
|
placeholder="请选择抄送人"
|
|
|
></dingDepartUser>
|
|
|
</a-form-model-item>
|
|
|
+ <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)">
|
|
|
+ <Upload
|
|
|
+ style="height: 100%;"
|
|
|
+ v-model="form.attachmentList"
|
|
|
+ ref="attachList"
|
|
|
+ :fileSize="10"
|
|
|
+ :maxNums="10"
|
|
|
+ fileType="*"
|
|
|
+ uploadType="attach"
|
|
|
+ :action="attachAction"
|
|
|
+ @change="changeAttach"
|
|
|
+ upText="上传附件"></Upload>
|
|
|
+ </a-form-model-item>
|
|
|
</a-form-model>
|
|
|
</div>
|
|
|
<div class="btn-cont">
|
|
@@ -65,12 +78,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { VSelect } from '@/components'
|
|
|
+import { VSelect, Upload } from '@/components'
|
|
|
import dingDepartUser from '@/views/common/dingDepartUser.js'
|
|
|
import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
|
|
|
export default {
|
|
|
name: 'ChooseDepartUserModal',
|
|
|
- components: { dingDepartUser, employee, VSelect },
|
|
|
+ components: { dingDepartUser, employee, VSelect, Upload },
|
|
|
props: {
|
|
|
openModal: { // 弹框显示状态
|
|
|
type: Boolean,
|
|
@@ -93,6 +106,8 @@ export default {
|
|
|
approvers: [], // 审批人
|
|
|
ccList: [] // 抄送人
|
|
|
},
|
|
|
+ attachList: [],
|
|
|
+ attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
|
|
|
rules: {
|
|
|
salesReturnType: [
|
|
|
{ required: true, message: '请选择退货类型', trigger: 'change' }
|
|
@@ -113,6 +128,13 @@ export default {
|
|
|
this.$refs.ruleForm.validateField(['applyPersonSn'])
|
|
|
})
|
|
|
},
|
|
|
+ // 附件上传
|
|
|
+ changeAttach (file) {
|
|
|
+ this.attachList = JSON.parse(file)
|
|
|
+ this.attachList.map(item => {
|
|
|
+ item.fileType = item.extName
|
|
|
+ })
|
|
|
+ },
|
|
|
updateUser () {
|
|
|
this.uploading = true
|
|
|
this.$refs.departUserApp.updateDeptUser()
|
|
@@ -136,6 +158,7 @@ export default {
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
+ form.attachmentList = this.attachList
|
|
|
if (form.approvers) {
|
|
|
form.approvers = this.getTreeVal(form.approvers)
|
|
|
}
|
|
@@ -153,12 +176,15 @@ export default {
|
|
|
resetForm () {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
+ this.$refs.attachList.setFileList('')
|
|
|
})
|
|
|
+ this.attachList = []
|
|
|
this.form = {
|
|
|
salesReturnType: undefined,
|
|
|
applyPersonSn: undefined,
|
|
|
ccList: undefined,
|
|
|
- approvers: undefined
|
|
|
+ approvers: undefined,
|
|
|
+ attachmentList: ''
|
|
|
}
|
|
|
},
|
|
|
cancel () {
|