Browse Source

修改bug

QuKatie 3 years ago
parent
commit
00c3e77523

+ 8 - 0
src/api/kaihe/domesticTrade/orderInformation.js

@@ -178,4 +178,12 @@ export function shippingList(query) {
     method: 'post',
     data: data
   })
+}
+
+// 查询货物名称
+export function getfLaneName() {
+  return request({
+    url: '/shipping/address/selectAirLineName',
+    method: 'GET'
+  })
 }

+ 45 - 0
src/api/kaihe/protocol/index.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+export function getList(query) {
+  return request({
+    url: '/warehouse/deal/list',
+    method: 'get',
+    params: query
+  })
+}
+//kaihe-查看详情
+export function getdetail(id) {
+  return request({
+    url: '/warehouse/deal/'+id,
+    method:'get'
+  })
+}
+//kaihe-保存
+export function save(data) {
+  return request({
+    url: '/warehouse/deal',
+    method:'post',
+    data:data
+  })
+}
+//kaihe-删除主表
+export function remove(id) {
+  return request({
+    url: '/warehouse/deal/' + id,
+    method: 'delete'
+  })
+}
+//keihe-删除明细表
+export function itemRemove(ids) {
+  return request({
+    url: '/warehouse/item/' + ids,
+    method: 'delete'
+  })
+}
+//tree
+export function getshipList(query) {
+  return request({
+    url: '/warehouse/deal/shipList',
+    method: 'get',
+    params: query
+  })
+}

+ 4 - 2
src/views/kaihe/domesticTrade/myOrder/index.vue

@@ -368,6 +368,7 @@
       show-summary
       :summary-method="getSummaries"
       @selection-change="handleSelectionChange"
+      :height="height"
     >
       <el-table-column type="selection" width="60" align="center" />
       <el-table-column label="行号" align="center" type="index" />
@@ -573,6 +574,7 @@ export default {
   },
   data() {
     return {
+      height:window.innerHeight - 380+'px',
       voyageOptions: [],
       vesselOptions: [],
       show: false,
@@ -1078,10 +1080,10 @@ export default {
             num2+=e.loadCntr;
           });
           if (item.property == "fCntrcount") {
-            sums[index] = num1 ? num1.toFixed(2) : "0.00";
+            sums[index] = num1 ? num1: "0";
           }
           if (item.property == "loadCntr") {
-            sums[index] = num2 ? num2.toFixed(2) : "0.00";
+            sums[index] = num2 ? num2: "0";
           }
         }
       });

+ 261 - 0
src/views/kaihe/domesticTrade/orderInformation/feeDialog.vue

