|
@@ -24,6 +24,15 @@
|
|
|
<button type="button" class="btn btn-danger" @click="clearFilter">
|
|
<button type="button" class="btn btn-danger" @click="clearFilter">
|
|
|
{{ $t("lang.AssetInventorySearch.empty") }}
|
|
{{ $t("lang.AssetInventorySearch.empty") }}
|
|
|
</button>
|
|
</button>
|
|
|
|
|
+ <a-button style="height: 33.5px" type="primary" @click="downloadFile">下载</a-button>
|
|
|
|
|
+ <a-upload
|
|
|
|
|
+ v-model:file-list="fileList"
|
|
|
|
|
+ :show-upload-list="false"
|
|
|
|
|
+ :before-upload="beforeUpload"
|
|
|
|
|
+ @change="uploadFileChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-button type="dashed" style="height: 33.5px"> 上传 </a-button>
|
|
|
|
|
+ </a-upload>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- <div class="grid-item-row2-column1">
|
|
<!-- <div class="grid-item-row2-column1">
|
|
@@ -37,7 +46,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div> -->
|
|
</div> -->
|
|
|
|
|
|
|
|
- <div class="grid-item-row1-column2">
|
|
|
|
|
|
|
+ <div class="grid-item-row1-column2" style="margin-left: 100px">
|
|
|
<a-form-item label="盘点单名称">
|
|
<a-form-item label="盘点单名称">
|
|
|
<a-input v-model:value="inventorySheetName" size="default" />
|
|
<a-input v-model:value="inventorySheetName" size="default" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -551,6 +560,7 @@ import ProjectItemTree from '../../widget/ProjectItemTree.vue';
|
|
|
import AssetCategoryTree from '../../widget/AssetCategoryTree.vue';
|
|
import AssetCategoryTree from '../../widget/AssetCategoryTree.vue';
|
|
|
|
|
|
|
|
import { Notify, Uuid } from 'pc-component-v3';
|
|
import { Notify, Uuid } from 'pc-component-v3';
|
|
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -657,6 +667,7 @@ export default {
|
|
|
inventorySheetName: undefined, //盘点单名称
|
|
inventorySheetName: undefined, //盘点单名称
|
|
|
assetInstancesTempory: [], //盘点清单展示
|
|
assetInstancesTempory: [], //盘点清单展示
|
|
|
modal1: false,
|
|
modal1: false,
|
|
|
|
|
+ fileList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -688,9 +699,81 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 下载文件
|
|
|
|
|
+ downloadFile: function () {
|
|
|
|
|
+ const loginInfo = JSON.parse(localStorage.getItem('#LoginInfo'));
|
|
|
|
|
+ const envClientId = loginInfo.loginClientId;
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: Common.getApiURL(
|
|
|
|
|
+ `ExcelReportResource/execute/20231121_164158?processReportNo=20231121_164158&envClientId=${envClientId}`,
|
|
|
|
|
+ ),
|
|
|
|
|
+ type: 'get',
|
|
|
|
|
+ xhrFields: {
|
|
|
|
|
+ responseType: 'blob',
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeSend: function (request) {
|
|
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
|
|
+ },
|
|
|
|
|
+ success: function (data) {
|
|
|
|
|
+ const blobUrl = window.URL.createObjectURL(data);
|
|
|
|
|
+ const link = document.createElement('a');
|
|
|
|
|
+ link.href = blobUrl;
|
|
|
|
|
+ link.style.display = 'none';
|
|
|
|
|
+ link.download = '抽盘数据.xlsx';
|
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
|
+ link.click();
|
|
|
|
|
+ URL.revokeObjectURL(blobUrl);
|
|
|
|
|
+ document.body.removeChild(link);
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 上传文件事件
|
|
|
|
|
+ uploadFileChange: function ({ file }) {
|
|
|
|
|
+ const _self = this;
|
|
|
|
|
+ const formData = new FormData();
|
|
|
|
|
+ formData.append('file', file);
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: Common.getApiURL(
|
|
|
|
|
+ 'AssetInstanceResource/assetInstanceLedgerUpload',
|
|
|
|
|
+ ),
|
|
|
|
|
+ type: 'post',
|
|
|
|
|
+ beforeSend: function (request) {
|
|
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
|
|
+ },
|
|
|
|
|
+ data: formData,
|
|
|
|
|
+ contentType: false,
|
|
|
|
|
+ processData: false,
|
|
|
|
|
+ success: function ({ errorCode,datas }) {
|
|
|
|
|
+ if (errorCode === 0) {
|
|
|
|
|
+ if(datas){
|
|
|
|
|
+ datas.forEach(item =>{
|
|
|
|
|
+ item.name = item.assetName;
|
|
|
|
|
+ item.no = item.assetCardNo;
|
|
|
|
|
+ item.categoryName = item.assetCategory;
|
|
|
|
|
+ _self.assetInstancesTempory.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ message.success('上传成功,已加入至盘点清单', 5);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ message.error('上传失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ _self.loading = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
|
|
+ _self.loading = false;
|
|
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 取消默认上传
|
|
|
|
|
+ beforeUpload: function () {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ },
|
|
|
// 选择责任人
|
|
// 选择责任人
|
|
|
custodianNameValueChanged: function (newResponsibilityFieldValue) {
|
|
custodianNameValueChanged: function (newResponsibilityFieldValue) {
|
|
|
- console.log('1111111111');
|
|
|
|
|
this.custodianNameFieldValue = newResponsibilityFieldValue;
|
|
this.custodianNameFieldValue = newResponsibilityFieldValue;
|
|
|
if (this.custodianNameFieldValue != null) {
|
|
if (this.custodianNameFieldValue != null) {
|
|
|
this.filter.custodianId = this.custodianNameFieldValue.id;
|
|
this.filter.custodianId = this.custodianNameFieldValue.id;
|