123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773 |
- <template>
- <div>
- <basicDetails
- ref="details"
- :titleText="mainData.title"
- :editData="mainData"
- :mainAreaData="mainAreaData"
- turnPageId="20221121201502"
- idname="sa_contractid"
- typeTask="合同"
- ownertable="sa_contract"
- :tabs="tabs"
- :statusCheck="[{key:'status',value:'已提交'},{key:'status',value:'审核'},{key:'status',value:'已终止'}]"
- @pageChange="pageChange"
- @onEditSuccess="editSuccess">
- <div slot="tags">
- </div>
- <div slot="customOperation">
- <editBtn class="inline-16" :modelList="modelList" v-if="tool.checkAuth($route.name,'update')" :disabled="mainData.status != '新建' || !isLeader" @onSuccess="queryMainData($route.query.id);$refs.billno && $refs.billno.listData()" :data="mainData" />
- <el-button
- type="primary"
- size="mini"
- @click="changeBill"
- v-if="mainData.status == '审核' && ($route.query.type == '经销项目' || $route.query.type == '直销项目') && (tool.checkAuth($route.name,'changeBillMag') || tool.checkAuth($route.name,'changeBillSaler') || tool.checkAuth($route.name,'changeBillOrder'))"
- >一键转单</el-button>
- <revoke class="inline-16" @onSuccess="queryMainData($route.query.id)" :data="mainData" v-if="tool.checkAuth($route.name,'revoke') && mainData.status === '已提交' && isLeader" ></revoke>
- <submit-check class="inline-16" :disabled="!isLeader" ref="submit" :data="mainData" @onSuccess="queryMainData($route.query.id)" />
- <reverseCheck class="inline-16" @onSuccess="queryMainData($route.query.id)" :data="mainData" v-if="tool.checkAuth($route.name,'reverseCheck') && mainData.status === '审核'" />
- <contractOver class="inline-16" v-if="tool.checkAuth($route.name,'contractOver') && mainData.status == '审核' && isLeader" :disabled="!isLeader" :id="mainData.sa_contractid" @onSuccess="queryMainData($route.query.id)" />
- <copyTo class="inline-16" v-if="tool.checkAuth($route.name,'copy')"></copyTo>
- <Del class="inline-16" :idName="20221121202502" :id="mainData.sa_contractid" idKey="sa_contractids" v-if="tool.checkAuth($route.name,'toVoid') && (mainData.status == '新建' || mainData.status == '已终止' || mainData.status == '已过期') && isLeader"/>
- </div>
- <div slot="slot0" >
- <div v-if="mainData.type == '项目'">
- <!--项目产品明细折扣表-->
- <productBillno :data="mainData" :isLeader="isLeader" ref="billno" @priceChange="queryMainData($route.query.id)" @delSuccess="queryMainData" @onSuccess="productAdd" >
- <template v-slot:edit="scope">
- </template>
- <template v-slot:del="scope">
- </template>
- <template v-slot:cooperate="scope">
- <el-button :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productBillManage') && isLeader">同步合作协议</el-button>
- <el-dialog title="同步合作协议" :visible.sync="cooperateVisible" append-to-body width="703px">
- <span style="color: #8C8C8C;font-size: 14px">请选择同步更新经销商/直销客户合作协议产品的方式:</span>
- <el-form :model="cooperateForm" style="margin-top: 20px">
- <el-radio v-model="cooperateForm.isadd" label="1" style="margin-bottom: 20px">
- <span style="font-size: 16px;color: #333333">同步添加合作协议产品</span><br><br>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 将协议中所有产品添加到表体,若表体已存在产品,则协议中相同产品的信息及其折扣价格覆盖更新
- </span><br><br>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 到表体。
- </span> <br><br>
- </el-radio>
- <el-radio v-model="cooperateForm.isadd" label="0">
- <span style="font-size: 16px;color: #333333">仅更新合作协议的产品折扣价格</span><br><br>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 将协议中与表体相同的产品信息及其折扣价格覆盖更新到表体,不添加协议产品。
- </span>
- </el-radio>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onCooperate" class="normal-btn-width">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- </productBillno>
- </div>
- <div v-if="mainData.type == '框架' || mainData.type == '直销' ">
- <!--产品明细折扣表-->
- <productDetailList :data="mainData" :isLeader="isLeader" ref="productDetailList" @priceChange="queryMainData($route.query.id)" @closeDrawer="queryMainData($route.query.id)">
- <importFile
- v-if="tool.checkAuth($route.name,'exportProduct') && isLeader && mainData.status === '新建'"
- slot="export"
- ref="importFile"
- class="inline-16"
- :bindData="{ownertable:'sa_contract',ownerid:$route.query.id,usetype:'default'}"
- :errorUrl="errorUrl"
- @clearUrl="errorUrl = null"
- @onSuccess="bindImportOrder"
- ></importFile>
- <template v-slot:cooperate="scope">
- <el-button class="inline-16" :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productDetailManage') && isLeader && mainData.type == '居间'">同步协议</el-button>
- <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 是否添加关联的项目或客户合同中的产品明细同步更新到列表
- </span>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onCooperate" class="normal-btn-width">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- </productDetailList>
- </div>
- <div v-if="mainData.type == '居间'">
- <!-- 详细信息 -->
- <BaseInfo v-if="siteid === 'HY'" :detailInfo="detailInfo"/>
- <!--产品明细折扣表-->
- <productDetailList v-else :data="mainData" :isLeader="isLeader" ref="productDetailList" @priceChange="queryMainData($route.query.id)" @closeDrawer="queryMainData($route.query.id)">
- <importFile
- v-if="tool.checkAuth($route.name,'exportProduct') && isLeader && mainData.status === '新建'"
- slot="export"
- ref="importFile"
- class="inline-16"
- :bindData="{ownertable:'sa_contract',ownerid:$route.query.id,usetype:'default'}"
- :errorUrl="errorUrl"
- @clearUrl="errorUrl = null"
- @onSuccess="bindImportOrder"
- ></importFile>
- <template v-slot:cooperate="scope">
- <el-button class="inline-16" :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productDetailManage') && isLeader && mainData.type == '居间'">同步协议</el-button>
- <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 是否添加关联的项目或客户合同中的产品明细同步更新到列表
- </span>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onCooperate" class="normal-btn-width">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- </productDetailList>
- </div>
- <div v-if="mainData.type == '工具借用'">
- <!--工具清单-->
- <toolList :data="mainData" :isLeader="isLeader" ref="toolList" v-if="mainData.type == '工具借用'" @priceChange="queryMainData($route.query.id)">
- <template v-slot:edit="scope">
- </template>
- </toolList>
- </div>
- </div>
- <div slot="slot1" >
- <!-- 居间 -->
- <div v-if="mainData.type === '居间'">
- <contactList v-if="siteid === 'HY' && mainData && tool.checkAuth($route.name,'contact')" :data="mainData"></contactList>
- <productClassList v-else :data="mainData" :isLeader="isLeader" ref="classList" @priceChange="queryMainData($route.query.id)">
- <addClass class="inline-16" v-if="tool.checkAuth($route.name,'productClassManage')" :disabled="mainData.status != '新建' || !isLeader" :typeName="mainData.type" slot="addProduct" @onSuccess="$refs.classList.listData()" ref="addProduct" @closeDrawer="closeDrawer"/>
- <template v-slot:edit="scope">
- </template>
- <template v-slot:cooperate="scope">
- <el-button class="inline-16" :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productClassManage') && isLeader && mainData.type == '居间'">同步协议</el-button>
- <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 是否添加关联的项目或客户合同中的产品类别同步更新到列表
- </span>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onCooperateItem" class="normal-btn-width">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- </productClassList>
- </div>
- <div v-if="mainData.type == '框架' || mainData.type == '直销' ">
- <!--产品类别折扣表-->
- <productClassList :data="mainData" :isLeader="isLeader" ref="classList" @priceChange="queryMainData($route.query.id)" >
- <addClass class="inline-16" v-if="tool.checkAuth($route.name,'productClassManage')" :disabled="mainData.status != '新建' || !isLeader" :typeName="mainData.type" slot="addProduct" @onSuccess="$refs.classList.listData()" ref="addProduct" @closeDrawer="closeDrawer"/>
- <template v-slot:edit="scope">
- </template>
- <template v-slot:cooperate="scope">
- <el-button class="inline-16" :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productClassManage') && isLeader && mainData.type == '居间'">同步协议</el-button>
- <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 是否添加关联的项目或客户合同中的产品类别同步更新到列表
- </span>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onCooperateItem" class="normal-btn-width">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- </productClassList>
- </div>
- <div v-if="mainData.type == '项目'">
- <!-- 产品类别折扣 -->
- <itemClass ref="itemClass" :data="mainData" :isLeader="isLeader" >
- <template v-slot:cooperate="scope">
- <el-button :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productClassManage') && isLeader">同步合作协议</el-button>
- <el-dialog title="同步合作协议" :visible.sync="cooperateVisible" append-to-body width="703px">
- <span style="color: #8C8C8C;font-size: 14px">请选择同步更新经销商/直销客户合作协议产品类别的方式:</span>
- <el-form :model="cooperateForm" style="margin-top: 20px">
- <el-radio v-model="cooperateForm.isadd" label="1" style="margin-bottom: 20px">
- <span style="font-size: 16px;color: #333333">同步添加合作协议产品类别及其折扣</span><br><br>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 将协议中所有产品类别及其折扣添加到表体,若表体已存在产品类别,则协议中相同产品类别的折扣
- </span><br><br>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 覆盖更新到表体。
- </span> <br><br>
- </el-radio>
- <el-radio v-model="cooperateForm.isadd" label="0">
- <span style="font-size: 16px;color: #333333">仅更新合作协议的产品类别折扣</span><br><br>
- <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
- 将协议中与表体相同的产品类别的折扣价格覆盖更新到表体,不添加协议的产品类别。
- </span>
- </el-radio>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onCooperateItem" class="normal-btn-width">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- </itemClass>
- </div>
- <div v-if="mainData.type === '工具借用'">
- <BaseInfo :detailInfo="detailInfo"/>
- </div>
- </div>
- <div slot="slot2">
- <div v-if="Object.keys(mainData).length > 0 && (mainData.type == '框架' || mainData.type == '直销')" >
- <!--业绩目标-->
- <taskTarget ref="taskTarget" :data="mainData">
- <template v-slot:addTarget="scope">
- <add-target :disabled="mainData.status != '新建' || !isLeader" v-if="tool.checkAuth($route.name,'taskTargetManage')" :data="mainData" @onSuccess="successYear"></add-target>
- </template>
- <template v-slot:edit="scope">
- <edit-target class="inline-16" :disabled="mainData.status != '新建' || !isLeader" v-if="tool.checkAuth($route.name,'taskTargetManage')" :data="scope.data" :salerId="mainData" @onSuccess="$refs.taskTarget.queryData()"/>
- </template>
- <template v-slot:delete="scope">
- <del-target @onSuccess="$refs.taskTarget.queryData()" class="inline-16" :disabled="mainData.status != '新建' || !isLeader" v-if="tool.checkAuth($route.name,'taskTargetManage')" :id="scope.data.sa_salestargetbillid"></del-target>
- </template>
- </taskTarget>
- </div>
- <div v-if="mainData.type == '项目'">
- <!-- 差价 -->
- <priceDifference v-if="siteid == 'HY' && tool.checkAuth($route.name,'brokerageFeeEntrySet')" :data="mainData"></priceDifference>
- <!-- 详细信息 -->
- <BaseInfo v-else :detailInfo="detailInfo"/>
- </div>
- <div v-if="mainData.type == '居间'">
- <BaseInfo v-if="siteid !== 'HY'" :detailInfo="detailInfo"/>
- </div>
- </div>
- <div slot="slot3">
- <div v-if="mainData.type === '居间' && siteid !== 'HY'">
- <contactList v-if="mainData && tool.checkAuth($route.name,'contact')" :data="mainData"></contactList>
- </div>
- <div v-if="mainData.type == '框架' || mainData.type == '直销'">
- <priceDifference v-if="siteid == 'HY' && tool.checkAuth($route.name,'brokerageFeeEntrySet')" :data="mainData"></priceDifference>
- <BaseInfo v-else :detailInfo="detailInfo"/>
- </div>
- <div v-if="mainData.type == '项目'">
- <BaseInfo v-else :detailInfo="detailInfo"/>
- </div>
- </div>
- <div slot="slot4">
- <div v-if="mainData.type == '框架' || mainData.type == '直销'">
- <BaseInfo :detailInfo="detailInfo"/>
- </div>
- </div>
- </basicDetails>
- </div>
- </template>
- <script>
- import Del from '../components/delete'
- import editBtn from '../components/editContract'
- import SubmitCheck from '../components/submitCheck'
- import productBillno from '../components/productList/productBillno.vue'
- import productDetailList from '../components/productDetailList/productDetailList.vue'
- import addProduct from '../components/productList/addProduct'
- import addProductDetail from '../components/productDetailList/addProduct.vue'
- import addTool from '../components/toolList/addTool'
- import toolList from '../components/toolList/toolList.vue'
- import addClass from '../components/productClassList/addProduct'
- import productClassList from '../components/productClassList/productClassList.vue'
- import contractClause from '../components/contractClause/contractClause'
- import editTarget from '../components/taskTarget/editTarget'
- import addTarget from '../components/taskTarget/addTarget'
- import taskTarget from '../components/taskTarget/taskTarget'
- import delTarget from '../components/taskTarget/delTarget'
- import contractOver from '../components/contractOver'
- import reverseCheck from '../components/reverseCheck'
- import revoke from "@/HDrpManagement/contractManage/components/revoke";
- import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo'
- import itemClass from '../components/itemClass/index.vue'
- import importFile from '../components/importFile'
- import copyTo from '../components/copyTo'
- import priceDifference from '../components/priceDifference/index'
- import contactList from '../components/contactList/index'
- import { Loading } from 'element-ui';
- export default {
- name: "detail",
- data() {
- return {
- mainData:{},
- mainAreaData:{},
- modelList:[],
- isLeader:false,
- detailInfo:{},
- message:'确定删除当前条款吗?',
- errorUrl:null,
- cooperateVisible:false,
- cooperateForm:{
- "sa_contractid": "",
- "isadd":''
- },
- siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid,
- tabs:[]
- }
- },
- components:{
- Del,
- SubmitCheck,
- editBtn,
- productBillno,
- addProduct,
- productDetailList,
- addProductDetail,
- addTool,
- toolList,
- addClass,
- productClassList,
- contractClause,
- editTarget,
- taskTarget,
- contractOver,
- reverseCheck,
- addTarget,
- delTarget,
- BaseInfo,
- revoke,
- itemClass,
- importFile,
- copyTo,
- priceDifference,
- contactList
- },
- provide () {
- return {
- detailData:() => this.mainData,
- }
- },
- watch: {
- mainData: {
- async handler (val) {
- const res = await this.$api.requested({
- "id": 20220930103501,
- "content": {
- "ownertable":"sa_contract",
- "ownerid":this.$route.query.id
- }
- })
- const agent = await this.$api.requested({
- "id":20230329122604,
- "content": {
- "ownertable":"sa_contract",
- "ownerid":this.$route.query.id
- }
- })
- if (this.mainData.leader && this.mainData.leader.length > 0){
- if (JSON.parse(window.sessionStorage.getItem('active_account')).userid === this.mainData.leader[0].userid){
- this.isLeader = true
- }else {
- let flag = 0
- for (var i=0;i<res.data[0].team.length;i++){
- if (res.data[0].team[i].userid === JSON.parse(window.sessionStorage.getItem('active_account')).userid){
- if (res.data[0].team[i].editable === 1){
- flag =1
- break
- }else {
- flag = 0
- break
- }
- }
- }
- console.log(agent.data.editable,'agent.data.editable')
- flag === 0 ?agent.data.editable === 0?this.isLeader = false:this.isLeader = true:this.isLeader = true
- this.$refs.details.$refs.group.editdataleader = agent.data.editdataleader
- console.log(this.isLeader,'isLeader')
- }
- }
- },
- deep:true,
- immediate:true
- }
- },
- methods:{
- tabsSet(){
- switch (this.mainData.type) {
- case '项目':
- this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'brokerageFeeEntrySet')?['产品明细折扣','产品类别折扣','差价','详细信息']:['产品明细折扣','产品类别折扣','详细信息']:['产品明细折扣','产品类别折扣','详细信息']
- break
- case '框架':
- this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'brokerageFeeEntrySet')?['产品明细折扣','产品类别折扣','业绩目标','差价','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']
- break
- case '居间':
- this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'contact')?['详细信息','联系人']:['详细信息']:this.tool.checkAuth(this.$route.name,'contact')?['产品明细折扣','产品类别折扣','详细信息','联系人']:['产品明细折扣','产品类别折扣','详细信息']
- break
- case '直销':
- this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'brokerageFeeEntrySet')?['产品明细折扣','产品类别折扣','业绩目标','差价','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']
- break
- default:
- this.tabs = ['工具清单','详细信息']
- }
- },
- editSuccess(){
- this.queryMainData(this.$route.query.id)
- },
- async queryMainData(id) {
- this.$refs.details.$refs.group.queryGroup()
- const res = await this.$api.requested({
- "id":20221121195102,
- "content": {
- "nocache":true,
- "sa_contractid": this.$route.query.id
- }
- })
- this.mainData = res.data
- console.log(this.$refs.details.param.content,'param')
- // this.$refs.details.param.content.type = this.$route.query.tabIndex
- // this.$refs.details.param.content.where.type = this.$route.query.type
- let listqueryid = sessionStorage.getItem('listqueryid')
- this.mainData.type == '项目'
- ? this.mainData.typemx == '直销'
- ? this.$router.replace({path:'/contractDetail',query:{id:this.$route.query.id,rowindex:this.$route.query.rowindex,type:'直销项目',tabIndex:this.$route.query.tabIndex,listqueryid:listqueryid,fieldname:'sa_contractid'}}) : this.$router.replace({path:'/contractDetail',query:{id:this.$route.query.id,rowindex:this.$route.query.rowindex,type:'经销项目',tabIndex:this.$route.query.tabIndex,listqueryid:listqueryid,fieldname:'sa_contractid'}})
- : this.$router.replace({path:'/contractDetail',query:{id:this.$route.query.id,rowindex:this.$route.query.rowindex,type:this.mainData.type,tabIndex:this.$route.query.tabIndex,listqueryid:listqueryid,fieldname:'sa_contractid'}})
- this.changeDataStructure()
- this.tabsSet()
- },
- changeDataStructure() {
- let that = this
- this.mainData.type == '项目'
- ? this.mainData.typemx == '直销'
- ? this.mainAreaData = [
- /* 直销信息 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同类型',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议' : '经销项目协议' : ''
- },
- {
- label:'合同模板',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议模板' : '经销项目协议模板' : ''
- },
- {
- label:'客户',
- value:this.mainData.enterprisename
- },
- {
- label:'项目名称',
- value:this.mainData.projectname
- },
- {
- label:'项目编号',
- value:this.mainData.projectnum?this.mainData.projectnum:'--'
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'签约金额(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- /*{
- label:'收货人',
- value:this.mainData.name
- },
- {
- label:'收货人电话',
- value:this.mainData.phonenumber
- },
- {
- label:'创建时间',
- value:this.mainData.createdate
- },
- {
- label:'创建人',
- value:this.mainData.createby
- },*/
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- /* {
- label:'合同描述',
- value:this.mainData.remarks
- },*/
- ] : this.mainAreaData = [
- /* 经销信息 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同类型',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议' : '经销项目协议' : ''
- },
- {
- label:'经销商',
- value:this.mainData.enterprisename
- },
- {
- label:'项目名称',
- value:this.mainData.projectname
- },
- {
- label:'项目编号',
- value:this.mainData.projectnum
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'签约金额(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- /* {
- label:'合同模板',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议模板' : '经销项目协议模板' : ''
- },
- {
- label:'创建时间',
- value:this.mainData.createdate
- },
- {
- label:'创建人',
- value:this.mainData.createby
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },*/
- ] : this.mainData.type == '框架'
- ? this.mainAreaData = [
- /* 合作协议 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同类型',
- value:'经销商合作协议'
- },
- {
- label:'经销商',
- value:this.mainData.enterprisename
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- // {
- // label:'签约金额(元)',
- // value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0.00
- // },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- /* {
- label:'合同模板',
- value:'经销商合作协议模板'
- },
- {
- label:'创建时间',
- value:this.mainData.createdate
- },
- {
- label:'创建人',
- value:this.mainData.createby
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },*/
- ] : this.mainData.type == '直销'
- ? this.mainAreaData = [
- /* 直销客户协议 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同类型',
- value:'直销客户合作协议'
- },
- {
- label:'客户',
- value:this.mainData.enterprisename
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- ]:
- this.mainData.type == '工具借用'
- ? this.mainAreaData = [
- /* 工具借用 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:'工具借用协议模板'
- },
- {
- label:'客户',
- value:this.mainData.enterprisename
- },
- {
- label:'合同类型',
- value:'工具借用协议'
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'单套价格(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'创建时间',
- value:this.mainData.createdate
- },
- {
- label:'创建人',
- value:this.mainData.createby
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ] : this.mainAreaData = [
- /* 居间协议 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同类型',
- value:'居间协议'
- },
- {
- label:'居间商',
- value:this.mainData.enterprisename
- },
- {
- label:'合同',
- value:this.mainData.ascription_title
- },
- {
- label:'项目名称',
- value:this.mainData.projectname
- },
- {
- label:'项目编号',
- value:this.mainData.projectnum
- },
- {
- label:'客户名称',
- value:this.mainData.ascription_enterprisename
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:this.mainData.calculatemodel == 1 ? '订单金额比例(%)' : '居间产品折扣(%)',
- value:this.mainData.calculatemodel == 1 ? Math.round((this.mainData.orderratio * 100)*100)/100 : Math.round((this.mainData.productdiscount *100)*100)/100,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- /* {
- label:'合同模板',
- value:'居间协议模板'
- },*/
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- /* {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'创建时间',
- value:this.mainData.createdate
- },
- {
- label:'创建人',
- value:this.mainData.createby
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },*/
- ]
- this.mainData.type == '项目'
- ? this.mainData.typemx == '直销'
- ? this.detailInfo = {
- baseInfo : [
- /* 直销信息 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议模板' : '经销项目协议模板' : ''
- },
- {
- label:'合同类型',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议' : '经销项目协议' : ''
- },
- {
- label:'客户',
- value:this.mainData.enterprisename
- },
- {
- label:'项目名称',
- value:this.mainData.projectname
- },
- {
- label:'项目编号',
- value:this.mainData.projectnum
- },
- {
- label:'项目地址',
- value:this.mainData.projectname ? this.mainData.province + this.mainData.city + this.mainData.county + this.mainData.address:'--'
- },
- {
- label:'收货人',
- value:this.mainData.name
- },
- {
- label:'收货人电话',
- value:this.mainData.phonenumber
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'签约金额(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'领域',
- value:this.mainData.tradefield ? this.mainData.tradefield : '--'
- },
- {
- label:'品牌',
- value:this.mainData.brandname
- },
- {
- label:'付款条件',
- value:this.mainData.paytype
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ],
- systemInfo: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'最近编辑人',value:this.mainData.changeby},
- {label:'最近编辑时间',value:this.mainData.changedate},
- {label:'提交人',value:this.mainData.submitby},
- {label:'提交时间',value:this.mainData.submitdate},
- {label:'审核人',value:this.mainData.checkby},
- {label:'审核时间',value:this.mainData.checkdate},
- /* {label:'作废原因',value:this.mainData.leader[0].leadernum == 0?'0':this.mainData.leader[0].leadernum},*/
- {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
- ]
- }
- : this.detailInfo = {
- baseInfo : [
- /* 经销信息 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议模板' : '经销项目协议模板' : ''
- },
- {
- label:'合同类型',
- value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议' : '经销项目协议' : ''
- },
- {
- label:'项目名称',
- value:this.mainData.projectname
- },
- {
- label:'项目编号',
- value:this.mainData.projectnum
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'签约金额(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'领域',
- value:this.mainData.tradefield ? this.mainData.tradefield : '--'
- },
- {
- label:'品牌',
- value:this.mainData.brandname
- },
- {
- label:'付款条件',
- value:this.mainData.paytype
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- /* {
- label:'经销商',
- value:this.mainData.enterprisename
- },*/
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ],
- systemInfo: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'最近编辑人',value:this.mainData.changeby},
- {label:'最近编辑时间',value:this.mainData.changedate},
- {label:'提交人',value:this.mainData.submitby},
- {label:'提交时间',value:this.mainData.submitdate},
- {label:'审核人',value:this.mainData.checkby},
- {label:'审核时间',value:this.mainData.checkdate},
- {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
- ]
- }
- : this.mainData.type == '框架'
- ? this.detailInfo ={
- baseInfo : [
- /* 合作协议 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:'经销商合作协议模板'
- },
- {
- label:'合同类型',
- value:'经销商合作协议'
- },
- {
- label:'经销商',
- value:this.mainData.enterprisename
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'签约金额(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'领域',
- value:this.mainData.tradefield ? this.mainData.tradefield : '--'
- },
- {
- label:'品牌',
- value:this.mainData.brandname
- },
- {
- label:'付款条件',
- value:this.mainData.paytype
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ],
- systemInfo: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'最近编辑人',value:this.mainData.changeby},
- {label:'最近编辑时间',value:this.mainData.changedate},
- {label:'提交人',value:this.mainData.submitby},
- {label:'提交时间',value:this.mainData.submitdate},
- {label:'审核人',value:this.mainData.checkby},
- {label:'审核时间',value:this.mainData.checkdate},
- {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
- ]
- }
- : this.mainData.type == '直销'
- ? this.detailInfo ={
- baseInfo : [
- /* 直销客户协议 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:'直销客户合作协议模板'
- },
- {
- label:'合同类型',
- value:'直销客户合作协议'
- },
- {
- label:'客户',
- value:this.mainData.enterprisename
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'签约金额(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'折扣(%)',
- value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
- },
- {
- label:'领域',
- value:this.mainData.tradefield ? this.mainData.tradefield : '--'
- },
- {
- label:'品牌',
- value:this.mainData.brandname
- },
- {
- label:'付款条件',
- value:this.mainData.paytype
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ],
- systemInfo: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'最近编辑人',value:this.mainData.changeby},
- {label:'最近编辑时间',value:this.mainData.changedate},
- {label:'提交人',value:this.mainData.submitby},
- {label:'提交时间',value:this.mainData.submitdate},
- {label:'审核人',value:this.mainData.checkby},
- {label:'审核时间',value:this.mainData.checkdate},
- {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
- ]
- }:this.mainData.type == '工具借用'
- ? this.detailInfo = {
- baseInfo : [
- /* 工具借用 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:'工具借用协议模板'
- },
- {
- label:'客户',
- value:this.mainData.enterprisename
- },
- {
- label:'合同类型',
- value:'工具借用协议'
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:'单套价格(元)',
- value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ],
- systemInfo: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'最近编辑人',value:this.mainData.changeby},
- {label:'最近编辑时间',value:this.mainData.changedate},
- {label:'提交人',value:this.mainData.submitby},
- {label:'提交时间',value:this.mainData.submitdate},
- {label:'审核人',value:this.mainData.checkby},
- {label:'审核时间',value:this.mainData.checkdate},
- {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
- ]
- }
- : this.detailInfo = {
- baseInfo : [
- /* 居间协议 */
- {
- label:'合同编号',
- value:this.mainData.billno
- },
- {
- label:'合同标题',
- value:this.mainData.title
- },
- {
- label:'合同模板',
- value:'居间协议模板'
- },
- {
- label:'合同类型',
- value:'居间协议'
- },
- {
- label:'居间商',
- value:this.mainData.enterprisename
- },
- {
- label:'合同',
- value:this.mainData.ascription_title
- },
- {
- label:'项目名称',
- value:this.mainData.projectname
- },
- {
- label:'项目编号',
- value:this.mainData.projectnum
- },
- {
- label:'客户名称',
- value:this.mainData.ascription_enterprisename
- },
- {
- label:'合同有效期',
- value:`${this.mainData.begdate}至${this.mainData.enddate}`,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'签约日期',
- value:this.mainData.signdate
- },
- {
- label:this.mainData.calculatemodel == 1 ? '订单金额比例(%)' : '居间产品折扣(%)',
- value:this.mainData.calculatemodel == 1 ? Math.round((this.mainData.orderratio * 100)*100)/100 : Math.round((this.mainData.productdiscount *100)*100)/100,
- style:function () {
- let style = {color:'#3874f6'}
- return style
- }
- },
- {
- label:'业务员',
- value:this.mainData.salername
- },
- {
- label:'状态',
- value:this.mainData.status,
- style:function () {
- let style = {}
- switch (that.mainData.status) {
- case '新建':
- style = {color:'#3874f6'}
- break;
- case '已提交':
- style = {color:'#52c41a'}
- break;
- case '审核':
- style = {color:'#333333'}
- break;
- case '已过期':
- style = {color:'#999999'}
- break;
- default:
- break;
- }
- return style
- }
- },
- {
- label:'合同描述',
- value:this.mainData.remarks
- },
- ],
- systemInfo: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'最近编辑人',value:this.mainData.changeby},
- {label:'最近编辑时间',value:this.mainData.changedate},
- {label:'提交人',value:this.mainData.submitby},
- {label:'提交时间',value:this.mainData.submitdate},
- {label:'审核人',value:this.mainData.checkby},
- {label:'审核时间',value:this.mainData.checkdate},
- {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
- ]
- }
- },
- changeBill (data) {
- this.$confirm('确定把当前合同转为订单吗?','提示',{
- confirmButtonText:'确定',
- cancelButtonText:'取消',
- type:'warning'
- }).then(() => {
- Loading.service({ fullscreen: true ,text:'刷新中...'});
- this.$axios({
- method:'POST',
- url:'/yos/rest/index',
- data: {
- "accesstoken":JSON.parse(sessionStorage.getItem('active_account')).token,
- "id":20230322153702,
- "content": {
- "sa_contractid": this.$route.query.id
- }
- }
- }).then((res) => {
- Loading.service().close()
- this.tool.showMessage(res.data,() => {
- this.oldRoute = {path:this.$route.path,query:this.$route.query}
- this.$store.dispatch('setHistoryRouter',this.oldRoute)
- if (this.tool.checkAuth(this.$route.name,'changeBillMag')) {
- this.$router.push({
- path:'/orderdetail',
- query:{
- id:res.data.data.sa_orderid,
- }
- })
- } else if (this.tool.checkAuth(this.$route.name,'changeBillSaler')) {
- this.$router.push({
- path:'/saler_orderDetails',
- query:{
- id:res.data.data.sa_orderid,
- }
- })
- } else if (this.tool.checkAuth(this.$route.name,'changeBillOrder')) {
- this.$router.push({
- path:'/agent_orderDetails',
- query:{
- id:res.data.data.sa_orderid,
- }
- })
- }
- })
- })
- })
- },
- async bindImportOrder (id) {
- const res = await this.$api.requested({
- "id": 20230314133404,
- "content": {
- "sa_contractid":this.$route.query.id,
- "attachmentid":id
- }
- })
- if (res.data !== '成功') {
- this.errorUrl = res.data
- }
- this.tool.showMessage(res,() => {
- this.$refs.productDetailList.listData()
- })
- },
- // 监听切换数据,上一页,下一页
- pageChange (id,rowindex,tabIndex) {
- /*this.flag = false
- tabIndex = this.$route.query.tabIndex
- this.$router.replace({path:'/contractDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})*/
- this.queryMainData(id)
- },
- onSuccess(){
- this.visible = false
- this.queryMainData(this.$route.query.id)
- this.$emit('onSuccess')
- },
- successYear(year){
- this.$refs.taskTarget.year = year
- this.$refs.taskTarget.queryData()
- },
- closeDrawer(){
- this.$refs.classList.listData()
- },
- productAdd(){
- this.queryMainData()
- },
- /*同步合作协议*/
- async onCooperate(){
- if (this.$route.query.type === '居间'){
- const res = await this.$api.requested({
- "id":20240518155604,
- "content": {
- "sa_contractid": this.$route.query.id
- },
- })
- this.tool.showMessage(res,()=>{
- this.cooperateVisible = false
- this.$refs.productDetailList.params.content.pageNumber = 1
- this.$refs.productDetailList.listData()
- this.queryMainData()
- })
- }else {
- const res = await this.$api.requested({
- "id": 20231204153904,
- "content": {
- "sa_contractid": this.$route.query.id,
- "isadd":this.cooperateForm.isadd
- }
- })
- this.tool.showMessage(res,()=>{
- this.cooperateVisible = false
- this.$refs.billno.params.content.pageNumber = 1
- this.$refs.billno.listData()
- this.queryMainData()
- })
- }
- },
- async onCooperateItem(){
- if (this.$route.query.type === '居间'){
- const res = await this.$api.requested({
- "id": 20240518160504,
- "content": {
- "sa_contractid": this.$route.query.id,
- }
- })
- this.tool.showMessage(res,()=>{
- this.cooperateVisible = false
- this.$refs.classList.params.content.pageNumber = 1
- this.$refs.classList.listData()
- this.queryMainData()
- })
- }else {
- const res = await this.$api.requested({
- "id": 20231208154904,
- "content": {
- "sa_contractid": this.$route.query.id,
- "isadd":this.cooperateForm.isadd
- }
- })
- this.tool.showMessage(res,()=>{
- this.cooperateVisible = false
- this.$refs.itemClass.param.content.pageNumber = 1
- this.$refs.itemClass.listData()
- this.queryMainData()
- })
- }
- }
- // async getModelList () {
- // let res = await this.$api.requested({
- // "id": 20221121155801,
- // "content": {
- // "pageNumber": 1,
- // "pageSize": 999999,
- // "where":{
- // "condition":""
- // }
- // }
- // })
- // this.modelList = res.data
- // console.log(this.modelList);
- // },
- },
- mounted () {
- this.queryMainData(this.$route.query.id)
- // this.getModelList()
- },
- created() {
- /*this.queryMainData(this.$route.query.id)*/
- }
- }
- </script>
- <style scoped>
- </style>
|