|
|
@@ -41,6 +41,10 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
+ <template slot="xmId" slot-scope="{ row }">
|
|
|
+ <span>{{ row.xmmc }}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot="xmIdForm">
|
|
|
<project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
|
|
|
</template>
|
|
|
@@ -63,9 +67,13 @@
|
|
|
<script>
|
|
|
import YearMonthSelect from "@/components/year-month-select";
|
|
|
import UploadExcelDialog from "@/components/upload-excel-dialog";
|
|
|
+import {exportBloByPost} from "@/api/common";
|
|
|
+import {getToken} from "@/util/auth";
|
|
|
+import {downloadXls} from "@/util/util";
|
|
|
import projectSelect from "@/components/project-select";
|
|
|
import moment from "moment";
|
|
|
import { isAlphanumericCombination } from "@/util/regex";
|
|
|
+import Decimal from "decimal.js";
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
|
@@ -93,38 +101,39 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
methods: {
|
|
|
validCustom() {
|
|
|
- if (!isAlphanumericCombination(this.form.wzbh)) {
|
|
|
+ if (!isAlphanumericCombination(this.form.code)) {
|
|
|
this.$message.warning("物质编号必须是英文字母加数字组合!");
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
addBefore(loading, callback) {
|
|
|
- console.log(this.form)
|
|
|
if (!this.validCustom()) {
|
|
|
loading();
|
|
|
return;
|
|
|
}
|
|
|
- // callback && callback();
|
|
|
+ callback && callback();
|
|
|
},
|
|
|
updateBefore(loading, callback) {
|
|
|
if (!this.validCustom()) {
|
|
|
loading();
|
|
|
return false;
|
|
|
}
|
|
|
- console.log(this.form)
|
|
|
- // callback && callback();
|
|
|
+ callback && callback();
|
|
|
+ },
|
|
|
+ getFormData() {
|
|
|
+ return { ...this.form, yearAndMonth: this.params.yearAndMonth }
|
|
|
},
|
|
|
handleImport() {
|
|
|
let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
|
- this.$refs.uploadExcelDialog.open('/api/kd-scientific/technician/import', excelParams);
|
|
|
+ this.$refs.uploadExcelDialog.open('/api/kd-scientific/goods/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 => {
|
|
|
+ exportBloByPost(`/api/kd-scientific/goods/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
downloadXls(res.data, `研发领料燃料动力明细清单${this.params.yearAndMonth}.xlsx`);
|
|
|
});
|
|
|
},
|
|
|
@@ -144,6 +153,16 @@ export default window.$crudCommon({
|
|
|
// 模块路径
|
|
|
name: 'yfCostManage/basicDataSetting/pickingDetail',
|
|
|
res: ({ data }) => {
|
|
|
+ data.records = data.records.map(item => {
|
|
|
+ let amount;
|
|
|
+ if (item.unitPrice && item.useQuantity) {
|
|
|
+ let unitPriceD = new Decimal(item.unitPrice);
|
|
|
+ let useQuantityD = new Decimal(item.useQuantity);
|
|
|
+ amount = unitPriceD.mul(useQuantityD).toFixed(2);
|
|
|
+ }
|
|
|
+ item.amount = amount;
|
|
|
+ return item;
|
|
|
+ });
|
|
|
return data;
|
|
|
},
|
|
|
});
|