123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170 |
- <template>
- <div v-loading.fullscreen.lock="fullscreenLoading">
- <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="backToList"
- >返回列表
- </el-button>
- </div>
- <div>
- <div class="el-button--small-yh add-customer-btn" v-if="param.paramValue == 1">
- <el-button type="success" size="small" @click="release()" :disabled="form.status !== 0">发布</el-button>
- <el-button type="warning" size="small" @click="toVoid()" :disabled="form.status !== 4">取消发布</el-button>
- <el-button type="primary" size="small" @click="storage()">保存</el-button>
- </div>
- <div class="el-button--small-yh add-customer-btn" v-else>
- <el-button type="success" size="small" @click="release()" :disabled="form.status !== 3">发布</el-button>
- <el-button type="warning" size="small" @click="pleaseCheck()" :disabled="form.status !== 0">请核</el-button>
- <el-button type="warning" size="small" @click.stop="checkDialog = true,checkData = detailData.check" v-if="checkDisabled">审批</el-button>
- <el-button type="primary" size="small" @click="storage()">保存</el-button>
- <el-dropdown style="margin-left: 10px">
- <el-button type="primary" size="small">
- 业务处理<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="copyNew()" :disabled="!form.id">复制新增</el-dropdown-item>
- <el-dropdown-item @click.native="toVoid()" :disabled="form.status < 4 || !form.status">取消发布</el-dropdown-item>
- <el-dropdown-item @click.native="checkScheduleDialog = true,checkId=form.id" :disabled="form.status < 0 || !form.status">审批流程</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- </div>
- <trade-card title="基础资料" style="margin-top: 50px">
- <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
- </trade-card>
- <trade-card title="箱信息">
- <avue-crud ref="crudBox" :key="key" :option="optionBox" :data="dataListBox"
- @resetColumn="resetColumn('crudBox','optionBox','optionBoxTwo',201.1)"
- @saveColumn="saveColumn('crudBox','optionBox','optionBoxTwo',201.1)">
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
- @click="edit(row)"
- >{{ row.$cellEdit ? '确 认' : '编 辑' }}
- </el-button>
- <el-button
- type="text"
- size="small"
- icon="el-icon-delete"
- v-if="form.status === 0"
- @click="rowDel(row,index,'box')"
- >删 除
- </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <trade-card title="代理信息">
- <avue-crud ref="crudAgent" :key="key" :option="optionAgent" :data="dataListAgent"
- @resetColumn="resetColumn('crudAgent','optionAgent','optionAgentTwo',201.2)"
- @saveColumn="saveColumn('crudAgent','optionAgent','optionAgentTwo',201.2)">
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
- @click="edit(row)"
- >{{ row.$cellEdit ? '确 认' : '编 辑' }}
- </el-button>
- <el-button
- type="text"
- size="small"
- icon="el-icon-delete"
- v-if="form.status === 0"
- @click="rowDel(row,index,'agent')"
- >删 除
- </el-button>
- </template>
- <template slot="menuLeft">
- <el-button
- type="success"
- size="small"
- icon="el-icon-bottom"
- @click="dialogVisible = true"
- >导入
- </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <trade-card title="投标对比">
- <avue-crud ref="crudBid" :key="key" :option="optionBid" :data="dataListBid"
- @resetColumn="resetColumn('crudBid','optionBid','optionBidTwo',201.3)"
- @saveColumn="saveColumn('crudBid','optionBid','optionBidTwo',201.3)">
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
- @click="edit(row)"
- >{{ row.$cellEdit ? '确 认' : '编 辑' }}
- </el-button>
- <el-button
- type="text"
- size="small"
- @click="winningTheBid(row,index)"
- v-if="row.status === 5"
- >确认中标
- </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <el-dialog
- v-dialogdrag
- title="导入客户"
- :fullscreen="dialogFull"
- :visible.sync="dialogVisible"
- class="el-dialogDeep"
- append-to-body
- :close-on-click-modal="false"
- width="80%"
- >
- <template slot="title">
- <span class="el-dialog__title">
- <span
- style="display:inline-block;background-color: #3478f5;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"
- ></span>
- 导入客户
- </span>
- <div
- style="float: right"
- class="avue-crud__dialog__menu"
- @click="dialogFull ? (dialogFull = false) : (dialogFull = true)"
- >
- <i class="el-icon-full-screen"></i>
- </div>
- </template>
- <el-row style="height: 0">
- <el-col :span="5">
- <div class="box">
- <el-scrollbar>
- <basic-container>
- <avue-tree
- :option="treeOption"
- :data="treeData"
- @node-click="nodeClick"
- />
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud
- :option="option"
- :data="dataList"
- ref="crud"
- v-model="form"
- :page.sync="page"
- :before-close="beforeClose"
- @search-change="searchChange"
- @search-reset="searchReset"
- @refresh-change="refreshChange"
- @selection-change="selectionChange"
- @on-load="onLoad"
- @saveColumn="saveColumn('crud','option','option',47)"
- @tree-load="treeLoad"
- >
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="confirmSelection"
- :disabled="selection.length > 0 ? false : true"
- >确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- append-to-body
- title="审批"
- class="el-dialogDeep"
- :visible.sync="checkDialog"
- width="50%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check
- :checkData="checkData"
- :checkDetail="false"
- :idList="[]"
- @choceCheckFun="checkDialog = false"
- >
- </check>
- </el-dialog>
- <el-dialog
- append-to-body
- title="审批进度"
- class="el-dialogDeep"
- :visible.sync="checkScheduleDialog"
- width="40%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check-schedule
- :checkId="checkId"
- :batchNo="batchNo"
- @choceScheduleFun="checkScheduleDialog = false"
- >
- </check-schedule>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- detailDelegationList,
- saveSaveList,
- boxDelete,
- agentDelete,
- confirmRelease, confirmVoid, confirmPleaseCheck, confirmWinningTheBid,allList,paramList
- } from "@/api/bidingDocument/issueTender";
- import check from "@/components/check/check";
- import checkSchedule from "@/components/check/checkSchedule";
- import {dateFormat} from "@/util/date";
- import option from "@/components/selectComponent/configuration/mainList.json";
- import {customerList, getDeptLazyTree} from "@/api/basicData/customerInformation";
- import {customerParameter} from "@/enums/management-type";
- import {getDictionary} from "@/api/system/dictbiz";
- export default {
- name: "detailsPageEdit",
- components:{
- check,
- checkSchedule
- },
- watch: {
- form: {
- handler(newValue, oldValue) {
- if (this.form.status > 0){
- this.$set(this.optionForm,'disabled',true)
- this.$set(this.optionBox,'addRowBtn',false)
- this.$set(this.optionAgent,'addRowBtn',false)
- this.optionBox.column.forEach(item=>{
- this.$set(item,'disabled',true)
- if (item.prop === "remark"){
- this.$set(item,'disabled',false)
- }
- })
- this.optionAgent.column.forEach(item=>{
- this.$set(item,'disabled',true)
- if (item.prop === "remark"){
- this.$set(item,'disabled',false)
- }
- })
- }else {
- this.$set(this.optionForm,'disabled',false)
- this.findObject(this.optionForm.column, "status").disabled = true
- this.$set(this.optionBox,'disabled',false)
- if (this.optionBox.column){
- this.findObject(this.optionBox.column, "status").disabled = true
- }
- this.$set(this.optionAgent,'disabled',false)
- if (this.optionAgent.column){
- this.findObject(this.optionAgent.column, "status").disabled = true
- }
- }
- }
- }
- },
- data() {
- return {
- dialogVisible:false,
- option:{},
- treeOption: {
- nodeKey: "id",
- lazy: true,
- treeLoad: function (node, resolve) {
- const parentId = node.level === 0 ? 0 : node.data.id;
- getDeptLazyTree({
- parentId: parentId,
- corpType: customerParameter.code
- }).then(res => {
- resolve(
- res.data.data.map(item => {
- return {
- ...item,
- leaf: !item.hasChildren
- };
- })
- );
- });
- },
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "value",
- children: "children"
- }
- },
- dataList:[],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0
- },
- dialogFull: false,
- checkDialog:false,
- checkScheduleDialog:false,
- checkId: '',
- batchNo:'',
- line:'',
- key:0,
- selection:[],
- checkData: {},
- fullscreenLoading: false,
- optionForm: {
- submitBtn: false,
- emptyBtn: false,
- span: 6,
- column: [{
- label: '发布日期',
- prop: 'releaseTime',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- value:dateFormat(new Date, 'yyyy-MM-dd hh:mm:ss'),
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '截止日期',
- prop: 'deadlineTime',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '合同号',
- prop: 'contractNo',
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '状态',
- disabled:true,
- prop: 'status',
- dataType: "number",
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '起运港',
- prop: 'departureHarbor',
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-client/port/allList",
- props: {
- label: "name",
- value: "name"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '目的港',
- prop: 'objectiveHarbor',
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-client/port/allList",
- props: {
- label: "name",
- value: "name"
- },
- change:(data)=>{
- allList().then(res=>{
- for (let item of res.data.data){
- if (data.value == item.name){
- this.line = item.line
- }
- }
- })
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '起运地',
- prop: 'departureLand',
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-client/port/allList",
- props: {
- label: "name",
- value: "name"
- }
- }, {
- label: '目的地',
- prop: 'objectiveLand',
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-client/port/allList",
- props: {
- label: "name",
- value: "name"
- }
- }, {
- label: '装柜日期',
- prop: 'loadingTime',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '是否直航',
- prop: 'directFlight',
- type: 'select',
- dicData: [{
- label: '是',
- value: 1
- }, {
- label: '否',
- value: 0
- }],
- value:1,
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '转港',
- prop: 'transshipment',
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-client/port/allList",
- props: {
- label: "name",
- value: "name"
- }
- }, {
- label: '运输方式',
- prop: 'transportType',
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=mode_transport",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value:"海运",
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '运输条款',
- prop: 'transportClause',
- value: "CY-CY",
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '件数',
- prop: 'number',
- value:10,
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '包装',
- prop: 'packing',
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value:"木箱",
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '重量(kgs)',
- prop: 'weight',
- value:27000,
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '尺码(cmb)',
- prop: 'size',
- value:18,
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '货物信息',
- prop: 'cargoInformation',
- span: 18,
- value: "GLASS",
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '备注',
- prop: 'remark',
- type: 'textarea',
- span: 24,
- }]
- },
- optionBox:{},
- optionBoxTwo: {
- align: 'center',
- index: true,
- refreshBtn: false,
- addBtn: false,
- addRowBtn: true,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- column: [{
- label: '箱型',
- prop: 'boxType',
- cell: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- index:1,
- }, {
- label: '箱量',
- prop: 'boxAmount',
- cell: true,
- index:2,
- },
- // {
- // label: '海运费',
- // prop: 'seaFreight',
- // cell: true,
- // index:3,
- // }, {
- // label: '起运港箱使费',
- // prop: 'departureHarborFee',
- // cell: true,
- // index:4,
- // }, {
- // label: '目的港箱使费',
- // prop: 'objectiveHarborFee',
- // cell: true,
- // index:5,
- // },
- {
- label: '状态',
- prop: 'status',
- type: 'select',
- dataType: "string",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index:6,
- }, {
- label: '备注',
- prop: 'remark',
- cell: true,
- index:7,
- }]
- },
- optionAgent:{},
- optionAgentTwo: {
- align: 'center',
- index: true,
- refreshBtn: false,
- addBtn: false,
- addRowBtn: true,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- column: [{
- label: '名称',
- prop: 'agentId',
- filterable:true,
- cell: true,
- dicUrl: '/api/blade-client/corpsdesc/bidingCorpsList',
- type: 'select',
- props: {
- label: "cname",
- value: "id"
- },
- index:1,
- }, {
- label: '联系人',
- prop: 'contacts',
- cell: true,
- index:2,
- }, {
- label: '邮箱',
- prop: 'mailbox',
- cell: true,
- index:3,
- }, {
- label: '电话',
- prop: 'phone',
- cell: true,
- index:4,
- }, {
- label: '状态',
- prop: 'status',
- type: 'select',
- dataType: "string",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index:5,
- }, {
- label: '备注',
- prop: 'remark',
- cell: true,
- index:6,
- }]
- },
- optionBid:{},
- optionBidTwo: {
- align: 'center',
- index:true,
- refreshBtn: false,
- addBtn: false,
- addRowBtn: false,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth:140,
- column: [{
- label: '名称',
- prop: 'contrastName',
- index:1,
- }, {
- label: '船公司',
- prop: 'shippingCompany',
- index:2,
- }, {
- label: '船名',
- prop: 'shipName',
- index:3,
- }, {
- label: '箱型',
- prop: 'boxType',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- index:4,
- }, {
- label: '运费',
- prop: 'seaFreight',
- index:5,
- }, {
- label: '截单时间',
- prop: 'cutOffTime',
- index:6,
- }, {
- label: '截港时间',
- prop: 'harborInterceptionTime',
- index:7,
- }, {
- label: '船期',
- prop: 'shippingDate',
- index:8,
- }, {
- label: '起运港箱使天数',
- prop: 'departureHarborFee',
- index:9,
- }, {
- label: '目的港箱使天数',
- prop: 'objectiveHarborFee',
- index:10,
- }, {
- label: '状态',
- prop: 'status',
- type: 'select',
- dataType: "string",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index:11,
- }, {
- label: '备注',
- prop: 'remark',
- cell: true,
- index:12,
- }]
- },
- form: {},
- dataListBox: [],
- dataListAgent: [],
- dataListBid: [],
- param:{},
- checkDisabled:false
- }
- },
- props: {
- id: {
- type: String
- },
- detailData: {
- type: Object
- }
- },
- async created() {
- paramList({
- paramKey:"release.approval",
- current:1,
- size:10
- }).then(res=>{
- for (let item of res.data.data.records){
- if (item.paramKey === "release.approval"){
- this.param = item
- }
- }
- })
- this.option = await this.getColumnData(this.getColumnName(47), option);
- if (this.id) {
- this.refreshData(this.id)
- }
- if (this.detailData.check) {
- this.checkDisabled = true
- this.batchNo = this.detailData.check.batchNo
- }
- this.optionBox = await this.getColumnData(this.getColumnName(201.1), this.optionBoxTwo);
- this.optionAgent = await this.getColumnData(this.getColumnName(201.2), this.optionAgentTwo);
- this.optionBid = await this.getColumnData(this.getColumnName(201.3), this.optionBidTwo);
- this.key++
- },
- methods: {
- nodeClick(data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoad(this.page);
- },
- //确认导出触发
- confirmSelection() {
- for (let item of this.selection){
- this.dataListAgent.push({
- $cellEdit: true,
- agentId:item.id,
- contacts:item.attn,
- phone:item.tel
- })
- }
- this.selection = [];
- this.dialogVisible = false;
- },
- //点击新增时触发
- beforeClose(done) {
- this.parentId = "";
- const column = this.findObject(this.option.column, "parentId");
- column.value = "";
- column.addDisabled = false;
- done();
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- console.log(params);
- this.treeDeptId = "";
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- //搜索重置按钮触发
- searchReset() {
- this.treeDeptId = "";
- this.onLoad(this.page);
- },
- //刷新触发
- refreshChange() {
- this.page = {
- pageSize: 10,
- pagerCount: 5,
- total: 0
- };
- },
- //选中触发
- selectionChange(selection) {
- this.selection = selection;
- },
- //树桩列点击展开触发
- treeLoad(tree, treeNode, resolve) {
- const parentId = tree.id;
- customerList({
- parentId: parentId,
- corpType: this.corpType ? this.corpType : "KH"
- }).then(res => {
- resolve(res.data.data.records);
- });
- },
- onLoad(page, params = { parentId: 0 }) {
- let queryParams = Object.assign({}, params, {
- size: page.pageSize,
- current: page.currentPage,
- corpsTypeId: this.treeDeptId,
- corpType: this.corpType ? this.corpType : "KH",
- line:this.line
- });
- customerList(queryParams).then(res => {
- this.dataList = res.data.data.records;
- this.page.total = res.data.data.total;
- if (this.page.total) {
- this.option.height = window.innerHeight - 500;
- } else {
- this.option.height = window.innerHeight - 200;
- }
- });
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的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("重置成功");
- if (this.form.status > 0){
- this.$set(this.optionForm,'disabled',true)
- this.$set(this.optionBox,'addRowBtn',false)
- this.$set(this.optionAgent,'addRowBtn',false)
- this.optionBox.column.forEach(item=>{
- this.$set(item,'disabled',true)
- if (item.prop === "remark"){
- this.$set(item,'disabled',false)
- }
- })
- this.optionAgent.column.forEach(item=>{
- this.$set(item,'disabled',true)
- if (item.prop === "remark"){
- this.$set(item,'disabled',false)
- }
- })
- }else {
- this.$set(this.optionForm,'disabled',false)
- this.findObject(this.optionForm.column, "status").disabled = true
- this.$set(this.optionBox,'disabled',false)
- this.findObject(this.optionBox.column, "status").disabled = true
- this.$set(this.optionAgent,'disabled',false)
- this.findObject(this.optionAgent.column, "status").disabled = true
- }
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- edit(row){
- if (row.$cellEdit){
- this.$set(row,'$cellEdit',false)
- }else {
- this.$set(row,'$cellEdit',true)
- }
- },
- rowDel(row, index, type) {
- this.$confirm('是否确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if (type === 'box') {
- if (row.id) {
- boxDelete({id: row.id}).then(res => {
- this.dataListBox.splice(index, 1);
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- })
- } else {
- this.dataListBox.splice(index, 1);
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- }
- } else if (type === 'agent') {
- if (row.id) {
- agentDelete({id: row.id}).then(res => {
- this.dataListAgent.splice(index, 1);
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- })
- } else {
- this.dataListAgent.splice(index, 1);
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- }
- }
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- backToList() {
- this.$router.push({
- path: '/bidingDocument/issueTender/index'
- });
- this.$emit('backToList', false)
- },
- // 确认中标
- winningTheBid(row,index){
- this.$confirm('是否确认中标?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- confirmWinningTheBid({id:row.id}).then(res=>{
- this.$message({
- type: 'success',
- message: '确认中标!'
- });
- this.refreshData(this.id)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- // 请核
- pleaseCheck(){
- this.$refs['form'].validate((valid, done) => {
- done()
- if (valid){
- this.$confirm('是否确认请核?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if (new Date(this.form.deadlineTime) < new Date()) return this.$message.error("截止日期不能小于等于当前日期")
- let form = {
- ...this.form,
- itemsList: this.dataListBox,
- agentList: this.dataListAgent,
- contrastList: this.dataListBid
- }
- this.fullscreenLoading = true
- const loading = this.$loading({
- lock: true,
- text: '发布中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- saveSaveList(form).then(res => {
- const data = {
- id: res.data.data.id,
- url: '/bidingDocument/issueTender/index',
- pageStatus: "this.$store.getters.entranceXsStatus"
- }
- confirmPleaseCheck(data).then(res=>{
- this.fullscreenLoading = false
- this.$message({
- type: 'success',
- message: '请核成功!'
- });
- loading.close();
- this.refreshData(this.form.id)
- })
- }).catch(()=>{
- loading.close();
- this.fullscreenLoading = false;
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- }else {
- done()
- }
- })
- },
- // 复制新增
- copyNew(){
- this.$confirm('是否确认复制新增?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.form.status = 0
- this.form.id = ''
- this.dataListBid = []
- this.dataListBox.forEach(item => item.id = '')
- this.dataListAgent.forEach(item => item.id = '')
- this.$set(this.optionForm,'disabled',false)
- this.$set(this.optionBox,'addRowBtn',true)
- this.$set(this.optionAgent,'addRowBtn',true)
- this.optionBox.column.forEach(item=>{
- this.$set(item,'disabled',false)
- })
- this.optionAgent.column.forEach(item=>{
- this.$set(item,'disabled',false)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- // 作废
- toVoid(){
- this.$confirm('是否确认作废?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- confirmVoid({id:this.form.id}).then(res=>{
- this.$message({
- type: 'success',
- message: '作废成功!'
- });
- this.refreshData(this.form.id)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- // 发布
- release(){
- this.$confirm('是否确认发布?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '发布中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- confirmRelease({id:this.form.id}).then(res=>{
- loading.close();
- this.$message({
- type: 'success',
- message: '发布成功!'
- });
- this.refreshData(this.form.id)
- }).catch(()=>{
- loading.close();
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消'
- });
- });
- },
- // 保存
- storage() {
- let form = {
- ...this.form,
- itemsList: this.dataListBox,
- agentList: this.dataListAgent,
- contrastList: this.dataListBid
- }
- this.fullscreenLoading = true
- saveSaveList(form).then(res => {
- this.refreshData(res.data.data.id)
- }).finally(() => {
- this.fullscreenLoading = false
- })
- },
- refreshData(id) {
- let ids = ''
- if (id) {
- ids = id
- } else {
- ids = this.form.id
- }
- this.fullscreenLoading = true
- detailDelegationList({id: ids}).then(res => {
- this.form = res.data.data
- this.dataListBox = this.form.itemsList
- this.dataListAgent = this.form.agentList
- this.dataListBid = this.form.contrastList
- delete this.form.itemsList
- delete this.form.agentList
- delete this.form.contrastList
- this.fullscreenLoading = false
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- ::v-deep .el-form-item {
- margin-bottom: 8px;
- }
- </style>
|