|
|
@@ -53,6 +53,10 @@
|
|
|
<year-month-select v-model="params.yearAndMonth"></year-month-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template slot="departmentIdForm">
|
|
|
+ <second-unit-cascader v-model="form.departmentId" :yearAndMonth="currYear" @change="handleSecondUnitChange" />
|
|
|
+ </template>
|
|
|
|
|
|
</avue-crud>
|
|
|
|
|
|
@@ -78,12 +82,14 @@ import moment from "moment";
|
|
|
import {getToken} from "@/util/auth";
|
|
|
import {downloadXls} from "@/util/util";
|
|
|
import { isAlphanumericCombination } from "@/util/regex";
|
|
|
+import secondUnitCascader from "@/components/second-unit-cascader";
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
|
components: {
|
|
|
YearMonthSelect,
|
|
|
UploadExcelDialog,
|
|
|
+ secondUnitCascader
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -94,6 +100,8 @@ export default window.$crudCommon({
|
|
|
|
|
|
wideTableColumns: [],
|
|
|
printTitle: "",
|
|
|
+
|
|
|
+ secondUnitNameArr: []
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -109,6 +117,9 @@ export default window.$crudCommon({
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ currYear() {
|
|
|
+ return moment(this.params.yearAndMonth).format('YYYY')
|
|
|
+ },
|
|
|
permissionList() {
|
|
|
return {
|
|
|
addBtn: !this.isSelAnnual,
|
|
|
@@ -118,6 +129,9 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleSecondUnitChange(val, nameArr) {
|
|
|
+ this.secondUnitNameArr = nameArr;
|
|
|
+ },
|
|
|
validCustom() {
|
|
|
if (!this.form.number && !this.form.idCard) {
|
|
|
this.$message.warning("工号和身份证号必须填写一项!");
|
|
|
@@ -129,7 +143,11 @@ export default window.$crudCommon({
|
|
|
return true;
|
|
|
},
|
|
|
getFormData() {
|
|
|
- return { ...this.form, yearAndMonth: this.params.yearAndMonth };
|
|
|
+ let _deptId;
|
|
|
+ if (this.form.departmentId && this.form.departmentId instanceof Array) {
|
|
|
+ _deptId = this.form.departmentId[this.form.departmentId.length - 1];
|
|
|
+ }
|
|
|
+ return { ...this.form, departmentId: _deptId, department: this.secondUnitNameArr.join('/'), yearAndMonth: this.params.yearAndMonth };
|
|
|
},
|
|
|
addBefore(loading, callback) {
|
|
|
if (!this.validCustom()) {
|