|
@ -2,51 +2,94 @@ import AppList from "../../../components/list/index.js"; |
|
|
import html from "html"; |
|
|
import html from "html"; |
|
|
import useConfig from "../../../models/inventory/log.js"; |
|
|
import useConfig from "../../../models/inventory/log.js"; |
|
|
import { reactive, ref } from "vue"; |
|
|
import { reactive, ref } from "vue"; |
|
|
import request from "../../request/index.js"; |
|
|
|
|
|
import { schemaToModel } from "../../utils/index.js"; |
|
|
import { schemaToModel } from "../../utils/index.js"; |
|
|
|
|
|
import AppForm from "../../../components/form/index.js"; |
|
|
|
|
|
import AppTable from "../../components/table/index.js"; |
|
|
|
|
|
import request, { get, getUrl, post } from "../../request/index.js"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { AppList }, |
|
|
components: { AppList, AppTable, AppForm }, |
|
|
template: html`<app-list :config="config" @command="onCommand" />
|
|
|
template: html` |
|
|
<el-dialog v-model="dialog" width="45%" title="补货数据导出"> |
|
|
<app-list :config="config" @command="onCommand" /> |
|
|
<el-form :model="exportModel" style="height:100%;"> |
|
|
<el-dialog v-model="addDialogVisible" align-center destroy-on-close style="width:380px;height:480px;"> |
|
|
<el-form-item label="" label-width="100px"> |
|
|
<template #header>补货数据导出</template> |
|
|
开始时间<el-date-picker v-model="exportModel.startDatetime" value-format="YYYY-MM-DD" /> |
|
|
<el-scrollbar> |
|
|
<span style="margin:0 .5em;">-</span> |
|
|
<el-row> |
|
|
结束时间<el-date-picker v-model="exportModel.endDatetime" value-format="YYYY-MM-DD" /> |
|
|
<el-col> |
|
|
</el-form-item> |
|
|
<app-form |
|
|
<el-button type="primary" @click="openDialog" style="margin-left: 10px;">确定</el-button> |
|
|
ref="addAdjFormRef" |
|
|
</el-form> |
|
|
v-if="addDialogVisible && adjModel" |
|
|
</el-dialog> `, |
|
|
:schema="adjSchema" |
|
|
|
|
|
v-model="adjModel" |
|
|
|
|
|
:hideButton="true" |
|
|
|
|
|
inline |
|
|
|
|
|
@submit="submitAdj" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-scrollbar> |
|
|
|
|
|
<template #footer> |
|
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="submitAdj">确定</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
`,
|
|
|
setup() { |
|
|
setup() { |
|
|
const defaultExportModel = { |
|
|
const addDialogVisible = ref(false); |
|
|
startDatetime: "", |
|
|
const addAdjFormRef = ref(null); |
|
|
endDatetime: "", |
|
|
const adjList = ref([]); |
|
|
}; |
|
|
const submitAdj = async () => { |
|
|
const exportModel = ref(defaultExportModel); |
|
|
try { |
|
|
const config = useConfig(); |
|
|
|
|
|
const dialog = ref(false); |
|
|
|
|
|
const prop = ref(""); |
|
|
|
|
|
const queryModel = ref(schemaToModel(config.query.schema)); |
|
|
|
|
|
function buildQuery() { |
|
|
|
|
|
const postData = JSON.parse(JSON.stringify(queryModel.value)); |
|
|
|
|
|
return postData; |
|
|
|
|
|
} |
|
|
|
|
|
const openDialog = async () => { |
|
|
|
|
|
const url = "settleaccount/vmi/replenished-export"; |
|
|
const url = "settleaccount/vmi/replenished-export"; |
|
|
const method = "POST"; |
|
|
const method = "POST"; |
|
|
const postData = buildQuery(); |
|
|
const response = await request(url, null, { method }); |
|
|
const response = await request(url, postData, { method }); |
|
|
|
|
|
if (!response.errors) { |
|
|
if (!response.errors) { |
|
|
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); |
|
|
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); |
|
|
} |
|
|
} |
|
|
dialog.value = false; |
|
|
} catch (error) { |
|
|
|
|
|
console.log(error); |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
const adjSchema = { |
|
|
|
|
|
type: "object", |
|
|
|
|
|
properties: { |
|
|
|
|
|
startBillTime: { |
|
|
|
|
|
type: "string", |
|
|
|
|
|
title: "发运开始日期", |
|
|
|
|
|
input: "datetime", |
|
|
|
|
|
rules: [{ required: true }], |
|
|
|
|
|
}, |
|
|
|
|
|
endBillTime: { |
|
|
|
|
|
type: "string", |
|
|
|
|
|
title: "发运结束日期", |
|
|
|
|
|
input: "datetime", |
|
|
|
|
|
rules: [{ required: true }], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
|
|
|
const defaultAdjModel = schemaToModel(adjSchema); |
|
|
|
|
|
const addAdj = () => { |
|
|
|
|
|
adjModel.value = Object.assign({}, defaultAdjModel); |
|
|
|
|
|
addDialogVisible.value = true; |
|
|
|
|
|
}; |
|
|
|
|
|
const adjModel = ref(defaultAdjModel); |
|
|
|
|
|
const config = useConfig(); |
|
|
const onCommand = async (item, rows) => { |
|
|
const onCommand = async (item, rows) => { |
|
|
prop.value = item.path; |
|
|
addDialogVisible.value = true; |
|
|
dialog.value = true; |
|
|
|
|
|
console.log(item.path, item, rows); |
|
|
console.log(item.path, item, rows); |
|
|
}; |
|
|
}; |
|
|
return { config, onCommand, dialog, prop, exportModel, openDialog }; |
|
|
return { |
|
|
|
|
|
config, |
|
|
|
|
|
onCommand, |
|
|
|
|
|
submitAdj, |
|
|
|
|
|
addDialogVisible, |
|
|
|
|
|
adjSchema, |
|
|
|
|
|
addAdjFormRef, |
|
|
|
|
|
defaultAdjModel, |
|
|
|
|
|
adjModel, |
|
|
|
|
|
addAdj, |
|
|
|
|
|
adjList, |
|
|
|
|
|
}; |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|