You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
233 lines
8.6 KiB
233 lines
8.6 KiB
|
|
@{
|
|
ViewBag.Title = "";
|
|
Layout = "~/Views/Shared/_Form.cshtml";
|
|
}
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<!--引入 element-ui 的样式,-->
|
|
<link rel="stylesheet" href="~/Content/element-ui/lib/theme-chalk/index.css">
|
|
<script src="~/Content/vue/dist/vue.js"></script>
|
|
<script src="~/Content/element-ui/lib/index.js"></script>
|
|
|
|
<script src="~/Content/axios.min.js"></script>
|
|
<style>
|
|
</style>
|
|
|
|
<form id="form1">
|
|
<div id="app">
|
|
<template>
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
|
<el-divider></el-divider>
|
|
<el-row :gutter="24">
|
|
<el-col :span="24">
|
|
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :gutter="24">
|
|
<el-col :span="2">
|
|
|
|
</el-col>
|
|
<el-col :span="20">
|
|
<el-table ref="dataSource4File" highlight-current-row
|
|
:data="dataSource4File"
|
|
style="width: 100%"
|
|
stripe border
|
|
size="mini"
|
|
height="200"
|
|
v-on:selection-change="handleSelectionChange4File">
|
|
<el-table-column type="index" width="50"></el-table-column>
|
|
<el-table-column type="selection" width="55"> </el-table-column>
|
|
<el-table-column prop="Code" label="送货单单号" width="200">
|
|
</el-table-column>
|
|
@*<el-table-column prop="InvCode" label="料品编码" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="BatchCode" label="批次" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="VenCode" label="供应商" width="100">
|
|
</el-table-column>*@
|
|
|
|
<el-table-column prop="FileName" label="文件名称" width="600">
|
|
</el-table-column>
|
|
<el-table-column label="操作">
|
|
<template slot-scope="scope">
|
|
@*<a id="NF-Delete" authorize="yes" class="btn btn-primary" v-on:click="handleDelete(scope.$index, scope.row)"><i class="fa fa-trash-o"></i>删除</a>*@
|
|
@*<a id="NF-Add" authorize="no" style="margin-left:3px;" class="btn btn-primary" v-on:click="handleView(scope.$index, scope.row)"><i class="fa fa-pencil-square-o"></i>预览</a>*@
|
|
<a style="margin-left:3px;" class="btn btn-success" v-on:click="handleDownload(scope.$index, scope.row)"> <i class="fa fa-download"></i>下载 </a>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-col>
|
|
<el-col :span="2">
|
|
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</template>
|
|
</div>
|
|
</form>
|
|
<script>
|
|
var SRMFileUrl ='@System.Web.Configuration.WebConfigurationManager.ConnectionStrings["SRMURL"].ConnectionString';
|
|
|
|
</script>
|
|
<script type="text/javascript">
|
|
//const { Console } = require("node:console");
|
|
var vm = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
ASNCode: '',
|
|
InvCode: '',
|
|
InvCode: '',
|
|
BatchCode:'',
|
|
userCode: "",
|
|
|
|
ssList: [],
|
|
form: {},
|
|
detail: {
|
|
key:0,
|
|
SetValueMin: 0,
|
|
SetValueMax: 0,
|
|
SampleQuantity: 0,
|
|
EATTRIBUTE1: 0,
|
|
EATTRIBUTE2: 0,
|
|
EATTRIBUTE3: 0,
|
|
},
|
|
currentRow4Right: null,//规则单选
|
|
rules: {
|
|
RulesCode: [{ required: true, message: '请输入', trigger: 'blur' },],
|
|
RulesName: [{ required: true, message: '请输入', trigger: 'blur' },],
|
|
|
|
},
|
|
dataSource4File: [],
|
|
multipleSelection:[],
|
|
},
|
|
//挂在DOM 触发
|
|
mounted() {
|
|
let reactiveObject = {
|
|
RulesCode: '',
|
|
RulesName: '',
|
|
RulesDesc: '',
|
|
Type: '',
|
|
Enable: true,
|
|
DetailList: [],
|
|
};
|
|
this.form = reactiveObject;
|
|
|
|
// this.loadGrid();
|
|
// this.show();
|
|
debugger;
|
|
this.ASNCode = '@ViewData["ASNCode"]';
|
|
|
|
this.InvCode = '@ViewData["InvCode"]';
|
|
this.BatchCode='@ViewData["BatchCode"]';
|
|
this.initControl();
|
|
// console.log(this.id);
|
|
},
|
|
beforeDestroy() {
|
|
// this.autoScrol1(true);
|
|
|
|
},
|
|
methods: {
|
|
//删除行
|
|
handleDelete(index, row) {
|
|
//debugger;
|
|
// console.log(index, row);
|
|
this.dataSource4File = this.dataSource4File.filter(x => x.FileID != row.FileID);
|
|
|
|
let ids = [];
|
|
ids.push(row.FileID);
|
|
|
|
axios
|
|
.post('/BBWMS/IQCQuality/DeleteItem2AqlFile', { keyValue: JSON.stringify(ids) })
|
|
.then(function (res) {
|
|
|
|
if (res.data.state == "success") {
|
|
$.modalMsg("操作成功", "success");
|
|
// that.query();
|
|
}
|
|
else
|
|
$.modalMsg(res.data.message, "warning");
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
},
|
|
handleView(index, row) {
|
|
// debugger;
|
|
axios
|
|
.get('/BBWMS/IQCQuality/GetVendorFilePath?fileName=' + row.FileName)
|
|
.then(function (res) {
|
|
|
|
if (res.data) {
|
|
//console.log(res.data.message);
|
|
window.open(res.data.message);
|
|
}
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
|
|
},
|
|
handleDownload(index, row) {
|
|
debugger;
|
|
// 固定基础URL
|
|
const baseUrl = SRMFileUrl;
|
|
const QuotationNo = row.Code + row.InvCode + row.BatchCode;
|
|
// 拼接下载地址(注意路径格式)
|
|
const downloadUrl = `${baseUrl}/File/VendorFile/${row.VenCode}/${QuotationNo}/${row.FileName}`;
|
|
|
|
// 创建隐藏链接触发下载
|
|
const link = document.createElement('a');
|
|
link.href = downloadUrl;
|
|
link.download = row.FileName; // 设置下载文件名
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
},
|
|
initControl: function () {
|
|
let that = this;
|
|
// let orgName = '';
|
|
// this.disabled4RulesCode = this.id ? true : false;
|
|
let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
|
|
// console.log(userName);
|
|
this.getData();
|
|
//this.getAllItem();
|
|
//this.getAllAql();
|
|
},
|
|
|
|
getData() {
|
|
//if (!this.id) return;
|
|
|
|
axios
|
|
.get('/BBWMS/IQCQuality/GetVendorFileList?keyValue=' + this.ASNCode + '&InvCode=' + this.InvCode + '&BatchCode=' + this.BatchCode)
|
|
.then(function (res) {
|
|
|
|
if (res.data) {
|
|
res.data.forEach(function (el, i) {
|
|
Vue.set(vm.dataSource4File, i, el)
|
|
});
|
|
|
|
}
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
},
|
|
|
|
handleSelectionChange4File(val) {
|
|
this.multipleSelection = val;
|
|
},
|
|
submitCheck() {
|
|
//$.submitForm({});
|
|
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
},
|
|
},
|
|
});
|
|
function submitForm() {
|
|
//debugger;
|
|
vm.submitCheck();
|
|
|
|
|
|
}
|
|
</script>
|