| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="goBack()">返回列表 </el-button>
- <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">上一票</el-button>
- <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
- </div>
- <div class="add-customer-btn">
- <el-button
- class="el-button--small-yh"
- style="margin-left: 6px;"
- type="primary"
- size="small"
- :disabled="selectionList.length == 0"
- @click="synchronous"
- >箱动态同步
- </el-button>
- <!-- <el-button v-if="form.status == '审核提交'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
- size="small" @click="revokeApplication">撤销单据请核
- </el-button> -->
- <!-- <el-dropdown style="line-height: 0">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
- size="small">
- 审 批<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown> -->
- </div>
- </div>
- <div style="margin-top: 50px">
- <!-- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- </avue-form>
- </trade-card> -->
- <trade-card title="基础明细">
- <avue-crud
- :option="option"
- :data="dataList"
- id="out-table"
- ref="crud"
- :header-cell-class-name="headerClassName"
- :row-style="{ height: '20px', padding: '0px' }"
- :cell-style="{ height: '20px', padding: '0px' }"
- @selection-change="selectionChange"
- @select="selectHandle"
- @row-update="rowUpdate"
- @resetColumn="resetColumn('crud', 'option', 'optionBack', 515)"
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 515)"
- >
- <template slot="menu" slot-scope="{ row, index }">
- <el-button size="small" type="text" @click="rowEdit(row)" v-if="row.whetherSynchronous == 0">
- {{ row.$cellEdit ? "保存" : "编辑" }}
- </el-button>
- <el-button size="small" type="text" @click="rowRevoke(row, index)" v-if="row.whetherSynchronous == 1">
- 撤销
- </el-button>
- <el-button size="small" type="text" @click="rowDel(row, index)" v-if="row.whetherSynchronous == 0&&row.srcStatus == 1">
- 删除
- </el-button>
- <el-popover placement="left" width="400" trigger="click">
- <avue-crud :option="recordOption" :data="recordData"></avue-crud>
- <el-button slot="reference" size="small" type="text" @click="rowRecord(row)" style="margin-left: 6px;">记录</el-button>
- </el-popover>
- </template>
- <!-- <template slot="menuLeft">
- <el-button type="danger" size="small" @click="allClick('撤销')">一键撤销 </el-button>
- </template> -->
- <tempalte slot="portCname" slot-scope="{ row, index }">
- <dic-select
- v-if="row.$cellEdit"
- v-model="row.portCname"
- placeholder="港口"
- label="cnName"
- res="records"
- url="/blade-los/bports/list?status=0¤t=1&size=5"
- :filterable="true"
- :remote="true"
- dataName="cnName"
- @selectChange="rowDicChange('portCname', $event, row)"
- :disabled="editDisabled"
- :slotRight="true"
- rightLabel="code"
- ></dic-select>
- <span v-else>{{ row.portCname }}</span>
- </tempalte>
- </avue-crud>
- </trade-card>
- </div>
- </div>
- </template>
- <script>
- import { detail, itemSubmit, synchronous, itemRemove, revokeSynchronous, getRecordlist } from "@/api/boxManagement/record/index.js";
- import dicSelect from "@/components/dicSelect/main";
- import checkSchedule from "@/components/checkH/checkSchedule.vue";
- import businessReports from "@/components/tradeAgency/businessReports.vue";
- import reports from "@/components/tradeAgency/reports.vue";
- import { dateFormat } from "@/util/date";
- import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
- import { getToken } from "@/util/auth";
- import _ from "lodash";
- import { Header } from "element-ui";
- export default {
- name: "detailsPage",
- data() {
- return {
- selectionList: [],
- editButton: false,
- editDisabled: false,
- dataList: [],
- recordData: [],
- recordOption: {
- align: "center",
- menu: false,
- header: false,
- column: [
- {
- label: "操作类型",
- prop: "operatorType",
- overHidden: true
- },
- {
- label: "操作内容",
- prop: "operatorContent",
- overHidden: true
- },
- {
- label: "操作人",
- prop: "operatorName",
- overHidden: true
- },
- {
- label: "操作时间",
- prop: "operatorDate",
- overHidden: true
- }
- ]
- },
- optionForm: {
- menuBtn: false,
- span: 6,
- disabled: false,
- labelWidth: 100,
- column: [
- {
- label: "起运港",
- prop: "polCname",
- disabled: false,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "目的港",
- prop: "podCname",
- disabled: false,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- minRows: 2,
- span: 12
- }
- ]
- },
- option: {},
- optionBack: {
- // height: 'auto',
- maxHeight: 700,
- calcHeight: 30,
- menuWidth: 110,
- tip: false,
- border: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- refreshBtn: false,
- selection: true,
- index: true,
- align: "center",
- // menu: false,
- column: [
- {
- label: "是否同步",
- prop: "whetherSynchronous",
- width: 80,
- sortable: true,
- type: "select",
- dicData: [
- {
- label: "否",
- value: "0"
- },
- {
- label: "是",
- value: "1"
- }
- ],
- overHidden: true
- },
- {
- label: "放箱号",
- prop: "containerNumber",
- cell: true,
- width: 150,
- sortable: true,
- overHidden: true
- },
- {
- label: "箱号",
- prop: "boxCode",
- width: 100,
- sortable: true,
- overHidden: true
- },
- {
- label: "箱型",
- prop: "boxType",
- width: 80,
- sortable: true,
- overHidden: true
- },
- {
- label: "港口",
- prop: "portCname",
- width: 150,
- sortable: true,
- overHidden: true
- },
- {
- label: "场站",
- prop: "stationCname",
- width: 100,
- sortable: true,
- overHidden: true
- },
- {
- label: "提单号",
- prop: "hblno",
- cell: true,
- width: 120,
- overHidden: true
- },
- {
- label: "出场日期",
- prop: "approachExitDate",
- width: 140,
- overHidden: true,
- cell: true,
- type: "datetime",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "出场目的",
- prop: "objective",
- width: 120,
- cell: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=exit_purpose",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- overHidden: true
- },
- {
- label: "箱好坏",
- prop: "boxStatus",
- width: 80,
- cell: true,
- overHidden: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true,
- overHidden: true
- }
- ]
- },
- roleName: [],
- form: {}
- };
- },
- components: {
- dicSelect,
- checkSchedule,
- businessReports,
- reports
- },
- props: {
- detailData: Object,
- pageIds: {
- type: Array, // 指定 prop 的类型为 Array
- default: () => [] // 提供一个默认值,这里使用函数形式返回一个空数组
- }
- },
- async created() {
- this.option = await this.getColumnData(this.getColumnName(515), this.optionBack);
- if (this.detailData.id) {
- // this.editButton = true
- // this.editDisabled = true
- // this.optionForm.disabled = true
- this.getDetail(this.detailData.id);
- }
- },
- methods: {
- lastPage() {
- if (this.pageIds.length) {
- const index = this.pageIds.indexOf(this.form.id);
- if (index == 0) {
- return this.$message.error("没有上一票了");
- }
- const lastIndex = index - 1;
- this.getDetail(this.pageIds[lastIndex]);
- }
- },
- nextPage() {
- if (this.pageIds.length) {
- const index = this.pageIds.indexOf(this.form.id);
- if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
- return this.$message.error("没有下一票了");
- }
- const nextIndex = index + 1;
- this.getDetail(this.pageIds[nextIndex]);
- }
- },
- rowDicChange(name, row, el) {
- if (name == "portCname") {
- if (row) {
- el.portId = row.id;
- el.portCode = row.code;
- el.portEname = row.enName;
- } else {
- el.portId = null;
- el.portCode = null;
- el.portEname = null;
- el.portCname = null;
- }
- }
- },
- synchronous() {
- let ids = [];
- for (let item of this.selectionList) {
- if (item.whetherSynchronous == 1) {
- return this.$message.error("请选择未同步的明细");
- }
- ids.push(item.id);
- }
- let obj = {
- id: this.detailData.id,
- ids: ids.join(",")
- };
- synchronous(obj).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.detailData.id);
- });
- },
- rowEdit(row) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- itemSubmit(row).then(res => {
- this.$message.success("保存成功");
- this.$set(row, "$cellEdit", false);
- this.getDetail(this.detailData.id);
- });
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowRecord(row) {
- this.recordData = [];
- let obj = {
- pid: row.id
- };
- getRecordlist(1, 50, obj).then(res => {
- this.recordData = res.data.data.records;
- });
- },
- rowRevoke(row) {
- this.$confirm("是否撤销数据?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {
- id: this.detailData.id,
- ids: row.id
- };
- revokeSynchronous(obj).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.detailData.id);
- });
- });
- },
- rowDel(row, index) {
- this.$confirm("是否删除数据?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {
- ids: row.id,
- };
- itemRemove(obj).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.detailData.id);
- });
- });
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- getDetail(id) {
- this.form.id = id;
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- detail({ pid: id })
- .then(res => {
- this.dataList = res.data.data;
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- this.$refs.crud.dicInit();
- });
- })
- .finally(() => {
- loading.close();
- });
- },
- submit(type) {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- itemSubmit(this.dataList)
- .then(res => {
- this.$message.success("保存成功");
- this.getDetail(this.detailData.id);
- })
- .finally(() => {
- loading.close();
- });
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumn(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- // 更改表格颜色
- headerClassName(tab) {
- //颜色间隔
- let back = "";
- if (tab.columnIndex >= 0 && tab.column.level === 1) {
- if (tab.columnIndex % 2 === 0) {
- back = "back-one";
- } else if (tab.columnIndex % 2 === 1) {
- back = "back-two";
- }
- }
- return back;
- },
- goBack(type) {
- this.$emit("goBack");
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- .el-form-item {
- margin-bottom: 0px !important;
- }
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- // ::v-deep#out-table .back-one {
- // background: #ecf5ff !important;
- // }
- // ::v-deep#out-table .back-two {
- // background: #ecf5ff !important;
- // }
- ::v-deep #out-table .back-one {
- background: #ecf5ff !important;
- text-align: center;
- padding: 4px 0;
- }
- ::v-deep #out-table .back-two {
- background: #ecf5ff !important;
- text-align: center;
- padding: 4px 0;
- }
- ::v-deep .el-table--small td,
- .el-table--small th {
- padding: 2px !important;
- }
- ::v-deep .el-card__body {
- padding: 3px 10px;
- }
- ::v-deep .box-card .el-card__body {
- padding: 4px !important;
- }
- .disabledBox {
- display: flex;
- align-items: center;
- }
- .meetSize {
- font-size: 16px;
- color: #54bcbd;
- }
- .fontSize {
- font-size: 16px;
- color: #81b337;
- }
- </style>
|