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", "vue-types": "^5.1.1",
"vuedraggable": "^4.1.0", "vuedraggable": "^4.1.0",
"web-storage-cache": "^1.1.1", "web-storage-cache": "^1.1.1",
"xlsx": "^0.18.5",
"xml-js": "^1.6.11" "xml-js": "^1.6.11"
}, },
"devDependencies": { "devDependencies": {

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

@ -82,7 +82,7 @@
<Icon icon="ep:download" /> <Icon icon="ep:download" />
{{ t('ts.下载模板') }} {{ t('ts.下载模板') }}
</el-button> </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" /> <Icon icon="ep:download" />
{{ t('ts.下载差异数据') }} {{ t('ts.下载差异数据') }}
</el-button> </el-button>
@ -101,6 +101,7 @@ import download from '@/utils/download'
import { getBaseUrl } from '@/utils/systemParam' import { getBaseUrl } from '@/utils/systemParam'
import { UploadFilled, List, CircleCheckFilled,WarningFilled } from '@element-plus/icons-vue' import { UploadFilled, List, CircleCheckFilled,WarningFilled } from '@element-plus/icons-vue'
import { waitForDebugger } from 'node:inspector/promises' import { waitForDebugger } from 'node:inspector/promises'
import * as XLSX from 'xlsx';
defineOptions({ name: 'ImportForm' }) defineOptions({ name: 'ImportForm' })
@ -432,6 +433,37 @@ const importTemplate = () => {
const res = importTemplateData.value.templateUrl const res = importTemplateData.value.templateUrl
download.excel(res, importTemplateData.value.templateTitle) 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> </script>
<style scoped lang="scss"> <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 // width: 120
// } // }
// }, // },
{ // {
label: '仓库代码', // label: '仓库代码',
field: 'warehouseCode', // field: 'warehouseCode',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
isSearch: true, // isSearch: true,
isForm: false, // isForm: true,
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true,
isSearchList: true, // 开启查询弹窗 // isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本 // searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 // searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题 // searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类 // searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法 // searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{ // searchCondition: [{
key: 'available', // key: 'available',
value: 'TRUE', // value: 'TRUE',
isMainValue: false // isMainValue: false
}], // }],
verificationParams: [{ // verificationParams: [{
key: 'code', // key: 'code',
action: '==', // action: '==',
value: '', // value: '',
isMainValue: false, // isMainValue: false,
isSearch: true, // isSearch: true,
isFormModel: true, // isFormModel: true,
}], // 失去焦点校验参数 // }], // 失去焦点校验参数
} // }
} // }
}, // },
{ {
label: '车间', label: '车间',
field: 'workshopCode', field: 'workshopCode',

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

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

Loading…
Cancel
Save