|
|
@@ -34,15 +34,66 @@
|
|
|
>
|
|
|
导出
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="handleReadyDevData"
|
|
|
+ >
|
|
|
+ 直接引用
|
|
|
+ </el-button>
|
|
|
<print-table-btn @click="printTable" />
|
|
|
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
- <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
|
|
|
+ <year-month-select v-model="params.yearAndMonth"></year-month-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
- <template slot="xmmcForm">
|
|
|
- <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
|
|
|
+ <template slot="sysmSearch">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <span>使用寿命:</span>
|
|
|
+ <avue-input-number v-model="params.sysmMin" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ <span style="width: 20px; text-align: center;">至</span>
|
|
|
+ <avue-input-number v-model="params.sysmMax" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="zcyzSearch">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <span>资产原值:</span>
|
|
|
+ <avue-input-number v-model="params.zcyzMin" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ <span style="width: 20px; text-align: center;">至</span>
|
|
|
+ <avue-input-number v-model="params.zcyzMax" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="ysysmSearch">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <span>已使用月数:</span>
|
|
|
+ <avue-input-number v-model="params.ysysmMin" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ <span style="width: 20px; text-align: center;">至</span>
|
|
|
+ <avue-input-number v-model="params.ysysmMax" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="yzjeSearch">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <span>月折旧额(每台/套):</span>
|
|
|
+ <avue-input-number v-model="params.yzjeMin" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ <span style="width: 20px; text-align: center;">至</span>
|
|
|
+ <avue-input-number v-model="params.yzjeMax" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="xmIdForm">
|
|
|
+ <project-select v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }"></project-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="assetIdForm">
|
|
|
+ <asset-select
|
|
|
+ v-model="form.assetId"
|
|
|
+ :params="{ yearAndMonth: params.yearAndMonth, zclb: '仪器设备' }"
|
|
|
+ @change="handleAssetChange"
|
|
|
+ ></asset-select>
|
|
|
</template>
|
|
|
|
|
|
</avue-crud>
|
|
|
@@ -61,9 +112,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { fetchDeviceData } from "@/api/yfCostManage/basicDataSetting/kyDeviceList"
|
|
|
import YearMonthSelect from "@/components/year-month-select";
|
|
|
import UploadExcelDialog from "@/components/upload-excel-dialog";
|
|
|
import projectSelect from "@/components/project-select";
|
|
|
+import assetSelect from "@/components/asset-select";
|
|
|
import moment from "moment";
|
|
|
|
|
|
|
|
|
@@ -71,6 +124,7 @@ export default window.$crudCommon({
|
|
|
components: {
|
|
|
YearMonthSelect,
|
|
|
projectSelect,
|
|
|
+ assetSelect,
|
|
|
UploadExcelDialog,
|
|
|
},
|
|
|
data() {
|
|
|
@@ -78,7 +132,7 @@ export default window.$crudCommon({
|
|
|
params: {
|
|
|
yearAndMonth: moment(new Date()).format('YYYYMM'),
|
|
|
},
|
|
|
- defaultColumns: [],
|
|
|
+ isSelAnnual: false,
|
|
|
|
|
|
wideTableColumns: [],
|
|
|
printTitle: "",
|
|
|
@@ -86,22 +140,37 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
watch: {
|
|
|
'params.yearAndMonth'(newVal) {
|
|
|
+ if (newVal.length > 4) {
|
|
|
+ // 是否勾选未全年
|
|
|
+ this.isSelAnnual = false;
|
|
|
+ } else {
|
|
|
+ this.isSelAnnual = true;
|
|
|
+ }
|
|
|
this.page.currentPage = 1;
|
|
|
this.getList(this.page);
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ permissionList() {
|
|
|
+ return {
|
|
|
+ addBtn: !this.isSelAnnual,
|
|
|
+ editBtn: !this.isSelAnnual,
|
|
|
+ delBtn: !this.isSelAnnual,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
handleImport() {
|
|
|
let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
|
- this.$refs.uploadExcelDialog.open('/api/kd-scientific/technician/import', excelParams);
|
|
|
+ this.$refs.uploadExcelDialog.open('/api/kd-scientific/asset/keyanyiqishebeimingxibiao/import', excelParams);
|
|
|
},
|
|
|
uploadAfter() {
|
|
|
this.page.currentPage = 1;
|
|
|
this.getList(this.page);
|
|
|
},
|
|
|
handleExport() {
|
|
|
- exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
- downloadXls(res.data, `项目直接投入费用表${this.params.yearAndMonth}.xlsx`);
|
|
|
+ exportBloByPost(`/api/kd-scientific/asset/keyanyiqishebeimingxibiao/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
+ downloadXls(res.data, `科研仪器设备明细表${this.params.yearAndMonth}.xlsx`);
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
@@ -110,16 +179,48 @@ export default window.$crudCommon({
|
|
|
*/
|
|
|
printTable(isLandscape) {
|
|
|
this.wideTableColumns = this.$refs.crud.columnOption;
|
|
|
- this.printTitle = `项目直接投入费用表${this.params.yearAndMonth}`;
|
|
|
+ this.printTitle = `科研仪器设备明细表${this.params.yearAndMonth}`;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
|
})
|
|
|
},
|
|
|
+ handleReadyDevData() {
|
|
|
+ fetchDeviceData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
|
|
|
+ let data = res.data;
|
|
|
+ if (data.success) {
|
|
|
+
|
|
|
+ this.$message.success('引用成功!');
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.getList(this.page);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleAssetChange({ zcbm }) {
|
|
|
+ this.form = { ...this.form, zcbm };
|
|
|
+ },
|
|
|
+ getFormData() {
|
|
|
+ const { xmId, assetId, zcbm } = this.form;
|
|
|
+ return { xmId, assetId, zcbm, yearAndMonth: this.params.yearAndMonth };
|
|
|
+ },
|
|
|
},
|
|
|
}, {
|
|
|
// 模块路径
|
|
|
name: 'yfCostManage/basicDataSetting/kyDeviceList',
|
|
|
res: ({ data }) => {
|
|
|
+ data.records = data.records.map(item => {
|
|
|
+ item.zcmc = item.asset ? item.asset.zcmc : '';
|
|
|
+ item.zclb = item.asset ? item.asset.zclb : '';
|
|
|
+ item.gl = item.asset ? item.asset.gl : '';
|
|
|
+ item.yt = item.asset ? item.asset.yt : '';
|
|
|
+ item.kssj = item.asset ? item.asset.kssj : '';
|
|
|
+ item.sysm = item.asset ? item.asset.sysm : '';
|
|
|
+ item.ysysm = item.asset ? item.asset.ysysm : '';
|
|
|
+ item.zcyz = item.asset ? item.asset.zcyz : '';
|
|
|
+ item.jcz = item.asset ? item.asset.jcz : '';
|
|
|
+ item.yzje = item.asset ? item.asset.yzje : '';
|
|
|
+ item.status = item.status ? item.asset.status : '';
|
|
|
+ return item;
|
|
|
+ });
|
|
|
return data;
|
|
|
},
|
|
|
});
|