|
|
@@ -120,7 +120,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item class="full-width" label="机构选择">
|
|
|
<div class="grey-9 pointer chose-box nowrap" @click="getOrg">
|
|
|
- 选择机构
|
|
|
+ {{ deptName }}
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
@@ -192,14 +192,14 @@
|
|
|
|
|
|
<script>
|
|
|
import baseButton from '../../../components/base-button.vue'
|
|
|
-import { useStore } from '@/store/user.js'
|
|
|
+import {useStore} from '@/store/user.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'owner_serach',
|
|
|
- components: { baseButton },
|
|
|
+ components: {baseButton},
|
|
|
watch: {
|
|
|
keyWords: {
|
|
|
- handler (val) {
|
|
|
+ handler(val) {
|
|
|
setTimeout(() => {
|
|
|
this.change()
|
|
|
}, 500)
|
|
|
@@ -207,11 +207,11 @@ export default {
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
- setup () {
|
|
|
+ setup() {
|
|
|
const user = useStore()
|
|
|
- return { user }
|
|
|
+ return {user}
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
deptList: [],
|
|
|
form: {
|
|
|
@@ -284,19 +284,20 @@ export default {
|
|
|
keyWords: '',
|
|
|
checked: false,
|
|
|
time1: null, // 计划 实际开工时间
|
|
|
- time2: null // 计划 实际入库时间
|
|
|
+ time2: null, // 计划 实际入库时间
|
|
|
+ deptName: '机构选择'
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.getTypeList()
|
|
|
},
|
|
|
methods: {
|
|
|
- getTypeList () {
|
|
|
+ getTypeList() {
|
|
|
this.$api.project.typeList().then(res => {
|
|
|
this.typeList = res.data.records
|
|
|
})
|
|
|
},
|
|
|
- sure () {
|
|
|
+ sure() {
|
|
|
this.form.type = true
|
|
|
if (this.time1 !== null && this.form.isStart.length === 0) {
|
|
|
this.$message.error('请先选择是否开工')
|
|
|
@@ -328,7 +329,7 @@ export default {
|
|
|
}
|
|
|
this.$bus.emit('serach', this.form)
|
|
|
},
|
|
|
- visibleTime (event, type) {
|
|
|
+ visibleTime(event, type) {
|
|
|
if (event) {
|
|
|
console.log(this.form.isStart)
|
|
|
if (type === 1) {
|
|
|
@@ -344,7 +345,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- clear () {
|
|
|
+ clear() {
|
|
|
this.form.projectName = ''
|
|
|
this.form.typeId = ''
|
|
|
this.form.isStorage = ''
|
|
|
@@ -360,16 +361,21 @@ export default {
|
|
|
this.form.storageTime = ''
|
|
|
this.time1 = null
|
|
|
this.time2 = null
|
|
|
+ this.deptName = '机构选择'
|
|
|
this.$bus.emit('serach', this.form)
|
|
|
},
|
|
|
- changeAmount () {
|
|
|
+ changeAmount() {
|
|
|
const tmps = this.form.amount.split(',')
|
|
|
this.form.totalAmountMin = tmps[0] === '-' ? '' : tmps[0]
|
|
|
this.form.totalAmountMax = tmps[1] === '-' ? '' : tmps[1]
|
|
|
},
|
|
|
- getOrg () {
|
|
|
+ getOrg() {
|
|
|
+ if (this.deptList.length > 0) {
|
|
|
+ this.showOrg = true
|
|
|
+ return
|
|
|
+ }
|
|
|
const parentId = [0, 2].includes(this.user.info.viewStage) ? this.user.info.parentDeptId : this.user.info.deptId
|
|
|
- this.$api.system.getDeptLazy({ parentId }).then(res => {
|
|
|
+ this.$api.system.getDeptLazy({parentId}).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.showOrg = true
|
|
|
this.deptList = res.data.map(e => {
|
|
|
@@ -381,15 +387,20 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- changeChecked (index) {
|
|
|
+ changeChecked(index) {
|
|
|
this.deptList[index].checked = !this.deptList[index].checked
|
|
|
},
|
|
|
- orgCheck () {
|
|
|
+ orgCheck() {
|
|
|
const checked = this.deptList.filter(sub => sub.checked)
|
|
|
this.form.deptIds = checked.map(sub => sub.id).join(',')
|
|
|
+ let tmp = checked.map(e => e.deptName)
|
|
|
+ if (tmp.length > 0) {
|
|
|
+ this.deptName = tmp[0]
|
|
|
+ }
|
|
|
this.showOrg = false
|
|
|
+
|
|
|
},
|
|
|
- change () {
|
|
|
+ change() {
|
|
|
if (this.keyWords.length === 0) {
|
|
|
this.deptList.forEach(sub => sub.search = false)
|
|
|
return
|