Browse Source

YT-978,YT-914:隐藏仓库代码字段和差异数据下载bug修复

intex
ljlong_2630 2 weeks ago
parent
commit
ee3a397b90
  1. 1
      package.json
  2. 34
      src/components/ImportForm/src/ImportFormStep.vue
  3. 70
      src/views/wms/basicDataManage/labelManage/callmaterials/callmaterials.data.ts
  4. 5
      src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts

1
package.json

@ -60,6 +60,7 @@
"vue-types": "^5.1.1",
"vuedraggable": "^4.1.0",
"web-storage-cache": "^1.1.1",
"xlsx": "^0.18.5",
"xml-js": "^1.6.11"
},
"devDependencies": {

34
src/components/ImportForm/src/ImportFormStep.vue

@ -82,7 +82,7 @@
<Icon icon="ep:download" />
{{ t('ts.下载模板') }}
</el-button>
<el-button type="primary" plain @click="importTemplate" v-if="active == 1">
<el-button type="primary" plain @click="downloadDifferenceData" v-if="active == 1">
<Icon icon="ep:download" />
{{ t('ts.下载差异数据') }}
</el-button>
@ -101,6 +101,7 @@ import download from '@/utils/download'
import { getBaseUrl } from '@/utils/systemParam'
import { UploadFilled, List, CircleCheckFilled,WarningFilled } from '@element-plus/icons-vue'
import { waitForDebugger } from 'node:inspector/promises'
import * as XLSX from 'xlsx';
defineOptions({ name: 'ImportForm' })
@ -432,6 +433,37 @@ const importTemplate = () => {
const res = importTemplateData.value.templateUrl
download.excel(res, importTemplateData.value.templateTitle)
}
const downloadDifferenceData = () => {
if (props.tableObject.tableList.length === 0) {
message.warning('没有可下载的差异数据');
return;
}
// 使
const columns = currentColumns.value;
// 簿使
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.json_to_sheet(props.tableObject.tableList);
// ;
columns.forEach((col, index) => {
const cellAddress = XLSX.utils.encode_cell({ r: 0, c: index });
if (ws[cellAddress]) {
ws[cellAddress].v = col.label;
}
});
//
const colWidth = columns.map(() => ({ wch: 20 }));
ws['!cols'] = colWidth;
// 簿
XLSX.utils.book_append_sheet(wb, ws, "差异数据");
const timestamp = new Date().getTime();
XLSX.writeFile(wb, `差异数据_${timestamp}.xlsx`);
}
</script>
<style scoped lang="scss">

70
src/views/wms/basicDataManage/labelManage/callmaterials/callmaterials.data.ts

@ -196,41 +196,41 @@ export const Callmaterials = useCrudSchemas(reactive<CrudSchema[]>([
// width: 120
// }
// },
{
label: '仓库代码',
field: 'warehouseCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
isForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
// {
// label: '仓库代码',
// field: 'warehouseCode',
// sort: 'custom',
// table: {
// width: 150
// },
// isSearch: true,
// isForm: true,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '仓库信息', // 查询弹窗标题
// searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
// searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// }
// },
{
label: '车间',
field: 'workshopCode',

5
src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts

@ -1012,6 +1012,11 @@ export const ImportLeadershipDocErrorData = useCrudSchemas(reactive<CrudSchema[]
field: 'materialCode',
sort: 'custom',
},
{
label: '物料描述',
field: 'materialDesc',
sort: 'custom',
},
{
label: '背番',
field: 'backNumber',

Loading…
Cancel
Save