detail.vue 71 KB

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