1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122 |
- <template>
- <!-- 添加或修改项目信息对话框 -->
- <div class="el-drawer__wrapper">
- <el-drawer :title="title" v-model="visible" direction="rtl" size="100%">
- <div class="page-container form-container">
- <div class="form-btns-container">
- <span class="title-label"
- ><el-icon>
- <Document />
- </el-icon>
- 合同信息</span
- >
- <el-button
- v-if="form.verifyStatus == 0 && !editStatus"
- type="warning"
- size="small"
- icon="Edit"
- @click="editStatus = true"
- >修改</el-button
- >
- <el-button
- v-if="form.id && editStatus"
- type="info"
- size="small"
- icon="Close"
- @click="
- () => {
- editStatus = false;
- getForm();
- }
- "
- >取消修改</el-button
- >
- <el-button
- v-if="form.id"
- type="success"
- size="small"
- icon="refresh"
- @click="getForm"
- >
- 刷新
- </el-button>
- <el-button
- v-show="form.id && !editStatus && form.verifyStatus == 0"
- v-hasPermi="['business:archive:order:verify']"
- type="primary"
- size="small"
- icon="check"
- @click="verifyHandler"
- >审核通过</el-button
- >
- <el-button
- v-show="form.id && !editStatus && form.verifyStatus == 0"
- v-hasPermi="['business:archive:order:verify']"
- type="danger"
- size="small"
- icon="back"
- @click="rejectHandler"
- >驳回</el-button
- >
- <el-button
- v-show="form.alterNumber > 0 && !editStatus"
- v-hasPermi="['business:archive:order:history']"
- type="info"
- size="small"
- icon="Notebook"
- @click="showHistoryList"
- >历史记录</el-button
- >
- <div class="screen-btn" @click="handleScreen">
- <template v-if="!isFullscreen">
- <i class="fa fa-window-maximize" aria-hidden="true" />
- <!-- <span>全屏</span> -->
- </template>
- <template v-else>
- <i class="fa fa-window-restore" aria-hidden="true" />
- <!-- <span>还原</span> -->
- </template>
- </div>
- <div class="close-btn" @click="cancel">
- <i class="fa fa-times" aria-hidden="true" />
- <!-- <span>关闭</span> -->
- </div>
- </div>
- <div
- class="Y-scrollbar"
- style="
- position: absolute;
- top: 32px;
- bottom: 0;
- width: 100%;
- overflow: auto;
- "
- ></div>
- <el-form
- ref="orderRef"
- class="master-container"
- size="small"
- :model="form"
- :rules="rules"
- label-width="100px"
- >
- <el-row :gutter="30">
- <el-col :span="6">
- <el-form-item label="合同编号" prop="contractNo">
- <el-input
- v-if="editStatus && type !== 'alterOrder'"
- v-model="form.contractNo"
- placeholder="请输入合同编号"
- width="100px"
- />
- <span v-else>{{ form.contractNo }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="合同类型" prop="contractType">
- <el-radio-group
- v-if="editStatus || type == 'alterOrder'"
- v-model="form.contractType"
- @change="contractTypeChangeHandler"
- >
- <el-radio :label="0">新签</el-radio>
- <el-radio :label="1">续签</el-radio>
- </el-radio-group>
- <span v-else>{{
- form.contractType === 0 ? "新签" : "续签"
- }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="客户名称" prop="companyId">
- <template v-if="editStatus && type !== 'alterOrder'">
- <el-autocomplete
- :fetch-suggestions="querySearchCompanyAsync"
- :trigger-on-focus="true"
- v-model="form.companyName"
- placeholder="请输入客户名称"
- popper-class="my-autocomplete"
- clearable
- @clear="handleClearCompany"
- @select="handleSelectCompany"
- style="width: 100%"
- >
- <template #append>
- <el-button icon="Plus" @click="showAddCompanyDialog">
- </el-button>
- </template>
- <template #default="{ item }">
- <div
- style="
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- "
- >
- <div class="name" style="font-size: 12px">
- {{ item.name }}
- </div>
- </div>
- </template>
- </el-autocomplete>
- <!-- <el-button @click="showAddCompanyDialog">
- <el-icon class="el-input__icon">
- <plus />
- </el-icon>
- </el-button> -->
- </template>
- <span v-else>{{ form.companyName }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="签约日期" prop="formDate">
- <el-date-picker
- v-if="editStatus && type !== 'alterOrder'"
- clearable
- v-model="form.formDate"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="请选择签约日期"
- >
- </el-date-picker>
- <span v-else>{{ form.formDate }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="签单人" prop="signerName">
- <el-autocomplete
- v-if="editStatus && type !== 'alterOrder'"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- style="width: 100%"
- v-model="form.signerName"
- placeholder="请输入签单人"
- popper-class="my-autocomplete"
- @select="handleSelectEmployee"
- >
- <template #default="{ item }">
- <div
- style="
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- "
- >
- <div class="name" style="font-size: 12px">
- {{ item.nickName }}
- </div>
- <span
- class="code"
- style="font-size: 10px; color: darkgrey"
- >{{ item.userName }}</span
- >
- </div>
- </template>
- </el-autocomplete>
- <span v-else>{{ form.signerName }}</span>
- </el-form-item>
- </el-col>
- <el-col v-if="form.verifyStatus === 4" :span="6">
- <el-form-item label="驳回原因" prop="verifyRemark">
- <span>{{ form.verifyRemark }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8" style="width: 100%">
- <el-form-item
- label="来源"
- prop="sourceCategoryName"
- style="width: 100%"
- >
- <CustomerFormCom
- ref="CustomerFormComRef"
- :edit-status="editStatus && type !== 'alterOrder'"
- :form-data="form"
- :source-categories="sourceCategories"
- />
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="客户标签" prop="customerLabelId">
- <span >{{ selectedOptionLabel }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="甲方" prop="boss">
- <el-input
- v-if="editStatus"
- v-model="form.boss"
- style="width: 100%; margin: 0; padding: 0"
- placeholder="请输入甲方"
- />
- <span v-else>{{ form.boss }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="14">
- <el-form-item label="备注" prop="remark">
- <el-input
- v-if="editStatus"
- v-model="form.remark"
- show-word-limit
- maxlength="200"
- style="width: 100%; margin: 0; padding: 0"
- placeholder="请输入备注"
- type="textarea"
- :rows="2"
- />
- <span v-else>{{ form.remark }}</span>
- </el-form-item>
- </el-col>
- <br />
- <el-col :span="24">
- <el-tabs
- v-model="form.serviceType"
- size="small"
- class="demo-tabs"
- @tab-change="handleServiceTypeClick"
- >
- <el-tab-pane :disabled="!editStatus" label="循环服务" :name="1">
- <el-row>
- <el-col :span="24">
- <el-checkbox-group
- :disabled="!editStatus"
- v-model="loops"
- @change="(arg) => changeDetails('loop', arg)"
- >
- <el-checkbox
- v-for="(item, index) in loopTasks"
- :key="index"
- :label="item.id"
- >{{ item.name }}</el-checkbox
- >
- </el-checkbox-group>
- </el-col>
- <el-col :span="24">
- <el-row
- v-for="(item, index) in loopDetails"
- :key="index"
- style="
- border-radius: 5px;
- border-color: rgba(0, 0, 0, 20%);
- border-style: solid;
- border-width: 1px;
- margin-bottom: 10px;
- "
- >
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="服务项目">
- {{ item.taskTypeName }}
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="月单价">
- <el-input-number
- v-if="editStatus"
- v-model="item.price"
- :precision="2"
- :step="0.1"
- :min="0"
- :controls="false"
- @change="
- (arg) =>
- inputChangeHandler('loop', 'price', item, arg)
- "
- />
- <div v-else>{{ rowNum(item.price) }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="服务月数">
- <el-input-number
- v-if="editStatus"
- v-model="item.serviceNum"
- :step="1"
- step-strictly
- :min="0"
- :controls="false"
- @change="
- (arg) =>
- inputChangeHandler(
- 'loop',
- 'serviceNum',
- item,
- arg
- )
- "
- />
- <div v-else>{{ item.serviceNum }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="赠送月数">
- <el-input-number
- v-if="editStatus"
- v-model="item.freeNum"
- :step="1"
- step-strictly
- :min="0"
- :controls="false"
- @change="
- (arg) =>
- inputChangeHandler(
- 'loop',
- 'freeNum',
- item,
- arg
- )
- "
- />
- <div v-else>{{ item.freeNum }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="优惠金额">
- <el-input-number
- v-if="editStatus"
- v-model="item.discountAmount"
- :precision="2"
- :step="0.1"
- :min="0"
- :controls="false"
- @change="
- (arg) =>
- inputChangeHandler('loop', 'discountAmount', item, arg)
- "
- />
- <div v-else>{{ rowNum(item.discountAmount) }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="合计金额">
- <div>{{ rowNum(item.amount) }}</div>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-top: 18px" v-if="item.taskTypeId ==4">
-
- </el-col>
- <el-col :span="4" style="padding-top: 18px" v-if="item.taskTypeId ==4">
- <el-form-item label="所属区">
- <el-select
- v-if="editStatus"
- v-model="item.belongRegion"
- style="margin-right: 5px"
- >
- <el-option
- v-for="item in belong_region"
- :key="item.value"
- :label="item.label"
- :value="item.id"
- ></el-option>
- </el-select>
- <span v-else>{{item.regionName}}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
-
- <el-divider />
- </el-row>
- </el-tab-pane>
- <el-tab-pane
- :disabled="!editStatus "
- label="代办服务"
- :name="2"
- >
- <el-checkbox-group
- :disabled="!editStatus"
- v-model="onces"
- @change="(arg) => changeDetails('once', arg)"
- >
- <el-checkbox
- v-for="(item, index) in onceTasks"
- :key="index"
- :label="item.id"
- >{{ item.name }}</el-checkbox
- >
- </el-checkbox-group>
- <el-col :span="24">
- <el-row
- v-for="(item, index) in onceDetails"
- :key="index"
- style="
- border-radius: 5px;
- border-color: rgba(0, 0, 0, 20%);
- border-style: solid;
- border-width: 1px;
- margin-bottom: 10px;
- "
- >
- <el-col :span="4" style="padding-top: 18px">
- <el-form-item label="服务项目">
- {{ item.taskTypeName }}
- </el-form-item>
- </el-col>
- <el-col
- v-if="item.payAddress === 1"
- :span="9"
- style="
- padding-top: 18px;
- padding-left: 35px;
- display: flex;
- flex-direction: column;
- margin-bottom: 18px;
- "
- >
- <el-radio-group
- v-if="editStatus"
- v-model="item.addressStyle"
- @change="changeProcesses(item)"
- >
- <el-radio :label="1" style="margin-bottom: 5px">
- <template #default>
- <div
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- "
- >
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- margin-right: 10px;
- "
- >
- 自有地址
- </div>
- <div>
- <el-select
- :disabled="item.addressStyle === 2"
- v-model="item.provinceCode"
- placeholder="省份"
- style="width: 36%"
- @change="handleSelectProvince(item, index)"
- >
- <el-option
- v-for="item in provincesArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- <el-select
- :disabled="item.addressStyle === 2"
- v-model="item.cityCode"
- placeholder="城市"
- style="width: 37%"
- @change="handleSelectCity(item, index)"
- >
- <el-option
- v-for="item in citiesArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- <el-select
- :disabled="item.addressStyle === 2"
- v-model="item.districtCode"
- placeholder="行政区"
- style="width: 37%"
- @change="handleSelectDistrict(item, index)"
- >
- <el-option
- v-for="item in districtsArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- </div>
- </div>
- </template>
- </el-radio>
- <el-radio :label="2" style="margin-bottom: 5px">
- <template #default>
- <div
- style="
- display: flex;
- flex-direction: row;
- width: 325px;
- justify-content: space-between;
- "
- >
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- margin-right: 10px;
- "
- >
- 虚拟地址
- </div>
- <el-select
- :disabled="item.addressStyle !== 2"
- v-model="item.fictionAddressId"
- style="margin-right: 5px"
- >
- <el-option
- v-for="item in virtual_address"
- :key="item.value"
- :label="item.label"
- :value="item.id"
- ></el-option>
- </el-select>
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- "
- >
- 金额:
- </div>
- <el-input-number
- :disabled="item.addressStyle !== 2"
- v-if="editStatus"
- v-model="item.addressAmount"
- :precision="2"
- :step="0.01"
- step-strictly
- :controls="false"
- @change="
- (arg) =>
- inputChangeHandler(
- 'once',
- 'addressAmount',
- item,
- arg
- )
- "
- />
- </div>
- </template>
- </el-radio>
- </el-radio-group>
- <div
- v-else
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- font-size: 12px;
- "
- >
- <div>
- {{
- item.addressStyle === 1
- ? "自有地址"
- : item.addressStyle === 2
- ? "虚拟地址"
- : ""
- }}
- </div>
- <div v-if="item.addressStyle === 1">
- 注册地区:{{ item.province }} - {{ item.city }} -
- {{ item.district }}
- </div>
- <div v-if="item.addressStyle === 2">
- {{ (item.fictionAddress) }}
- </div>
- <div v-if="item.addressStyle === 2">
- 金额:{{ rowNum(item.addressAmount) }}
- </div>
- </div>
- </el-col>
- <el-col
- v-if="item.payAddress === 0"
- :span="9"
- style="
- padding-top: 18px;
- display: flex;
- flex-direction: column;
- margin-bottom: 18px;
- "
- >
- <el-form-item
- v-if="item.taskTypeId === '6'"
- label="变更类型"
- >
- <el-select
- v-if="editStatus"
- v-model="item.alterType"
- style="width: 280px"
- >
- <el-option
- v-for="alter in alterTypes"
- :label="alter.label"
- :key="alter.value"
- :value="alter.value"
- >
- </el-option>
- </el-select>
- <div v-else>{{ item.alterType }}</div>
- </el-form-item>
- <div
- v-if="item.alterType === '跨区变更'"
- style="margin-left: 60px"
- >
- <el-radio-group
- v-if="editStatus"
- v-model="item.addressStyle"
- @change="changeProcesses(item)"
- >
- <el-radio :label="1" style="margin-bottom: 5px">
- <template #default>
- <div
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- "
- >
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- margin-right: 10px;
- "
- >
- 自有地址
- </div>
- <div>
- <el-select
- :disabled="item.addressStyle === 2"
- v-model="item.provinceCode"
- placeholder="省份"
- style="width: 33.33%"
- @change="
- handleSelectProvince(item, index)
- "
- >
- <el-option
- v-for="item in provincesArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- <el-select
- :disabled="item.addressStyle === 2"
- v-model="item.cityCode"
- placeholder="城市"
- style="width: 33.33%"
- @change="handleSelectCity(item, index)"
- >
- <el-option
- v-for="item in citiesArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- <el-select
- :disabled="item.addressStyle === 2"
- v-model="item.districtCode"
- placeholder="行政区"
- style="width: 33.33%"
- @change="
- handleSelectDistrict(item, index)
- "
- >
- <el-option
- v-for="item in districtsArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- </div>
- </div>
- </template>
- </el-radio>
- <el-radio :label="2" style="margin-bottom: 5px">
- <template #default>
- <div
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- "
- >
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- margin-right: 10px;
- "
- >
- 虚拟地址
- </div>
- <el-select
- :disabled="item.addressStyle !== 2"
- v-model="item.fictionAddressId"
- style="margin-right: 5px"
- >
- <el-option
- v-for="item in virtual_address"
- :key="item.value"
- :label="item.label"
- :value="item.id"
- ></el-option>
- </el-select>
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- "
- >
- 金额:
- </div>
- <el-input-number
- :disabled="item.addressStyle !== 2"
- v-if="editStatus"
- v-model="item.addressAmount"
- :precision="2"
- :step="0.01"
- step-strictly
- :controls="false"
- @change="
- (arg) =>
- inputChangeHandler(
- 'once',
- 'addressAmount',
- item,
- arg
- )
- "
- />
- </div>
- </template>
- </el-radio>
- </el-radio-group>
- <div
- v-else
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- font-size: 12px;
- "
- >
- <div>
- {{
- item.addressStyle === 1
- ? "自有地址"
- : item.addressStyle === 2
- ? "虚拟地址"
- : ""
- }}
- </div>
- <div v-if="item.addressStyle === 1">
- 注册地区:{{ item.province }} - {{ item.city }} -
- {{ item.district }}
- </div>
- <div v-if="item.addressStyle === 2">
- {{ item.fictionAddress }}
- </div>
- <div v-if="item.addressStyle === 2">
- 金额:{{ rowNum(item.addressAmount) }}
- </div>
- </div>
- </div>
- <el-form-item v-else label="办理地区">
- <div
- v-if="editStatus"
- style="
- display: flex;
- flex-direction: row;
- width: 280px;
- justify-content: space-between;
- "
- >
- <el-select
- v-model="item.provinceCode"
- placeholder="省份"
- style="width: 33.33%"
- @click.stop="null"
- @change="handleSelectProvince(item, index)"
- >
- <el-option
- v-for="item in provincesArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- <el-select
- v-model="item.cityCode"
- placeholder="城市"
- style="width: 33.33%"
- @change="handleSelectCity(item, index)"
- @click.stop="null"
- >
- <el-option
- v-for="item in citiesArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- <el-select
- v-model="item.districtCode"
- placeholder="行政区"
- style="width: 33.33%"
- @change="handleSelectDistrict(item, index)"
- @click.stop="null"
- >
- <el-option
- v-for="item in districtsArr[index]"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- />
- </el-select>
- </div>
- <div
- v-else
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- "
- >
- {{ item.province }} - {{ item.city }} -
- {{ item.district }}
- </div>
- </el-form-item>
- </el-col>
- <el-col
- :span="7"
- style="padding-top: 18px; margin-bottom: 18px"
- >
- <el-checkbox-group
- :disabled="!editStatus"
- v-model="item.processes"
- @change="(arg) => changeProcesses(item, arg)"
- style="display: flex; flex-direction: column"
- >
- <el-checkbox
- v-for="(process, index) in item.defaultProcesses"
- :key="index"
- :label="process"
- >
- <template #default>
- <div
- style="
- display: flex;
- flex-direction: row;
- width: 300px;
- justify-content: space-between;
- "
- >
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- margin-right: 10px;
- width: 80px;
- "
- >
- {{ process.taskTypeDetailName }}
- </div>
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- "
- >
- 金额:
- </div>
- <el-input-number
- :disabled="
- checkedProcess(
- process.taskTypeDetailId,
- item
- )
- "
- size="small"
- v-if="editStatus"
- v-model="process.amount"
- :precision="2"
- :step="0.01"
- step-strictly
- :controls="false"
- style="width: 100px"
- @click.stop="null"
- @change="
- (arg) =>
- inputChangeHandler(
- 'process',
- 'amount',
- process,
- arg,
- item
- )
- "
- />
- <div
- v-else
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- width: 40px;
- text-align: right;
- "
- >
- {{ rowNum(process.amount) }}
- </div>
- </div>
- </template>
- <!-- {{ process.name }} -->
- </el-checkbox>
- </el-checkbox-group>
- </el-col>
- <el-col
- :span="3"
- style="
- padding-top: 18px;
- display: flex;
- flex-direction: column;
- margin-bottom: 18px;
- "
- >
- <div
- style="
- display: flex;
- flex-direction: row;
- font-size: 12px;
- "
- >
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- margin-left: 10px;
- "
- >
- 总金额:
- </div>
- <div
- style="
- display: inline-block;
- height: 24px;
- line-height: 24px;
- "
- >
- {{ rowNum(item.amount) }}
- </div>
- </div>
- </el-col>
- <el-col :span="4" style="padding-top: 18px">
-
- </el-col>
- <el-col
- v-if="item.taskTypeId == 9 || item.taskTypeId == 8"
- :span="9"
- style="
- padding-top: 18px;
- display: flex;
- flex-direction: column;
- margin-bottom: 18px;
- "
- >
- <el-form-item label="备注" prop="remark">
- <el-input v-model = "item.remark" v-if="editStatus"/>
- <div v-else>{{ item.remark }}</div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- <el-divider />
- </el-tab-pane>
- </el-tabs>
- </el-col>
- <el-col :span="6">
- <el-form-item label="合计:" prop="remark">
- <span>{{ rowNum(form.amount) }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="优惠金额:">
- <span>{{ rowNum(form.discountAmount) }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="实收:">
- <div>{{ rowNum(form.trueAmount) }}</div>
- </el-form-item>
- </el-col>
- <br />
- <el-col :span="24">
- <div class="details-head" style="font-size: 12px">
- <div class="title">
- <i class="fa fa-th-list" aria-hidden="true" /> 合同附件
- </div>
- <div class="details-btns-container" style="display: flex">
- <el-upload
- v-if="editStatus && type != 'alterOrder'"
- action="#"
- :http-request="upload"
- :with-credentials="true"
- :show-file-list="false"
- multiple
- >
- <el-button style="margin-top: 10px; margin-bottom:10px;" size="small" type="primary" icon="Upload"
- >点击上传</el-button>
- </el-upload>
- </div>
- </div>
- <div class="details-body" style="height: 200px">
- <el-table
- ref="filesTable"
- :data="form.files"
- size="small"
- height="100%"
- border
- header-row-class-name="list-header-row"
- >
- <el-table-column
- type="index"
- label="序号"
- width="47"
- align="center"
- />
- <el-table-column
- label="文件名"
- prop="originalFileName"
- align="center"
- >
- <template #default="scope">
- <el-link
- :href="`${baseUrl}${scope.row.fileUrl}`"
- :underline="false"
- target="_blank"
- type="primary"
- >
- {{ scope.row.originalFileName }}
- </el-link>
- </template>
- </el-table-column>
- <el-table-column
- v-if="editStatus && type !== 'alterOrder'"
- label="操作"
- width="70"
- align="center"
- >
- <template #default="scope">
- <el-button
- link
- size="small"
- type="danger"
- @click="handleDelFile(scope.$index)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <br />
- </el-col>
- <el-col
- v-if="editStatus"
- :span="24"
- style="
- text-align: center;
- display: flex;
- flex-direction: row;
- justify-content: center;
- "
- >
- <el-button
- size="small"
- type="primary"
- icon="Finished"
- style="width: 160px"
- @click="submitForm"
- >保存</el-button
- >
- </el-col>
- </el-row>
- <br />
- </el-form>
- </div>
- </el-drawer>
- <el-dialog
- title="驳回详情"
- v-model="rejectOpen"
- width="500px"
- append-to-body
- draggable
- :close-on-click-modal = "false"
- >
- <el-form ref="dictRef" :model="form" label-width="100">
- <el-form-item label="驳回原因" :prop="verifyRemark">
- <el-input
- v-model.trim="form.verifyRemark"
- type="textarea"
- :rows="3"
- placeholder="请输入驳回原因"
- maxlength="200"
- show-word-limit
- />
- </el-form-item>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button
- type="primary"
- icon="Finished"
- size="small"
- @click="verifyUpload(4)"
- >确 定</el-button
- >
- <el-button icon="close" size="small" @click="rejectCancel"
- >取 消</el-button
- >
- </div>
- </template>
- </el-dialog>
- <el-dialog
- title="是否续签"
- v-model="verifyOpen"
- width="600px"
- append-to-body
- draggable
- >
- <el-form ref="dictRef" :model="verifyForm" label-width="380" size="small">
- <el-form-item
- v-for="item in redirectDetails"
- :key="item.id"
- :label="`${item.taskTypeName}上个任务结束月:${item.endMonth}是否重新开始`"
- >
- <el-checkbox v-model="item.redirect" />
- </el-form-item>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button
- type="primary"
- icon="Finished"
- size="small"
- @click="redirectVerify()"
- >确 定</el-button
- >
- <el-button icon="close" size="small" @click="verifyFormClose"
- >取 消</el-button
- >
- </div>
- </template>
- </el-dialog>
- <AddCompanyDialog ref="addCompanyDialogRef" />
- <dialog-history-choice
- ref="historyChoiceRef"
- @choice="historyChoiceHandle"
- />
- </div>
- </template>
- <script setup>
- import { uploadFile } from "@/api/tool/file";
- import { listLableNoPage } from "@/api/business/lable";
- import AddCompanyDialog from "../AddCompanyDialog";
- import match from "@/utils/match";
- import {
- getOrder,
- initTaskTypes,
- addOrder,
- updateOrder,
- verifyOrder,
- alterOrder,
- dissolutionOrder,
- verifyCheckOrder,
- } from "@/api/business/crm/contract";
- import { listSource } from "@/api/settings/source";
- import { listCompany } from "@/api/business/crm/company";
- import { listUser } from "@/api/system/user";
- import CustomerFormCom from "@/components/CustomerFormCom";
- import DialogHistoryChoice from "@/views/dialog/DialogHistoryChoice.vue";
- import { formatDate, rowNum } from "@/utils/index";
- import { ref } from "vue";
- import useUserStore from "@/store/modules/user";
- // import { it } from "element-plus/es/locale";
- const { proxy } = getCurrentInstance();
- const verifyOpen = ref(false);
- const verifyForm = ref({});
- const redirectDetails = ref([]);
- const baseUrl = import.meta.env.VITE_APP_BASE_API;
- const historyChoiceRef = ref(null);
- const alterTypes = ref([
- {
- value: "普通变更",
- label: "普通变更",
- },
- {
- value: "股权变更",
- label: "股权变更",
- },
- {
- value: "减资",
- label: "减资",
- },
- {
- value: "跨区变更",
- label: "跨区变更",
- },
- ]);
- /** 父组件传参 */
- const props = defineProps({
- getList: {
- type: Function,
- default: () => {},
- },
- });
- const { getList } = toRefs(props);
- /** 字典数组区 */
- const { virtual_address } = proxy.useDict("virtual_address");
- const { belong_region } = proxy.useDict("belong_region");
- /** 表单抽屉 页变量 */
- const title = ref("");
- const loading = ref(false);
- const multiple = ref(true);
- const visible = ref(false);
- const editStatus = ref(false);
- const loopTasks = ref([]);
- const onceTasks = ref([]);
- const sourceCategories = ref([]);
- const loops = ref([]);
- const onces = ref([]);
- const type = ref("");
- const addCompanyDialogRef = ref(null);
- const rejectOpen = ref(false);
- // 循环任务明细
- const loopDetails = ref([]);
- // 单次任务明细
- const onceDetails = ref([]);
- const detailEmpty = {
- id: null,
- taskTypeName: "",
- taskTypeId: null,
- serviceNum: undefined,
- freeNum: undefined,
- price: undefined,
- amount: undefined,
- addressStyle: undefined,
- address: undefined,
- fictionAddressId: undefined,
- tenantId: undefined,
- province: "",
- city: "",
- district: "",
- addressStyle: 1,
- provinceId: undefined,
- processes: [],
- defaultProcesses: [],
- };
- //地址数组
- const provincesArr = ref([]);
- const citiesArr = ref([]);
- const districtsArr = ref([]);
- const provinces = ref(proxy.region.getProvinces());
- provinces.value.unshift({ code: "", name: "全部" });
- const cities = ref([]);
- const districts = ref([]);
- const options = ref([]);
- const contractEmpty = {
- serviceType: 1,
- contractType: 0,
- formDate: formatDate(new Date(), "yyyy-MM-dd"),
- signerId: useUserStore().user.userId,
- signerName: useUserStore().user.nickName,
- files: [],
- };
- const isFullscreen = ref(false);
- const webHost = import.meta.env.VITE_APP_BASE_API;
- const data = reactive({
- form: {},
- rules: {
- contractNo: [
- { required: true, message: "合同编号不能为空", trigger: "blur" },
- ],
- companyId: [{ required: true, message: "请选择有效客户", trigger: "blur" }],
- formDate: [
- { required: true, message: "签约日期不能为空", trigger: "blur" },
- ],
- amount: [{ required: true, message: "签约金额不能为空", trigger: "blur" }],
- // signerName: [
- // { required: true, message: "签单人不能为空", trigger: "change" },
- // ],
- contractType: [
- { required: true, message: "合同类型不能为空", trigger: "change" },
- ],
- serviceType: [
- { required: true, message: "任务类型不能为空", trigger: "change" },
- ],
- // sourceCategoryName: [
- // { validator: sourceValidator, trigger: "change" },
- // { required: true, message: "客户来源不能为空", trigger: "change" },
- // ],
- },
- });
- const { form, rules } = toRefs(data);
- /*********************** 方法区 ****************************/
- /** 打开抽屉 */
- function open(id) {
- reset();
-
- visible.value = true;
- if (id) {
- Promise.all([initTaskTypes(), listSource(), getOrder(id)]).then((res) => {
- loopTasks.value = res[0].data.loopTasks;
- onceTasks.value = res[0].data.onceTasks;
- sourceCategories.value = res[1].rows;
- form.value = res[2].data;
- type.value =
- type.value == "" && form.value.status === 8 ? "alterOrder" : type.value;
- parseDetail(form.value.details, form.value);
- // console.log(onceDetails.value)
- editStatus.value = false;
- title.value = "修改订单信息";
- initRegion();
- });
- // getOrder(id).then(response => {
- // })
- } else {
- Promise.all([initTaskTypes(), listSource()]).then((res) => {
- loopTasks.value = res[0].data.loopTasks;
- onceTasks.value = res[0].data.onceTasks;
- sourceCategories.value = res[1].rows;
- });
- editStatus.value = true;
- title.value = "添加订单信息";
- }
- getOption()
- }
- function getOption(){
- listLableNoPage().then(res =>{
- options.value = res.data
- })
- }
- const selectedOptionLabel = computed(() => {
- const selectedOption = options.value.find(option => option.id === form.value.customerLabelId);
- return selectedOption ? selectedOption.lable : '';
- });
- function openSimple(id, optionType) {
- reset();
- visible.value = true;
- type.value = optionType || "";
- if (id) {
- Promise.all([initTaskTypes(), listSource(), getOrder(id)]).then((res) => {
- loopTasks.value = res[0].data.loopTasks;
- onceTasks.value = res[0].data.onceTasks;
- sourceCategories.value = res[1].rows;
- form.value = res[2].data;
- parseDetail(form.value.details, form.value);
- title.value = "合同变更信息";
- if (type.value != "") {
- editStatus.value = true;
- } else {
- editStatus.value = false;
- }
- });
- } else {
- Promise.all([initTaskTypes(), listSource()]).then((res) => {
- loopTasks.value = res[0].data.loopTasks;
- onceTasks.value = res[0].data.onceTasks;
- sourceCategories.value = res[1].rows;
- });
- editStatus.value = true;
- title.value = "添加订单信息";
- }
- }
- /** 取消按钮 */
- function cancel() {
- visible.value = false;
- reset();
- }
- /** 表单重置 */
- function reset() {
- form.value = JSON.parse(JSON.stringify(contractEmpty));
- loops.value = [];
- onces.value = [];
- loopDetails.value = [];
- onceDetails.value = [];
- type.value = "";
- // console.log(form)
- proxy.resetForm("orderRef");
- }
- /** 全屏缩放 */
- function handleScreen() {
- const dom = document.querySelector(
- ".list-container > .el-drawer__wrapper > .el-overlay"
- );
- isFullscreen.value = !isFullscreen.value;
- dom.style.position = isFullscreen.value ? "fixed" : "absolute";
- }
- function sourceValidator(rule, value, callback) {
- if (form.value.sourceCategoryName === "") {
- callback(new Error("来源类型不能为空"));
- return;
- }
- if (
- form.value.referrerDataSource !== "" &&
- form.value.referrerDataSource != null &&
- form.value.sourceName === ""
- ) {
- callback(new Error("来源不能为空"));
- return;
- }
- return callback();
- }
- /** 提交按钮 */
- function submitForm() {
- const query = { userId: form.value.signerId };
- const users = [];
- listUser(query).then((res) => {
- users.value = res.rows;
- console.log(form.value.signerId);
- // if (users.value.length == 1) {
- // if (
- // form.value.signerId == users.value[0].userId &&
- // form.value.signerName == users.value[0].nickName
- // ) {
- // } else {
- // proxy.$modal.msgError("请选择有效签单人");
- // return;
- // }
- // } else {
- // proxy.$modal.msgError("请选择有效签单人");
- // return;
- // }
- const companyQuery = { id: form.value.companyId };
- const companys = [];
- listCompany(companyQuery).then((res) => {
- companys.value = res.rows;
- if (companys.value.length == 1) {
- if (
- form.value.companyId == companys.value[0].id &&
- form.value.companyName == companys.value[0].name
- ) {
- } else {
- proxy.$modal.msgError("请选择有效客户");
- return;
- }
- } else {
- proxy.$modal.msgError("请选择有效客户");
- return;
- }
- proxy.$refs["orderRef"].validate((valid) => {
- if (valid && detailValid() && amountValid()) {
- const formValue = form.value;
- formValue.details =
- form.value.serviceType === 1
- ? loopDetails.value
- : onceDetails.value;
- if (formValue.id != null) {
- if (formValue.companyId !== null) {
- if (type.value == "") {
- updateOrder(formValue).then((response) => {
- proxy.$modal.msgSuccess("修改成功");
- visible.value = false;
- getList.value();
- });
- } else if (type.value == "alterOrder") {
- alterOrder(formValue).then((response) => {
- proxy.$modal.msgSuccess("修改成功");
- visible.value = false;
- getList.value();
- });
- } else if (type.value == "dissolutionOrder") {
- dissolutionOrder(formValue).then((response) => {
- proxy.$modal.msgSuccess("修改成功");
- visible.value = false;
- getList.value();
- });
- } else {
- proxy.$modal.msgError("请选择有效客户");
- }
- }
- } else {
- addOrder(formValue).then((response) => {
- proxy.$modal.msgSuccess("新增成功");
- visible.value = false;
- getList.value();
- });
- }
- }
- });
- });
- });
- }
- function detailValid() {
- if (form.value.serviceType === 1) {
- // 循环服务
- if (loopDetails.value.length === 0) {
- proxy.$modal.msgError("请选择至少一条任务");
- return false;
- }
- // loopDetails.forEach((item, index) => {
- for (let i = 0; i < loopDetails.value.length; i++) {
- let item = loopDetails.value[i];
- if (
- (item.freeNum ? Number(item.freeNum) : 0) +
- (item.serviceNum ? Number(item.serviceNum) : 0) <=
- 0
- ) {
- proxy.$modal.msgError(`${item.taskTypeName}服务月数不能为0`);
- return false;
- }
- if (item.price == null || item.price === "") {
- proxy.$modal.msgError(`${item.taskTypeName}请填写服务单价`);
- return false;
- }
- }
- } else if (form.value.serviceType === 2) {
- // 代账服务
- if (onceDetails.value.length === 0) {
- proxy.$modal.msgError("请选择至少一条任务");
- return false;
- }
- for (let i = 0; i < onceDetails.value.length; i++) {
- let item = onceDetails.value[i];
- if (item.payAddress === 1) {
- if (item.addressStyle == null) {
- proxy.$modal.msgError("请选择注册地址类型");
- return false;
- }
- if (
- item.addressStyle === 1 &&
- (item.province == null || item.city == null || item.district == null)
- ) {
- proxy.$modal.msgError("请选择注册区域");
- return false;
- }
- console.log(item);
- if (item.addressStyle === 2 && item.fictionAddressId == null) {
- proxy.$modal.msgError("请选择虚拟地址");
- return false;
- }
- if (item.addressStyle === 2 && item.addressAmount == undefined) {
- proxy.$modal.msgError("请填写虚拟地址金额");
- return false;
- }
- }
- if (
- item.payAddress === 0 &&
- (item.province == null || item.city == null || item.district == null)
- ) {
- proxy.$modal.msgError("请选择办理地区");
- return false;
- }
- for (let j = 0; j < item.processes.length; j++) {
- let process = item.processes[j];
- if (process.amount == undefined) {
- proxy.$modal.msgError(`${process.taskTypeDetailName}请填写金额`);
- return false;
- }
- }
- }
- }
- return true;
- }
- function amountValid() {
- if (form.value.trueAmount < 0) {
- proxy.$modal.msgError("实收金额不可小于0");
- return false;
- }
- return true;
- }
- /** 查询表单信息 */
- function getForm() {
- proxy.$refs.orderRef.resetFields();
- loading.value = true;
- getOrder(form.value.id).then((response) => {
- loading.value = false;
- form.value = response.data;
- type.value =
- type.value == "" && form.value.status === 8 ? "alterOrder" : type.value;
- });
- }
- function handleServiceTypeClick(tab) {
- computedService();
- }
- function changeDetails(type, arg) {
- switch (type) {
- case "loop":
- arg.forEach((e) => {
- const taskType = loopTasks.value.find((v) => v.id == e);
- if (loopDetails.value.findIndex((v) => v.taskTypeId == e) < 0) {
- const newDetail = JSON.parse(JSON.stringify(detailEmpty));
- newDetail.taskTypeId = e;
- newDetail.taskTypeName = taskType.name;
- loopDetails.value.push(newDetail);
- }
- });
- loopDetails.value = loopDetails.value.filter(
- (v) => arg.findIndex((e) => e == v.taskTypeId) > -1
- );
- break;
- case "once":
- arg.forEach((e) => {
- const taskType = onceTasks.value.find((v) => v.id == e);
- if (onceDetails.value.findIndex((v) => v.taskTypeId == e) < 0) {
- const newDetail = JSON.parse(JSON.stringify(detailEmpty));
- newDetail.taskTypeId = e;
- newDetail.taskTypeName = taskType.name;
- newDetail.payAddress = taskType.payAddress;
- (newDetail.alterType = e === "6" ? "普通变更" : ""),
- (newDetail.defaultProcesses = taskType.processes.map((v) => ({
- taskTypeId: e,
- taskTypeDetailId: v.id,
- taskTypeDetailName: v.name,
- fictionAddressId: null,
- fictionAddress: "",
- addressStyle: 0,
- checked: false,
- amount: undefined,
- })));
- newDetail.processes = [];
- onceDetails.value.push(newDetail);
- }
- });
- onceDetails.value = onceDetails.value.filter(
- (v) => arg.findIndex((e) => e == v.taskTypeId) > -1
- );
- let provincesLength = provincesArr.value.length;
- if (onceDetails.value.length > provincesLength) {
- for (let i = 0; i < onceDetails.value.length - provincesLength; i++) {
- provincesArr.value.push(provinces.value);
- citiesArr.value.push(cities.value);
- districtsArr.value.push(districts.value);
- }
- } else if (onceDetails.value.length < provincesLength) {
- for (let i = 0; i < provincesLength - onceDetails.value.length; i++) {
- provincesArr.value.length--;
- citiesArr.value.length--;
- districtsArr.value.length--;
- }
- }
- break;
- default:
- break;
- }
- }
- function inputChangeHandler(type, field, item, value, parent) {
- console.log(111,type, field, item, value, parent);
- let amount = 0;
- switch (type) {
- case "loop":
- switch (field) {
- case "price":
- amount =
- (item.serviceNum ? Number(item.serviceNum) : 0) *
- (value ? Number(value) : 0) -(item.discountAmount?Number(item.discountAmount):0);
- item.amount = amount;
- break;
- case "serviceNum":
- amount =
- (item.price ? Number(item.price) : 0) * (value ? Number(value) : 0) -(item.discountAmount?Number(item.discountAmount):0);
- item.amount = amount;
- break;
- case "freeNum":
- amount =
- (item.price ? Number(item.price) : 0) *
- (item.serviceNum ? Number(item.serviceNum) : 0) -(item.discountAmount?Number(item.discountAmount):0);
- item.amount = amount;
- break;
- case "discountAmount":
- amount =
- (item.price ? Number(item.price) : 0) *
- (item.serviceNum ? Number(item.serviceNum) : 0) -(value ? Number(value) : 0);
- item.amount = amount;
- }
- break;
- case "once":
- computedItem(item);
- break;
- case "process":
- computedItem(parent);
- break;
- default:
- break;
- }
- computedService();
- }
- function computedItem(parent) {
- let amount = 0;
- amount +=
- parent.payAddress === 1 && parent.addressStyle === 2 && parent.addressAmount
- ? Number(parent.addressAmount)
- : 0;
- amount +=
- parent.taskTypeId === "6" &&
- parent.alterType === "跨区变更" &&
- parent.addressStyle === 2 &&
- parent.addressAmount
- ? Number(parent.addressAmount)
- : 0;
- parent.processes.forEach((l) => {
- amount += l.amount ? Number(l.amount) : 0;
- });
- parent.amount = amount;
- }
- function computedService() {
- //子表中的实际金额
- let amount = 0;
- let discountAmount = 0;
- let trueAmount = 0;
- switch (form.value.serviceType) {
- case 1:
- loopDetails.value.forEach((l) => {
- amount += l.amount;
- discountAmount += l.discountAmount;
- trueAmount += l.trueAmount;
- });
- amount = amount >= 0 ? amount : 0;
- discountAmount = discountAmount >= 0 ? discountAmount : 0;
- break;
- case 2:
- onceDetails.value.forEach((l) => {
- amount +=
- l.payAddress === 1 && l.addressStyle === 2 && l.addressAmount
- ? Number(l.addressAmount)
- : 0;
- l.processes.forEach((v) => {
- amount += v.amount ? Number(v.amount) : 0;
- });
- });
- break;
- }
- form.value.discountAmount = discountAmount;
- form.value.trueAmount =amount
- form.value.amount = match.add(amount,discountAmount);
- }
- /** 输入框输出建议 */
- function querySearchAsync(queryString, cb) {
- const query = { keyword: queryString };
- listUser(query).then((res) => {
- cb(res.rows);
- });
- }
- function querySearchCompanyAsync(queryString, cb) {
- const query =
- queryString.length > 0
- ? {
- keyword: queryString,
- pageSize: 50,
- pageNum: 1,
- orderByColumn: "create_time",
- }
- : { pageSize: 50, pageNum: 1, orderByColumn: "create_time" };
- listCompany(query).then((res) => {
- cb(res.rows);
- });
- }
- function handleSelectEmployee(item) {
- form.value.signerName = item.nickName;
- form.value.signerId = item.userId;
- }
- function handleSelectCompany(item) {
- form.value.companyName = item.name;
- form.value.companyId = item.id;
- form.value.customerLabelId = item.customerLabelId
- }
- function handleClearCompany(){
- form.value.customerLabelId = "";
- }
- function handleSelectProvince(item, index) {
- const _provinceCode = item.provinceCode;
- const _province = provincesArr.value[index].find((i) => {
- return i.code === _provinceCode;
- });
- item.province = _province.name;
- citiesArr.value[index] = proxy.region.getCities(_provinceCode);
- if (citiesArr.value[index].length === 0) {
- // 清空城市数据
- item.cityCode = "";
- item.city = "";
- cities.value = [{ code: "", name: "全部" }];
- // 清空行政区数据
- item.districtCode = "";
- item.district = "";
- districts.value = [{ code: "", name: "全部" }];
- } else {
- citiesArr.value[index].unshift({ code: "", name: "全部" });
- item.cityCode = citiesArr.value[index][0].code;
- item.city = citiesArr.value[index][0].name;
- handleSelectCity(item, index);
- }
- }
- function handleSelectCity(item, index) {
- const _cityCode = item.cityCode;
- const _city = citiesArr.value[index].find((i) => {
- return i.code === _cityCode;
- });
- item.city = _city.name;
- districtsArr.value[index] = proxy.region.getDistricts(_cityCode);
- if (districtsArr.value[index].length === 0) {
- // 清空行政区数据
- item.districtCode = "";
- item.district = "";
- districtsArr.value[index] = [{ code: "", name: "全部" }];
- } else {
- districtsArr.value[index].unshift({ code: "", name: "全部" });
- item.districtCode = districtsArr.value[index][0].code;
- item.district = districtsArr.value[index][0].name;
- }
- }
- function handleSelectDistrict(item, index) {
- const _districtCode = item.districtCode;
- const _district = districtsArr.value[index].find((i) => {
- return i.code === _districtCode;
- });
- item.district = _district.name;
- }
- function getProcess(item) {
- const typeItem = onceTasks.value.find((i) => i.id === item.taskTypeId);
- return typeItem.processes;
- }
- function checkedProcess(processId, item) {
- const processes = item.processes;
- return processes.findIndex((v) => v.taskTypeDetailId == processId) < 0;
- }
- function changeProcesses(item) {
- computedItem(item);
- computedService();
- }
- function parseDetail(details, form) {
- loops.value = [];
- onces.value = [];
- loopDetails.value = [];
- onceDetails.value = [];
- switch (form.serviceType) {
- case 1:
- // 循环任务
- details.forEach((i) => {
- loops.value.push(i.taskTypeId);
- loopDetails.value.push(i);
- });
- break;
- case 2:
- // 代办任务
- details.forEach((i) => {
- onces.value.push(i.taskTypeId);
- const taskType = onceTasks.value.find((j) => j.id === i.taskTypeId);
- onceDetails.value.push({
- ...i,
- defaultProcesses: parseProcess(i, taskType.processes),
- });
- onceDetails.value.forEach((j) => {
- j.processes = j.defaultProcesses.filter((v) => v.checked);
- });
- });
- break;
- default:
- break;
- }
- }
- function parseProcess(item, processes) {
- return processes.map((l) => {
- // console.log(item.processes.find((i) => i.taskTypeDetailId === l.id));
- if (item.processes.findIndex((i) => i.taskTypeDetailId === l.id) < 0) {
- return {
- taskTypeId: item.taskTypeId,
- taskTypeDetailId: l.id,
- taskTypeDetailName: l.name,
- checked: false,
- amount: undefined,
- };
- } else {
- return {
- ...item.processes.find((i) => i.taskTypeDetailId === l.id),
- checked: true,
- };
- }
- });
- }
- function verifyHandler() {
- proxy.$modal
- .confirm("是否确认审核?")
- .then((_) => {
- verifyCheckOrder(form.value).then((res) => {
- if (res.data == null) {
- verifyUpload(1);
- } else {
- verifyOpen.value = true;
- redirectDetails.value = res.data;
- }
- });
- })
- .catch((_) => {
- proxy.$modal.msg("取消审核");
- });
- }
- function verifyFormClose() {
- redirectDetails.value = [];
- verifyForm.value = {};
- verifyOpen.value = false;
- }
- function redirectVerify() {
- redirectDetails.value.forEach((l) => {
- const index = form.value.details.findIndex((v) => v.id === l.id);
- form.value.details[index].redirect = l.redirect;
- });
- verifyUpload(1);
- verifyFormClose();
- }
- function rejectHandler() {
- rejectOpen.value = true;
- }
- function rejectCancel() {
- rejectOpen.value = false;
- }
- function rejectSubmitHandler() {
- if (form.value.verifyRemark === "" || form.value.verifyRemark == null) {
- proxy.$modal.msgError("请填写驳回原因");
- return;
- }
- }
- function verifyUpload(status) {
- const formValue = proxy.deepClone(form.value);
- formValue.verifyStatus = status;
- formValue.status = status;
- verifyOrder(formValue).then((res) => {
- getForm();
- getList.value();
- rejectCancel();
- proxy.$modal.msgSuccess("保存成功");
- });
- }
- /** 文件上传 */
- function upload(param) {
- const formData = new FormData();
- formData.append("file", param.file);
- uploadFile(formData).then((res) => {
- if (res.code === 200) {
- const file = {};
- file.fileName = res.newFileName;
- file.url = res.url;
- file.originalFileName = res.originalFilename;
- file.fileUrl = res.fileName;
- form.value.files.push(file);
- }
- });
- }
- function handleDelFile(index) {
- form.value.files.splice(index, 1);
- }
- function initRegion() {
- console.log("initRegion开始", form.value);
- for (let i = 0; i < form.value.details.length; i++) {
- cities.value = proxy.region.getCities(form.value.details[i].provinceCode);
- cities.value.unshift({ code: "", name: "全部" });
- districts.value = proxy.region.getDistricts(form.value.details[i].cityCode);
- districts.value.unshift({ code: "", name: "全部" });
- console.log("市", cities.value);
- provincesArr.value.push(provinces.value);
- citiesArr.value.push(cities.value);
- districtsArr.value.push(districts.value);
- }
- }
- function showAddCompanyDialog() {
- addCompanyDialogRef.value.open();
- }
- function contractTypeChangeHandler() {
- if (form.value.contractType === 1) {
- form.value.serviceType = 1;
- }
- }
- function showHistoryList() {
- historyChoiceRef.value.open(
- form.value.fromId === "0" ? form.value.id : form.value.fromId
- );
- }
- function historyChoiceHandle(row) {
- open(row.id);
- }
- /** 暴露给父组件的方法 */
- defineExpose({
- open,
- openSimple,
- });
- </script>
- <style scoped>
- .my-autocomplete .el-input-group__append {
- padding: 0 10px !important;
- }
- </style>
|