123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- <template>
- <!-- 辅料运输派单 -->
- <div class="homeworkPath">
- <div class="top">
- <el-input
- placeholder="请输入内容"
- class="input"
- v-model="input"
- 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 {
- 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&orderType=5&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- } else if (val == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- } else if (val == "second") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- }
- } else {
- if (val == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- } else if (val == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- } else if (val == "second") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- }
- }
- },
- },
- created() {
- //判断是否是承运商
- if (getCookie("orgCode") == "chengyunshang") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
- getCookie("userId");
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
- getCookie("userId");
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
- getCookie("userId");
- } else {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
- null;
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
- null;
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
- null;
- }
- },
- methods: {
- getRequestUrl() {
- //判断是否是承运商
- if (getCookie("orgCode") == "chengyunshang") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
- getCookie("userId") +
- "&i=" +
- new Date();
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
- getCookie("userId") +
- "&i=" +
- new Date();
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
- getCookie("userId") +
- "&i=" +
- new Date();
- } else {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
- null +
- "&i=" +
- new Date();
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
- null +
- "&i=" +
- new Date();
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
- null +
- "&i=" +
- new Date();
- }
- },
- onclick() {
- if (getCookie("orgCode") == "chengyunshang") {
- if (this.activeName == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- } else if (this.activeName == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- } else if (this.activeName == "second") {
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- getCookie("userId");
- }
- } 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&orderType=5&orderStatus=4&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- null +
- "&startTime=" +
- startTime +
- "&endTime=" +
- endTime;
- } else if (this.activeName == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- null +
- "&startTime=" +
- startTime +
- "&endTime=" +
- endTime;
- } else if (this.activeName == "second") {
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- null +
- "&startTime=" +
- startTime +
- "&endTime=" +
- endTime;
- }
- }
- } else {
- if (this.activeName == "option") {
- this.option.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- } else if (this.activeName == "first") {
- this.option1.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- } else if (this.activeName == "second") {
- this.option2.requestUrl =
- "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" +
- this.input +
- "&i=" +
- new Date() +
- "&carrierSSOId=" +
- null;
- }
- }
- }
- },
- 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>
|