|
@@ -4,7 +4,7 @@
|
|
|
<div class="sache">
|
|
|
<el-input placeholder="请输入内容" v-model="inputText" clearable>
|
|
|
</el-input>
|
|
|
- <el-button type="primary" class="btn">
|
|
|
+ <el-button type="primary" class="btn" @click="onclick">
|
|
|
<i class="el-icon-search"></i>查询
|
|
|
</el-button>
|
|
|
<el-button
|
|
@@ -28,7 +28,11 @@
|
|
|
<div>
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
<el-tab-pane label="未下发" name="first">
|
|
|
- <dilTable v-bind.sync="first" @selection-change="selectionChange" ref="table1">
|
|
|
+ <dilTable
|
|
|
+ v-bind.sync="first"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ ref="table1"
|
|
|
+ >
|
|
|
<el-table-column fixed="right" label="操作" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -44,9 +48,14 @@
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="已下发" name="second">
|
|
|
<dilTable v-bind.sync="second" ref="table">
|
|
|
- <el-table-column fixed="right" label="操作" width="80">
|
|
|
+ <el-table-column fixed="right" label="操作" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" size="mini" @click="getRequirementOrder(scope)">运单</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="mini"
|
|
|
+ @click="getRequirementOrder(scope)"
|
|
|
+ >运单</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</dilTable>
|
|
@@ -62,89 +71,96 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
inputText: "",
|
|
|
- orgCode:"",
|
|
|
+ orgCode: "",
|
|
|
first: {
|
|
|
// first请求数据的地址
|
|
|
- requestUrl:
|
|
|
- "",
|
|
|
+ requestUrl: "",
|
|
|
selectionType: "select",
|
|
|
- mapList: [],
|
|
|
+ mapList: []
|
|
|
},
|
|
|
second: {
|
|
|
// second请求数据的地址
|
|
|
- requestUrl:
|
|
|
- "",
|
|
|
+ requestUrl: ""
|
|
|
},
|
|
|
- //记录旧的row对象(未下发)
|
|
|
- oldRow: "",
|
|
|
- //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
|
|
|
- oldRowCount: 1,
|
|
|
- //记录旧的row对象(已下发)
|
|
|
- oldRow1: "",
|
|
|
- //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已下发)
|
|
|
- oldRowCount1: 1,
|
|
|
- tableHead: [
|
|
|
- {
|
|
|
- prop: "materialName",
|
|
|
- label: "物资名称",
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- {
|
|
|
- prop:"loadName",
|
|
|
- label:"装货点",
|
|
|
- width:150
|
|
|
- },
|
|
|
- {
|
|
|
- prop:"unloadName",
|
|
|
- label:"卸货点",
|
|
|
- width:150
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "materialWeight",
|
|
|
- label: "物资重量",
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "materialCount",
|
|
|
- label: "物资数量",
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- ],
|
|
|
tableData: [],
|
|
|
tableData1: [
|
|
|
{
|
|
|
- materialCount : 100
|
|
|
+ materialCount: 100
|
|
|
}
|
|
|
],
|
|
|
- activeName: "first",
|
|
|
+ activeName: "first"
|
|
|
};
|
|
|
},
|
|
|
- created(){
|
|
|
- if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"){
|
|
|
- this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0"
|
|
|
- this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1"
|
|
|
- }else{
|
|
|
- this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" + getCookie("orgCode")
|
|
|
- this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" + getCookie("orgCode")
|
|
|
+ created() {
|
|
|
+ if (
|
|
|
+ getCookie("orgCode") == "dagangadmin" ||
|
|
|
+ getCookie("orgCode") == "zidonghuabu"
|
|
|
+ ) {
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0";
|
|
|
+ this.second.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1";
|
|
|
+ } else {
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" +
|
|
|
+ getCookie("orgCode");
|
|
|
+ this.second.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" +
|
|
|
+ getCookie("orgCode");
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onclick() {
|
|
|
+ let orgCode = null;
|
|
|
+ if (
|
|
|
+ getCookie("orgCode") != "dagangadmin" &&
|
|
|
+ getCookie("orgCode") != "zidonghuabu"
|
|
|
+ ) {
|
|
|
+ orgCode = getCookie("orgCode");
|
|
|
+ }
|
|
|
+ if (this.activeName == "first") {
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" +
|
|
|
+ orgCode +
|
|
|
+ "&index=" +
|
|
|
+ this.inputText;
|
|
|
+ } else {
|
|
|
+ this.second.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" +
|
|
|
+ orgCode +
|
|
|
+ "&index=" +
|
|
|
+ this.inputText;
|
|
|
+ }
|
|
|
+ },
|
|
|
//查看需求下面的运单
|
|
|
- getRequirementOrder(scope){
|
|
|
- this.$router.push(
|
|
|
- "/getRequirementOrder/" + scope.row.requirementId
|
|
|
- );
|
|
|
+ getRequirementOrder(scope) {
|
|
|
+ this.$router.push("/getRequirementOrder/" + scope.row.requirementId);
|
|
|
},
|
|
|
handleClick(tab, event) {
|
|
|
- this.getRequestUrl()
|
|
|
+ this.getRequestUrl();
|
|
|
},
|
|
|
- getRequestUrl(){
|
|
|
- if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"){
|
|
|
- this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&i=" + new Date()
|
|
|
- this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&i=" + new Date()
|
|
|
- }else{
|
|
|
- this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" + getCookie("orgCode") + "&i=" + new Date()
|
|
|
- this.second.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" + getCookie("orgCode") + "&i=" + new Date()
|
|
|
+ getRequestUrl() {
|
|
|
+ if (
|
|
|
+ getCookie("orgCode") == "dagangadmin" ||
|
|
|
+ getCookie("orgCode") == "zidonghuabu"
|
|
|
+ ) {
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&i=" +
|
|
|
+ new Date();
|
|
|
+ this.second.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&i=" +
|
|
|
+ new Date();
|
|
|
+ } else {
|
|
|
+ this.first.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" +
|
|
|
+ getCookie("orgCode") +
|
|
|
+ "&i=" +
|
|
|
+ new Date();
|
|
|
+ this.second.requestUrl =
|
|
|
+ "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" +
|
|
|
+ getCookie("orgCode") +
|
|
|
+ "&i=" +
|
|
|
+ new Date();
|
|
|
}
|
|
|
},
|
|
|
selectionChange(selection) {
|
|
@@ -154,33 +170,31 @@ export default {
|
|
|
this.$router.push("/addRequirement2");
|
|
|
},
|
|
|
updateRequirement(scope) {
|
|
|
- this.$router.push(
|
|
|
- "/updateRequirement/" + scope.row.requirementId
|
|
|
- );
|
|
|
+ this.$router.push("/updateRequirement/" + scope.row.requirementId);
|
|
|
},
|
|
|
deleteRequirement(scope) {
|
|
|
this.$confirm("是否删除", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
- center: true,
|
|
|
+ center: true
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.axios
|
|
|
.post(
|
|
|
"/api/v1/ams/deleteTruckRequirement/" + scope.row.requirementId
|
|
|
)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "删除成功!",
|
|
|
+ message: "删除成功!"
|
|
|
});
|
|
|
- this.getRequestUrl()
|
|
|
+ this.getRequestUrl();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: "删除失败",
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -188,44 +202,52 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
- message: "删除操作已取消!",
|
|
|
+ message: "删除操作已取消!"
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
Issue() {
|
|
|
console.log(this.first.mapList);
|
|
|
- if(this.first.mapList.length == 0){
|
|
|
- this.$message.warning("请选择需求")
|
|
|
- return
|
|
|
+ if (this.first.mapList.length == 0) {
|
|
|
+ this.$message.warning("请选择需求");
|
|
|
+ return;
|
|
|
}
|
|
|
- // 权限控制,判断用户是否属于炼铁厂下面的车间
|
|
|
- for(let i=0;i<this.first.mapList.length;i++){
|
|
|
- if((this.first.mapList[i].requirementType=="计时")&&(getCookie("orgCode")=="liantiechang-yuanliaochejian"||getCookie("orgCode")=="liantiechang-shaojiechejian"||getCookie("orgCode")=="liantiechang-dagaoluchejian"||getCookie("orgCode")=="liantiechang-xiaogaoluchejian"||getCookie("orgCode")=="liantiechang-rongjichejian"||getCookie("orgCode")=="liantiechang-weijianchejian")){
|
|
|
- this.$message.warning("请选择联系炼铁厂相关负责人完成计时作业下发")
|
|
|
- return
|
|
|
+ // 权限控制,判断用户是否属于炼铁厂下面的车间
|
|
|
+ for (let i = 0; i < this.first.mapList.length; i++) {
|
|
|
+ if (
|
|
|
+ this.first.mapList[i].requirementType == "计时" &&
|
|
|
+ (getCookie("orgCode") == "liantiechang-yuanliaochejian" ||
|
|
|
+ getCookie("orgCode") == "liantiechang-shaojiechejian" ||
|
|
|
+ getCookie("orgCode") == "liantiechang-dagaoluchejian" ||
|
|
|
+ getCookie("orgCode") == "liantiechang-xiaogaoluchejian" ||
|
|
|
+ getCookie("orgCode") == "liantiechang-rongjichejian" ||
|
|
|
+ getCookie("orgCode") == "liantiechang-weijianchejian")
|
|
|
+ ) {
|
|
|
+ this.$message.warning("请选择联系炼铁厂相关负责人完成计时作业下发");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
this.$confirm("是否下发", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
- center: true,
|
|
|
+ center: true
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.axios
|
|
|
.post("/api/v1/ams/downRequirement", this.first.mapList)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "下发成功!",
|
|
|
+ message: "下发成功!"
|
|
|
});
|
|
|
- this.getRequestUrl()
|
|
|
- this.activeName = 'second'
|
|
|
+ this.getRequestUrl();
|
|
|
+ this.activeName = "second";
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: "下发失败",
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -233,23 +255,23 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
- message: "取消下发!",
|
|
|
+ message: "取消下发!"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- .inwardRequirement{
|
|
|
- margin-top: 20px;
|
|
|
- margin-left: 20px;
|
|
|
- .sache{
|
|
|
- margin-top: 30px;
|
|
|
- padding-bottom: 10px;
|
|
|
- .el-input {
|
|
|
- width: 20%;
|
|
|
- }
|
|
|
- }
|
|
|
+.inwardRequirement {
|
|
|
+ margin-top: 20px;
|
|
|
+ margin-left: 20px;
|
|
|
+ .sache {
|
|
|
+ margin-top: 30px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ .el-input {
|
|
|
+ width: 20%;
|
|
|
+ }
|
|
|
}
|
|
|
+}
|
|
|
</style>
|