12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481 |
- <template>
- <el-dialog
- :title="title"
- :visible.sync="showDialog"
- width="80%"
- @close="handleClose"
- :close-on-click-modal="false"
- >
- <span>
- <el-form ref="form" :model="form" label-width="110px">
- <!-- <span style="font-size: 20px" v-if="form.billKind == 'NN'"> 直单 </span>-->
- <!-- <span style="font-size: 20px" v-if="form.billKind == 'MM'"> 主单 </span>-->
- <!-- <span style="font-size: 20px" v-if="form.billKind == 'MH'"> 从单 </span>-->
- <el-row>
- <el-col :span="6">
- <el-form-item label="车号" prop="carregNo">
- <el-input
- v-model="form.carregNo"
- placeholder="请输入车号"
- :disabled="true"
- size="small"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="司机" prop="driverName">
- <el-input
- v-model="form.driverName"
- placeholder="请输入司机"
- :disabled="true"
- size="small"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="运输性质" prop="transProp">
- <el-select
- v-model="form.transProp"
- placeholder="请选择运输方式"
- :disabled="true"
- size="small"
- style="width: 100%"
- >
- <el-option
- v-for="(dict, index) in transPropList"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="运单号" prop="orderNo">
- <el-input
- v-model="form.orderNo"
- placeholder="请输入运单号"
- size="small"
- style="width: 100%"
- v-input-limit="2"
- disabled
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="6">
- <el-form-item label="客户名称" prop="fCorpId">
- <el-select
- v-model="form.fCorpId"
- placeholder="请输入客户名称"
- :clearable="true"
- filterable
- size="small"
- style="width: 100%"
- :disabled="true"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="业务类型" prop="billType">
- <el-select
- v-model="form.billType"
- placeholder="请选择业务类型"
- :disabled="true"
- size="small"
- style="width: 100%"
- >
- <el-option
- v-for="(dict, index) in billTypeList"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="提单号" prop="mblno">
- <el-input
- v-model="form.mblno"
- placeholder="请输入提单号"
- :disabled="true"
- size="small"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="装车地点" prop="tLoadAddr">
- <el-input
- v-model="form.tLoadAddr"
- placeholder="请输入装车地点"
- :disabled="true"
- size="small"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="卸车地点" prop="unLoadAddr">
- <el-input
- v-model="form.tUnLoadAddr"
- placeholder="请输入卸车地点"
- :disabled="true"
- size="small"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-collapse v-model="collapselist">
- <el-collapse-item name="1">
- <template slot="title">
- <span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
- >原业务费用信息</span>
- </template>
- <el-table :data="feesList" style="width: 100%">
- <el-table-column
- prop="fCorpid"
- label="结算单位"
- align="center"
- width="180"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fCorpid"
- placeholder="请输入客户名称"
- :clearable="true"
- filterable
- size="mini"
- style="width: 160px"
- :disabled="true"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeid"
- label="费用名称"
- align="center"
- width="120"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- :disabled="true"
- remote
- placeholder="费用名称"
- >
- <el-option
- v-for="(dict, index) in fCNameOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="fDc" label="收付" align="center" width="100">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fDc"
- placeholder="请选择"
- :disabled="true"
- >
- <el-option label="收" value="D"></el-option>
- <el-option label="付" value="C"></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeunitid"
- label="计费单位"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeunitid"
- placeholder="请选择计费单位"
- :disabled="true"
- clearable
- >
- <el-option
- v-for="dict in jFeetunitOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fBillingQty"
- label="计费数量"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fBillingQty"
- :disabled="true"
- placeholder="请输入内容"
- @input="total(scope.row)"
- v-input-limit="2"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="fUnitprice"
- label="单价"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fUnitprice"
- :disabled="true"
- placeholder="请输入内容"
- @input="total(scope.row)"
- v-input-limit="2"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="fCurrency"
- label="币种"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fCurrency"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="fExrate" label="汇率" align="center" width="100">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fExrate"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="fAmount" label="金额" align="center" width="100">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fAmount"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="fTaxrate"
- label="税率"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fTaxrate"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="remarks" label="备注" align="center" width="180">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.remarks"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="remarks" label="费用来源" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.actId == 1080">费用确认</span>
- <span v-if="scope.row.actId == 1090">追加费用</span>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- fixed="right"
- width="100px"
- >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- :disabled="disabled"
- @click.native.prevent="change(scope)"
- >变更</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-collapse-item>
- <el-collapse-item name="2">
- <template slot="title">
- <span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
- >更改费用信息</span>
- </template>
- <div>
- <div style="display: flex; justify-content: space-between; margin: 10px 0">
- <div>
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="addRelevtTwo"
- :disabled="form.orderStatus < 80"
- >保存</el-button>
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="addRelevt2"
- :disabled="form.orderStatus < 80"
- >提交请核</el-button>
- </div>
- </div>
- </div>
- <el-table :data="formfeesList" style="width: 100%">
- <el-table-column
- prop="fCorpid"
- label="结算单位"
- align="center"
- width="180"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fCorpid"
- placeholder="请输入客户名称"
- :clearable="true"
- filterable
- size="mini"
- style="width: 160px"
- :disabled="true"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeid"
- label="费用名称"
- align="center"
- width="120"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- :disabled="true"
- remote
- placeholder="费用名称"
- >
- <el-option
- v-for="(dict, index) in fCNameOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="fDc" label="收付" align="center" width="100">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fDc"
- placeholder="请选择"
- :disabled="true"
- >
- <el-option label="收" value="D"></el-option>
- <el-option label="付" value="C"></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeunitid"
- label="计费单位"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeunitid"
- placeholder="请选择计费单位"
- :disabled="true"
- clearable
- >
- <el-option
- v-for="dict in jFeetunitOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fBillingQty"
- label="计费数量"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fBillingQty"
- :disabled="true"
- placeholder="请输入内容"
- @input="total(scope.row)"
- v-input-limit="2"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="fUnitprice"
- label="单价"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fUnitprice"
- :disabled="true"
- placeholder="请输入内容"
- @input="total(scope.row)"
- v-input-limit="2"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="fCurrency"
- label="币种"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fCurrency"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="fExrate" label="汇率" align="center" width="100">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fExrate"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="fAmount" label="金额" align="center" width="100">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fAmount"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="fTaxrate"
- label="税率"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fTaxrate"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="remarks" label="费用来源" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.actId == 1080">费用确认</span>
- <span v-if="scope.row.actId == 1090">追加费用</span>
- </template>
- </el-table-column>
- <el-table-column prop="remarks" label="录入人" align="center"></el-table-column>
- <el-table-column prop="remarks" label="录入日期" align="center"></el-table-column>
- <el-table-column prop="remarks" label="审核人" align="center"></el-table-column>
- <el-table-column prop="remarks" label="审核日期" align="center"></el-table-column>
- <el-table-column prop="remarks" label="备注" align="center" width="180">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.remarks"
- :disabled="true"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- fixed="right"
- width="140px"
- >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- :disabled="form.orderStatus < 80"
- @click.native.prevent="deleteRow(scope,scope.$index)"
- >删除</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- :disabled="form.orderStatus < 80"
- @click.native.prevent="deleteRow(scope,scope.$index)"
- >请核</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-collapse-item>
- </el-collapse>
- </span>
- <span slot="footer" class="dialog-footer">
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- @click="submitForm('acceptDate')"-->
- <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
- <!-- :disabled="form.billStatus == 7"-->
- <!-- >接 单</el-button-->
- <!-- >-->
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- @click="submitForm('loadDate')"-->
- <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
- <!-- :disabled="form.billStatus == 7"-->
- <!-- >提 箱</el-button-->
- <!-- >-->
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- @click="submitForm('mdLoadDate')"-->
- <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
- <!-- :disabled="form.billStatus == 7"-->
- <!-- >装卸货</el-button-->
- <!-- >-->
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- @click="submitForm('unLoadDate')"-->
- <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
- <!-- :disabled="form.billStatus == 7"-->
- <!-- >还卸柜</el-button-->
- <!-- >-->
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- @click="submitForm('waybillDate')"-->
- <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
- <!-- :disabled="form.billStatus == 7"-->
- <!-- >回 单</el-button-->
- <!-- >-->
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- @click="driversubmitForm"-->
- <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
- <!-- :disabled="form.billStatus == 7"-->
- <!-- >提 交</el-button-->
- <!-- >-->
- <el-button
- type="success"
- @click="submitAllowChanges"
- v-hasPermi="['fleet:vehicleStatus:edit']"
- :disabled="form.orderStatus <= 80"
- >修 改</el-button
- >
- <el-button
- type="info"
- @click="addRelevtTwo"
- v-hasPermi="['fleet:vehicleStatus:edit']"
- :disabled="form.orderStatus <= 80"
- >保 存</el-button
- >
- <!-- <el-button type="warning" @click="submitRetreat">撤 回</el-button> -->
- <el-button @click="showDialog = false">取 消</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import {
- removeFtmsorderbillscars,
- driverSaveFtmsorderbillscars,
- insertDriverFtmsorderbillscars,
- deleteList
- } from "@/api/fleet/ftmsorderbillscarstwo";
- import {getBasicInformation} from "@/api/kaihe/basicdata/container";
- import {listGoods} from "@/api/basicdata/goods";
- import {listCorps} from "@/api/basicdata/corps";
- import {listFees} from "@/api/basicdata/fees";
- import UploadFile from "@/components/Uploadfile";
- import {
- submit,
- changeFees,
- revokeFees,
- deleteFees,
- driverSubmit,
- } from "@/api/track/singleCost";
- import Cookies from "js-cookie";
- import {getToken} from "@/utils/auth";
- import {addStowageTwo} from "../../../api/fleet/ftmsorderbillscarstwo";
- export default {
- name: "plans",
- props: {
- addOrUpdateVisible: {
- type: Boolean,
- default: false,
- },
- title: {
- type: String,
- required: "",
- },
- form: Object,
- carsTable: Object,
- DList: {
- type: Array,
- default: [],
- },
- CList: {
- type: Array,
- default: [],
- },
- disabled: Boolean,
- relevantAttachments: {
- type: Array,
- default: [],
- },
- feesList: {
- type: Array,
- default: () => [],
- },
- formfeesList: {
- type: Array,
- default: () => [],
- },
- allfMblnoOptions: {
- type: Array,
- default: [],
- },
- },
- components: {
- UploadFile,
- },
- data() {
- return {
- chiFeesList: [],
- // 控制弹出框显示隐藏
- showDialog: false,
- billTypeList: [],
- transTypeList: [],
- transPropList: [],
- goodsLossTypeList: [],
- cntrIdList: [],
- priceTypeList: [],
- userType: null,
- username: null,
- collapses: [],
- fMblnoOptions: [],
- fMblnoOptions2: [],
- cntrId2List: [],
- goodsOptions: [],
- collapselist: ["1", "2"],
- fWbuOptions: [],
- ffeeunitidList: [],
- polList: [],
- podList: [],
- uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
- headers: {
- Authorization: "Bearer " + getToken(),
- },
- jFeetunitOptions: [],
- detailsHidden: false,
- fCNameOptions: []
- };
- },
- created() {
- this.getDicts("data_unitfees").then((response) => {
- if (response.data) {
- this.jFeetunitOptions = response.data;
- }
- });
- this.getDicts("data_billType").then((response) => {
- this.billTypeList = response.data;
- });
- this.getDicts("data_transType").then((response) => {
- this.transTypeList = response.data;
- });
- this.getDicts("data_transProp").then((response) => {
- this.transPropList = response.data;
- });
- this.getDicts("data_goodsLossType").then((response) => {
- this.goodsLossTypeList = response.data;
- });
- this.getDicts("data_cntrId").then((response) => {
- response.data.map((e) => (e.noOption = false));
- this.cntrIdList = response.data;
- });
- this.getDicts("data_priceType").then((response) => {
- this.priceTypeList = response.data;
- });
- this.getDicts("data_ffeeunitid").then((response) => {
- this.ffeeunitidList = response.data;
- });
- getBasicInformation({
- fTypes: 1,
- fStatus: "T",
- }).then((response) => {
- this.polList = response;
- this.podList = response;
- });
- listCorps().then((response) => {
- this.fMblnoOptions = response.rows;
- });
- listFees().then((response) => {
- this.fCNameOptions = response.rows;
- });
- listGoods().then((response) => {
- this.goodsOptions = response.rows;
- });
- listFees().then((response) => {
- this.fWbuOptions = response.rows;
- });
- this.userType = Cookies.get("userType");
- this.username = Cookies.get("userName");
- },
- methods: {
- //变更按钮
- change(scope){
- console.log(scope)
- for (let item in this.formfeesList){
- if (scope.row.fId === this.formfeesList[item].fId) return this.$message({
- showClose: true,
- message: '已有相同单据',
- type: 'error'
- });
- }
- this.formfeesList.push(scope.row)
- },
- // 新增附件上传
- addRelevt4() {
- this.chiFeesList.push({
- actId: "1090",
- fCorpid: this.form.fCorpId,
- fFeeid: "",
- fDc: "",
- fFeeunitid: "1",
- fBillingQty: 0,
- fUnitprice: 0,
- fCurrency: "RMB",
- fTaxrate: null,
- fAmount: 0,
- fExrate: 1,
- remarks: "",
- });
- },
- // 新增附件上传
- addRelevt() {
- this.relevantAttachments.push({
- attachUrl: null,
- attachName: null,
- createBy: this.username,
- createTime: Date.parse(new Date()),
- });
- },
- //附件删除
- deleteFile(scope) {
- this.relevantAttachments[scope.$index].attachName = "";
- this.relevantAttachments[scope.$index].attachUrl = "";
- if (this.relevantAttachments[scope.$index].attachUrl === "") {
- this.$message.success("删除成功");
- } else {
- this.$message.error("未知错误,删除失败");
- }
- },
- //附件查看
- checkFile(scope) {
- if (this.relevantAttachments[scope.$index].attachUrl) {
- window.open(this.relevantAttachments[scope.$index].attachUrl);
- } else {
- this.$message.error("请上传附件");
- }
- },
- //附件上传
- handleSucces(scope, res, file) {
- this.relevantAttachments[scope.$index].attachName = res.fileName;
- this.relevantAttachments[scope.$index].attachUrl = res.url;
- if (this.relevantAttachments[scope.$index].attachUrl === "") {
- this.$message.error("上传失败");
- } else {
- this.$message.success("上传成功");
- }
- },
- // 添加行
- addRow(tableData, event) {
- var obj = {};
- tableData.push(obj);
- },
- addDListRow(tableData, event) {
- var obj = {
- fcorpid: this.form.fCorpId,
- fcurrency: "RMB",
- fPid: this.form.id,
- fExrate: "1",
- };
- tableData.push(obj);
- },
- //內容删除
- deleteRow(rows,index) {
- deleteList(rows.row.fId).then(res =>{
- console.log(res);
- this.formfeesList.splice(index, 1);
- })
- },
- // 上传成功返回数据
- showFile(row) {
- for (let list in this.relevantAttachments) {
- this.$set(this.relevantAttachments[list], "attachUrl", row.url);
- this.$set(this.relevantAttachments[list], "attachName", row.fileName);
- }
- },
- addRelevtTwo(){
- let formData = new window.FormData();
- formData.append("status", "6");
- formData.append("cars", JSON.stringify(this.form));
- formData.append("ftmsorderbillsfees", JSON.stringify(this.formfeesList));
- addStowageTwo(formData).then((response) => {
- if (response.code == 200) {
- this.msgSuccess("保存成功");
- this.$parent.getList();
- // this.$parent.getSave(response);
- }
- });
- },
- addRelevt2() {
- let arr = this.chiFeesList;
- arr.filter((e) => e.actId == "1080");
- if (arr.length > 0) {
- this.$confirm("已生成费用信息, 是否重新生成?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.chiFeesList = this.chiFeesList.filter(
- (e) => e.fBillstatus == 6 || e.actId != "1080"
- );
- console.log(this.chiFeesList);
- this.addRelevt3();
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消",
- });
- });
- } else {
- this.addRelevt3();
- }
- },
- addRelevt3() {
- if (this.form.oilAmt > 0) {
- this.fFeeid52 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 52 && e.actId == 1080) {
- this.fFeeid52 = false;
- }
- });
- if (this.fFeeid52) {
- this.chiFeesList.push({
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 52,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.oilAmt,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.oilAmt,
- fExrate: 1,
- remarks: null,
- });
- }
- }
- if (this.form.driverbonus > 0) {
- this.fFeeid53 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 53 && e.actId == 1080) {
- this.fFeeid53 = false;
- }
- });
- if (this.fFeeid53) {
- this.chiFeesList.push({
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 53,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.driverbonus,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.driverbonus,
- fExrate: 1,
- remarks: null,
- });
- }
- }
- if (this.form.costOth > 0) {
- this.fFeeid54 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 54 && e.actId == 1080) {
- this.fFeeid54 = false;
- }
- });
- if (this.fFeeid54) {
- this.chiFeesList.push({
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 54,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costOth,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costOth,
- fExrate: 1,
- remarks: null,
- });
- }
- }
- if (this.form.costomAmt03 > 0) {
- this.fFeeid55 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 55 && e.actId == 1080) {
- this.fFeeid55 = false;
- }
- });
- if (this.fFeeid55) {
- this.chiFeesList.push(
- {
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 55,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt03,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt03,
- fExrate: 1,
- remarks: null,
- },
- {
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 55,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt03,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt03,
- fExrate: 1,
- remarks: null,
- }
- );
- }
- }
- if (this.form.costomAmt04 > 0) {
- this.fFeeid56 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 56 && e.actId == 1080) {
- this.fFeeid56 = false;
- }
- });
- if (this.fFeeid56) {
- this.chiFeesList.push(
- {
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 56,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt04,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt04,
- fExrate: 1,
- remarks: null,
- },
- {
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 56,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt04,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt04,
- fExrate: 1,
- remarks: null,
- }
- );
- }
- }
- if (this.form.costomAmt02 > 0) {
- this.chiFeesList.map((e) => {
- this.fFeeid57 = true;
- if (e.fFeeid == 57 && e.actId == 1080) {
- this.fFeeid57 = false;
- }
- });
- if (this.fFeeid57) {
- this.chiFeesList.push(
- {
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 57,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt02,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt02,
- fExrate: 1,
- remarks: null,
- },
- {
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 57,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt02,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt02,
- fExrate: 1,
- remarks: null,
- }
- );
- }
- }
- if (this.form.costomAmt05 > 0) {
- this.fFeeid58 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 58 && e.actId == 1080) {
- this.fFeeid58 = false;
- }
- });
- if (this.fFeeid58) {
- this.chiFeesList.push(
- {
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 58,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt05,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt05,
- fExrate: 1,
- remarks: null,
- },
- {
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 58,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt05,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt05,
- fExrate: 1,
- remarks: null,
- }
- );
- }
- }
- if (this.form.costomAmt06 > 0) {
- this.fFeeid59 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 59 && e.actId == 1080) {
- this.fFeeid59 = false;
- }
- });
- if (this.fFeeid59) {
- this.chiFeesList.push(
- {
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 59,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt06,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt06,
- fExrate: 1,
- remarks: null,
- },
- {
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 59,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt06,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt06,
- fExrate: 1,
- remarks: null,
- }
- );
- }
- }
- if (this.form.costomAmt01 > 0) {
- this.fFeeid60 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 60 && e.actId == 1080) {
- this.fFeeid60 = false;
- }
- });
- if (this.fFeeid60) {
- this.chiFeesList.push(
- {
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 60,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt01,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt01,
- fExrate: 1,
- remarks: null,
- },
- {
- actId: "1080",
- fCorpid: this.form.driverUserId,
- fFeeid: 60,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.costomAmt01,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.costomAmt01,
- fExrate: 1,
- remarks: null,
- }
- );
- }
- }
- if (this.form.freightPriceCr > 0 || this.form.freightPriceDr > 0) {
- this.fFeeid61 = true;
- this.chiFeesList.map((e) => {
- if (e.fFeeid == 61 && e.actId == 1080) {
- this.fFeeid61 = false;
- }
- });
- if (this.fFeeid61 && this.form.freightPriceDr > 0) {
- this.chiFeesList.push({
- actId: "1080",
- fCorpid: this.form.fCorpId,
- fFeeid: 61,
- fDc: "D",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.freightPriceDr,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.freightPriceDr,
- fExrate: 1,
- remarks: null,
- });
- }
- if (this.fFeeid61 && this.form.freightPriceCr > 0) {
- this.chiFeesList.push({
- actId: "1080",
- fCorpid: this.form.carcorPid,
- fFeeid: 61,
- fDc: "C",
- fFeeunitid: "6",
- fBillingQty: 1,
- fUnitprice: this.form.freightPriceCr,
- fCurrency: "RMB",
- fTaxrate: 3,
- fAmount: this.form.freightPriceCr,
- fExrate: 1,
- remarks: null,
- });
- }
- } else {
- this.$message.error("未找到运输费用,请确认是否已添加");
- }
- },
- // 弹出框关闭后触发
- handleClose() {
- // 子组件调用父组件方法,并传递参数
- this.$emit("changeShow", "false");
- this.cntrIdList.forEach((item) => (item.noOption = false));
- this.collapses = [];
- },
- /** 提交按钮 */
- submitForm(butType) {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.costOth > 0 && !this.form.costRemarks) {
- return this.$message.error("请输入花销备注");
- }
- if (this.form.costomAmt02 > 0 && !this.form.costomStr02) {
- return this.$message.error("请输入费用备注");
- }
- if (this.form.costomAmt01 > 0 && !this.form.costomStr01) {
- return this.$message.error("请输入费用备注");
- }
- this.DList.map((e) => {
- return (e.fDc = "D");
- });
- this.CList.map((e) => {
- return (e.fDc = "C");
- });
- let formData = new window.FormData();
- formData.append("cars", JSON.stringify(this.form));
- formData.append("attachs", JSON.stringify(this.relevantAttachments));
- formData.append("operationType", butType);
- insertDriverFtmsorderbillscars(formData).then((response) => {
- if (response.code == 200) {
- this.$set(this.form, "orderStatus", response.data.orderStatus);
- this.msgSuccess("提交成功");
- this.$parent.getList();
- }
- });
- }
- });
- },
- //修改
- submitFix() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- }
- });
- },
- //保存
- submitSave() {
- let formData = new window.FormData();
- formData.append("cars", JSON.stringify(this.form));
- formData.append("attachs", JSON.stringify(this.relevantAttachments));
- formData.append("fees", JSON.stringify(this.chiFeesList));
- formData.append("operationType", "unLoadDate");
- driverSaveFtmsorderbillscars(formData).then((response) => {
- if (response.code == 200) {
- this.msgSuccess("保存成功");
- this.$parent.getList();
- // this.$parent.getSave(response);
- }
- });
- },
- //撤回
- submitRetreat() {
- },
- //修改
- submitAllowChanges() {
- console.log(this.form.orderStatus)
- if (this.form.orderStatus < 80) {
- this.$emit("fixDisabled", "false");
- this.msgSuccess("允许修改");
- } else {
- this.msgSuccess("不允许修改");
- }
- },
- driversubmitForm() {
- if (this.chiFeesList.length == 0) {
- return this.$message.error("确认费用不能为空");
- }
- if (this.form.orderStatus < 60) {
- return this.$message.error("该运单未回单,请先回单");
- }
- let formData = new window.FormData();
- formData.append("cars", JSON.stringify(this.form));
- formData.append("attachs", JSON.stringify(this.relevantAttachments));
- formData.append("fees", JSON.stringify(this.chiFeesList));
- driverSubmit(formData).then((response) => {
- if (response.code == 200) {
- this.msgSuccess("提交成功");
- this.showDialog = false;
- this.$parent.getList();
- }
- });
- },
- addFees(row) {
- if (row.fBillstatus == 1) {
- row.fBillstatus = 6;
- }
- if (row.fBillstatus == 6) {
- return this.$message.error("已提交,请勿重复提交");
- }
- let formDatae = new window.FormData();
- formDatae.append("status", 6);
- formDatae.append("cars", JSON.stringify(this.form));
- formDatae.append("ftmsorderbillsfees", JSON.stringify(row));
- submit(formDatae).then((response) => {
- if (response.code == 200) {
- this.$message.success("提交成功");
- this.$set(row, "fId", response.data.ftmsorderbillsfeesList.fId);
- this.$set(
- row,
- "fBillstatus",
- response.data.ftmsorderbillsfeesList.fBillstatus
- );
- }
- });
- },
- fixFees(row) {
- if (row.fBillstatus == 0) {
- return this.$message.error("已进行变更,请勿重复点击");
- }
- if (row.fId) {
- changeFees(row.fId).then((response) => {
- if (response.code == 200) {
- this.$message.success("允许修改");
- this.$set(row, "fBillstatus", 1);
- }
- });
- }
- },
- delFees(index, rows, row) {
- if (row.fBillstatus == 2 || row.fBillstatus == 3) {
- deleteFees(row.fId).then((response) => {
- if (response.code == 200) {
- rows.splice(index, 1);
- this.$message.success("删除成功");
- }
- });
- } else if (!row.fBillstatus) {
- rows.splice(index, 1);
- this.$message.success("删除成功");
- } else {
- this.$message.error("不允许删除");
- }
- },
- revokeFees(row) {
- revokeFees(row.fId).then((response) => {
- if (response.code == 200) {
- this.$message.success("撤销成功");
- this.$set(row, "fBillstatus", 3);
- }
- });
- },
- //单条订单调度提交
- addscarsRow(row) {
- },
- delscarsRow(index, rows, row) {
- if (row.billStatus != 6 && row.id != null) {
- removeFtmsorderbillscars(row).then((response) => {
- if (response.code == 200) {
- rows.splice(index, 1);
- this.msgSuccess("成功删除");
- }
- });
- } else {
- rows.splice(index, 1);
- }
- },
- revokescarsRow(index, rows, row) {
- },
- changescarsRow(row) {
- },
- total(row) {
- console.log(row);
- if (row.fQty && row.fUnitprice) {
- this.$set(row, "fAmount", (row.fQty * row.fUnitprice).toFixed(2));
- } else {
- this.$set(row, "fAmount", 0);
- }
- },
- },
- watch: {
- // 监听 addOrUpdateVisible 改变
- addOrUpdateVisible(oldVal, newVal) {
- this.showDialog = this.addOrUpdateVisible;
- },
- feesList(newVal, oldVal) {
- console.log(newVal)
- this.chiFeesList = newVal;
- },
- },
- computed: {
- sortchiFeesList() {
- return sortByKey(this.chiFeesList, "fDc");
- },
- },
- };
- function sortByKey(array, key) {
- return array.sort(function (a, b) {
- var x = a[key];
- var y = b[key];
- return x > y ? -1 : x < y ? 1 : 0;
- });
- }
- </script>
|