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.
206 lines
7.4 KiB
206 lines
7.4 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="InvCode" label="料品编码" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="InvName" label="料品名称" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="InvStd" label="规格型号" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="MUSERName" label="维护人" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="MTIME" label="维护时间" width="150">
|
|
</el-table-column>
|
|
<el-table-column prop="FileName" label="文件名称" width="100">
|
|
</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>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-col>
|
|
<el-col :span="2">
|
|
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</template>
|
|
</div>
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
//const { Console } = require("node:console");
|
|
var vm = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
id:'',
|
|
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();
|
|
this.id = '@ViewData["ids"]';
|
|
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/GetItem2AqlFilePath?fileName=' + row.FileName)
|
|
.then(function (res) {
|
|
|
|
if (res.data) {
|
|
//console.log(res.data.message);
|
|
window.open(res.data.message);
|
|
}
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
|
|
},
|
|
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/GetItem2AqlFileList?keyValue=' + this.id)
|
|
.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>
|