detail.vue 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="mainData.title"
  6. :editData="mainData"
  7. :mainAreaData="mainAreaData"
  8. turnPageId="20221121201502"
  9. idname="sa_contractid"
  10. typeTask="合同"
  11. ownertable="sa_contract"
  12. :tabs="tabs"
  13. :statusCheck="[{key:'status',value:'已提交'},{key:'status',value:'审核'},{key:'status',value:'已终止'}]"
  14. :attachmentDisabled="mainData.status == '已提交' || mainData.status == '审核' || mainData.status == '已终止' || mainData.status == '已过期'"
  15. @pageChange="pageChange"
  16. @onEditSuccess="editSuccess">
  17. <div slot="tags">
  18. </div>
  19. <div slot="customOperation">
  20. <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" />
  21. <el-button
  22. type="primary"
  23. size="mini"
  24. @click="changeBill"
  25. 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'))"
  26. >{{$t('一键转单')}}</el-button>
  27. <revoke class="inline-16" @onSuccess="queryMainData($route.query.id)" :data="mainData" v-if="tool.checkAuth($route.name,'revoke') && mainData.status === '已提交' && isLeader" ></revoke>
  28. <submit-check class="inline-16" :disabled="!isLeader" ref="submit" :data="mainData" @onSuccess="queryMainData($route.query.id)" />
  29. <reverseCheck class="inline-16" @onSuccess="queryMainData($route.query.id)" :data="mainData" v-if="tool.checkAuth($route.name,'reverseCheck') && mainData.status === '审核'" />
  30. <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)" />
  31. <copyTo class="inline-16" v-if="tool.checkAuth($route.name,'copy')"></copyTo>
  32. <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"/>
  33. </div>
  34. <div slot="slot0" >
  35. <div v-if="mainData.type == '项目'">
  36. <!--项目产品明细折扣表-->
  37. <productBillno :data="mainData" :isLeader="isLeader" ref="billno" @priceChange="queryMainData($route.query.id)" @delSuccess="queryMainData" @onSuccess="productAdd" >
  38. <template v-slot:edit="scope">
  39. </template>
  40. <template v-slot:del="scope">
  41. </template>
  42. <template v-slot:cooperate="scope">
  43. <el-button :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productBillManage') && isLeader">{{$t('同步合作协议')}}</el-button>
  44. <el-dialog :title="$t('同步合作协议')" :visible.sync="cooperateVisible" append-to-body width="703px">
  45. <span style="color: #8C8C8C;font-size: 14px">{{$t('请选择同步更新经销商/直销客户合作协议产品的方式')}}:</span>
  46. <el-form :model="cooperateForm" style="margin-top: 20px">
  47. <el-radio v-model="cooperateForm.isadd" label="1" style="margin-bottom: 20px">
  48. <span style="font-size: 16px;color: #333333">{{$t('同步添加合作协议产品')}}</span><br><br>
  49. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  50. {{$t('将协议中所有产品添加到表体,若表体已存在产品,则协议中相同产品的信息及其折扣价格覆盖更新')}}
  51. </span><br><br>
  52. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  53. {{$t('到表体')}}。
  54. </span> <br><br>
  55. </el-radio>
  56. <el-radio v-model="cooperateForm.isadd" label="0">
  57. <span style="font-size: 16px;color: #333333">{{$t('仅更新合作协议的产品折扣价格')}}</span><br><br>
  58. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  59. {{$t('将协议中与表体相同的产品信息及其折扣价格覆盖更新到表体,不添加协议产品')}}。
  60. </span>
  61. </el-radio>
  62. </el-form>
  63. <div slot="footer" class="dialog-footer">
  64. <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
  65. <el-button size="small" type="primary" @click="onCooperate" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
  66. </div>
  67. </el-dialog>
  68. </template>
  69. </productBillno>
  70. </div>
  71. <div v-if="mainData.type == '框架' || mainData.type == '直销' ">
  72. <!--产品明细折扣表-->
  73. <productDetailList :data="mainData" :isLeader="isLeader" ref="productDetailList" @priceChange="queryMainData($route.query.id)" @closeDrawer="queryMainData($route.query.id)">
  74. <importFile
  75. v-if="tool.checkAuth($route.name,'exportProduct') && isLeader && mainData.status === '新建'"
  76. slot="export"
  77. ref="importFile"
  78. class="inline-16"
  79. :bindData="{ownertable:'sa_contract',ownerid:$route.query.id,usetype:'default'}"
  80. :errorUrl="errorUrl"
  81. @clearUrl="errorUrl = null"
  82. @onSuccess="bindImportOrder"
  83. ></importFile>
  84. <template v-slot:cooperate="scope">
  85. <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 == '居间'">{{$t('同步协议')}}</el-button>
  86. <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
  87. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  88. {{$t('是否添加关联的项目或客户合同中的产品明细同步更新到列表')}}
  89. </span>
  90. <div slot="footer" class="dialog-footer">
  91. <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
  92. <el-button size="small" type="primary" @click="onCooperate" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
  93. </div>
  94. </el-dialog>
  95. </template>
  96. </productDetailList>
  97. </div>
  98. <div v-if="mainData.type == '居间'">
  99. <!-- 详细信息 -->
  100. <BaseInfo v-if="siteid === 'HY'" :detailInfo="detailInfo"/>
  101. <!--产品明细折扣表-->
  102. <productDetailList v-else :data="mainData" :isLeader="isLeader" ref="productDetailList" @priceChange="queryMainData($route.query.id)" @closeDrawer="queryMainData($route.query.id)">
  103. <importFile
  104. v-if="tool.checkAuth($route.name,'exportProduct') && isLeader && mainData.status === '新建'"
  105. slot="export"
  106. ref="importFile"
  107. class="inline-16"
  108. :bindData="{ownertable:'sa_contract',ownerid:$route.query.id,usetype:'default'}"
  109. :errorUrl="errorUrl"
  110. @clearUrl="errorUrl = null"
  111. @onSuccess="bindImportOrder"
  112. ></importFile>
  113. <template v-slot:cooperate="scope">
  114. <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 == '居间'">{{$t('同步协议')}}</el-button>
  115. <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
  116. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  117. {{$t('是否添加关联的项目或客户合同中的产品明细同步更新到列表')}}
  118. </span>
  119. <div slot="footer" class="dialog-footer">
  120. <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
  121. <el-button size="small" type="primary" @click="onCooperate" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
  122. </div>
  123. </el-dialog>
  124. </template>
  125. </productDetailList>
  126. </div>
  127. <div v-if="mainData.type == '工具借用'">
  128. <!--工具清单-->
  129. <toolList :data="mainData" :isLeader="isLeader" ref="toolList" v-if="mainData.type == '工具借用'" @priceChange="queryMainData($route.query.id)">
  130. <template v-slot:edit="scope">
  131. </template>
  132. </toolList>
  133. </div>
  134. </div>
  135. <div slot="slot1" >
  136. <!-- 居间 -->
  137. <div v-if="mainData.type === '居间'">
  138. <contactList v-if="siteid === 'HY' && mainData && tool.checkAuth($route.name,'contact')" :data="mainData"></contactList>
  139. <productClassList v-else :data="mainData" :isLeader="isLeader" ref="classList" @priceChange="queryMainData($route.query.id)">
  140. <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"/>
  141. <template v-slot:edit="scope">
  142. </template>
  143. <template v-slot:cooperate="scope">
  144. <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 == '居间'">{{$t('同步协议')}}</el-button>
  145. <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
  146. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  147. {{$t('是否添加关联的项目或客户合同中的产品类别同步更新到列表')}}
  148. </span>
  149. <div slot="footer" class="dialog-footer">
  150. <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
  151. <el-button size="small" type="primary" @click="onCooperateItem" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
  152. </div>
  153. </el-dialog>
  154. </template>
  155. </productClassList>
  156. </div>
  157. <div v-if="mainData.type == '框架' || mainData.type == '直销' ">
  158. <!--产品类别折扣表-->
  159. <productClassList :data="mainData" :isLeader="isLeader" ref="classList" @priceChange="queryMainData($route.query.id)" >
  160. <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"/>
  161. <template v-slot:edit="scope">
  162. </template>
  163. <template v-slot:cooperate="scope">
  164. <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 == '居间'">{{$t('同步协议')}}</el-button>
  165. <el-dialog title="同步协议" :visible.sync="cooperateVisible" append-to-body width="703px" center>
  166. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  167. {{$t('是否添加关联的项目或客户合同中的产品类别同步更新到列表')}}
  168. </span>
  169. <div slot="footer" class="dialog-footer">
  170. <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
  171. <el-button size="small" type="primary" @click="onCooperateItem" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
  172. </div>
  173. </el-dialog>
  174. </template>
  175. </productClassList>
  176. </div>
  177. <div v-if="mainData.type == '项目'">
  178. <!-- 产品类别折扣 -->
  179. <itemClass ref="itemClass" :data="mainData" :isLeader="isLeader" >
  180. <template v-slot:cooperate="scope">
  181. <addClass class="inline-16" v-if="tool.checkAuth($route.name,'productClassManage') && mainData.status === '新建' && isLeader" :disabled="mainData.status != '新建' || !isLeader" :typeName="mainData.type" slot="addProduct" @onSuccess="$refs.itemClass.listData()" title="自产品类别添加" ref="addProduct" @closeDrawer="closeDrawer"/>
  182. <el-button :disabled="mainData.status !== '新建'" size="small" :type="mainData.status === '新建'?'primary':''" @click="cooperateVisible = true" v-if="tool.checkAuth($route.name,'productClassManage') && isLeader">{{$t('同步合作协议')}}</el-button>
  183. <el-dialog :title="$t('同步合作协议')" :visible.sync="cooperateVisible" append-to-body width="703px">
  184. <span style="color: #8C8C8C;font-size: 14px">{{$t('请选择同步更新经销商/直销客户合作协议产品类别的方式')}}:</span>
  185. <el-form :model="cooperateForm" style="margin-top: 20px">
  186. <el-radio v-model="cooperateForm.isadd" label="1" style="margin-bottom: 20px">
  187. <span style="font-size: 16px;color: #333333">{{$t('同步添加合作协议产品类别及其折扣')}}</span><br><br>
  188. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  189. {{$t('将协议中所有产品类别及其折扣添加到表体,若表体已存在产品类别,则协议中相同产品类别的折扣')}}
  190. </span><br><br>
  191. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  192. {{$t('覆盖更新到表体')}}。
  193. </span> <br><br>
  194. </el-radio>
  195. <el-radio v-model="cooperateForm.isadd" label="0">
  196. <span style="font-size: 16px;color: #333333">{{$t('仅更新合作协议的产品类别折扣')}}</span><br><br>
  197. <span style="font-size: 14px;color: #8C8C8C;margin: 20px 0 0 22px;padding-top: 20px">
  198. {{$t('将协议中与表体相同的产品类别的折扣价格覆盖更新到表体,不添加协议的产品类别')}}。
  199. </span>
  200. </el-radio>
  201. </el-form>
  202. <div slot="footer" class="dialog-footer">
  203. <el-button size="small" @click="cooperateVisible = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
  204. <el-button size="small" type="primary" @click="onCooperateItem" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
  205. </div>
  206. </el-dialog>
  207. </template>
  208. </itemClass>
  209. </div>
  210. <div v-if="mainData.type === '工具借用'">
  211. <BaseInfo :detailInfo="detailInfo"/>
  212. </div>
  213. </div>
  214. <div slot="slot2">
  215. <div v-if="Object.keys(mainData).length > 0 && (mainData.type == '框架' || mainData.type == '直销')" >
  216. <!--业绩目标-->
  217. <taskTarget ref="taskTarget" :data="mainData">
  218. <template v-slot:addTarget="scope">
  219. <add-target :disabled="mainData.status != '新建' || !isLeader" v-if="tool.checkAuth($route.name,'taskTargetManage')" :data="mainData" @onSuccess="successYear"></add-target>
  220. </template>
  221. <template v-slot:edit="scope">
  222. <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()"/>
  223. </template>
  224. <template v-slot:delete="scope">
  225. <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>
  226. </template>
  227. </taskTarget>
  228. </div>
  229. <div v-if="mainData.type == '项目'">
  230. <!-- 差价 -->
  231. <priceDifference v-if="siteid == 'HY' && tool.checkAuth($route.name,'brokerageFeeEntrySet')" :data="mainData"></priceDifference>
  232. <!-- 详细信息 -->
  233. <BaseInfo v-else :detailInfo="detailInfo"/>
  234. </div>
  235. <div v-if="mainData.type == '居间'">
  236. <BaseInfo v-if="siteid !== 'HY'" :detailInfo="detailInfo"/>
  237. </div>
  238. </div>
  239. <div slot="slot3">
  240. <div v-if="mainData.type === '居间' && siteid !== 'HY'">
  241. <contactList v-if="mainData && tool.checkAuth($route.name,'contact')" :data="mainData"></contactList>
  242. </div>
  243. <div v-if="mainData.type == '框架' || mainData.type == '直销'">
  244. <priceDifference v-if="siteid == 'HY' && tool.checkAuth($route.name,'brokerageFeeEntrySet')" :data="mainData"></priceDifference>
  245. <BaseInfo v-else :detailInfo="detailInfo"/>
  246. </div>
  247. <div v-if="mainData.type == '项目'">
  248. <BaseInfo :detailInfo="detailInfo"/>
  249. </div>
  250. </div>
  251. <div slot="slot4">
  252. <div v-if="mainData.type == '框架' || mainData.type == '直销'">
  253. <BaseInfo :detailInfo="detailInfo"/>
  254. </div>
  255. </div>
  256. </basicDetails>
  257. </div>
  258. </template>
  259. <script>
  260. import Del from '../components/delete'
  261. import editBtn from '../components/editContract'
  262. import SubmitCheck from '../components/submitCheck'
  263. import productBillno from '../components/productList/productBillno.vue'
  264. import productDetailList from '../components/productDetailList/productDetailList.vue'
  265. import addProduct from '../components/productList/addProduct'
  266. import addProductDetail from '../components/productDetailList/addProduct.vue'
  267. import addTool from '../components/toolList/addTool'
  268. import toolList from '../components/toolList/toolList.vue'
  269. import addClass from '../components/productClassList/addProduct'
  270. import productClassList from '../components/productClassList/productClassList.vue'
  271. import contractClause from '../components/contractClause/contractClause'
  272. import editTarget from '../components/taskTarget/editTarget'
  273. import addTarget from '../components/taskTarget/addTarget'
  274. import taskTarget from '../components/taskTarget/taskTarget'
  275. import delTarget from '../components/taskTarget/delTarget'
  276. import contractOver from '../components/contractOver'
  277. import reverseCheck from '../components/reverseCheck'
  278. import revoke from "@/HDrpManagement/contractManage/components/revoke";
  279. import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo'
  280. import itemClass from '../components/itemClass/index.vue'
  281. import importFile from '../components/importFile'
  282. import copyTo from '../components/copyTo'
  283. import priceDifference from '../components/priceDifference/index'
  284. import contactList from '../components/contactList/index'
  285. import { Loading } from 'element-ui';
  286. export default {
  287. name: "detail",
  288. data() {
  289. return {
  290. mainData:{},
  291. mainAreaData:{},
  292. modelList:[],
  293. isLeader:false,
  294. detailInfo:{},
  295. message:'确定删除当前条款吗?',
  296. errorUrl:null,
  297. cooperateVisible:false,
  298. cooperateForm:{
  299. "sa_contractid": "",
  300. "isadd":''
  301. },
  302. siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid,
  303. tabs:[]
  304. }
  305. },
  306. components:{
  307. Del,
  308. SubmitCheck,
  309. editBtn,
  310. productBillno,
  311. addProduct,
  312. productDetailList,
  313. addProductDetail,
  314. addTool,
  315. toolList,
  316. addClass,
  317. productClassList,
  318. contractClause,
  319. editTarget,
  320. taskTarget,
  321. contractOver,
  322. reverseCheck,
  323. addTarget,
  324. delTarget,
  325. BaseInfo,
  326. revoke,
  327. itemClass,
  328. importFile,
  329. copyTo,
  330. priceDifference,
  331. contactList
  332. },
  333. provide () {
  334. return {
  335. detailData:() => this.mainData,
  336. }
  337. },
  338. watch: {
  339. mainData: {
  340. async handler (val) {
  341. const res = await this.$api.requested({
  342. "id": 20220930103501,
  343. "content": {
  344. "ownertable":"sa_contract",
  345. "ownerid":this.$route.query.id
  346. }
  347. })
  348. const agent = await this.$api.requested({
  349. "id":20230329122604,
  350. "content": {
  351. "ownertable":"sa_contract",
  352. "ownerid":this.$route.query.id
  353. }
  354. })
  355. if (this.mainData.leader && this.mainData.leader.length > 0){
  356. if (JSON.parse(window.sessionStorage.getItem('active_account')).userid === this.mainData.leader[0].userid){
  357. this.isLeader = true
  358. }else {
  359. let flag = 0
  360. for (var i=0;i<res.data[0].team.length;i++){
  361. if (res.data[0].team[i].userid === JSON.parse(window.sessionStorage.getItem('active_account')).userid){
  362. if (res.data[0].team[i].editable === 1){
  363. flag =1
  364. break
  365. }else {
  366. flag = 0
  367. break
  368. }
  369. }
  370. }
  371. console.log(agent.data.editable,'agent.data.editable')
  372. flag === 0 ?agent.data.editable === 0?this.isLeader = false:this.isLeader = true:this.isLeader = true
  373. this.$refs.details.$refs.group.editdataleader = agent.data.editdataleader
  374. console.log(this.isLeader,'isLeader')
  375. }
  376. }
  377. },
  378. deep:true,
  379. immediate:true
  380. }
  381. },
  382. methods:{
  383. tabsSet(){
  384. switch (this.mainData.type) {
  385. case '项目':
  386. this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'brokerageFeeEntrySet')?['产品明细折扣','产品类别折扣','差价','详细信息']:['产品明细折扣','产品类别折扣','详细信息']:['产品明细折扣','产品类别折扣','详细信息']
  387. break
  388. case '框架':
  389. this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'brokerageFeeEntrySet')?['产品明细折扣','产品类别折扣','业绩目标','差价','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']
  390. break
  391. case '居间':
  392. this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'contact')?['详细信息','联系人']:['详细信息']:this.tool.checkAuth(this.$route.name,'contact')?['产品明细折扣','产品类别折扣','详细信息','联系人']:['产品明细折扣','产品类别折扣','详细信息']
  393. break
  394. case '直销':
  395. this.tabs = this.siteid == 'HY'?this.tool.checkAuth(this.$route.name,'brokerageFeeEntrySet')?['产品明细折扣','产品类别折扣','业绩目标','差价','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']:['产品明细折扣','产品类别折扣','业绩目标','详细信息']
  396. break
  397. default:
  398. this.tabs = ['工具清单','详细信息']
  399. }
  400. },
  401. editSuccess(){
  402. this.queryMainData(this.$route.query.id)
  403. },
  404. async queryMainData(id) {
  405. this.$refs.details.$refs.group.queryGroup()
  406. const res = await this.$api.requested({
  407. "id":20221121195102,
  408. "content": {
  409. "nocache":true,
  410. "sa_contractid": this.$route.query.id
  411. }
  412. })
  413. this.mainData = res.data
  414. console.log(this.$refs.details.param.content,'param')
  415. // this.$refs.details.param.content.type = this.$route.query.tabIndex
  416. // this.$refs.details.param.content.where.type = this.$route.query.type
  417. let listqueryid = sessionStorage.getItem('listqueryid')
  418. this.mainData.type == '项目'
  419. ? this.mainData.typemx == '直销'
  420. ? 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'}})
  421. : 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'}})
  422. this.changeDataStructure()
  423. this.tabsSet()
  424. },
  425. changeDataStructure() {
  426. let that = this
  427. this.mainData.type == '项目'
  428. ? this.mainData.typemx == '直销'
  429. ? this.mainAreaData = [
  430. /* 直销信息 */
  431. {
  432. label:'合同编号',
  433. value:this.mainData.billno
  434. },
  435. {
  436. label:'合同标题',
  437. value:this.mainData.title
  438. },
  439. {
  440. label:'合同类型',
  441. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议') : this.$t('经销项目协议') : ''
  442. },
  443. {
  444. label:'合同模板',
  445. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议模板') : this.$t('经销项目协议模板') : ''
  446. },
  447. {
  448. label:'客户',
  449. value:this.mainData.enterprisename
  450. },
  451. {
  452. label:'项目名称',
  453. value:this.mainData.projectname
  454. },
  455. {
  456. label:'项目编号',
  457. value:this.mainData.projectnum?this.mainData.projectnum:'--'
  458. },
  459. {
  460. label:'业务员',
  461. value:this.mainData.salername
  462. },
  463. {
  464. label:'合同有效期',
  465. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  466. style:function () {
  467. let style = {color:'#3874f6'}
  468. return style
  469. }
  470. },
  471. {
  472. label:'签约日期',
  473. value:this.mainData.signdate
  474. },
  475. {
  476. label:'签约金额(元)',
  477. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0,
  478. style:function () {
  479. let style = {color:'#3874f6'}
  480. return style
  481. }
  482. },
  483. /*{
  484. label:'收货人',
  485. value:this.mainData.name
  486. },
  487. {
  488. label:'收货人电话',
  489. value:this.mainData.phonenumber
  490. },
  491. {
  492. label:'创建时间',
  493. value:this.mainData.createdate
  494. },
  495. {
  496. label:'创建人',
  497. value:this.mainData.createby
  498. },*/
  499. {
  500. label:'折扣(%)',
  501. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  502. },
  503. {
  504. label:'状态',
  505. value:this.mainData.status,
  506. style:function () {
  507. let style = {}
  508. switch (that.mainData.status) {
  509. case '新建':
  510. style = {color:'#3874f6'}
  511. break;
  512. case '已提交':
  513. style = {color:'#52c41a'}
  514. break;
  515. case '审核':
  516. style = {color:'#333333'}
  517. break;
  518. case '已过期':
  519. style = {color:'#999999'}
  520. break;
  521. default:
  522. break;
  523. }
  524. return style
  525. }
  526. },
  527. /* {
  528. label:'合同描述',
  529. value:this.mainData.remarks
  530. },*/
  531. ] : this.mainAreaData = [
  532. /* 经销信息 */
  533. {
  534. label:'合同编号',
  535. value:this.mainData.billno
  536. },
  537. {
  538. label:'合同标题',
  539. value:this.mainData.title
  540. },
  541. {
  542. label:'合同类型',
  543. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议') : this.$t('经销项目协议') : ''
  544. },
  545. {
  546. label:'经销商',
  547. value:this.mainData.enterprisename
  548. },
  549. {
  550. label:'项目名称',
  551. value:this.mainData.projectname
  552. },
  553. {
  554. label:'项目编号',
  555. value:this.mainData.projectnum
  556. },
  557. {
  558. label:'合同有效期',
  559. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  560. style:function () {
  561. let style = {color:'#3874f6'}
  562. return style
  563. }
  564. },
  565. {
  566. label:'签约日期',
  567. value:this.mainData.signdate
  568. },
  569. {
  570. label:'签约金额(元)',
  571. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  572. },
  573. {
  574. label:'折扣(%)',
  575. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  576. },
  577. {
  578. label:'业务员',
  579. value:this.mainData.salername
  580. },
  581. {
  582. label:'状态',
  583. value:this.mainData.status,
  584. style:function () {
  585. let style = {}
  586. switch (that.mainData.status) {
  587. case '新建':
  588. style = {color:'#3874f6'}
  589. break;
  590. case '已提交':
  591. style = {color:'#52c41a'}
  592. break;
  593. case '审核':
  594. style = {color:'#333333'}
  595. break;
  596. case '已过期':
  597. style = {color:'#999999'}
  598. break;
  599. default:
  600. break;
  601. }
  602. return style
  603. }
  604. },
  605. /* {
  606. label:'合同模板',
  607. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? '直销项目协议模板' : '经销项目协议模板' : ''
  608. },
  609. {
  610. label:'创建时间',
  611. value:this.mainData.createdate
  612. },
  613. {
  614. label:'创建人',
  615. value:this.mainData.createby
  616. },
  617. {
  618. label:'合同描述',
  619. value:this.mainData.remarks
  620. },*/
  621. ] : this.mainData.type == '框架'
  622. ? this.mainAreaData = [
  623. /* 合作协议 */
  624. {
  625. label:'合同编号',
  626. value:this.mainData.billno
  627. },
  628. {
  629. label:'合同标题',
  630. value:this.mainData.title
  631. },
  632. {
  633. label:'合同类型',
  634. value:'经销商合作协议'
  635. },
  636. {
  637. label:'经销商',
  638. value:this.mainData.enterprisename
  639. },
  640. {
  641. label:'折扣(%)',
  642. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  643. },
  644. {
  645. label:'合同有效期',
  646. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  647. style:function () {
  648. let style = {color:'#3874f6'}
  649. return style
  650. }
  651. },
  652. {
  653. label:'签约日期',
  654. value:this.mainData.signdate
  655. },
  656. // {
  657. // label:'签约金额(元)',
  658. // value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0.00
  659. // },
  660. {
  661. label:'业务员',
  662. value:this.mainData.salername
  663. },
  664. {
  665. label:'状态',
  666. value:this.mainData.status,
  667. style:function () {
  668. let style = {}
  669. switch (that.mainData.status) {
  670. case '新建':
  671. style = {color:'#3874f6'}
  672. break;
  673. case '已提交':
  674. style = {color:'#52c41a'}
  675. break;
  676. case '审核':
  677. style = {color:'#333333'}
  678. break;
  679. case '已过期':
  680. style = {color:'#999999'}
  681. break;
  682. default:
  683. break;
  684. }
  685. return style
  686. }
  687. },
  688. /* {
  689. label:'合同模板',
  690. value:'经销商合作协议模板'
  691. },
  692. {
  693. label:'创建时间',
  694. value:this.mainData.createdate
  695. },
  696. {
  697. label:'创建人',
  698. value:this.mainData.createby
  699. },
  700. {
  701. label:'合同描述',
  702. value:this.mainData.remarks
  703. },*/
  704. ] : this.mainData.type == '直销'
  705. ? this.mainAreaData = [
  706. /* 直销客户协议 */
  707. {
  708. label:'合同编号',
  709. value:this.mainData.billno
  710. },
  711. {
  712. label:'合同标题',
  713. value:this.mainData.title
  714. },
  715. {
  716. label:'合同类型',
  717. value:'直销客户合作协议'
  718. },
  719. {
  720. label:'客户',
  721. value:this.mainData.enterprisename
  722. },
  723. {
  724. label:'折扣(%)',
  725. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  726. },
  727. {
  728. label:'合同有效期',
  729. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  730. style:function () {
  731. let style = {color:'#3874f6'}
  732. return style
  733. }
  734. },
  735. {
  736. label:'签约日期',
  737. value:this.mainData.signdate
  738. },
  739. {
  740. label:'业务员',
  741. value:this.mainData.salername
  742. },
  743. {
  744. label:'状态',
  745. value:this.mainData.status,
  746. style:function () {
  747. let style = {}
  748. switch (that.mainData.status) {
  749. case '新建':
  750. style = {color:'#3874f6'}
  751. break;
  752. case '已提交':
  753. style = {color:'#52c41a'}
  754. break;
  755. case '审核':
  756. style = {color:'#333333'}
  757. break;
  758. case '已过期':
  759. style = {color:'#999999'}
  760. break;
  761. default:
  762. break;
  763. }
  764. return style
  765. }
  766. },
  767. ]:
  768. this.mainData.type == '工具借用'
  769. ? this.mainAreaData = [
  770. /* 工具借用 */
  771. {
  772. label:'合同编号',
  773. value:this.mainData.billno
  774. },
  775. {
  776. label:'合同标题',
  777. value:this.mainData.title
  778. },
  779. {
  780. label:'合同模板',
  781. value:'工具借用协议模板'
  782. },
  783. {
  784. label:'客户',
  785. value:this.mainData.enterprisename
  786. },
  787. {
  788. label:'合同类型',
  789. value:'工具借用协议'
  790. },
  791. {
  792. label:'业务员',
  793. value:this.mainData.salername
  794. },
  795. {
  796. label:'合同有效期',
  797. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  798. style:function () {
  799. let style = {color:'#3874f6'}
  800. return style
  801. }
  802. },
  803. {
  804. label:'签约日期',
  805. value:this.mainData.signdate
  806. },
  807. {
  808. label:'单套价格(元)',
  809. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  810. },
  811. {
  812. label:'创建时间',
  813. value:this.mainData.createdate
  814. },
  815. {
  816. label:'创建人',
  817. value:this.mainData.createby
  818. },
  819. {
  820. label:'状态',
  821. value:this.mainData.status,
  822. style:function () {
  823. let style = {}
  824. switch (that.mainData.status) {
  825. case '新建':
  826. style = {color:'#3874f6'}
  827. break;
  828. case '已提交':
  829. style = {color:'#52c41a'}
  830. break;
  831. case '审核':
  832. style = {color:'#333333'}
  833. break;
  834. case '已过期':
  835. style = {color:'#999999'}
  836. break;
  837. default:
  838. break;
  839. }
  840. return style
  841. }
  842. },
  843. {
  844. label:'合同描述',
  845. value:this.mainData.remarks
  846. },
  847. ] : this.mainAreaData = [
  848. /* 居间协议 */
  849. {
  850. label:'合同编号',
  851. value:this.mainData.billno
  852. },
  853. {
  854. label:'合同标题',
  855. value:this.mainData.title
  856. },
  857. {
  858. label:'合同类型',
  859. value:'居间协议'
  860. },
  861. {
  862. label:'居间商',
  863. value:this.mainData.enterprisename
  864. },
  865. {
  866. label:'合同',
  867. value:this.mainData.ascription_title
  868. },
  869. {
  870. label:'项目名称',
  871. value:this.mainData.projectname
  872. },
  873. {
  874. label:'项目编号',
  875. value:this.mainData.projectnum
  876. },
  877. {
  878. label:'客户名称',
  879. value:this.mainData.ascription_enterprisename
  880. },
  881. {
  882. label:'合同有效期',
  883. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  884. style:function () {
  885. let style = {color:'#3874f6'}
  886. return style
  887. }
  888. },
  889. {
  890. label:'签约日期',
  891. value:this.mainData.signdate
  892. },
  893. {
  894. label:this.mainData.calculatemodel == 1 ? this.$t('订单金额比例(%)') : this.$t('居间产品折扣(%)'),
  895. value:this.mainData.calculatemodel == 1 ? Math.round((this.mainData.orderratio * 100)*100)/100 : Math.round((this.mainData.productdiscount *100)*100)/100,
  896. style:function () {
  897. let style = {color:'#3874f6'}
  898. return style
  899. }
  900. },
  901. /* {
  902. label:'合同模板',
  903. value:'居间协议模板'
  904. },*/
  905. {
  906. label:'状态',
  907. value:this.mainData.status,
  908. style:function () {
  909. let style = {}
  910. switch (that.mainData.status) {
  911. case '新建':
  912. style = {color:'#3874f6'}
  913. break;
  914. case '已提交':
  915. style = {color:'#52c41a'}
  916. break;
  917. case '审核':
  918. style = {color:'#333333'}
  919. break;
  920. case '已过期':
  921. style = {color:'#999999'}
  922. break;
  923. default:
  924. break;
  925. }
  926. return style
  927. }
  928. },
  929. /* {
  930. label:'业务员',
  931. value:this.mainData.salername
  932. },
  933. {
  934. label:'创建时间',
  935. value:this.mainData.createdate
  936. },
  937. {
  938. label:'创建人',
  939. value:this.mainData.createby
  940. },
  941. {
  942. label:'合同描述',
  943. value:this.mainData.remarks
  944. },*/
  945. ]
  946. this.mainData.type == '项目'
  947. ? this.mainData.typemx == '直销'
  948. ? this.detailInfo = {
  949. baseInfo : [
  950. /* 直销信息 */
  951. {
  952. label:'合同编号',
  953. value:this.mainData.billno
  954. },
  955. {
  956. label:'合同标题',
  957. value:this.mainData.title
  958. },
  959. {
  960. label:'合同模板',
  961. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议模板') : this.$t('经销项目协议模板') : ''
  962. },
  963. {
  964. label:'合同类型',
  965. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议') : this.$t('经销项目协议') : ''
  966. },
  967. {
  968. label:'客户',
  969. value:this.mainData.enterprisename
  970. },
  971. {
  972. label:'项目名称',
  973. value:this.mainData.projectname
  974. },
  975. {
  976. label:'项目编号',
  977. value:this.mainData.projectnum
  978. },
  979. {
  980. label:'项目地址',
  981. value:this.mainData.projectname ? this.mainData.province + this.mainData.city + this.mainData.county + this.mainData.address:'--'
  982. },
  983. {
  984. label:'收货人',
  985. value:this.mainData.name
  986. },
  987. {
  988. label:'收货人电话',
  989. value:this.mainData.phonenumber
  990. },
  991. {
  992. label:'合同有效期',
  993. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  994. style:function () {
  995. let style = {color:'#3874f6'}
  996. return style
  997. }
  998. },
  999. {
  1000. label:'签约日期',
  1001. value:this.mainData.signdate
  1002. },
  1003. {
  1004. label:'签约金额(元)',
  1005. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  1006. },
  1007. {
  1008. label:'折扣(%)',
  1009. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  1010. },
  1011. {
  1012. label:'领域',
  1013. value:this.mainData.tradefield ? this.mainData.tradefield : '--'
  1014. },
  1015. {
  1016. label:'品牌',
  1017. value:this.mainData.brandname
  1018. },
  1019. {
  1020. label:'付款条件',
  1021. value:this.mainData.paytype
  1022. },
  1023. {
  1024. label:'业务员',
  1025. value:this.mainData.salername
  1026. },
  1027. {
  1028. label:'状态',
  1029. value:this.mainData.status,
  1030. style:function () {
  1031. let style = {}
  1032. switch (that.mainData.status) {
  1033. case '新建':
  1034. style = {color:'#3874f6'}
  1035. break;
  1036. case '已提交':
  1037. style = {color:'#52c41a'}
  1038. break;
  1039. case '审核':
  1040. style = {color:'#333333'}
  1041. break;
  1042. case '已过期':
  1043. style = {color:'#999999'}
  1044. break;
  1045. default:
  1046. break;
  1047. }
  1048. return style
  1049. }
  1050. },
  1051. {
  1052. label:'合同描述',
  1053. value:this.mainData.remarks
  1054. },
  1055. ],
  1056. systemInfo: [
  1057. {label:'创建人',value:this.mainData.createby},
  1058. {label:'创建时间',value:this.mainData.createdate},
  1059. {label:'最近编辑人',value:this.mainData.changeby},
  1060. {label:'最近编辑时间',value:this.mainData.changedate},
  1061. {label:'提交人',value:this.mainData.submitby},
  1062. {label:'提交时间',value:this.mainData.submitdate},
  1063. {label:'审核人',value:this.mainData.checkby},
  1064. {label:'审核时间',value:this.mainData.checkdate},
  1065. /* {label:'作废原因',value:this.mainData.leader[0].leadernum == 0?'0':this.mainData.leader[0].leadernum},*/
  1066. {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
  1067. ]
  1068. }
  1069. : this.detailInfo = {
  1070. baseInfo : [
  1071. /* 经销信息 */
  1072. {
  1073. label:'合同编号',
  1074. value:this.mainData.billno
  1075. },
  1076. {
  1077. label:'合同标题',
  1078. value:this.mainData.title
  1079. },
  1080. {
  1081. label:'合同模板',
  1082. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议模板') : this.$t('经销项目协议模板') : ''
  1083. },
  1084. {
  1085. label:'合同类型',
  1086. value:this.mainData.type == '项目' ? this.mainData.typemx == '直销' ? this.$t('直销项目协议') : this.$t('经销项目协议') : ''
  1087. },
  1088. {
  1089. label:'项目名称',
  1090. value:this.mainData.projectname
  1091. },
  1092. {
  1093. label:'项目编号',
  1094. value:this.mainData.projectnum
  1095. },
  1096. {
  1097. label:'合同有效期',
  1098. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  1099. style:function () {
  1100. let style = {color:'#3874f6'}
  1101. return style
  1102. }
  1103. },
  1104. {
  1105. label:'签约日期',
  1106. value:this.mainData.signdate
  1107. },
  1108. {
  1109. label:'签约金额(元)',
  1110. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  1111. },
  1112. {
  1113. label:'折扣(%)',
  1114. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  1115. },
  1116. {
  1117. label:'领域',
  1118. value:this.mainData.tradefield ? this.mainData.tradefield : '--'
  1119. },
  1120. {
  1121. label:'品牌',
  1122. value:this.mainData.brandname
  1123. },
  1124. {
  1125. label:'付款条件',
  1126. value:this.mainData.paytype
  1127. },
  1128. {
  1129. label:'业务员',
  1130. value:this.mainData.salername
  1131. },
  1132. /* {
  1133. label:'经销商',
  1134. value:this.mainData.enterprisename
  1135. },*/
  1136. {
  1137. label:'状态',
  1138. value:this.mainData.status,
  1139. style:function () {
  1140. let style = {}
  1141. switch (that.mainData.status) {
  1142. case '新建':
  1143. style = {color:'#3874f6'}
  1144. break;
  1145. case '已提交':
  1146. style = {color:'#52c41a'}
  1147. break;
  1148. case '审核':
  1149. style = {color:'#333333'}
  1150. break;
  1151. case '已过期':
  1152. style = {color:'#999999'}
  1153. break;
  1154. default:
  1155. break;
  1156. }
  1157. return style
  1158. }
  1159. },
  1160. {
  1161. label:'合同描述',
  1162. value:this.mainData.remarks
  1163. },
  1164. ],
  1165. systemInfo: [
  1166. {label:'创建人',value:this.mainData.createby},
  1167. {label:'创建时间',value:this.mainData.createdate},
  1168. {label:'最近编辑人',value:this.mainData.changeby},
  1169. {label:'最近编辑时间',value:this.mainData.changedate},
  1170. {label:'提交人',value:this.mainData.submitby},
  1171. {label:'提交时间',value:this.mainData.submitdate},
  1172. {label:'审核人',value:this.mainData.checkby},
  1173. {label:'审核时间',value:this.mainData.checkdate},
  1174. {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
  1175. ]
  1176. }
  1177. : this.mainData.type == '框架'
  1178. ? this.detailInfo ={
  1179. baseInfo : [
  1180. /* 合作协议 */
  1181. {
  1182. label:'合同编号',
  1183. value:this.mainData.billno
  1184. },
  1185. {
  1186. label:'合同标题',
  1187. value:this.mainData.title
  1188. },
  1189. {
  1190. label:'合同模板',
  1191. value:'经销商合作协议模板'
  1192. },
  1193. {
  1194. label:'合同类型',
  1195. value:'经销商合作协议'
  1196. },
  1197. {
  1198. label:'经销商',
  1199. value:this.mainData.enterprisename
  1200. },
  1201. {
  1202. label:'折扣(%)',
  1203. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  1204. },
  1205. {
  1206. label:'合同有效期',
  1207. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  1208. style:function () {
  1209. let style = {color:'#3874f6'}
  1210. return style
  1211. }
  1212. },
  1213. {
  1214. label:'签约日期',
  1215. value:this.mainData.signdate
  1216. },
  1217. {
  1218. label:'签约金额(元)',
  1219. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  1220. },
  1221. {
  1222. label:'折扣(%)',
  1223. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  1224. },
  1225. {
  1226. label:'领域',
  1227. value:this.mainData.tradefield ? this.mainData.tradefield : '--'
  1228. },
  1229. {
  1230. label:'品牌',
  1231. value:this.mainData.brandname
  1232. },
  1233. {
  1234. label:'付款条件',
  1235. value:this.mainData.paytype
  1236. },
  1237. {
  1238. label:'业务员',
  1239. value:this.mainData.salername
  1240. },
  1241. {
  1242. label:'状态',
  1243. value:this.mainData.status,
  1244. style:function () {
  1245. let style = {}
  1246. switch (that.mainData.status) {
  1247. case '新建':
  1248. style = {color:'#3874f6'}
  1249. break;
  1250. case '已提交':
  1251. style = {color:'#52c41a'}
  1252. break;
  1253. case '审核':
  1254. style = {color:'#333333'}
  1255. break;
  1256. case '已过期':
  1257. style = {color:'#999999'}
  1258. break;
  1259. default:
  1260. break;
  1261. }
  1262. return style
  1263. }
  1264. },
  1265. {
  1266. label:'合同描述',
  1267. value:this.mainData.remarks
  1268. },
  1269. ],
  1270. systemInfo: [
  1271. {label:'创建人',value:this.mainData.createby},
  1272. {label:'创建时间',value:this.mainData.createdate},
  1273. {label:'最近编辑人',value:this.mainData.changeby},
  1274. {label:'最近编辑时间',value:this.mainData.changedate},
  1275. {label:'提交人',value:this.mainData.submitby},
  1276. {label:'提交时间',value:this.mainData.submitdate},
  1277. {label:'审核人',value:this.mainData.checkby},
  1278. {label:'审核时间',value:this.mainData.checkdate},
  1279. {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
  1280. ]
  1281. }
  1282. : this.mainData.type == '直销'
  1283. ? this.detailInfo ={
  1284. baseInfo : [
  1285. /* 直销客户协议 */
  1286. {
  1287. label:'合同编号',
  1288. value:this.mainData.billno
  1289. },
  1290. {
  1291. label:'合同标题',
  1292. value:this.mainData.title
  1293. },
  1294. {
  1295. label:'合同模板',
  1296. value:'直销客户合作协议模板'
  1297. },
  1298. {
  1299. label:'合同类型',
  1300. value:'直销客户合作协议'
  1301. },
  1302. {
  1303. label:'客户',
  1304. value:this.mainData.enterprisename
  1305. },
  1306. {
  1307. label:'合同有效期',
  1308. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  1309. style:function () {
  1310. let style = {color:'#3874f6'}
  1311. return style
  1312. }
  1313. },
  1314. {
  1315. label:'签约日期',
  1316. value:this.mainData.signdate
  1317. },
  1318. {
  1319. label:'签约金额(元)',
  1320. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  1321. },
  1322. {
  1323. label:'折扣(%)',
  1324. value:this.mainData.discountrate !== 0?Math.round((this.mainData.discountrate * 100)*100)/100:'--'
  1325. },
  1326. {
  1327. label:'领域',
  1328. value:this.mainData.tradefield ? this.mainData.tradefield : '--'
  1329. },
  1330. {
  1331. label:'品牌',
  1332. value:this.mainData.brandname
  1333. },
  1334. {
  1335. label:'付款条件',
  1336. value:this.mainData.paytype
  1337. },
  1338. {
  1339. label:'业务员',
  1340. value:this.mainData.salername
  1341. },
  1342. {
  1343. label:'状态',
  1344. value:this.mainData.status,
  1345. style:function () {
  1346. let style = {}
  1347. switch (that.mainData.status) {
  1348. case '新建':
  1349. style = {color:'#3874f6'}
  1350. break;
  1351. case '已提交':
  1352. style = {color:'#52c41a'}
  1353. break;
  1354. case '审核':
  1355. style = {color:'#333333'}
  1356. break;
  1357. case '已过期':
  1358. style = {color:'#999999'}
  1359. break;
  1360. default:
  1361. break;
  1362. }
  1363. return style
  1364. }
  1365. },
  1366. {
  1367. label:'合同描述',
  1368. value:this.mainData.remarks
  1369. },
  1370. ],
  1371. systemInfo: [
  1372. {label:'创建人',value:this.mainData.createby},
  1373. {label:'创建时间',value:this.mainData.createdate},
  1374. {label:'最近编辑人',value:this.mainData.changeby},
  1375. {label:'最近编辑时间',value:this.mainData.changedate},
  1376. {label:'提交人',value:this.mainData.submitby},
  1377. {label:'提交时间',value:this.mainData.submitdate},
  1378. {label:'审核人',value:this.mainData.checkby},
  1379. {label:'审核时间',value:this.mainData.checkdate},
  1380. {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
  1381. ]
  1382. }:this.mainData.type == '工具借用'
  1383. ? this.detailInfo = {
  1384. baseInfo : [
  1385. /* 工具借用 */
  1386. {
  1387. label:'合同编号',
  1388. value:this.mainData.billno
  1389. },
  1390. {
  1391. label:'合同标题',
  1392. value:this.mainData.title
  1393. },
  1394. {
  1395. label:'合同模板',
  1396. value:'工具借用协议模板'
  1397. },
  1398. {
  1399. label:'客户',
  1400. value:this.mainData.enterprisename
  1401. },
  1402. {
  1403. label:'合同类型',
  1404. value:'工具借用协议'
  1405. },
  1406. {
  1407. label:'业务员',
  1408. value:this.mainData.salername
  1409. },
  1410. {
  1411. label:'合同有效期',
  1412. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  1413. style:function () {
  1414. let style = {color:'#3874f6'}
  1415. return style
  1416. }
  1417. },
  1418. {
  1419. label:'签约日期',
  1420. value:this.mainData.signdate
  1421. },
  1422. {
  1423. label:'单套价格(元)',
  1424. value:this.mainData.signamount?this.tool.formatAmount(this.mainData.signamount,2):0
  1425. },
  1426. {
  1427. label:'状态',
  1428. value:this.mainData.status,
  1429. style:function () {
  1430. let style = {}
  1431. switch (that.mainData.status) {
  1432. case '新建':
  1433. style = {color:'#3874f6'}
  1434. break;
  1435. case '已提交':
  1436. style = {color:'#52c41a'}
  1437. break;
  1438. case '审核':
  1439. style = {color:'#333333'}
  1440. break;
  1441. case '已过期':
  1442. style = {color:'#999999'}
  1443. break;
  1444. default:
  1445. break;
  1446. }
  1447. return style
  1448. }
  1449. },
  1450. {
  1451. label:'合同描述',
  1452. value:this.mainData.remarks
  1453. },
  1454. ],
  1455. systemInfo: [
  1456. {label:'创建人',value:this.mainData.createby},
  1457. {label:'创建时间',value:this.mainData.createdate},
  1458. {label:'最近编辑人',value:this.mainData.changeby},
  1459. {label:'最近编辑时间',value:this.mainData.changedate},
  1460. {label:'提交人',value:this.mainData.submitby},
  1461. {label:'提交时间',value:this.mainData.submitdate},
  1462. {label:'审核人',value:this.mainData.checkby},
  1463. {label:'审核时间',value:this.mainData.checkdate},
  1464. {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
  1465. ]
  1466. }
  1467. : this.detailInfo = {
  1468. baseInfo : [
  1469. /* 居间协议 */
  1470. {
  1471. label:'合同编号',
  1472. value:this.mainData.billno
  1473. },
  1474. {
  1475. label:'合同标题',
  1476. value:this.mainData.title
  1477. },
  1478. {
  1479. label:'合同模板',
  1480. value:'居间协议模板'
  1481. },
  1482. {
  1483. label:'合同类型',
  1484. value:'居间协议'
  1485. },
  1486. {
  1487. label:'居间商',
  1488. value:this.mainData.enterprisename
  1489. },
  1490. {
  1491. label:'合同',
  1492. value:this.mainData.ascription_title
  1493. },
  1494. {
  1495. label:'项目名称',
  1496. value:this.mainData.projectname
  1497. },
  1498. {
  1499. label:'项目编号',
  1500. value:this.mainData.projectnum
  1501. },
  1502. {
  1503. label:'客户名称',
  1504. value:this.mainData.ascription_enterprisename
  1505. },
  1506. {
  1507. label:'合同有效期',
  1508. value:`${this.mainData.begdate}至${this.mainData.enddate}`,
  1509. style:function () {
  1510. let style = {color:'#3874f6'}
  1511. return style
  1512. }
  1513. },
  1514. {
  1515. label:'签约日期',
  1516. value:this.mainData.signdate
  1517. },
  1518. {
  1519. label:this.mainData.calculatemodel == 1 ? this.$t('订单金额比例(%)') : this.$t('居间产品折扣(%)'),
  1520. value:this.mainData.calculatemodel == 1 ? Math.round((this.mainData.orderratio * 100)*100)/100 : Math.round((this.mainData.productdiscount *100)*100)/100,
  1521. style:function () {
  1522. let style = {color:'#3874f6'}
  1523. return style
  1524. }
  1525. },
  1526. {
  1527. label:'业务员',
  1528. value:this.mainData.salername
  1529. },
  1530. {
  1531. label:'状态',
  1532. value:this.mainData.status,
  1533. style:function () {
  1534. let style = {}
  1535. switch (that.mainData.status) {
  1536. case '新建':
  1537. style = {color:'#3874f6'}
  1538. break;
  1539. case '已提交':
  1540. style = {color:'#52c41a'}
  1541. break;
  1542. case '审核':
  1543. style = {color:'#333333'}
  1544. break;
  1545. case '已过期':
  1546. style = {color:'#999999'}
  1547. break;
  1548. default:
  1549. break;
  1550. }
  1551. return style
  1552. }
  1553. },
  1554. {
  1555. label:'合同描述',
  1556. value:this.mainData.remarks
  1557. },
  1558. ],
  1559. systemInfo: [
  1560. {label:'创建人',value:this.mainData.createby},
  1561. {label:'创建时间',value:this.mainData.createdate},
  1562. {label:'最近编辑人',value:this.mainData.changeby},
  1563. {label:'最近编辑时间',value:this.mainData.changedate},
  1564. {label:'提交人',value:this.mainData.submitby},
  1565. {label:'提交时间',value:this.mainData.submitdate},
  1566. {label:'审核人',value:this.mainData.checkby},
  1567. {label:'审核时间',value:this.mainData.checkdate},
  1568. {label:'转手次数',value:this.mainData.leader?this.mainData.leader[0].leadernum:"--"}
  1569. ]
  1570. }
  1571. },
  1572. changeBill (data) {
  1573. this.$confirm(this.$t('确定把当前合同转为订单吗')+'?',this.$t('提示'),{
  1574. confirmButtonText:this.$t('确定'),
  1575. cancelButtonText:this.$t('取消'),
  1576. type:'warning'
  1577. }).then(() => {
  1578. Loading.service({ fullscreen: true ,text:this.$t('刷新中...')});
  1579. this.$axios({
  1580. method:'POST',
  1581. url:'/yos/rest/index',
  1582. data: {
  1583. "accesstoken":JSON.parse(sessionStorage.getItem('active_account')).token,
  1584. "id":20230322153702,
  1585. "content": {
  1586. "sa_contractid": this.$route.query.id
  1587. }
  1588. }
  1589. }).then((res) => {
  1590. Loading.service().close()
  1591. this.tool.showMessage(res.data,() => {
  1592. this.oldRoute = {path:this.$route.path,query:this.$route.query}
  1593. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  1594. if (this.tool.checkAuth(this.$route.name,'changeBillMag')) {
  1595. this.$router.push({
  1596. path:'/orderdetail',
  1597. query:{
  1598. id:res.data.data.sa_orderid,
  1599. }
  1600. })
  1601. } else if (this.tool.checkAuth(this.$route.name,'changeBillSaler')) {
  1602. this.$router.push({
  1603. path:'/saler_orderDetails',
  1604. query:{
  1605. id:res.data.data.sa_orderid,
  1606. }
  1607. })
  1608. } else if (this.tool.checkAuth(this.$route.name,'changeBillOrder')) {
  1609. this.$router.push({
  1610. path:'/agent_orderDetails',
  1611. query:{
  1612. id:res.data.data.sa_orderid,
  1613. }
  1614. })
  1615. }
  1616. })
  1617. })
  1618. })
  1619. },
  1620. async bindImportOrder (id) {
  1621. const res = await this.$api.requested({
  1622. "id": 20230314133404,
  1623. "content": {
  1624. "sa_contractid":this.$route.query.id,
  1625. "attachmentid":id
  1626. }
  1627. })
  1628. if (res.data !== '成功') {
  1629. this.errorUrl = res.data
  1630. }
  1631. this.tool.showMessage(res,() => {
  1632. this.$refs.productDetailList.listData()
  1633. })
  1634. },
  1635. // 监听切换数据,上一页,下一页
  1636. pageChange (id,rowindex,tabIndex) {
  1637. /*this.flag = false
  1638. tabIndex = this.$route.query.tabIndex
  1639. this.$router.replace({path:'/contractDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})*/
  1640. this.queryMainData(id)
  1641. },
  1642. onSuccess(){
  1643. this.visible = false
  1644. this.queryMainData(this.$route.query.id)
  1645. this.$emit('onSuccess')
  1646. },
  1647. successYear(year){
  1648. this.$refs.taskTarget.year = year
  1649. this.$refs.taskTarget.queryData()
  1650. },
  1651. closeDrawer(){
  1652. this.$refs.classList.listData()
  1653. },
  1654. productAdd(){
  1655. this.queryMainData()
  1656. },
  1657. /*同步合作协议*/
  1658. async onCooperate(){
  1659. if (this.$route.query.type === '居间'){
  1660. const res = await this.$api.requested({
  1661. "id":20240518155604,
  1662. "content": {
  1663. "sa_contractid": this.$route.query.id
  1664. },
  1665. })
  1666. this.tool.showMessage(res,()=>{
  1667. this.cooperateVisible = false
  1668. this.$refs.productDetailList.params.content.pageNumber = 1
  1669. this.$refs.productDetailList.listData()
  1670. this.queryMainData()
  1671. })
  1672. }else {
  1673. const res = await this.$api.requested({
  1674. "id": 20231204153904,
  1675. "content": {
  1676. "sa_contractid": this.$route.query.id,
  1677. "isadd":this.cooperateForm.isadd
  1678. }
  1679. })
  1680. this.tool.showMessage(res,()=>{
  1681. this.cooperateVisible = false
  1682. this.$refs.billno.params.content.pageNumber = 1
  1683. this.$refs.billno.listData()
  1684. this.queryMainData()
  1685. })
  1686. }
  1687. },
  1688. async onCooperateItem(){
  1689. if (this.$route.query.type === '居间'){
  1690. const res = await this.$api.requested({
  1691. "id": 20240518160504,
  1692. "content": {
  1693. "sa_contractid": this.$route.query.id,
  1694. }
  1695. })
  1696. this.tool.showMessage(res,()=>{
  1697. this.cooperateVisible = false
  1698. this.$refs.classList.params.content.pageNumber = 1
  1699. this.$refs.classList.listData()
  1700. this.queryMainData()
  1701. })
  1702. }else {
  1703. const res = await this.$api.requested({
  1704. "id": 20231208154904,
  1705. "content": {
  1706. "sa_contractid": this.$route.query.id,
  1707. "isadd":this.cooperateForm.isadd
  1708. }
  1709. })
  1710. this.tool.showMessage(res,()=>{
  1711. this.cooperateVisible = false
  1712. this.$refs.itemClass.param.content.pageNumber = 1
  1713. this.$refs.itemClass.listData()
  1714. this.queryMainData()
  1715. })
  1716. }
  1717. }
  1718. // async getModelList () {
  1719. // let res = await this.$api.requested({
  1720. // "id": 20221121155801,
  1721. // "content": {
  1722. // "pageNumber": 1,
  1723. // "pageSize": 999999,
  1724. // "where":{
  1725. // "condition":""
  1726. // }
  1727. // }
  1728. // })
  1729. // this.modelList = res.data
  1730. // console.log(this.modelList);
  1731. // },
  1732. },
  1733. mounted () {
  1734. this.queryMainData(this.$route.query.id)
  1735. // this.getModelList()
  1736. },
  1737. created() {
  1738. /*this.queryMainData(this.$route.query.id)*/
  1739. }
  1740. }
  1741. </script>
  1742. <style scoped>
  1743. </style>