| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682 | <template>  <div class="app-container">    <el-menu      :default-active="activeIndex"      class="el-menu-demo"      mode="horizontal"      @select="handleSelect"      text-color="#000"      active-text-color="#ffd04b">      <el-menu-item index="0">全部</el-menu-item><!--      <el-menu-item index="1">新建</el-menu-item>--><!--      <el-menu-item index="2">计划暂存</el-menu-item>--><!--      <el-menu-item index="3">计划驳回审批</el-menu-item>-->      <el-menu-item index="1">计划提交审批</el-menu-item><!--      <el-menu-item index="5">计划审批中</el-menu-item>-->      <el-menu-item index="2">计划审批通过</el-menu-item>      <el-menu-item index="3">配船暂存</el-menu-item><!--      <el-menu-item index="8">配船驳回审批</el-menu-item>-->      <el-menu-item index="4">配船提交审批</el-menu-item><!--      <el-menu-item index="10">配船审批中</el-menu-item>-->      <el-menu-item index="5">配船审批通过</el-menu-item>      <el-menu-item index="6">运单变更</el-menu-item>    </el-menu>    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" style="margin-top:20px">      <el-row>          <el-form-item label="订舱号" prop="fBillno">            <el-input size="small" width="240px" clearable v-model="queryParams.fBillno"/>          </el-form-item>        <el-form-item label="运输条款" prop="fServiceitems">          <el-select size="small" width="240px" clearable v-model="queryParams.fServiceitems">            <el-option              v-for="item in serviceitems"              :key="item.dictValue"              :label="item.dictLabel"              :value="item.dictValue"/>          </el-select>        </el-form-item>        <el-form-item label="收货人" prop="fConsigneername">          <el-input size="small" width="240px" clearable v-model="queryParams.fConsigneername"/>        </el-form-item>        <el-form-item label="箱型" prop="fCntrid">          <el-select size="small" v-model="queryParams.fCntrid" clearable :remote-method="cntrRemoteMethod">            <el-option              v-for="(dict, index) in container"              :key="dict.fId"              :label="dict.fNo"              :value="dict.fId"            ></el-option>          </el-select>        </el-form-item>        <el-form-item label="箱量" prop="fCntrcount">          <el-input size="small" width="240px" clearable v-model="queryParams.fCntrcount"/>        </el-form-item>        <el-form-item label="装货时间" prop="fBsdate">          <el-date-picker            v-model="queryParams.fBsdate"            type="date"            placeholder="选择日期"            format="yyyy-MM-dd">          </el-date-picker>        </el-form-item>      </el-row>    </el-form>    <el-row :gutter="10" class="mb8">      <div style="float: left">        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>      </div>      <div class="tabSetting">          <right-toolbar            :showSearch.sync="showSearch"            @queryTable="getList"          ></right-toolbar>          <div style="margin: 0 12px">            <el-button              icon="el-icon-setting"              size="mini"              circle              @click="showSetting = !showSetting"            ></el-button>          </div>        </div>    </el-row>    <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag>      <template slot="title">        <div class="avue-crud__dialog__header">            <span class="el-dialog__title">            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>            </span>        </div>      </template>      <div>配置排序列数据(拖动调整顺序)</div>      <div style="margin-left: 17px">        <el-checkbox          v-model="allCheck"          label="全选"          @change="allChecked"        ></el-checkbox>      </div>      <div style="padding: 4px; display: flex; justify-content: center">        <draggable          v-model="setRowList"          group="site"          animation="300"          @start="onStart"          @end="onEnd"          handle=".indraggable"        >          <transition-group>            <div              v-for="item in setRowList"              :key="item.surface"              class="listStyle"            >              <div style="width: 500px" class="indraggable">                <div class="progress" :style="{ width: item.width + 'px' }">                  <el-checkbox                    :label="item.name"                    v-model="item.checked"                    :true-label="0"                    :false-label="1"                  >{{ item.name }}                  </el-checkbox>                </div>              </div>              <el-input-number                v-model.number="item.width"                controls-position="right"                :min="1"                :max="500"                size="mini"              ></el-input-number>            </div>          </transition-group>        </draggable>      </div>      <span slot="footer" class="dialog-footer">        <el-button @click="showSetting = false">取 消</el-button>        <el-button @click="delRow" type="danger">重 置</el-button>        <el-button type="primary" @click="save()">确 定</el-button>      </span>    </el-dialog>    <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">      <el-table-column type="selection" width="55" align="center" />      <el-table-column label="行号" align="center" type="index" fixed/>      <el-table-column        v-for="(item, index) in getRowList"        :key="index"        :label="item.name"        :width="item.width"        :prop="item.label"        align="center"        :fixed="item.fixed"        :show-overflow-tooltip="true"        sortable      >        <template slot-scope="scope">          <span v-if="item.label == 'fBillno'">{{scope.row.fBillno}}</span>          <span v-if="item.label == 'fServiceitems'">{{scope.row.fServiceitems}}</span>          <span v-if="item.label == 'fConsigneername'">{{scope.row.fConsigneername}}</span>          <span v-if="item.label == 'fName'">{{scope.row.fName}}</span>          <span v-if="item.label == 'fNo'">{{scope.row.fNo}}</span>          <span v-if="item.label == 'fCntrcount'">{{scope.row.fCntrcount}}</span>          <span v-if="item.label == 'fBsdate'">{{scope.row.fBsdate}}</span>          <span v-if="item.label == 'fBillstatus'">{{scope.row.fBillstatus}}</span>          <span v-if="item.label == 'vslName'">{{scope.row.vslName}}</span>          <span v-if="item.label == 'voyNo'">{{scope.row.voyNo}}</span>          <span v-if="item.label == 'fMblno'">{{scope.row.fMblno}}</span>          <span v-if="item.label == 'corpName'">{{scope.row.corpName}}</span>          <span v-if="item.label == 'goodsName'">{{scope.row.goodsName}}</span>          <span v-if="item.label == 'createBy'">{{scope.row.createBy}}</span>          <span v-if="item.label == 'createTime'">{{ (scope.row.createTime).slice(0,10) }}</span>          <span v-if="item.label == 'loadportName'">{{scope.row.loadportName}}</span>          <span v-if="item.label == 'destportName'">{{scope.row.destportName}}</span>        </template>      </el-table-column><!--      <el-table-column label="订舱号" align="center" prop="fBillno"/>--><!--      <el-table-column label="运输条款" align="center" prop="fServiceitems" />--><!--      <el-table-column label="收货人" align="center" prop="fConsigneername"/>--><!--      <el-table-column label="航线" align="center" prop="fName"/>--><!--      <el-table-column label="箱型" align="center" prop="fNo"/>--><!--      <el-table-column label="箱量" align="center" prop="fCntrcount"/>--><!--      <el-table-column label="装货时间" align="center" prop="fBsdate"/>-->      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" min-width="160px">        <template slot-scope="scope">          <el-button            size="mini"            type="text"            icon="el-icon-edit"            v-hasPermi="['shipping:ctnprice:edit']"            @click="handleUpdate(scope.row)"          >查看</el-button>          <el-button            size="mini"            type="text"            icon="el-icon-delete"            v-hasPermi="['shipping:items:remove']"            @click="handleDelete(scope.row)"          >移除</el-button>        </template>      </el-table-column>      <!--      <el-table-column--><!--        class-name="small-padding fixed-width"--><!--        v-for="(item,index) in boxDistributionName"--><!--        :key="item.index"--><!--        :label="item"--><!--        :value="item.index"--><!--        :prop="item"--><!--      >--><!--      </el-table-column>-->    </el-table>    <pagination      v-show="total>0"      :total="total"      :page.sync="queryParams.pageNum"      :limit.sync="queryParams.pageSize"      @pagination="getList"    />  </div></template><script>  import { listCorps, getcntrName, delCorps, changeCorpsStatus,exportCorps } from "@/api/kaihe/domesticTrade/myOrder";  import Cookies from 'js-cookie'  import { addSet, resetModule, select } from '@/api/system/set'  import Vue from 'vue'  Vue.directive('dialogDrag', {    bind(el, binding, vnode, oldVnode) {      const dialogHeaderEl = el.querySelector('.el-dialog__header')      const dragDom = el.querySelector('.el-dialog')      const enlarge = el.querySelector('.enlarge')      dialogHeaderEl.style.cursor = 'move'      // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);      const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)      if(enlarge){        enlarge.onclick = (e) => {          dragDom.style.top = '0px'          dragDom.style.left = '0px'        }      }      dialogHeaderEl.onmousedown = (e) => {        // 鼠标按下,计算当前元素距离可视区的距离        const disX = e.clientX - dialogHeaderEl.offsetLeft        const disY = e.clientY - dialogHeaderEl.offsetTop        // 获取到的值带px 正则匹配替换        let styL, styT        // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px        if (sty.left.includes('%')) {          styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)          styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)        } else {          styL = +sty.left.replace(/\px/g, '')          styT = +sty.top.replace(/\px/g, '')        }        document.onmousemove = function(e) {          // 通过事件委托,计算移动的距离          const l = e.clientX - disX          const t = e.clientY - disY          // 移动当前元素          if ((t + styT) >= 0){            dragDom.style.top = `${t + styT}px`          }          dragDom.style.left = `${l + styL}px`          // 将此时的位置传出去          // binding.value({x:e.pageX,y:e.pageY})        }        document.onmouseup = function(e) {          document.onmousemove = null          document.onmouseup = null        }      }    }  })  export default {    name: "myOrder",    components: {    },    data() {      return {        activeIndex: '0',        setRowList: [],        getRowList: [],        tableDate: [          {            surface: "1",            label: "fBillno",            name: "订舱号",            fixed:"left",            checked: 0,            width: 120,          },          {            surface: "2",            label: "fServiceitems",            name: "运输条款",            fixed:"left",            checked: 0,            width: 120,          },          {            surface: "3",            label: "fConsigneername",            name: "收货人",            fixed:"left",            checked: 0,            width: 120,          },          {            surface: "4",            label: "fName",            name: "航线",            fixed:"left",            checked: 0,            width: 120,          },          {            surface: "5",            label: "fNo",            name: "箱型",            fixed:"left",            checked: 0,            width: 120,          },          {            surface: "6",            label: "fCntrcount",            name: "箱量",            fixed:"left",            checked: 0,            width: 120,          },          {            surface: "7",            label: "fBsdate",            name: "装货时间",            checked: 0,            width: 120,          },          {            surface: "8",            label: "fBillstatus",            name: "状态",            checked: 0,            width: 120,          },          {            surface: "9",            label: "vslName",            name: "船名",            checked: 0,            width: 120,          },          {            surface: "10",            label: "voyNo",            name: "航次",            checked: 0,            width: 120,          },          {            surface: "11",            label: "fMblno",            name: "提单号",            checked: 0,            width: 120,          },          {            surface: "12",            label: "corpName",            name: "订舱单位",            checked: 0,            width: 120,          },          {            surface: "13",            label: "goodsName",            name: "货名",            checked: 0,            width: 120,          },          {            surface: "14",            label: "createBy",            name: "订舱人",            checked: 0,            width: 120,          },          {            surface: "15",            label: "createTime",            name: "订舱时间",            checked: 0,            width: 120,          },          {            surface: "16",            label: "loadportName",            name: "起运港",            checked: 0,            width: 120,          },          {            surface: "17",            label: "destportName",            name: "目的港",            checked: 0,            width: 120,          },        ],        //自定义列宽        allCheck: false,        showSetting:false,        serviceitems:[],        container:[],        // 遮罩层        loading: true,        // 选中数组        ids: [],        // 非单个禁用        single: true,        // 非多个禁用        multiple: true,        // 显示搜索条件        showSearch: true,        // 总条数        total: 0,        // 客户详情表格数据        corpsList: [],        // 查询参数        queryParams: {          pageNum: 1,          pageSize: 10,        },      };    },    created() {      this.setRowList = this.tableDate;      this.getRowList = this.tableDate;      this.getList();      this.cntrRemoteMethod()      this.getDicts("f_serviceitems").then((response) => {        if (response.data) {          this.serviceitems = response.data;        }      });      // this.getRow()    },    activated() {      // this.getList()    },    methods: {      handleSelect(key, keyPath) {        console.log(key);        console.log(keyPath);        if(key === '0'){          this.queryParams = {            pageNum: 1,            pageSize: 10,          }        }else if(key === '1'){          this.queryParams.fBillstatus = 4        }else if(key === '2'){          this.queryParams.fBillstatus = 6        }else if(key === '3'){          this.queryParams.fBillstatus = 7        }else if(key === '4'){          this.queryParams.fBillstatus = 9        }else if(key === '5'){          this.queryParams.fBillstatus = 11        }else if(key === '6'){          this.queryParams.fBillstatus = 12        }        listCorps(this.queryParams).then(response => {          console.log(response)          this.corpsList = response.rows;          this.total = response.total;          this.loading = false;        });      },      //重置列表      delRow() {        this.data = {          tableName: "船舶信息",          userId: Cookies.get("userName"),        };        resetModule(this.data).then((res) => {          if (res.code == 200) {            this.showSetting = false;            this.setRowList = this.tableDate;            this.getRowList = this.tableDate;          }        });      },      //列设置全选      allChecked() {        if (this.allCheck == true) {          this.setRowList.map((e) => {            return (e.checked = 0);          });        } else {          this.setRowList.map((e) => {            return (e.checked = 1);          });        }      },      //查询列数据      getRow() {        let that = this;        this.data = {          tableName: "船舶信息",          userId: Cookies.get("userName"),        };        select(this.data).then((res) => {          if (res.data.length != 0) {            this.getRowList = res.data.filter((e) => e.checked == 0);            this.setRowList = res.data;            this.setRowList = this.setRowList.reduce((res, item) => {              res.push({                surface: item.surface,                label: item.label,                name: item.name,                checked: item.checked,                width: item.width,                fixed: item.fixed              });              return res;            }, []);          }        });      },      //保存列设置      save() {        this.showSetting = false;        this.data = {          tableName: "船舶信息",          userId: Cookies.get("userName"),          sysTableSetList: this.setRowList,        };        addSet(this.data).then((res) => {          this.getRowList = this.setRowList.filter((e) => e.checked == 0);        });      },      //开始拖拽事件      onStart() {        this.drag = true;      },      //拖拽结束事件      onEnd() {        this.drag = false;      },      //箱型下拉查询      cntrRemoteMethod() {        let queryParams = { pageNum: 1,};        getcntrName(queryParams).then(response=>{          console.log(response)          this.container = response.rows        })      },      /** 删除按钮操作 */      handleDelete(row) {        const fIds = row.fId || this.ids;        this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', "警告", {          confirmButtonText: "确定",          cancelButtonText: "取消",          type: "warning"        }).then(function() {          return delCorps(fIds);        }).then(() => {          this.getList();          this.msgSuccess("删除成功");        })      },      //查看跳转      handleUpdate(row){        console.log(row.fId)        let res = {}        res = {          fId:row.fId        }        this.$router.push({          path: "/domesticTrade/orderInformation",          query: { data: JSON.stringify(res) },        });      },      //模糊查询地点      addressMethod(){        let queryParams = { pageNum: 1,};        getaddress(queryParams).then(response=>{          this.addressOptions = response.rows        })      },      /** 查询客户详情列表 */      getList() {        listCorps(this.queryParams).then(response => {          console.log(response)          this.corpsList = response.rows;          this.total = response.total;          this.loading = false;        });      },      // 从表重置      contList() {        this.contactList = []      },      // 状态修改      handleStatusChange(row) {        let text = row.fStatus === "0" ? "启用" : "停用";        this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {          confirmButtonText: "确定",          cancelButtonText: "取消",          type: "warning"        }).then(function() {          return changeCorpsStatus(row.fId, row.fStatus);        }).then(() => {          this.msgSuccess(text + "成功");        }).catch(function() {          row.fStatus = row.fStatus === "0" ? "1" : "0";        });      },      /** 搜索按钮操作 */      handleQuery() {        this.queryParams.pageNum = 1;        this.getList();      },      /** 重置按钮操作 */      resetQuery() {        this.resetForm("queryForm");        this.handleQuery();      },      // 多选框选中数据      handleSelectionChange(selection) {        this.ids = selection.map(item => item.fId)        this.single = selection.length!==1        this.multiple = !selection.length      },    }  };</script><style lang="scss" scoped>.tabSetting {  display: flex;  justify-content: flex-end;}.listStyle {  display: flex;  border-top: 1px solid #dcdfe6;  border-left: 1px solid #dcdfe6;  border-right: 1px solid #dcdfe6;}.listStyle:last-child {  border-bottom: 1px solid #dcdfe6;}.progress {  display: flex;  align-items: center;  padding: 2px;  background-color: rgba(0, 0, 0, 0.05);  height: 100%;}</style>
 |