123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <template>
- <!-- 燃料运输派单 -->
- <div>
- <div style="margin:10px">
- <el-select v-model="condition1" placeholder="请选择筛选条件" style="width:150px" clearable>
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-input
- placeholder="请输入内容"
- v-model="input1"
- style="width:200px"
- clearable
- >
- </el-input>
- <el-select v-model="condition2" placeholder="请选择筛选条件" style="width:150px" clearable>
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-input
- placeholder="请输入内容"
- v-model="input2"
- style="width:200px"
- clearable
- >
- </el-input>
- <span class="text">下发时间:</span>
- <el-date-picker
- v-model="startTime"
- type="datetime"
- placeholder="选择日期"
- >
- </el-date-picker>
- <span class="text">至</span>
- <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
- </el-date-picker>
- <el-button type="primary" class="btn" @click="onclick">
- <i class="el-icon-search"></i>查询
- </el-button>
- <el-button
- type="primary"
- class="btn"
- @click="clickClose"
- v-if="activeName == 'option'"
- >
- <i class="el-icon-close"></i>关闭
- </el-button>
- </div>
- <el-tabs v-model="activeName">
- <el-tab-pane label="未接收" name="option">
- <dilTable v-bind.sync="option" @selection-change="selectionChange">
- </dilTable>
- </el-tab-pane>
- <el-tab-pane label="已接收" name="first">
- <dilTable v-bind.sync="option1"> </dilTable>
- </el-tab-pane>
- <el-tab-pane label="已拒绝" name="second">
- <dilTable v-bind.sync="option2"> </dilTable>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- <script>
- import { getCookie } from "@/utils/util.js";
- import { sjTime } from "@/utils/sharedJsFile";
- export default {
- name: "inplantTMS",
- data() {
- return {
- condition1:null,
- condition2:null,
- input1:null,
- input2:null,
- options:[
- {
- label:"车牌号",
- value:"capacityNumber"
- },
- {
- label:"物资名称",
- value:"materialName"
- },
- {
- label:"发货单位",
- value:"supplierName"
- },
- {
- label:"采购订单",
- value:"purchaseOrderNo"
- }
-
- ],
- startTime: null,
- endTime: null,
- input: "",
- Time: "",
- activeName: "option",
- option: {
- // 表格请求数据的地址
- requestUrl: "",
- selectionType: "select",
- },
- option1: {
- // 表格请求数据的地址
- requestUrl: "",
- },
- option2: {
- // 表格请求数据的地址
- requestUrl: "",
- },
- list: [],
- };
- },
- watch: {
- activeName(val) {
- if (getCookie("orgCode") == "chengyunshang") {
- if (val == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- } else if (val == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- } else if (val == "second") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- }
- } else {
- if (val == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- } else if (val == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- } else if (val == "second") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- }
- }
- },
- },
- created() {
- //判断是否是承运商
- if (getCookie("orgCode") == "chengyunshang") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" +
- getCookie("userId");
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" +
- getCookie("userId");
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" +
- getCookie("userId");
- } else {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" +
- null;
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" +
- null;
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" +
- null;
- }
- },
- methods: {
- getRequestUrl() {
- if (getCookie("orgCode") == "chengyunshang") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" +
- getCookie("userId") +
- "&i=" +
- new Date();
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" +
- getCookie("userId") +
- "&i=" +
- new Date();
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" +
- getCookie("userId") +
- "&i=" +
- new Date();
- } else {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" +
- null +
- "&i=" +
- new Date();
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" +
- null +
- "&i=" +
- new Date();
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" +
- null +
- "&i=" +
- new Date();
- }
- },
- onclick() {
- let requestQuery={}
- if(this.condition1 == this.condition2){
- requestQuery[this.condition1]=[this.input1,this.input2]
- }else{
- requestQuery[this.condition1]=[this.input1+'']
- requestQuery[this.condition2]=[this.input2+'']
- }
- if (getCookie("orgCode") == "chengyunshang") {
- if (this.activeName == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- this.option.requestQuery=requestQuery;
- } else if (this.activeName == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- this.option1.requestQuery=requestQuery;
- } else if (this.activeName == "second") {
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- this.option2.requestQuery=requestQuery;
- }
- } else {
- let startTime = null;
- let endTime = null;
- if (this.startTime) {
- startTime = sjTime(this.startTime);
- }
- if (this.endTime) {
- endTime = sjTime(this.endTime);
- }
- if (startTime && endTime) {
- if (startTime < endTime) {
- if (this.activeName == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- null +
- "&startTime=" +
- startTime +
- "&endTime=" +
- endTime;
- this.option.requestQuery=requestQuery;
- } else if (this.activeName == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- null +
- "&startTime=" +
- startTime +
- "&endTime=" +
- endTime;
- this.option1.requestQuery=requestQuery;
- } else if (this.activeName == "second") {
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- null +
- "&startTime=" +
- startTime +
- "&endTime=" +
- endTime;
- this.option2.requestQuery=requestQuery;
- }
- }
- } else {
- console.log("aaaa");
- if (this.activeName == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- this.option.requestQuery=requestQuery;
- } else if (this.activeName == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- this.option1.requestQuery=requestQuery;
- } else if (this.activeName == "second") {
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- this.option2.requestQuery=requestQuery;
- }
- }
- }
- this.$forceUpdate();
- },
- clickClose() {
- console.log(this.list);
- if (this.list.length == 0) {
- this.$message.warning("请选择订单之后在关闭");
- } else {
- this.axios
- .post("/api/v1/oms/deleteOrders", { list: this.list })
- .then((res) => {
- if (res.data.code == "200") {
- this.$message.success("关闭成功");
- this.getRequestUrl();
- }
- });
- }
- },
- selectionChange(selection) {
- (this.list = []),
- selection.forEach((e) => {
- this.list.push(e.orderId);
- });
- },
- },
- };
- </script>
- <style lang='scss'>
- .homeworkPath {
- .top {
- padding: 40px;
- .input {
- width: 250px;
- margin-right: 10px;
- }
- }
- }
- </style>
|