|
|
|
@ -104,13 +104,13 @@
|
|
|
|
|
class="upload"
|
|
|
|
|
:action="this.uploadUrl"
|
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
|
on-success="uploadHandleSuccess"
|
|
|
|
|
:on-success="uploadHandleSuccess"
|
|
|
|
|
:limit="3"
|
|
|
|
|
:file-list="fileList">
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传 xls/xlsx 文件</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<el-button type="primary" style="margin-top: 20px;">提交</el-button>
|
|
|
|
|
<el-button type="primary" style="margin-top: 20px;" @click.native="importStackOrder">提交</el-button>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
@ -211,7 +211,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getStackOrderList, deleteStackOrder, updateStack, uploadStack} from "@/api/production/stackOrder";
|
|
|
|
|
import {getStackOrderList, deleteStackOrder, updateStack, uploadStack, importStackOrder} from "@/api/production/stackOrder";
|
|
|
|
|
import {getStackCodeList, deleteCode, addStackCode} from "@/api/production/stackCode";
|
|
|
|
|
import stackCode from "@/views/production/stackCode";
|
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
@ -443,6 +443,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
importStackCode() {
|
|
|
|
|
this.importVisible = true;
|
|
|
|
|
this.filePath = null;
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
},
|
|
|
|
|
beforeUpload(file) {
|
|
|
|
|
let fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
|
|
|
|
@ -455,18 +457,34 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
uploadHandleSuccess(response) {
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
|
this.filePath = res.data.path;
|
|
|
|
|
this.filePath = response.data.path;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error("上传失败:" + response.message);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
importStackOrder() {
|
|
|
|
|
if (isBlank(this.filePath)) {
|
|
|
|
|
this.$message.error("请上传文件")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {filePath: this.filePath};
|
|
|
|
|
importStackOrder(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("导入成功");
|
|
|
|
|
this.importVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
exportStackCode(orderId) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.uploadUrl = BASE_URL + "/udims/stack/order/importStackOrder";
|
|
|
|
|
this.uploadUrl = BASE_URL + "/udims/stack/order/uploadStackFile";
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|