Files
8357WMS/HHWMS.Web/Areas/Shipment/Views/ShipmentHeader/Analyse.cshtml
T

97 lines
3.6 KiB
Plaintext

@model HHWMS.Web.ShipmentHeaderVM
<el-row id="analyse" :gutter="20">
<el-card class="box-card">
<el-table :data="tableData" max-height="600" border
style="width: 100%">
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
<el-table-column label="批次" align="center" prop="Batch"></el-table-column>
<el-table-column label="数量" align="center" prop="Qty"></el-table-column>
<el-table-column label="物料状态" align="center" prop="InventoryStatus">
<template slot-scope="scope">
<el-button :type="scope.row.InventoryStatus === '不足' ? 'danger' : 'success'">
{{scope.row.InventoryStatus}}
</el-button>
</template>
</el-table-column>
<el-table-column fixed="right"
align="center">
<template slot-scope="scope">
<el-button @@click="handleClick(scope.row)" type="primary" icon="el-icon-search"></el-button>
</template>
</el-table-column>
</el-table>
<el-divider></el-divider>
</el-card>
<el-dialog title="库存明细" :visible.sync="dialogTableVisible">
<el-table :data="invData">
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
<el-table-column label="批次" align="center" prop="Batch"></el-table-column>
<el-table-column label="数量" align="center" prop="Qty"></el-table-column>
</el-table>
</el-dialog>
</el-row>
<script>
var str = "";
@{
<text>str = @Model.Entity.ID; </text>
}
var app = new Vue({
el: "#analyse",
data() {
return {
dialogTableVisible: false,
tableData: [],
invData: []
};
},
mounted: function () {
// 获取所有单据明细
$.ajax({
type: "post",
dataType: "json",
data: { id: str },
url: "/shipment/ShipmentHeader/AnalyseData",
success: function (json) {
app.tableData = json.Data;
},
error: function (json) {
console.log("加载失败");
}
});
},
methods: {
// 查询库存
handleClick(data) {
var _this = this;
var uniqueCode = data.UniqueCode;
// 查询库存
if (data.InventoryStatus != "不足") {
_this.dialogTableVisible = true;
$.ajax({
type: "post",
dataType: "json",
data: { uniqueCode: uniqueCode },
url: "/shipment/ShipmentHeader/GetInvData",
success: function (json) {
_this.invData = json.Data;
},
error: function (json) {
_this.$message({
message: json.Message,
type: 'warning'
});
}
});
}
}
}
});
</script>