123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <!-- <el-form-item label="业务编号" prop="fBillno">-->
- <!-- <el-input-->
- <!-- v-model="queryParams.fBillno"-->
- <!-- placeholder="请输入业务编号"-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- @keyup.enter.native="handleQuery"-->
- <!-- />-->
- <!-- </el-form-item>-->
- <el-form-item label="客户名称" prop="fCorpid">
- <el-select
- v-model="queryParams.fCorpid"
- filterable
- remote
- clearable
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入客户名称"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="货物品名" prop="fGoodsid">-->
- <!-- <el-select-->
- <!-- v-model="queryParams.fGoodsid"-->
- <!-- filterable-->
- <!-- remote-->
- <!-- clearable-->
- <!-- style="width: 200px"-->
- <!-- :remote-method="goodsRemoteMethod"-->
- <!-- @keyup.enter.native="handleQuery"-->
- <!-- placeholder="请输入货物品名"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="(dict, index) in goodsOptions"-->
- <!-- :key="index.fId"-->
- <!-- :label="dict.fName"-->
- <!-- :value="dict.fId"-->
- <!-- ></el-option>-->
- <!-- </el-select>-->
- <!-- </el-form-item>-->
- <el-form-item label="制单部门" prop="fDeptid">
- <el-input
- v-model="queryParams.fDeptid"
- placeholder="请输入制单部门"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="有效期起" prop="fBegindate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryParams.fBegindate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期起"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="有效期至" prop="fEnddate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryParams.fEnddate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期至"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="协议编号" prop="fContractno">
- <el-input
- v-model="queryParams.fContractno"
- placeholder="请输入协议编号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-row>
- <el-form-item style="float: right;padding: 5px">
- <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-form-item>
- </el-row>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd()"
- v-hasPermi="['agreement:agreementStorage:add']"
- >新增
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['agreement:agreementStorage:export']"
- >导出
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-download"
- size="mini"
- :disabled="single"
- @click="handleUpdate(null,2)"
- v-hasPermi="['agreement:agreementStorage:export']"
- >复制新增
- </el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" border :data="agreementList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center"/>
- <el-table-column label="合同编号" sortable align="center" prop="fContractno" show-overflow-tooltip/>
- <el-table-column label="客户名称" sortable align="center" width="220" prop="fCorpid"/>
- <!-- <el-table-column label="货物品名" align="center" prop="fGoodsid"/>-->
- <el-table-column label="有效期起" sortable align="center" prop="fBegindate" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.fBegindate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="有效期至" sortable align="center" prop="fEnddate" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.fEnddate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="状态" align="center" prop="fId" />-->
- <el-table-column label="是否启用" align="center" prop="fStatus">
- <template slot-scope="scope">
- <el-switch
- v-model="scope.row.fStatus"
- active-value="0"
- inactive-value="1"
- @change="handleStatusChange(scope.row)"
- ></el-switch>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="fBillstatus">
- <template slot-scope="scope">
- <span v-if="scope.row.fBillstatus === '1'">保存</span>
- <span v-else-if="scope.row.fBillstatus === '2'">暂存</span>
- <span v-else-if="scope.row.fBillstatus === '3'">审批驳回</span>
- <span v-else-if="scope.row.fBillstatus === '4'">提交审核</span>
- <span v-else-if="scope.row.fBillstatus === '5'">审核中</span>
- <span v-else-if="scope.row.fBillstatus === '6'">审核完成</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="check_s(scope.row,0)"
- v-hasPermi="['agreement:agreementStorage:edit']"
- >查看
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="check(scope.row,1)"
- v-hasPermi="['agreement:agreementStorage:edit']"
- v-if="scope.row.fBillstatus === '4' || scope.row.fBillstatus === '5'"
- >审批进度
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row,1)"
- v-hasPermi="['agreement:agreementStorage:edit']"
- v-if="scope.row.fBillstatus < 4"
- >修改
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-if="scope.row.fBillstatus < 4"
- v-hasPermi="['agreement:agreementStorage:remove']"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改仓储费对话框 -->
- <el-dialog
- v-dialogDrag
- :fullscreen="dialogFull"
- :title="title"
- :visible.sync="open" width="65%"
- append-to-body
- :show-close="colseButton"
- >
- <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 class="avue-crud__dialog__menu enlarge" @click="full">
- <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
- </div>
- </div>
- </template>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px"
- style="display: flex;flex-wrap: wrap;"
- >
- <el-form-item label="客户名称" prop="fCorpid">
- <el-select
- :disabled="notChange"
- v-model="form.fCorpid"
- filterable
- clearable
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- placeholder="请输入客户名称"
- remote
- :remote-method="corpsRemoteMethod"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="制单部门">
- <el-input v-model="deptName" :disabled="true" placeholder="请输入制单部门" style="width: 200px"/>
- </el-form-item>
- <el-form-item label="有效期起" prop="fBegindate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.fBegindate"
- type="date"
- :disabled="notChange"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期起"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="有效期至" prop="fEnddate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.fEnddate"
- :disabled="notChange"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期至"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="合同编号" prop="fContractno">
- <el-input v-model="form.fContractno" :disabled="notChange" placeholder="请输入合同编号" style="width: 200px"/>
- </el-form-item>
- <el-form-item label="商品类别" prop="tPackages">
- <el-select v-model="form.tPackages" :disabled="notChange" placeholder="请选择商品类别" multiple>
- <el-option
- v-for="(dict, index) in fTypeidOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- style="width: 210px;"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="仓库" prop="fWarehouseid" v-if="showWarehouse == '0'">
- <el-select v-model="form.fWarehouseid" :disabled="notChange" placeholder="请选择仓库库区" multiple>
- <el-option
- v-for="(item, index) in warehouseOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- style="width: 210px;"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <el-button type="primary" @click="submit" :disabled="notChange">请 核</el-button>
- <div class="dialogTableTitle flex a-center jlr">
- <h2>收款</h2>
- <el-button @click="getList_s('C')" :disabled="notChange">新增</el-button>
- </div>
- <el-table v-loading="loading_s" border :data="agreementitemsList" @selection-change="handleSelectionChange">
- <!-- <el-table-column type="selection" width="55" align="center"/>-->
- <el-table-column label="行号" align="center" type="index" fixed="left"/>
- <el-table-column
- prop="fFeeunitid"
- header-align="center"
- align="center"
- width="125px"
- label="计价单位"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeunitid"
- placeholder="请选择计价单位"
- @change="changeFeeUnit(scope.row)"
- clearable
- :disabled="browseStatus"
- >
- <el-option
- v-for="(dict, index) in jFeetunitOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="开始天数" align="center" width="90">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fFromdays"
- placeholder="请输入开始天数"
- oninput='value = value.replace(/[^\d.]/g,"")'
- clearable
- size="small"
- :disabled="notChange"
- />
- </template>
- </el-table-column>
- <el-table-column label="结束天数" align="center" width="90">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fEndays"
- placeholder="请输入结束天数"
- oninput='value = value.replace(/[^\d.]/g,"")'
- clearable
- size="small"
- :disabled="notChange"
- />
- </template>
- </el-table-column>
- <el-table-column label="单价" align="center" width="90">
- <el-input
- slot-scope="scope"
- v-model="scope.row.fPrice"
- placeholder="请输入单价"
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
- clearable
- size="small"
- :disabled="notChange"
- />
- </el-table-column>
- <el-table-column label="录入人" align="center" width="120">
- <el-input
- slot-scope="scope"
- v-model="scope.row.createBy"
- :disabled="true"
- placeholder="默认录入人"
- clearable
- size="small"
- />
- </el-table-column>
- <el-table-column label="录入时间" align="center" width="150">
- <el-input
- slot-scope="scope"
- v-model="scope.row.createTime"
- placeholder="默认录入时间"
- :disabled="true"
- clearable
- size="small"
- />
- </el-table-column>
- <el-table-column
- prop="fFeeid"
- header-align="center"
- align="center"
- width="180px"
- label="费用名称"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- remote
- :disabled="browseStatus"
- :remote-method="fWRemoteMethod"
- placeholder="费用名称"
- >
- <el-option
- v-for="(dict, index) in fWbuOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- :disabled="browseStatus"
- @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 付款-->
- <!-- <div class="dialogTableTitle flex a-center jlr">-->
- <!-- <h2>付款</h2>-->
- <!-- <el-button @click="getList_s('D')" :disabled="notChange">新增</el-button>-->
- <!-- </div>-->
- <!-- <el-table v-loading="loading_f" :data="agreementitemsListD" @selection-change="handleSelectionChange">-->
- <!-- <!– <el-table-column type="selection" width="55" align="center"/>–>-->
- <!-- <el-table-column label="行号" align="center" type="index"/>-->
- <!-- <el-table-column-->
- <!-- prop="fFeeunitid"-->
- <!-- header-align="center"-->
- <!-- align="center"-->
- <!-- width="180px"-->
- <!-- label="计价单位"-->
- <!-- >-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-select-->
- <!-- v-model="scope.row.fFeeunitid"-->
- <!-- placeholder="请选择计价单位"-->
- <!-- @change="changeFeeUnit(scope.row)"-->
- <!-- clearable-->
- <!-- :disabled="browseStatus"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="(dict, index) in jFeetunitOptions"-->
- <!-- :key="index.dictValue"-->
- <!-- :label="dict.dictLabel"-->
- <!-- :value="dict.dictValue"-->
- <!-- />-->
- <!-- </el-select>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="开始天数" align="center">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-input-->
- <!-- v-model="scope.row.fFromdays"-->
- <!-- placeholder="请输入开始天数"-->
- <!-- oninput='value = value.replace(/[^\d.]/g,"")'-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- :disabled="notChange"-->
- <!-- />-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="结束天数" align="center">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-input-->
- <!-- v-model="scope.row.fEndays"-->
- <!-- placeholder="请输入结束天数"-->
- <!-- oninput='value = value.replace(/[^\d.]/g,"")'-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- :disabled="notChange"-->
- <!-- />-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="单价" align="center">-->
- <!-- <el-input-->
- <!-- slot-scope="scope"-->
- <!-- v-model="scope.row.fPrice"-->
- <!-- placeholder="请输入单价"-->
- <!-- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- :disabled="notChange"-->
- <!-- />-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="录入人" align="center">-->
- <!-- <el-input-->
- <!-- slot-scope="scope"-->
- <!-- v-model="scope.row.createBy"-->
- <!-- :disabled="true"-->
- <!-- placeholder="默认录入人"-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- />-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="录入时间" align="center">-->
- <!-- <el-input-->
- <!-- slot-scope="scope"-->
- <!-- v-model="scope.row.createTime"-->
- <!-- placeholder="默认录入时间"-->
- <!-- :disabled="true"-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- />-->
- <!-- </el-table-column>-->
- <!-- <el-table-column-->
- <!-- prop="fFeeid"-->
- <!-- header-align="center"-->
- <!-- align="center"-->
- <!-- width="180px"-->
- <!-- label="费用名称"-->
- <!-- >-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-select-->
- <!-- v-model="scope.row.fFeeid"-->
- <!-- filterable-->
- <!-- remote-->
- <!-- :disabled="browseStatus"-->
- <!-- :remote-method="fWRemoteMethod"-->
- <!-- placeholder="费用名称"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="(dict, index) in fWbuOptions"-->
- <!-- :key="index.fId"-->
- <!-- :label="dict.fName"-->
- <!-- :value="dict.fId"-->
- <!-- ></el-option>-->
- <!-- </el-select>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-button-->
- <!-- size="mini"-->
- <!-- type="text"-->
- <!-- icon="el-icon-delete"-->
- <!-- :disabled="browseStatus"-->
- <!-- @click.native.prevent="deleteRow(scope.$index, agreementitemsListD)"-->
- <!-- >删除-->
- <!-- </el-button>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- </el-table>-->
- <!-- 附件明细-->
- <div class="dialogTableTitle flex a-center jlr">
- <h2>附件明细</h2>
- <el-button @click="addRelevt" :disabled="notChange">新增</el-button>
- </div>
- <el-table
- :data="relevantAttachments"
- ref="table"
- tooltip-effect="dark"
- stripe
- style="width: 100%"
- >
- <el-table-column label="序号" type="index" width="80"></el-table-column>
- <el-table-column
- prop="fName"
- header-align="center"
- align="center"
- label="附件名称"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fName"
- :disabled="browseStatus"
- placeholder="附件名称"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fDesc"
- header-align="center"
- align="center"
- label="附件描述"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fDesc"
- :disabled="browseStatus"
- placeholder="附件描述"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fUrl"
- header-align="center"
- align="center"
- label="上传附件"
- >
- <template slot-scope="scope">
- <div style="display: flex; justify-content: center">
- <el-upload
- class="upload-demo"
- :action="uploadImgUrl"
- :on-success="
- (res, file) => {
- handleSucces(scope, res, file);
- }
- "
- :headers="headers"
- :disabled="browseStatus"
- :show-file-list="false"
- :limit="1"
- >
- <el-button size="small" type="text" :disabled="browseStatus"
- >点击上传</el-button
- >
- </el-upload>
- <el-button size="small" type="text" @click="checkFile(scope)"
- >查看</el-button
- >
- </div>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- label="操作"
- width="130PX"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- @click.native.prevent="deleteUploadRow(scope.$index, relevantAttachments)"
- :disabled="browseStatus"
- size="small"
- type="text"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
- <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
- <el-button v-if="approve === true" @click="goApproval('f_billstatus')">审批</el-button>
- <el-button type="danger" @click="backApproval('f_billstatus')" v-if="form.fBillstatus === '4' && operator === lander">撤销审批</el-button>
- <el-button type="info" v-if="form.fBillstatus >= 3" @click="addOrUpdateHandle('f_billstatus')">查看审批流</el-button>
- <el-button type="success" @click="backrRconciliation" v-if="form.fBillstatus === '6'">撤销请核</el-button>
- <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
- <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
- <el-button v-if="cancelButton === false" @click="homePage">取消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import {
- RevocationApproval,
- backFee,
- PleaseCheck,
- listAgreements,
- getAgreement,
- delAgreement,
- addAgreement,
- updateAgreement_s,
- exportAgreement,
- listAgreementitems,
- queryUserVal
- } from '@/api/warehouseBusiness/agreement'
- import { listCorps } from '@/api/basicdata/corps'
- import { listGoods } from '@/api/basicdata/goods'
- import { delWarehousebills } from '@/api/warehouseBusiness/warehouseInStock'
- import { listGoodsTransfer } from '@/api/warehouseBusiness/goodsTransfer'
- import { listFees } from '@/api/basicdata/fees'
- import { changeUserStatus } from '@/api/system/user'
- import AddOrUpdate from '@/views/viewApproval'
- import ApprovalComments from '@/views/startApproval'
- import Global from '@/layout/components/global'
- import Vue from 'vue'
- // import { listUser, queryUserVal } from '@/api/system/user'
- import { getToken } from "@/utils/auth";
- import {
- listWarehousesss,
- } from "@/api/basicdata/warehouse";
- 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: 'Agreement',
- components: {
- AddOrUpdate,
- ApprovalComments
- },
- data() {
- return {
- dialogFull:false,
- addOrEdid:1,
- idCopy:'',
- colseButton:true,
- cancelButton:true,
- // 审批状态
- approve:false,
- addOrUpdateVisible: false,
- addOrUpdateVisib:false,
- notChange: false,
- dataList: '',
- value_s: [],
- // 遮罩层
- loading: true,
- loading_s: false,
- loading_f: false,
- browseStatus: false,
- // 计价单位
- jFeetunitOptions: [],
- agreementId: 310,
- goodsOptions: [],
- fTypeidOptions: [],
- // 选中数组
- ids: [],
- deptName: '',
- // 客户(客户数据)
- fMblnoOptions: [],
- fFeeunitidOptions: [],
- fWbuOptions: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 仓储费表格数据
- agreementList: [],
- // 仓库
- warehouseOptions: [],
- showWarehouse: null,
- // 弹出层标题
- title: '',
- add: '',
- // 是否显示弹出层
- open: false,
- // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典
- fStltypeidOptions: [],
- // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典
- tPackagesOptions: [],
- // 贸易方式,对应t_trademodels 字典
- fTrademodeidOptions: [],
- // 仓储费收款明细表表格数据
- agreementitemsList: [],
- //仓储费付款明细表表格数据
- agreementitemsListD: [],
- // 操作人
- operator: '',
- lander: '',
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- fBillno: null,
- fDeptid: null,
- fContractno: null,
- fCorpid: null,
- fStltypeid: null,
- fGoodsid: null,
- fFeetypeid: null,
- tPackages: null,
- fTrademodeid: null,
- fFreedays: null,
- fBegindate: null,
- fEnddate: null,
- fBillstatus: null,
- fStatus: null
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- fBillno: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ],
- fCorpid: [
- { required: true, message: ' ', trigger: 'blur' }
- ],
- tPackages:[
- { required: true, message: ' ', trigger: 'blur' }
- ],
- fBegindate:[
- { required: true, message: ' ', trigger: 'blur' }
- ],
- fEnddate:[
- { required: true, message: ' ', trigger: 'blur' }
- ],
- fWarehouseid: [
- { required: true, message: ' ', trigger: 'blur' }
- ],
- },
- // 附件上传数组
- relevantAttachments: [],
- headers: {
- Authorization: "Bearer " + getToken(),
- },
- uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
- }
- },
- created() {
- this.getList()
- // console.log(fMblnoOptions)
- listCorps().then(response => {
- this.fMblnoOptions = response.rows
- })
- listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
- this.warehouseOptions = response.rows;
- });
- this.getDicts('data_settlement_method').then(response => {
- this.fStltypeidOptions = response.data
- })
- this.getDicts('data_package_unit').then(response => {
- this.tPackagesOptions = response.data
- })
- this.getDicts('data_trademodes').then(response => {
- this.fTrademodeidOptions = response.data
- })
- this.getDicts('data_goods_category').then(response => {
- this.fTypeidOptions = response.data
- })
- this.getDicts("data_unitfees").then(response => {
- this.jFeetunitOptions = response.data;
- });
- this.getConfigKey("agreement.warehouse").then((response) => {
- this.showWarehouse = response.msg;
- });
- this.register()
- },
- activated(){
- this.Jump()
- },
- methods: {
- full(){
- this.dialogFull = !this.dialogFull
- },
- //复制新增按钮
- handleCopy(){
- getAgreement().then(response => {
- })
- },
- homepaGe(){
- let view = {
- fullPath: "/agreement/agreementStorage",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "AgreementStorage",
- params: Object,
- path: "/agreement/agreementStorage",
- query: Object,
- title: "仓储费协议"
- }
- this.$router.push({ path: '/index'})
- this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
- if (this.isActive(view)) {
- this.toLastView(visitedViews, view)
- }
- })
- Global.$emit("removeCache", "closeSelectedTag", view);
- },
- homePage() {
- this.open = false
- let view = {
- fullPath: "/agreement/agreementStorage",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "AgreementStorage",
- params: Object,
- path: "/agreement/agreementStorage",
- query: Object,
- title: "仓储费协议"
- }
- this.$router.push({ path: '/index' })
- this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
- if (this.isActive(view)) {
- this.toLastView(visitedViews, view)
- }
- })
- Global.$emit("removeCache", "closeSelectedTag", view);
- },
- Jump(){
- this.approval = this.$route.query.data
- if(this.approval) {
- this.approval = JSON.parse(this.approval)
- this.colseButton = false
- this.hide = false
- this.open = true
- this.notChange = true
- this.approve = true
- this.cancelButton = false
- this.reset()
- getAgreement(this.approval.billId).then(response => {
- this.deptName = response.data.dept?response.data.dept.deptName: ''
- this.form = response.data.tWarehouseAgreement
- //--
- // this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- this.fWbuOptions = response.data.feesList
- // this.add = row
- this.open = true
- this.browseStatus = true
- })
- }
- },
- goApproval(status){
- this.addOrUpdateVisib = true
- this.$nextTick(() => {
- this.$refs.ApprovalComments.init(this.form.fId,status,this.agreementId)
- })
- },
- returnData(){
- this.addOrUpdateVisib = false
- this.open = false
- this.homepaGe()
- },
- getDataList(){
- this.addOrUpdateVisible = false
- },
- // 查看审批流
- addOrUpdateHandle(status) {
- this.addOrUpdateVisible = true
- this.addOrUpdateVisib = false
- let id = '448'
- let actId = '110'
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(this.form.fId, this.agreementId,status)
- })
- },
- register() {
- queryUserVal().then((response) => {
- this.lander = response.user.userName
- })
- },
- check_s(row, res) {
- this.notChange = true
- this.browseStatus = true
- this.relevantAttachments = []
- this.register()
- getAgreement(row.fId).then(response => {
- // this.$set(this,'fMblnoOptions',response.data.corps)
- if (response.data.dept) {
- this.deptName = response.data.dept.deptName
- }
- this.form = response.data.tWarehouseAgreement
- if (response.data.attachList) {
- this.relevantAttachments = response.data.attachList
- } else {
- this.relevantAttachments = []
- }
- if (response.data.tWarehouseAgreement.tPackages) {
- // this.form.tPackages = this.form.tPackages
- // .replace(/\[|]/g, "")
- // .replace(/\"/g, "")
- // .split(",");
- this.form.tPackages = JSON.parse(this.form.tPackages)
- }
- if (response.data.tWarehouseAgreement.fWarehouseid) {
- this.form.fWarehouseid = JSON.parse(this.form.fWarehouseid)
- }
- this.operator = this.form.createBy
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.add = row
- this.title = '修改仓储费'
- this.open = true
- })
- },
- // 查看按钮
- check(row, res) {
- this.notChange = true
- this.browseStatus = true
- this.register()
- getAgreement(row.fId).then(response => {
- // this.fMblnoOptions = response.data.corps
- // this.deptName = response.data.dept.deptName
- this.deptName = response.data.dept?response.data.dept.deptName: ''
- this.form = response.data.tWarehouseAgreement
- this.operator = this.form.createBy
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.add = row
- this.title = '修改仓储费'
- this.open = true
- })
- },
- //撤销审批
- backApproval(status) {
- let data = {
- id: this.form.fId,
- actId: this.agreementId,
- billId: this.form.fId,
- fidStatus: status,
- }
- RevocationApproval(data).then(data => {
- if (data.code === 200) {
- this.$message.success('撤销成功')
- this.open = false
- this.getList()
- }
- })
- },
- // 撤销请核
- backrRconciliation() {
- let formData = new window.FormData()
- // 附件数据
- formData.append('agreement', JSON.stringify(this.form))
- formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
- backFee(formData).then(response => {
- this.msgSuccess('撤销成功')
- this.open = false
- this.getList()
- })
- },
- // 请核按钮
- submit() {
- if (this.agreementitemsList.length <= 0) {
- this.$message.error('仓储费协议明细为空,无法操作')
- return false
- }
- for (let agr = 0; agr < this.agreementitemsList.length; agr ++) {
- if (!this.agreementitemsList[agr].fFeeunitid) {
- this.$message.error('请维护仓储费明细计价单位')
- return false
- }
- if (!this.agreementitemsList[agr].fFromdays) {
- this.$message.error('请维护仓储费明细开始天数')
- return false
- }
- if (!this.agreementitemsList[agr].fEndays) {
- this.$message.error('请维护仓储费明细结束天数')
- return false
- }
- if (this.agreementitemsList[agr].fPrice.length === 0) {
- this.$message.error('请维护仓储费明细单价')
- return false
- }
- if (!this.agreementitemsList[agr].fFeeid) {
- this.$message.error('请维护仓储费明细费用名称')
- return false
- }
- }
- this.$refs['form'].validate(valid => {
- if (valid) {
- let formData = new window.FormData()
- formData.append('agreement', JSON.stringify(this.form))
- formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
- formData.append('attachments', JSON.stringify(this.relevantAttachments))
- PleaseCheck(formData).then(response => {
- this.msgSuccess('请核成功')
- this.open = false
- this.getList()
- })
- }
- })
- },
- // 仓储费状态修改
- handleStatusChange(row) {
- if(row.fBillstatus == '6'){
- let text = row.fStatus === '0' ? '启用' : '停用'
- this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', '警告', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function() {
- return updateAgreement_s(row.fId, row.fStatus)
- }).then(() => {
- this.msgSuccess(text + '成功')
- }).catch(function() {
- row.fStatus = row.fStatus === '0' ? '1' : '0'
- })
- }else{
- row.fStatus = 0
- this.$message.error('审核完成时才能启用');
- }
- },
- /** 创建仓储费明细表列表 */
- getList_s(payment) {
- queryUserVal().then((response) => {
- if (payment === 'C') {
- this.agreementitemsList.push({
- //行号
- fLineno: '',
- //计价单位
- fFeeunitid: '',
- //费用名称
- fFeeid: '',
- //开始天数
- fFromdays: '',
- //结束天数
- fEndays: '',
- //单价
- fPrice: '',
- //录入人
- createBy: response.user.userName,
- //创建时间
- createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
- })
- } else {
- this.agreementitemsListD.push({
- //行号
- fLineno: '',
- //计价单位
- fFeeunitid: '',
- //费用名称
- fFeeid: '',
- //开始天数
- fFromdays: '',
- //结束天数
- fEndays: '',
- //单价
- fPrice: '',
- //录入人
- createBy: response.user.userName,
- //创建时间
- createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
- })
- }
- // this.$set("deptName", response.dept.deptName);
- this.deptName = response.dept?response.dept.deptName: ''
- this.form.fDeptid = response.dept? response.dept.deptId: ''
- this.agreementitemsList.createBy = response.user.userName
- // this.$set(this.agreementitemsList, "createBy", response.user.userName);
- //格式化时间戳
- // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
- })
- listAgreementitems(this.queryParams).then(response => {
- })
- },
- /* 远程模糊查询商品 */
- goodsRemoteMethod(name) {
- if (name == null || name === '') {
- return false
- }
- let queryParams = { pageNum: 1, pageSize: 10, fName: name }
- listGoods(queryParams).then((response) => {
- this.goodsOptions = response.rows
- })
- },
- // 计价单位
- fFeeunitidFormat(row, column) {
- return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid)
- },
- /** 查询仓储费列表 */
- getList() {
- this.loading = true
- listAgreements(this.queryParams).then(response => {
- this.agreementList = response.rows
- this.total = response.total
- this.loading = false
- })
- },
- // 远程模糊查询费用名称
- fWRemoteMethod(name) {
- this.fWbuOptions = []
- if (name == null || name === '') {
- return false
- }
- let queryParams = { fName: name }
- listFees(queryParams).then((response) => {
- this.fWbuOptions = response.rows
- })
- },
- // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
- fStltypeidFormat(row, column) {
- return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
- },
- // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
- tPackagesFormat(row, column) {
- return this.selectDictLabel(this.tPackagesOptions, row.tPackages)
- },
- // 贸易方式,对应t_trademodels 字典翻译
- fTrademodeidFormat(row, column) {
- return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
- },
- // 取消按钮
- cancel() {
- this.open = false
- this.reset()
- this.getList()
- this.agreementitemsList = []
- },
- handleClose() {
- this.open = false
- this.reset()
- this.getList()
- this.agreementitemsList = []
- },
- // 表单重置
- reset() {
- this.form = {
- fId: null,
- fBillno: null,
- fDeptid: null,
- fContractno: null,
- fCorpid: null,
- fStltypeid: null,
- fGoodsid: null,
- fFeetypeid: null,
- tPackages: null,
- fTrademodeid: null,
- fFreedays: null,
- fBegindate: null,
- fEnddate: null,
- fBillstatus: null,
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- remark: null
- }
- this.resetForm('form')
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1
- this.getList()
- },
- // 变更计价单位
- changeFeeUnit(row) {
- if (!row.fFeeUnitid) {
- return false
- }
- if (row.fFeeUnitid === '0') {
- this.$set(row, 'fQty', this.fCntqty)
- } else if (row.fFeeUnitid === '1') {
- this.$set(row, 'fQty', this.fGrossweight)
- }
- if (row.fUnitprice) {
- this.$set(
- row,
- 'fAmount',
- parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
- )
- }
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm('queryForm')
- this.handleQuery()
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.fId)
- this.idCopy = this.ids[0]
- this.single = selection.length !== 1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.form = {}
- this.agreementitemsList = []
- this.agreementitemsListD = []
- this.reset()
- // this.agreementitemsList = {
- // fFeeunitid:'',
- // fFromdays:'',
- // fEndays:'',
- // fPrice:'',
- // fFeeid:''
- // }
- this.open = true
- this.browseStatus = false
- this.notChange = false
- this.title = '添加仓储费'
- queryUserVal().then((response) => {
- // this.$set("deptName", response.dept.deptName);
- this.deptName = response.dept?response.dept.deptName: ''
- this.form.fDeptid = response.dept? response.dept.deptId: ''
- // this.agreementitemsList.createBy = response.user.userName
- // this.$set(this.agreementitemsList, "createBy", response.user.userName);
- //格式化时间戳
- // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
- })
- },
- /** 修改按钮操作 */
- handleUpdate(row,num) {
- this.relevantAttachments = []
- if (num === 2){
- this.notChange = false
- getAgreement(this.idCopy).then(response => {
- // this.deptName = response.data.dept.deptName
- this.deptName = response.data.dept?response.data.dept.deptName: ''
- this.form = response.data.tWarehouseAgreement
- this.form.fId = null
- this.form.fBillstatus = ''
- if (response.data.tWarehouseAgreement.tPackages) {
- this.form.tPackages = this.form.tPackages
- .replace(/\[|]/g, "")
- .replace(/\"/g, "")
- .split(",");
- }
- if (response.data.tWarehouseAgreement.fWarehouseid) {
- this.form.fWarehouseid = JSON.parse(this.form.fWarehouseid)
- }
- // this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- this.fWbuOptions = response.data.feesList
- this.add = row
- this.open = true
- this.title = '新增仓储费'
- })
- }else {
- this.notChange = false
- this.browseStatus = false
- const fId = row.fId || this.ids
- getAgreement(fId).then(response => {
- // this.deptName = response.data.dept.deptName
- this.deptName = response.data.dept?response.data.dept.deptName: ''
- this.form = response.data.tWarehouseAgreement
- if (response.data.tWarehouseAgreement.tPackages) {
- this.form.tPackages = this.form.tPackages
- .replace(/\[|]/g, "")
- .replace(/\"/g, "")
- .split(",");
- }
- if (response.data.tWarehouseAgreement.fWarehouseid) {
- this.form.fWarehouseid = JSON.parse(this.form.fWarehouseid)
- }
- // this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- if (response.data.attachList) {
- this.relevantAttachments = response.data.attachList
- } else {
- this.relevantAttachments = []
- }
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- this.fWbuOptions = response.data.feesList
- let queryParams = { fName: name }
- listFees(queryParams).then((response) => {
- this.fWbuOptions = response.rows
- })
- this.add = row
- this.open = true
- this.title = '修改仓储费'
- })
- }
- },
- /** 远程模糊查询用户 */
- corpsRemoteMethod(name) {
- if (name == null || name === '') {
- return false
- }
- let queryParams = { pageNum: 1, fName: name, type: 1 }
- listCorps(queryParams).then((response) => {
- this.fMblnoOptions = response.rows
- this.KHblnoOptions = response.rows
- })
- },
- debounce(fn, delay) {
- let timerId = null;
- return function () {
- let self = this;
- let args = arguments;
- timerId && clearTimeout(timerId);
- timerId = setTimeout(function () {
- fn.apply(self, args);
- }, delay || 1000);
- }
- },
- /** 保存按钮 */
- submitForm() {
- if(this.addOrEdid == 2){
- this.$set(this.form, 'fId', null)
- }
- this.$refs['form'].validate(valid => {
- if (valid) {
- let formData = new window.FormData()
- formData.append('agreement', JSON.stringify(this.form))
- formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
- formData.append('attachments', JSON.stringify(this.relevantAttachments))
- addAgreement(formData).then(response => {
- this.msgSuccess('操作成功')
- this.$set(this.form, 'fId', response.data.tWarehouseAgreement.fId)
- this.$set(this.form, 'fBillsStatus', response.data.tWarehouseAgreement.fBillsStatus)
- })
- }
- })
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const fIds = row.fId || this.ids
- this.$confirm('是否确认删除仓储费编号为"' + fIds + '"的数据项?', '警告', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function() {
- return delAgreement(fIds)
- }).then(() => {
- this.getList()
- this.msgSuccess('删除成功')
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams
- this.$confirm('是否确认导出所有仓储费数据项?', '警告', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function() {
- return exportAgreement(queryParams)
- }).then(response => {
- this.download(response.msg)
- })
- },
- deleteRow(index, rows) {
- rows.splice(index, 1)
- },
- // 新增附件明细数据
- addRelevt() {
- this.relevantAttachments.push({
- fUrl: null,
- fName: null,
- createBy: this.createBy,
- createTime: Date.parse(new Date()),
- });
- console.log(this.relevantAttachments)
- },
- //附件上传
- handleSucces(scope, res, file) {
- this.relevantAttachments[scope.$index].fName = res.fileName;
- this.relevantAttachments[scope.$index].fUrl = res.url;
- if (!this.relevantAttachments[scope.$index].fUrl) {
- this.$message.error("上传失败");
- } else {
- this.$message.success("上传成功");
- }
- },
- //附件查看
- checkFile(scope) {
- if (this.relevantAttachments[scope.$index].fUrl) {
- console.log(this.relevantAttachments[scope.$index].fUrl)
- window.open(this.relevantAttachments[scope.$index].fUrl);
- } else {
- this.$message.error("请上传附件");
- }
- },
- deleteUploadRow(index, rows) {
- rows.splice(index, 1);
- },
- }
- }
- </script>
- <style lang="scss">
- .avue-crud__dialog__header {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- justify-content: space-between;
- }
- .el-dialog__title {
- color: rgba(0,0,0,.85);
- font-weight: 500;
- word-wrap: break-word;
- }
- .avue-crud__dialog__menu {
- padding-right: 20px;
- float: left;
- }
- .avue-crud__dialog__menu i {
- color: #909399;
- font-size: 15px;
- }
- .el-icon-full-screen{
- cursor: pointer;
- }
- .el-icon-full-screen:before {
- content: "\e719";
- }
- </style>
|