@@ -0,0 +1,261 @@
+<template>
+  <el-dialog
+    title="导入协议"
+    :visible.sync="dialogVisible"
+    width="80%"
+    @closed="closed"
+  >
+    <span>
+      <el-row>
+        <el-col :span="4">
+          <el-card :body-style="{ height: '500px' }">
+            <el-input placeholder="输入关键字" v-model="filterText"> </el-input>
+            <el-tree
+              ref="tree"
+              :data="treeData"
+              :props="defaultProps"
+              @node-click="handleNodeClick"
+              :filter-node-method="filterNode"
+            ></el-tree>
+          </el-card>
+        </el-col>
+        <el-col :span="20" v-loading="loading">
+          <el-form ref="form" :model="form" label-width="100px" disabled>
+            <el-row>
+              <el-col :span="6">
+                <el-form-item label="协议名称" prop="fName">
+                  <el-input
+                    v-model="form.fName"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="协议类型" prop="fTypes">
+                  <el-input
+                    v-model="form.fTypes"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="制单人" prop="createBy">
+                  <el-input
+                    v-model="form.createBy"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="状态" prop="status">
+                  <el-input
+                    v-model="form.status"
+                    size="small"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="6">
+                <el-form-item label="起运港" prop="fLoadportId">
+                  <el-input
+                    v-model="form.fLoadportName"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="运输条款" prop="fLoadportMode">
+                  <el-input
+                    v-model="form.fLoadportMode"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="目的港" prop="fDestportId">
+                  <el-input
+                    v-model="form.fDestportName"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="运输条款" prop="fDestportMode">
+                  <el-input
+                    v-model="form.fDestportMode"
+                    placeholder="请输入"
+                    size="small"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="有效期开始" prop="fPeriodStart">
+                  <el-date-picker
+                    style="width: 100%"
+                    v-model="form.fPeriodStart"
+                    placeholder="请选择"
+                    type="date"
+                    size="small"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="有效期结束" prop="fPeriodEnd">
+                  <el-date-picker
+                    style="width: 100%"
+                    v-model="form.fPeriodEnd"
+                    placeholder="请选择"
+                    type="date"
+                    size="small"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="制单时间" prop="createTime">
+                  <el-date-picker
+                    style="width: 100%"
+                    v-model="form.createTime"
+                    placeholder="请选择"
+                    type="date"
+                    size="small"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="24">
+                <el-form-item label="备注" prop="remark">
+                  <el-input
+                    v-model="form.remark"
+                    size="small"
+                    placeholder="请输入"
+                    type="textarea"
+                    :rows="2"
+                  />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <el-table
+            ref="multipleTable"
+            :data="data"
+            style="width: 100%"
+            height="324px"
+            @selection-change="selectionChange"
+          >
+            <el-table-column type="selection" width="55"> </el-table-column>
+            <el-table-column label="序号" type="index" width="50" />
+            <el-table-column
+              v-for="(item, index) in tableOption"
+              :key="index"
+              :label="item.name"
+              :width="item.width"
+              :prop="item.label"
+              align="center"
+              :fixed="item.fixed"
+              :show-overflow-tooltip="true"
+            />
+          </el-table>
+        </el-col>
+      </el-row>
+    </span>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="dialogVisible = false">取 消</el-button>
+      <el-button
+        type="primary"
+        @click="dialogVisible = false"
+        :disabled="selectionList.length == 0"
+        >导 入</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { tableOption } from "./js/index";
+import { getshipList, getdetail } from "@/api/kaihe/protocol/index";
+import { dateFormat } from "@/utils/date";
+export default {
+  name: "feeDialog",
+  data() {
+    return {
+      dialogVisible: false,
+      filterText: null,
+      treeData: [],
+      defaultProps: {
+        label: "fName",
+      },
+      form: {},
+      tableOption: tableOption,
+      data: [],
+      loading: false,
+      selectionList: [],
+      feeType: null,
+    };
+  },
+  created() {},
+  methods: {
+    init(type) {
+      this.dialogVisible = true;
+      this.feeType = type;
+      let date = new Date();
+      const data = {
+        fTypes: type,
+        fPeriodStart: dateFormat(date, "yyyy-MM-dd"),
+        fPeriodEnd: dateFormat(date, "yyyy-MM-dd"),
+      };
+      getshipList(data).then((res) => {
+        this.treeData = res.rows;
+      });
+    },
+    handleNodeClick(data) {
+      this.loading = true;
+      getdetail(data.fId).then((res) => {
+        this.form = res.data;
+        this.data = res.data.tShipDealItemList;
+        this.loading = false;
+      });
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.fName.indexOf(value) !== -1;
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    closed() {
+      this.$emit("importFee", this.selectionList, this.feeType);
+      this.filterText = null;
+      this.feeType = null;
+      this.treeData = [];
+      this.form = {};
+      this.data = [];
+      this.$refs.multipleTable.clearSelection();
+    },
+  },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped></style>

File diff suppressed because it is too large
+ 493 - 223
src/views/kaihe/domesticTrade/orderInformation/index.vue


+ 43 - 0
src/views/kaihe/domesticTrade/orderInformation/js/index.js

@@ -0,0 +1,43 @@
+export const tableOption = [{
+  surface: "1",
+  label: "fFeeName",
+  name: "费用名称",
+  checked: 0,
+  width: 100,
+},
+{
+  surface: "2",
+  label: "fFeeunitName",
+  name: "价格单位",
+  checked: 0,
+  width: 100,
+},
+{
+  surface: "3",
+  label: "fPrice",
+  name: "单价",
+  checked: 0,
+  width: 100,
+},
+{
+  surface: "4",
+  label: "remark",
+  name: "备注",
+  checked: 0,
+  width: 100,
+},
+{
+  surface: "5",
+  label: "createBy",
+  name: "录入人",
+  checked: 0,
+  width: 100,
+},
+{
+  surface: "6",
+  label: "createTime",
+  name: "录入时间",
+  checked: 0,
+  width: 100,
+}
+]

+ 559 - 0
src/views/kaihe/protocol/detail.vue

@@ -0,0 +1,559 @@
+<template>
+  <div v-if="showDetail">
+    <div style="display: flex; justify-content: space-between">
+      <div style="display: flex; align-items: center">
+        <el-breadcrumb separator="/">
+          <el-breadcrumb-item
+            ><span style="font-weight: 700">凯和协议</span></el-breadcrumb-item
+          >
+          <el-breadcrumb-item
+            ><span style="font-weight: 700"
+              >凯和协议详情页</span
+            ></el-breadcrumb-item
+          >
+        </el-breadcrumb>
+        <el-button
+          style="margin-left: 10px"
+          size="mini"
+          icon="el-icon-arrow-left"
+          @click="cancel"
+          >返回列表
+        </el-button>
+      </div>
+    </div>
+    <br />
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="100px"
+      :disabled="readOnly"
+    >
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="协议名称" prop="fName">
+            <el-input v-model="form.fName" placeholder="请输入" size="small">
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="协议类型" prop="fTypes">
+            <el-select
+              style="width: 100%"
+              v-model="form.fTypes"
+              placeholder="请选择"
+              size="small"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="item in protocolTypes"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictLabel"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="制单人" prop="createBy">
+            <el-input
+              v-model="form.createBy"
+              size="small"
+              placeholder="请输入"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="状态" prop="status">
+            <el-input
+              v-model="form.status"
+              size="small"
+              placeholder="请输入"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="起运港" prop="fLoadportId">
+            <el-select
+              style="width: 100%"
+              v-model="form.fLoadportId"
+              placeholder="请选择"
+              size="small"
+              @change="loadportChange"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="item in fMblnoOptions"
+                :key="item.fId"
+                :label="item.fName"
+                :value="item.fId"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="运输条款" prop="fLoadportMode">
+            <el-select
+              style="width: 100%"
+              v-model="form.fLoadportMode"
+              placeholder="请选择起运港运输条款"
+              size="small"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="item in fServiceitems"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictLabel"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="目的港" prop="fDestportId">
+            <el-select
+              style="width: 100%"
+              v-model="form.fDestportId"
+              placeholder="请选择"
+              size="small"
+              @change="destportChange"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="item in fMblnoOptions"
+                :key="item.fId"
+                :label="item.fName"
+                :value="item.fId"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="运输条款" prop="fDestportMode">
+            <el-select
+              style="width: 100%"
+              v-model="form.fDestportMode"
+              placeholder="请选择目的港运输条款"
+              size="small"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="item in fServiceitemsNews"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictLabel"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="有效期开始" prop="fPeriodStart">
+            <el-date-picker
+              style="width: 100%"
+              v-model="form.fPeriodStart"
+              placeholder="请选择"
+              type="date"
+              size="small"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="有效期结束" prop="fPeriodEnd">
+            <el-date-picker
+              style="width: 100%"
+              v-model="form.fPeriodEnd"
+              placeholder="请选择"
+              type="date"
+              size="small"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="制单时间" prop="createTime">
+            <el-date-picker
+              style="width: 100%"
+              v-model="form.createTime"
+              placeholder="请选择"
+              type="date"
+              size="small"
+              disabled
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="备注" prop="remark">
+            <el-input
+              v-model="form.remark"
+              size="small"
+              placeholder="请输入"
+              type="textarea"
+              :rows="2"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div class="head-but">
+      <div>
+        <el-button type="primary" size="mini" @click="add" :disabled="readOnly">
+          新 增
+        </el-button>
+        <el-button
+          type="success"
+          size="mini"
+          @click="save"
+          :disabled="readOnly"
+        >
+          保 存
+        </el-button>
+        <el-button type="info" size="mini" :disabled="readOnly">
+          生效申请
+        </el-button>
+        <el-button type="danger" size="mini" :disabled="readOnly">
+          作废申请
+        </el-button>
+      </div>
+      <div class="tabSetting">
+        <div style="margin: 0 12px">
+          <el-button
+            icon="el-icon-setting"
+            size="mini"
+            circle
+            @click="colSetting"
+          ></el-button>
+        </div>
+      </div>
+    </div>
+    <el-table :data="data" style="width: 100%">
+      <el-table-column label="序号" type="index" width="50" />
+      <el-table-column
+        v-for="(item, index) in tableOption"
+        :key="index"
+        :label="item.name"
+        :width="item.width"
+        :prop="item.label"
+        align="center"
+        :fixed="item.fixed"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="{ row }">
+          <span v-if="item.label == 'fFeeId'">
+            <el-select
+              style="width: 100%"
+              v-model="row.fFeeId"
+              placeholder="请选择"
+              size="small"
+              filterable
+              clearable
+              @change="feeChange(row)"
+              :disabled="readOnly"
+            >
+              <el-option
+                v-for="item in listFees"
+                :key="item.fId"
+                :label="item.fName"
+                :value="item.fId"
+              >
+              </el-option>
+            </el-select>
+          </span>
+          <span v-if="item.label == 'fFeeunitId'">
+            <el-select
+              style="width: 100%"
+              v-model="row.fFeeunitId"
+              placeholder="请选择"
+              size="small"
+              filterable
+              clearable
+              @change="feeunitChange(row)"
+              :disabled="readOnly"
+            >
+              <el-option
+                v-for="item in unitfees"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              >
+              </el-option>
+            </el-select>
+          </span>
+          <span v-if="item.label == 'fPrice'">
+            <el-input
+              v-model="row.fPrice"
+              placeholder="请输入"
+              size="small"
+              oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
+              :disabled="readOnly"
+            >
+            </el-input>
+          </span>
+          <span v-if="item.label == 'remark'">
+            <el-input
+              v-model="row.remark"
+              placeholder="请输入"
+              size="small"
+              :disabled="readOnly"
+            >
+            </el-input>
+          </span>
+          <span v-if="item.label == 'createBy'">
+            {{ row.createBy }}
+          </span>
+          <span v-if="item.label == 'createTime'">
+            {{ row.createTime }}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" width="80" align="center">
+        <template slot-scope="{ row, $index }">
+          <el-button
+            type="text"
+            size="small"
+            @click="rowDel(row, $index)"
+            :disabled="readOnly"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <column-setting
+      ref="columnSetting"
+      @reset="reset"
+      @getRowdata="getRowdata"
+      tableName="凯和协议明细"
+    />
+  </div>
+</template>
+
+<script>
+import { tableOption2 } from "./js/index";
+import columnSetting from "@/components/ColumnSetting/index";
+import { portInquiry } from "@/api/kaihe/domesticTrade/orderInformation";
+import { listFees } from "@/api/basicdata/fees";
+import { getdetail, save, itemRemove } from "@/api/kaihe/protocol/index";
+export default {
+  data() {
+    return {
+      form: {},
+      tableOption: tableOption2,
+      readOnly: null,
+      data: [],
+      protocolTypes: [],
+      fServiceitems: [],
+      fServiceitemsNews: [],
+      fMblnoOptions: [],
+      listFees: [],
+      unitfees: [],
+      rules: {
+        fName: [
+          { required: true, message: "请选择协议名称", trigger: "change" },
+        ],
+        fTypes: [
+          { required: true, message: "请选择协议类型", trigger: "change" },
+        ],
+        fPeriodStart: [
+          { required: true, message: "请选择协议类型", trigger: "change" },
+        ],
+        fPeriodEnd: [
+          { required: true, message: "请选择协议类型", trigger: "change" },
+        ],
+      },
+    };
+  },
+  props: {
+    showDetail: {
+      type: Boolean,
+    },
+  },
+  components: {
+    columnSetting,
+  },
+  created() {},
+  methods: {
+    init(row, status) {
+      this.readOnly = status;
+      if (row) {
+        console.log(row);
+        getdetail(row.fId).then((res) => {
+          this.form = res.data;
+          this.data = res.data.tShipDealItemList;
+        });
+      }
+      this.getDicts("protocol_type").then((response) => {
+        this.protocolTypes = response.data;
+      });
+      this.getDicts("f_serviceitems").then((response) => {
+        this.fServiceitems = response.data;
+      });
+      this.getDicts("f_serviceitemsNew").then((response) => {
+        this.fServiceitemsNews = response.data;
+      });
+      this.getDicts("data_unitfees").then((response) => {
+        this.unitfees = response.data;
+      });
+      portInquiry().then((res) => {
+        this.fMblnoOptions = res.rows;
+      });
+      listFees().then((res) => {
+        this.listFees = res.rows;
+      });
+      setTimeout((e) => {
+        this.$refs.columnSetting.getRow(this.tableOption);
+      }, 100);
+    },
+    feeChange(row) {
+      this.listFees.forEach((e) => {
+        if (e.fId == row.fFeeId) {
+          row.fFeeName = e.fName;
+        }
+      });
+    },
+    feeunitChange(row) {
+      this.unitfees.forEach((e) => {
+        if (e.dictValue == row.fFeeunitId) {
+          row.fFeeunitName = e.dictLabel;
+        }
+      });
+    },
+    loadportChange(row) {
+      this.fMblnoOptions.forEach((e) => {
+        if (row == e.fId) {
+          this.form.fLoadportName = e.fName;
+        }
+      });
+    },
+    destportChange(row) {
+      this.fMblnoOptions.forEach((e) => {
+        if (row == e.fId) {
+          this.form.fDestportName = e.fName;
+        }
+      });
+    },
+    returnData() {
+      this.$emit("goBack", false);
+    },
+    resetQuery() {
+      this.form = this.$options.data().form;
+    },
+    getList() {},
+    add() {
+      this.data.push({});
+    },
+    save() {
+      if (this.data.length > 0) {
+        for (let i = 0; i < this.data.length; i++) {
+          if (!this.data[i].fFeeId) {
+            return this.$message.error(
+              "请选择第" + Number(i + 1) + "行费用名称"
+            );
+          }
+          if (!this.data[i].fFeeunitId) {
+            return this.$message.error(
+              "请选择第" + Number(i + 1) + "行价格单位"
+            );
+          }
+          console.log(this.data[i].fPrice)
+          if (this.data[i].fPrice == undefined || this.data[i].fPrice === "") {
+            return this.$message.error("请输入第" + Number(i + 1) + "行单价");
+          }
+        }
+      }
+      save({ ...this.form, tShipDealItemList: this.data }).then((res) => {
+        if (res.code == 200) {
+          this.form = res.data;
+          this.data = res.data.tShipDealItemList;
+          this.$message({
+            type: "success",
+            message: "保存成功!",
+          });
+        }
+      });
+    },
+    rowDel(row, index) {
+      console.log(row, index);
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        if (row.fId) {
+          itemRemove(row.fId).then((res) => {
+            this.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+            this.data.splice(index, 1);
+          });
+        } else {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+          this.data.splice(index, 1);
+        }
+      });
+    },
+    colSetting() {
+      this.$refs.columnSetting.init(this.tableOption);
+    },
+    getRowdata(list) {
+      this.tableOption = list;
+    },
+    reset() {
+      this.tableOption = this.$options.data().tableOption;
+    },
+    cancel() {
+      if (!this.readOnly) {
+        this.$confirm("返回列表,是否保存?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.save("back");
+            Object.assign(this.$data, this.$options.data());
+            this.$emit("goBack", false);
+          })
+          .catch(() => {
+            Object.assign(this.$data, this.$options.data());
+            this.$emit("goDetail", false);
+          });
+      } else {
+        Object.assign(this.$data, this.$options.data());
+        this.$emit("goBack", false);
+      }
+    },
+  },
+  watch: {
+    info: function (obj) {
+      console.log(obj);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.head-but {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 8px;
+}
+</style>

+ 387 - 0
src/views/kaihe/protocol/index.vue

@@ -0,0 +1,387 @@
+<template>
+  <div class="app-container">
+    <div v-if="!showDetail">
+      <el-form ref="form" :model="form" label-width="100px" v-show="showSearch">
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="协议名称">
+              <el-input v-model="form.fName" placeholder="请输入" size="small">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="协议类型">
+              <el-select
+                style="width: 100%"
+                v-model="form.fTypes"
+                placeholder="请选择"
+                size="small"
+                filterable
+                clearable
+              >
+                <el-option
+                  v-for="item in protocolTypes"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictLabel"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="起运港">
+              <el-select
+                style="width: 100%"
+                v-model="form.fLoadportId"
+                placeholder="请选择"
+                size="small"
+                filterable
+                clearable
+              >
+                <el-option
+                  v-for="item in fMblnoOptions"
+                  :key="item.fId"
+                  :label="item.fName"
+                  :value="item.fId"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="运输条款">
+              <el-select
+                style="width: 100%"
+                v-model="form.fLoadportMode"
+                placeholder="请选择起运港运输条款"
+                size="small"
+                filterable
+                clearable
+              >
+                <el-option
+                  v-for="item in fServiceitems"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictLabel"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-collapse-transition>
+          <el-row v-show="show">
+            <el-col :span="6">
+              <el-form-item label="目的港">
+                <el-select
+                  style="width: 100%"
+                  v-model="form.fDestportId"
+                  placeholder="请选择"
+                  size="small"
+                  filterable
+                  clearable
+                >
+                  <el-option
+                    v-for="item in fMblnoOptions"
+                    :key="item.fId"
+                    :label="item.fName"
+                    :value="item.fId"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="运输条款">
+                <el-select
+                  style="width: 100%"
+                  v-model="form.fDestportMode"
+                  placeholder="请选择目的港运输条款"
+                  size="small"
+                  filterable
+                  clearable
+                >
+                  <el-option
+                    v-for="item in fServiceitemsNews"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictLabel"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="有效期开始">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="form.fPeriodStart"
+                  placeholder="请选择"
+                  value-format="yyyy-MM-dd"
+                  type="date"
+                  size="small"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="有效期结束">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="form.fPeriodEnd"
+                  placeholder="请选择"
+                  value-format="yyyy-MM-dd"
+                  type="date"
+                  size="small"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="制单时间">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="form.cLoadDate"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-collapse-transition>
+      </el-form>
+      <div class="head-but">
+        <div>
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="mini"
+            @click="goDetail(true)"
+          >
+            新增
+          </el-button>
+        </div>
+        <div class="tabSetting">
+          <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>
+          <el-button
+            v-show="show"
+            @click="show = !show"
+            icon="el-icon-arrow-up"
+            size="mini"
+          >
+            展开
+          </el-button>
+          <el-button
+            v-show="!show"
+            @click="show = !show"
+            icon="el-icon-arrow-down"
+            size="mini"
+          >
+            展开
+          </el-button>
+          <right-toolbar
+            style="margin-left: 12px"
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+          ></right-toolbar>
+          <div style="margin: 0 12px">
+            <el-button
+              icon="el-icon-setting"
+              size="mini"
+              circle
+              @click="colSetting"
+            ></el-button>
+          </div>
+        </div>
+      </div>
+      <el-table :data="data" style="width: 100%" v-loading="loading">
+        <el-table-column
+          v-for="(item, index) in tableOption"
+          :key="index"
+          :label="item.name"
+          :width="item.width"
+          :prop="item.label"
+          align="center"
+          :fixed="item.fixed"
+          :show-overflow-tooltip="true"
+        />
+        <el-table-column fixed="right" label="操作" width="120" align="center">
+          <template slot-scope="{ row, $index }">
+            <el-button type="text" size="small" @click="rowCheck(row, true)"
+              >查看</el-button
+            >
+            <el-button type="text" size="small" @click="rowCheck(row, false)"
+              >修改</el-button
+            >
+            <el-button type="text" size="small" @click="rowDel(row, $index)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="page.total > 0"
+        :total="page.total"
+        :page.sync="page.pageNum"
+        :limit.sync="page.pageSize"
+        @pagination="getList"
+      />
+    </div>
+
+    <detail-page
+      ref="detail"
+      :showDetail="showDetail"
+      @goDetail="goDetail"
+      @goBack="goBack"
+      @refFresh="refFresh"
+    />
+    <column-setting
+      ref="columnSetting"
+      @reset="reset"
+      @getRowdata="getRowdata"
+      tableName="凯和协议列表"
+    />
+  </div>
+</template>
+
+<script>
+import { tableOption } from "./js/index";
+import columnSetting from "@/components/ColumnSetting/index";
+import { portInquiry } from "@/api/kaihe/domesticTrade/orderInformation";
+import { getList, remove } from "@/api/kaihe/protocol/index";
+import detailPage from "./detail";
+export default {
+  name: "protocolIndex",
+  data() {
+    return {
+      loading: false,
+      show: false,
+      showDetail: false,
+      showSearch: true,
+      tableOption: tableOption,
+      form: {},
+      data: [],
+      page: {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+      },
+      protocolTypes: [],
+      fServiceitems: [],
+      fServiceitemsNews: [],
+      fDNameOptions: [],
+      fMblnoOptions: [],
+    };
+  },
+  created() {
+    this.getDicts("protocol_type").then((response) => {
+      this.protocolTypes = response.data;
+    });
+    this.getDicts("f_serviceitems").then((response) => {
+      this.fServiceitems = response.data;
+    });
+    this.getDicts("f_serviceitemsNew").then((response) => {
+      this.fServiceitemsNews = response.data;
+    });
+
+    portInquiry().then((res) => {
+      this.fMblnoOptions = res.rows;
+    });
+    this.getList();
+  },
+  activated() {
+    this.$refs.columnSetting.getRow(this.tableOption);
+  },
+  components: {
+    columnSetting,
+    detailPage,
+  },
+  methods: {
+    goDetail(bool) {
+      if (bool) {
+        this.$refs.detail.init();
+      }
+      this.showDetail = bool;
+    },
+    goBack(bool) {
+      this.getList();
+      this.showDetail = bool;
+    },
+    refFresh() {
+      this.getList();
+    },
+    rowCheck(row, status) {
+      this.$refs.detail.init(row, status);
+      this.showDetail = true;
+    },
+    rowDel(row, index) {
+      console.log(row, index);
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        remove(row.fId).then((res) => {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+          this.data.splice(index, 1);
+        });
+      });
+    },
+    handleQuery() {
+      this.page.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.form = this.$options.data().form;
+    },
+    getList() {
+      const data = {
+        ...this.form,
+        pageNum: this.page.pageNum,
+        pageSize: this.page.pageSize,
+      };
+      this.loading = true;
+      getList(data).then((response) => {
+        this.data = response.rows;
+        this.page.total = response.total;
+        this.loading = false;
+      });
+    },
+    colSetting() {
+      this.$refs.columnSetting.init(this.tableOption);
+    },
+    getRowdata(list) {
+      this.tableOption = list;
+    },
+    reset() {
+      this.tableOption = this.$options.data().tableOption;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.head-but {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 8px;
+}
+</style>

+ 107 - 0
src/views/kaihe/protocol/js/index.js

@@ -0,0 +1,107 @@
+export const tableOption = [{
+    surface: "1",
+    label: "fName",
+    name: "协议名称",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "2",
+    label: "fTypes",
+    name: "协议类型",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "3",
+    label: "fLoadportName",
+    name: "起运港",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "4",
+    label: "fLoadportMode",
+    name: "起运港运输条款",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "5",
+    label: "fDestportName",
+    name: "目的港",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "6",
+    label: "fDestportMode",
+    name: "目的港运输条款",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "7",
+    label: "fPeriodStart",
+    name: "有效期开始",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "8",
+    label: "fPeriodEnd",
+    name: "有效期结束",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "9",
+    label: "createTime",
+    name: "制单日期",
+    checked: 0,
+    width: 150,
+  }
+]
+export const tableOption2 = [{
+    surface: "1",
+    label: "fFeeId",
+    name: "费用名称",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "2",
+    label: "fFeeunitId",
+    name: "价格单位",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "3",
+    label: "fPrice",
+    name: "单价",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "4",
+    label: "remark",
+    name: "备注",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "5",
+    label: "createBy",
+    name: "录入人",
+    checked: 0,
+    width: 150,
+  },
+  {
+    surface: "6",
+    label: "createTime",
+    name: "录入时间",
+    checked: 0,
+    width: 150,
+  }
+]

+ 3 - 3
src/views/kaihe/singleVoyageShip/indexItem.vue

@@ -180,9 +180,9 @@ export default {
       if (!this.arrival) {
         return this.$message.error("到港时间未选择");
       }
-      if (!this.fLoadportid) {
-        return this.$message.error("港口地点未选择");
-      }
+      // if (!this.fLoadportid) {
+      //   return this.$message.error("港口地点未选择");
+      // }
       const data = {
         billList: arr,
         fUpdatetime: this.arrival,

Some files were not shown because too many files changed in this diff