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.
208 lines
7.6 KiB
208 lines
7.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="dataSource4Test" highlight-current-row
|
|
:data="dataSource4Test"
|
|
style="width: 100%"
|
|
stripe border
|
|
size="mini"
|
|
height="200"
|
|
v-on:current-change="handleCurrentChange4Test">
|
|
<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="150">
|
|
</el-table-column>
|
|
<el-table-column prop="InvName" label="物料名称" width="150">
|
|
</el-table-column>
|
|
<el-table-column prop="LotNo" label="物料条码" width="150">
|
|
</el-table-column>
|
|
<el-table-column prop="TransCode" label="采购订单" width="150">
|
|
</el-table-column>
|
|
<el-table-column prop="TransSequence" label="采购订单行" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="InvBatcgNo" label="批次" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="Quantity" label="条码数量" width="100">
|
|
</el-table-column>
|
|
<el-table-column prop="SampleQty" label="抽选数量" width="100">
|
|
<template slot-scope="scope">
|
|
<el-input-number v-model="scope.row.SampleQty" :min="0" size="small" style="width:60px;" :controls="false" v-on:change="change4SampleQty"></el-input-number>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="LeftQty" label="剩余数量" width="100">
|
|
</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,
|
|
},
|
|
currentRow4Test: null,//规则单选
|
|
rules: {
|
|
RulesCode: [{ required: true, message: '请输入', trigger: 'blur' },],
|
|
RulesName: [{ required: true, message: '请输入', trigger: 'blur' },],
|
|
|
|
},
|
|
dataSource4Test: [],
|
|
//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: {
|
|
handleCurrentChange4Test(val) {
|
|
this.currentRow4Test = val;
|
|
},
|
|
change4SampleQty(currentValue, oldValue) {
|
|
let currentRow = this.dataSource4Test.filter((x) => x.LotNo == this.currentRow4Test.LotNo)[0];
|
|
if (!currentRow) {
|
|
return;
|
|
}
|
|
|
|
currentRow.LeftQty = currentRow.Quantity - currentValue;
|
|
if (currentRow.LeftQty < 0) {
|
|
currentRow.SampleQty = 0;
|
|
currentRow.LeftQty = 0;
|
|
}
|
|
},
|
|
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;
|
|
let _this = this;
|
|
// debugger;
|
|
axios
|
|
.get('/BBWMS/IQCQuality/GetMaterialCheckMain?keyValue=' + _this.id)
|
|
.then(function (res) {
|
|
|
|
// debugger;
|
|
if (res.data) {
|
|
if (res.data[0]) {
|
|
for (var i in res.data[0]) {
|
|
Vue.set(vm.form, i, res.data[0][i]);
|
|
}
|
|
}
|
|
}
|
|
})
|
|
.then(function () {
|
|
axios
|
|
.get("/BBWMS/IQCQuality/GetMaterialInStorageCheckDetailList2?code=" + _this.form.AsnCode + "&lotno=" + _this.form.InvBatcgNo + "&invCode=" + _this.form.InvCode )
|
|
.then(function (res) {
|
|
|
|
if (res.data) {
|
|
res.data.forEach(function (el, i) {
|
|
el.SampleQty = 0;
|
|
el.LeftQty = el.Quantity;
|
|
Vue.set(vm.dataSource4Test, i, el)
|
|
});
|
|
|
|
}
|
|
})
|
|
})
|
|
.catch(function (error) { // 请求失败处理
|
|
alert(error);
|
|
});
|
|
},
|
|
|
|
handleSelectionChange4File(val) {
|
|
this.multipleSelection = val;
|
|
},
|
|
submitCheck() {
|
|
//$.submitForm({});
|
|
|
|
// $.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
|
|
},
|
|
},
|
|
});
|
|
function submitForm() {
|
|
//debugger;
|
|
vm.submitCheck();
|
|
|
|
return vm.dataSource4Test;
|
|
}
|
|
|
|
|
|
function Close() {
|
|
$.modalClose();
|
|
}
|
|
</script>
|