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.
177 lines
5.8 KiB
177 lines
5.8 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-row :gutter="24">
|
|
<el-col :span="6">
|
|
<el-form-item label="物料编码" prop="InvCode">
|
|
<el-input v-model="form.InvCode" size="mini" :disabled="true"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="Aql编码" prop="RulesCode">
|
|
<el-select v-model="form.RulesCode" placeholder="请选择" size="mini">
|
|
<el-option v-for="item in dataSource4Right"
|
|
:key="item.RulesCode"
|
|
:label="item.RulesName"
|
|
:value="item.RulesCode">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="启用" prop="Enable">
|
|
<el-switch v-model="form.Enable" active-color="#13ce66" inactive-color="#ff4949">
|
|
</el-switch>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
|
|
</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: {},
|
|
|
|
dataSource4Detail: [],
|
|
rules: {
|
|
InvCode: [{ required: true, message: '请输入', trigger: 'blur' },],
|
|
RulesCode: [{ required: true, message: '请输入', trigger: 'blur' },],
|
|
|
|
},
|
|
disabled4RulesCode: false,
|
|
dataSource4Left: [],
|
|
dataSource4Right: [],
|
|
},
|
|
//挂在DOM 触发
|
|
mounted() {
|
|
let reactiveObject = {
|
|
InvCode:'',
|
|
RulesCode: '',
|
|
RulesName: '',
|
|
RulesDesc: '',
|
|
Type: '',
|
|
Enable: true,
|
|
|
|
};
|
|
this.form = reactiveObject;
|
|
|
|
// this.loadGrid();
|
|
// this.show();
|
|
this.id = '@ViewData["ids"]';
|
|
this.initControl();
|
|
// console.log(this.id);
|
|
},
|
|
beforeDestroy() {
|
|
// this.autoScrol1(true);
|
|
|
|
},
|
|
methods: {
|
|
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.getAllAql();
|
|
this.getData();
|
|
//this.getAllItem();
|
|
|
|
},
|
|
|
|
getAllAql() {
|
|
axios
|
|
.get('/BBWMS/IQCQuality/GetAllAqlList?code=')
|
|
.then(function (res) {
|
|
|
|
if (res.data) {
|
|
res.data.forEach(function (el, i) {
|
|
Vue.set(vm.dataSource4Right, i, el)
|
|
});
|
|
}
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
},
|
|
getData() {
|
|
if (!this.id) return;
|
|
|
|
axios
|
|
.get('/BBWMS/IQCQuality/GetItem2Aql?keyValue=' + this.id)
|
|
.then(function (res) {
|
|
|
|
if (res.data) {
|
|
for (var i in res.data) {
|
|
Vue.set(vm.form, i, res.data[i]);
|
|
}
|
|
|
|
//res.data.DetailList.forEach(function (el, i) {
|
|
// Vue.set(vm.dataSource4Detail, i, el)
|
|
//});
|
|
}
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
},
|
|
submitCheck() {
|
|
|
|
|
|
|
|
this.$refs['form'].validate((valid) => {
|
|
if (valid) {
|
|
//alert('submit!');
|
|
|
|
$.submitForm({
|
|
url: "/BBWMS/IQCQuality/SaveItem2AqlSingle",
|
|
param: { keyValue: JSON.stringify(this.form) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
|
|
} else {
|
|
console.log('error submit!!');
|
|
return false;
|
|
}
|
|
});
|
|
// console.log(result);
|
|
},
|
|
},
|
|
});
|
|
function submitForm() {
|
|
//debugger;
|
|
vm.submitCheck();
|
|
|
|
|
|
}
|
|
</script>
|