ProjectSelectionDrawer.vue 102 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937
  1. <template>
  2. <el-drawer
  3. v-model="visible"
  4. direction="rtl"
  5. size="80%"
  6. :before-close="handleClose"
  7. class="project-detail-drawer"
  8. :with-header="false"
  9. >
  10. <!-- 顶部标题栏 -->
  11. <div class="detail-header">
  12. <span class="project-title">{{ modeTitle }}</span>
  13. <el-icon class="close-btn" @click="handleClose"><CloseIcon /></el-icon>
  14. </div>
  15. <!-- 模式 1: 详情展示模式 -->
  16. <template v-if="!isEdit">
  17. <!-- 项目进度步骤条 -->
  18. <div class="progress-section">
  19. <div class="section-label">项目进度</div>
  20. <div class="step-bar">
  21. <div class="step" v-for="(step, idx) in stepList" :key="idx"
  22. :class="{ active: (form.projectStatus || 0) === (idx + 1), finished: (form.projectStatus || 0) > (idx + 1) }"
  23. @click="handleStepClick(idx + 1)">
  24. <span class="step-text">{{ step }}</span>
  25. </div>
  26. </div>
  27. <div class="progress-link-row">
  28. <span class="progress-label">最新进度</span>
  29. <span class="progress-link" @click="showProgressDrawer = true">全部进度</span>
  30. </div>
  31. </div>
  32. <div class="detail-container">
  33. <!-- 左侧详情内容 -->
  34. <div class="detail-left">
  35. <el-tabs v-model="activeTab" class="custom-tabs">
  36. <el-tab-pane label="项目信息" name="info">
  37. <!-- 悬浮在右侧的编辑按钮 (原型图标准) -->
  38. <el-button type="primary" class="floating-edit-btn" @click="handleEdit">
  39. <el-icon style="margin-right: 4px;"><EditIcon /></el-icon> 编辑
  40. </el-button>
  41. <div class="info-block">
  42. <div class="block-header">
  43. <div class="block-title">基本信息</div>
  44. </div>
  45. <div class="info-grid info-grid-2col">
  46. <div class="info-item full-row">
  47. <span class="label">项目名称</span>
  48. <span class="value">{{ form.projectName || '' }}</span>
  49. </div>
  50. <div class="info-item">
  51. <span class="label">归属公司</span>
  52. <span class="value">{{ companyName }}</span>
  53. </div>
  54. <div class="info-item">
  55. <span class="label">客户名称</span>
  56. <span class="value">{{ form.customerName || '' }}</span>
  57. </div>
  58. <div class="info-item">
  59. <span class="label">行业</span>
  60. <span class="value">{{ industryName }}</span>
  61. </div>
  62. <div class="info-item">
  63. <span class="label">部门</span>
  64. <span class="value">{{ deptName }}</span>
  65. </div>
  66. <div class="info-item">
  67. <span class="label">项目负责人</span>
  68. <span class="value">{{ leaderName }}</span>
  69. </div>
  70. <div class="info-item">
  71. <span class="label">项目状态</span>
  72. <span class="value status-text">
  73. <el-tag
  74. v-if="options.status.find(o => String(o.dictValue || o.value) === String(form.projectStatus))"
  75. :class="['custom-status-tag', String(form.projectStatus) === '1' ? 'status-follow' : 'status-done']"
  76. effect="plain"
  77. >
  78. {{ options.status.find(o => String(o.dictValue || o.value) === String(form.projectStatus))?.dictLabel || options.status.find(o => String(o.dictValue || o.value) === String(form.projectStatus))?.label }}
  79. </el-tag>
  80. </span>
  81. </div>
  82. <div class="info-item">
  83. <span class="label">项目级别</span>
  84. <span class="value grade-text">
  85. {{ options.level.find(o => String(o.dictValue || o.value) === String(form.projectLevel))?.dictLabel || options.level.find(o => String(o.dictValue || o.value) === String(form.projectLevel))?.label }}
  86. </span>
  87. </div>
  88. <div class="info-item left-only">
  89. <span class="label">项目类型</span>
  90. <span class="value">
  91. {{ options.type.find(o => String(o.dictValue || o.value) === String(form.businessType))?.dictLabel || options.type.find(o => String(o.dictValue || o.value) === String(form.businessType))?.label }}
  92. </span>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="info-block mt-24">
  97. <div class="block-header">
  98. <div class="block-title">项目情况</div>
  99. </div>
  100. <div class="info-grid info-grid-3col">
  101. <div class="info-item"><span class="label">登记日期</span><span class="value">{{ proxy.parseTime(form.createTime, '{y}-{m}-{d}') }}</span></div>
  102. <div class="info-item"><span class="label">金额(万)</span><span class="value">{{ form.amount || '0.00' }}</span></div>
  103. <div class="info-item"><span class="label">报名费</span><span class="value">{{ form.entryFee || '0.00' }}</span></div>
  104. <div class="info-item"><span class="label">投标保证金</span><span class="value">{{ form.bidBond || '0.00' }}</span></div>
  105. <div class="info-item"><span class="label">赢单率(%)</span><span class="value">{{ form.winningRate || '0' }}%</span></div>
  106. <div class="info-item"><span class="label">报名截止时间</span><span class="value">{{ proxy.parseTime(form.signUpDeadline, '{y}-{m}-{d}') }}</span></div>
  107. <div class="info-item"><span class="label">投标截止时间</span><span class="value">{{ proxy.parseTime(form.tenderDeadline, '{y}-{m}-{d}') }}</span></div>
  108. <div class="info-item"><span class="label">标书汇编完成时间</span><span class="value">--</span></div>
  109. <div class="info-item"><span class="label">服务期(年)</span><span class="value">{{ form.standardPeriod || '--' }}</span></div>
  110. <div class="info-item"><span class="label">服务时间段</span><span class="value">{{ form.serviceTime || '--' }}</span></div>
  111. <div class="info-item">
  112. <span class="label">入围类型</span>
  113. <span class="value">
  114. {{ options.shortlisted.find(o => String(o.dictValue || o.value) === String(form.shortlistedType))?.dictLabel || options.shortlisted.find(o => String(o.dictValue || o.value) === String(form.shortlistedType))?.label }}
  115. </span>
  116. </div>
  117. <div class="info-item">
  118. <span class="label">物资类目</span>
  119. <span class="value">
  120. {{ options.profession.find(o => String(o.dictValue || o.value) === String(form.profession))?.dictLabel || options.profession.find(o => String(o.dictValue || o.value) === String(form.profession))?.label }}
  121. </span>
  122. </div>
  123. <div class="info-item"><span class="label">招标代理机构</span><span class="value">{{ form.biddingAgency || '--' }}</span></div>
  124. <div class="info-item"><span class="label">机构联系方式</span><span class="value">{{ form.agencyContact || '--' }}</span></div>
  125. <div class="info-item empty-cell"></div>
  126. <div class="info-item"><span class="label">标期类型</span><span class="value">{{ form.bidPeriodType === 1 ? '单项目入围' : '周期性框架' }}</span></div>
  127. <div class="info-item"><span class="label">预计下次投标时间</span><span class="value">{{ proxy.parseTime(form.nextBiddingTime, '{y}-{m}-{d}') }}</span></div>
  128. <div class="info-item"><span class="label">提前提醒天数</span><span class="value">{{ form.noticeAdvanceDays || '60' }}</span></div>
  129. <div class="info-item full-row-3col">
  130. <span class="label">招标链接</span>
  131. <span class="value link-text" @click="handleOpenLink(form.biddingLink)">{{ form.biddingLink || '--' }}</span>
  132. </div>
  133. <div class="info-item full-row-3col">
  134. <span class="label">入围要求</span>
  135. <span class="value wrap-text">{{ form.condition || '' }}</span>
  136. </div>
  137. <div class="info-item full-row-3col">
  138. <span class="label">项目描述</span>
  139. <span class="value wrap-text">{{ form.projectDesc || '' }}</span>
  140. </div>
  141. </div>
  142. </div>
  143. </el-tab-pane>
  144. <!-- 项目联系人 -->
  145. <el-tab-pane label="项目联系人" name="contact">
  146. <div class="tab-contact">
  147. <div style="display: flex; justify-content: flex-end; margin-bottom: 12px;">
  148. <el-dropdown @command="handleContactCommand">
  149. <el-button type="primary" size="small">
  150. <el-icon style="margin-right: 4px;"><PlusIcon /></el-icon> 新建联系人
  151. </el-button>
  152. <template #dropdown>
  153. <el-dropdown-menu>
  154. <el-dropdown-item command="link">关联客户联系人</el-dropdown-item>
  155. <el-dropdown-item command="create">新建联系人</el-dropdown-item>
  156. </el-dropdown-menu>
  157. </template>
  158. </el-dropdown>
  159. </div>
  160. <el-table :data="(form.contactList || [])" border class="contact-table">
  161. <el-table-column label="姓名" align="center" prop="name" min-width="100" show-overflow-tooltip />
  162. <el-table-column label="性别" align="center" prop="gender" width="70">
  163. <template #default="scope">{{ scope.row.gender === 1 ? '男' : scope.row.gender === 2 ? '女' : '--' }}</template>
  164. </el-table-column>
  165. <el-table-column label="部门" align="center" prop="deptName" min-width="100" show-overflow-tooltip />
  166. <el-table-column label="职位" align="center" prop="position" min-width="100" show-overflow-tooltip />
  167. <el-table-column label="项目角色" align="center" prop="roleName" min-width="100" show-overflow-tooltip />
  168. <el-table-column label="是否关键人" align="center" prop="isKeyPerson" width="100">
  169. <template #default="scope">{{ scope.row.isKeyPerson ? '是' : '否' }}</template>
  170. </el-table-column>
  171. <el-table-column label="手机号码" align="center" prop="phone" min-width="120" show-overflow-tooltip />
  172. <el-table-column label="办公座机" align="center" prop="tel" min-width="130" show-overflow-tooltip />
  173. <el-table-column label="操作" align="center" width="120">
  174. <template #default="scope">
  175. <el-button link type="primary" size="small">编辑</el-button>
  176. <el-button link type="danger" size="small">删除</el-button>
  177. </template>
  178. </el-table-column>
  179. </el-table>
  180. <div v-if="!(form.contactList && form.contactList.length)" class="tab-empty">暂无数据</div>
  181. </div>
  182. </el-tab-pane>
  183. <!-- 结果分析 -->
  184. <el-tab-pane label="结果分析" name="analysis">
  185. <div class="tab-analysis">
  186. <div class="analysis-form">
  187. <div class="form-field">
  188. <div class="field-label">成交结果</div>
  189. <el-radio-group v-model="form.resultType" size="small" style="margin-top: 4px;">
  190. <el-radio :value="1">赢单</el-radio>
  191. <el-radio :value="2">丢单</el-radio>
  192. </el-radio-group>
  193. </div>
  194. <div class="form-field">
  195. <div class="field-label">赢单总结</div>
  196. <el-input
  197. v-model="form.winSummary"
  198. type="textarea"
  199. placeholder="请输入赢单总结"
  200. :rows="5"
  201. resize="none"
  202. maxlength="500"
  203. show-word-limit
  204. />
  205. </div>
  206. </div>
  207. </div>
  208. </el-tab-pane>
  209. <!-- 附件 -->
  210. <el-tab-pane label="附件" name="files">
  211. <div class="tab-files">
  212. <div style="display: flex; justify-content: flex-end; margin-bottom: 12px;">
  213. <el-upload
  214. multiple
  215. :action="uploadFileUrl"
  216. :headers="headers"
  217. :show-file-list="false"
  218. :on-success="handleUploadSuccess"
  219. >
  220. <el-button type="primary" :icon="UploadIcon" size="small">上传附件</el-button>
  221. </el-upload>
  222. </div>
  223. <el-table :data="(form.fileList || [])" border class="file-table" empty-text="暂无附件">
  224. <el-table-column label="文件名称" align="left" prop="fileName" min-width="200" show-overflow-tooltip />
  225. <el-table-column label="文件类型" align="center" prop="fileType" width="100" />
  226. <el-table-column label="上传时间" align="center" prop="uploadTime" width="160" />
  227. <el-table-column label="操作" align="center" width="140">
  228. <template #default="scope">
  229. <el-button link type="primary" size="small" @click="handleDownloadFile(scope.row)">下载</el-button>
  230. <el-button link type="danger" size="small" @click="handleDeleteFile(scope.$index)">删除</el-button>
  231. </template>
  232. </el-table-column>
  233. </el-table>
  234. </div>
  235. </el-tab-pane>
  236. </el-tabs>
  237. </div>
  238. <!-- 右侧侧边栏内容 -->
  239. <div class="detail-right">
  240. <el-tabs v-model="activeSideTab" class="custom-tabs side-tabs">
  241. <el-tab-pane label="团队成员" name="team">
  242. <div class="side-content">
  243. <div class="team-header">
  244. <span>团队成员 ({{ (form.memberList || []).length }})</span>
  245. <el-icon class="add-icon" @click="handleAddMember"><PlusIcon /></el-icon>
  246. </div>
  247. <div class="search-box">
  248. <el-input v-model="memberSearchKeyword" placeholder="请输入成员" :prefix-icon="SearchIcon" clearable />
  249. </div>
  250. <div class="team-list">
  251. <div v-for="(m, i) in filteredMemberList" :key="i" class="team-item">
  252. <el-avatar :size="36" class="user-avatar">{{ (m.memberName || m.staffName || m.realName || '').charAt(0) }}</el-avatar>
  253. <div class="member-info">
  254. <div class="info-top">
  255. <span class="member-name">{{ m.memberName || m.staffName || m.realName }}{{ m.deptName ? '/' + m.deptName : '' }}</span>
  256. <el-tag v-if="m.izManager === 1" size="small" type="success" effect="plain" class="leader-tag">负责人</el-tag>
  257. <span class="role-desc">{{ m.roleName }}</span>
  258. <span class="permission-desc">{{ m.permission }}</span>
  259. </div>
  260. </div>
  261. <div class="member-actions">
  262. <el-button link class="btn-edit" size="small" @click="handleEditMember(m)">编辑</el-button>
  263. <el-button link class="btn-delete" size="small" @click="handleRemoveMember(m, i)">删除</el-button>
  264. </div>
  265. </div>
  266. <div v-if="!filteredMemberList.length" class="empty-data">暂无团队成员</div>
  267. </div>
  268. </div>
  269. </el-tab-pane>
  270. <el-tab-pane label="跟进记录" name="records">
  271. <div class="side-content">
  272. <div class="record-header">
  273. <el-button link type="primary" size="small" @click="handleAddRecord">
  274. <el-icon><PlusIcon /></el-icon> 新建跟进记录
  275. </el-button>
  276. <div class="filter-item">
  277. <span class="filter-label">拜访方式</span>
  278. <el-select v-model="recordFilterType" placeholder="请选择" size="small" style="width: 100px" clearable>
  279. <el-option v-for="item in options.visitType" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
  280. </el-select>
  281. </div>
  282. </div>
  283. <div class="record-list custom-scroll">
  284. <div v-if="!(form.followRecords && form.followRecords.length)" class="tab-empty">
  285. <el-empty description="暂无跟进记录" :image-size="60" />
  286. </div>
  287. <div v-else class="timeline-container">
  288. <div class="record-card-wrapper" v-for="(r, i) in form.followRecords" :key="i">
  289. <!-- 时间轴点与时间 -->
  290. <div class="timeline-header">
  291. <div class="timeline-dot"></div>
  292. <span class="timeline-time">{{ r.visitDate || r.createTime }}</span>
  293. </div>
  294. <!-- 内容卡片 -->
  295. <div class="record-card">
  296. <div class="card-top">
  297. <div class="user-info">
  298. <el-avatar :size="32" class="user-avatar">{{ (r.visitorName || r.createBy || '').charAt(0) }}</el-avatar>
  299. <div class="publish-info">
  300. <span class="user-name">{{ r.visitorName || r.createBy }}</span>
  301. <span class="publish-text">发布了条{{ options.visitType.find(o => String(o.dictValue) === String(r.visitType))?.dictLabel || '跟进' }}:</span>
  302. </div>
  303. </div>
  304. <el-icon class="expand-icon"><ArrowDown /></el-icon>
  305. </div>
  306. <div class="card-content">
  307. <div class="detail-row">
  308. <span class="label">客户:</span>
  309. <span class="value">{{ form.customerName }}</span>
  310. </div>
  311. <div class="detail-row">
  312. <span class="label">拜访目的:</span>
  313. <span class="value">{{ r.purpose || '--' }}</span>
  314. </div>
  315. <div class="detail-row">
  316. <span class="label">跟进情况:</span>
  317. <span class="value">{{ r.progress || r.content || '--' }}</span>
  318. </div>
  319. <!-- 记录图片 -->
  320. <div class="image-section" v-if="r.imageList && r.imageList.length">
  321. <span class="label">记录图片:</span>
  322. <div class="image-list">
  323. <el-image
  324. v-for="(img, idx) in r.imageList"
  325. :key="idx"
  326. :src="img"
  327. :preview-src-list="r.imageList"
  328. class="record-img"
  329. fit="cover"
  330. />
  331. </div>
  332. </div>
  333. <div class="update-time-row">
  334. <span class="label">更新时间:</span>
  335. <span class="value">{{ r.updateTime || r.visitDate || r.createTime }}</span>
  336. </div>
  337. </div>
  338. <!-- 回复区域 -->
  339. <div class="reply-section">
  340. <el-input
  341. v-model="r.replyContent"
  342. type="textarea"
  343. placeholder="请输入回复内容"
  344. :rows="3"
  345. resize="none"
  346. class="reply-input"
  347. />
  348. <div class="reply-btn-row">
  349. <el-button type="primary" size="small" class="reply-submit-btn" @click="handleReplySubmit(r)">
  350. <el-icon style="margin-right: 4px;"><ChatLineSquare /></el-icon> 回复
  351. </el-button>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. </div>
  357. </div>
  358. </div>
  359. </el-tab-pane>
  360. <el-tab-pane label="操作日志" name="logs">
  361. <div class="side-content">
  362. <div class="log-list">
  363. <div class="log-item" v-for="(log, i) in (form.operationLogs || [])" :key="i">
  364. <span class="log-time">{{ log.createTime }}</span>
  365. <span class="log-user">{{ log.operator }}</span>
  366. <span class="log-action">{{ formatLogAction(log) }}</span>
  367. <span class="log-target" style="margin-left: 4px;">{{ translateDetails(log.actionDetails) }}<template v-if="formatLogTarget(log)">:</template>{{ formatLogTarget(log) }}</span>
  368. </div>
  369. <div v-if="!(form.operationLogs && form.operationLogs.length)" class="tab-empty">
  370. <el-empty description="暂无日志" :image-size="60" />
  371. </div>
  372. </div>
  373. </div>
  374. </el-tab-pane>
  375. <el-tab-pane label="管理信息" name="manage">
  376. <div class="side-content manage-info-container">
  377. <div class="manage-info-grid">
  378. <div class="manage-item">
  379. <span class="label">创建人</span>
  380. <span class="value">{{ form.createByName || form.createBy || '--' }}</span>
  381. </div>
  382. <div class="manage-item">
  383. <span class="label">创建日期</span>
  384. <span class="value">{{ proxy.parseTime(form.createTime, '{y}-{m}-{d}') }}</span>
  385. </div>
  386. <div class="manage-item">
  387. <span class="label">修改日期</span>
  388. <span class="value">{{ proxy.parseTime(form.updateTime, '{y}-{m}-{d}') }}</span>
  389. </div>
  390. <div class="manage-item">
  391. <span class="label">最后修改人</span>
  392. <span class="value">{{ form.updateByName || form.updateBy || '--' }}</span>
  393. </div>
  394. </div>
  395. </div>
  396. </el-tab-pane>
  397. </el-tabs>
  398. </div>
  399. </div>
  400. </template>
  401. <!-- 模式 2: 表单编辑模式 -->
  402. <template v-else>
  403. <div class="edit-form-container">
  404. <el-form :model="form" :rules="rules" ref="formRef" label-width="0">
  405. <!-- 基本信息 -->
  406. <div class="form-section">
  407. <div class="form-section-header">
  408. <span class="section-title">基本信息</span>
  409. </div>
  410. <div class="form-grid form-grid-3col">
  411. <el-form-item prop="companyNo">
  412. <div class="form-item">
  413. <span class="field-label"><span class="required-star">*</span>归属公司</span>
  414. <el-select v-model="form.companyNo" placeholder="请选择" size="small">
  415. <el-option v-for="item in options.company" :key="item.companyCode || item.id" :label="item.companyName" :value="String(item.companyCode || item.id)" />
  416. </el-select>
  417. </div>
  418. </el-form-item>
  419. <el-form-item prop="customerName">
  420. <div class="form-item">
  421. <span class="field-label"><span class="required-star">*</span>客户名称</span>
  422. <el-select
  423. v-model="form.customerName"
  424. placeholder="请输入关键词搜索客户"
  425. size="small"
  426. filterable
  427. remote
  428. :remote-method="remoteLoadCustomers"
  429. :loading="customerLoading"
  430. clearable
  431. >
  432. <el-option
  433. v-for="item in options.customer"
  434. :key="item.id || item.customerNo"
  435. :label="item.customerName || item.customName"
  436. :value="item.customerName || item.customName"
  437. />
  438. </el-select>
  439. </div>
  440. </el-form-item>
  441. <el-form-item prop="businessType">
  442. <div class="form-item">
  443. <span class="field-label"><span class="required-star">*</span>项目类型</span>
  444. <el-select v-model="form.businessType" placeholder="请选择" size="small">
  445. <el-option v-for="item in options.type" :key="item.dictValue" :label="item.dictLabel" :value="String(item.dictValue)" />
  446. </el-select>
  447. </div>
  448. </el-form-item>
  449. <el-form-item prop="projectLevel">
  450. <div class="form-item">
  451. <span class="field-label"><span class="required-star">*</span>项目类别</span>
  452. <el-select v-model="form.projectLevel" placeholder="请选择" size="small">
  453. <el-option v-for="item in options.level" :key="item.dictValue" :label="item.dictLabel" :value="String(item.dictValue)" />
  454. </el-select>
  455. </div>
  456. </el-form-item>
  457. <el-form-item prop="leader">
  458. <div class="form-item">
  459. <span class="field-label">项目负责人</span>
  460. <el-select v-model="form.leader" placeholder="请选择" size="small">
  461. <el-option v-for="item in options.user" :key="item.staffId || item.userId" :label="item.staffName || item.nickName" :value="String(item.staffId || item.userId)" />
  462. </el-select>
  463. </div>
  464. </el-form-item>
  465. <div></div>
  466. <el-form-item prop="projectName" class="form-full-row">
  467. <div class="form-item form-full-item">
  468. <span class="field-label"><span class="required-star">*</span>项目名称</span>
  469. <el-input v-model="form.projectName" placeholder="请输入" size="small" />
  470. </div>
  471. </el-form-item>
  472. </div>
  473. </div>
  474. <!-- 项目情况 -->
  475. <div class="form-section">
  476. <div class="form-section-header">
  477. <span class="section-title">项目情况</span>
  478. </div>
  479. <div class="form-grid form-grid-3col">
  480. <!-- 第1行:金额 / 报名费 / 投标保证金 -->
  481. <el-form-item prop="amount">
  482. <div class="form-item">
  483. <span class="field-label"><span class="required-star">*</span>金额(万)</span>
  484. <el-input v-model="form.amount" placeholder="请输入" size="small">
  485. <template #append>万</template>
  486. </el-input>
  487. </div>
  488. </el-form-item>
  489. <el-form-item prop="entryFee">
  490. <div class="form-item">
  491. <span class="field-label"><span class="required-star">*</span>报名费</span>
  492. <el-input v-model="form.entryFee" placeholder="请输入" size="small" />
  493. </div>
  494. </el-form-item>
  495. <el-form-item prop="bidBond">
  496. <div class="form-item">
  497. <span class="field-label">投标保证金</span>
  498. <el-input v-model="form.bidBond" placeholder="请输入" size="small" />
  499. </div>
  500. </el-form-item>
  501. <!-- 第2行:赢单率 / 报名截止时间 / 投标截止时间 -->
  502. <el-form-item prop="winningRate">
  503. <div class="form-item">
  504. <span class="field-label"><span class="required-star">*</span>赢单率(%)</span>
  505. <el-input v-model="form.winningRate" placeholder="请输入" size="small">
  506. <template #append>%</template>
  507. </el-input>
  508. </div>
  509. </el-form-item>
  510. <el-form-item prop="signUpDeadline">
  511. <div class="form-item">
  512. <span class="field-label"><span class="required-star">*</span>报名截止时间</span>
  513. <el-date-picker v-model="form.signUpDeadline" type="date" placeholder="请选择" size="small" value-format="YYYY-MM-DD" />
  514. </div>
  515. </el-form-item>
  516. <el-form-item prop="tenderDeadline">
  517. <div class="form-item">
  518. <span class="field-label"><span class="required-star">*</span>投标截止时间</span>
  519. <el-date-picker v-model="form.tenderDeadline" type="date" placeholder="请选择" size="small" value-format="YYYY-MM-DD" />
  520. </div>
  521. </el-form-item>
  522. <!-- 第3行:服务期 / 服务时间段 / 入围类型 -->
  523. <el-form-item prop="standardPeriod">
  524. <div class="form-item">
  525. <span class="field-label"><span class="required-star">*</span>服务期(年)</span>
  526. <el-input v-model="form.standardPeriod" placeholder="请输入" size="small">
  527. <template #append>年</template>
  528. </el-input>
  529. </div>
  530. </el-form-item>
  531. <el-form-item prop="serviceTime">
  532. <div class="form-item">
  533. <span class="field-label">服务时间段</span>
  534. <el-input v-model="form.serviceTime" placeholder="请输入" size="small" />
  535. </div>
  536. </el-form-item>
  537. <el-form-item prop="shortlistedType">
  538. <div class="form-item">
  539. <span class="field-label"><span class="required-star">*</span>入围类型</span>
  540. <el-select v-model="form.shortlistedType" placeholder="请选择" size="small">
  541. <el-option v-for="item in options.shortlisted" :key="item.dictValue" :label="item.dictLabel" :value="String(item.dictValue)" />
  542. </el-select>
  543. </div>
  544. </el-form-item>
  545. <!-- 第4行:物资类目 / 招标代理机构 / 代理机构联系方式 -->
  546. <el-form-item prop="profession">
  547. <div class="form-item">
  548. <span class="field-label"><span class="required-star">*</span>物资类目</span>
  549. <el-select v-model="form.profession" placeholder="请选择" size="small">
  550. <el-option v-for="item in options.profession" :key="item.dictValue" :label="item.dictLabel" :value="String(item.dictValue)" />
  551. </el-select>
  552. </div>
  553. </el-form-item>
  554. <el-form-item prop="biddingAgency">
  555. <div class="form-item">
  556. <span class="field-label">招标代理机构</span>
  557. <el-input v-model="form.biddingAgency" placeholder="请输入" size="small" />
  558. </div>
  559. </el-form-item>
  560. <el-form-item prop="agencyContact">
  561. <div class="form-item">
  562. <span class="field-label">代理机构联系方式</span>
  563. <el-input v-model="form.agencyContact" placeholder="请输入" size="small" />
  564. </div>
  565. </el-form-item>
  566. <!-- 第5行:标期类型(整行) -->
  567. <el-form-item prop="bidPeriodType" class="form-full-row">
  568. <div class="form-item form-full-item">
  569. <span class="field-label"><span class="required-star">*</span>标期类型</span>
  570. <div style="display:flex;gap:24px;">
  571. <el-radio-group v-model="form.bidPeriodType" size="small">
  572. <el-radio :value="1">单项目入围</el-radio>
  573. <el-radio :value="2">周期性框架</el-radio>
  574. </el-radio-group>
  575. </div>
  576. </div>
  577. </el-form-item>
  578. <!-- 第6行:招标链接 -->
  579. <el-form-item prop="biddingLink" class="form-full-row" v-if="form.bidPeriodType === 2">
  580. <div class="form-item form-full-item">
  581. <span class="field-label">招标链接</span>
  582. <el-input v-model="form.biddingLink" placeholder="请输入/粘贴链接" size="small" />
  583. </div>
  584. </el-form-item>
  585. <!-- 第7行:入围要求 -->
  586. <el-form-item prop="condition" class="form-full-row">
  587. <div class="form-item form-full-item form-item-vertical">
  588. <span class="field-label"><span class="required-star">*</span>入围要求</span>
  589. <el-input v-model="form.condition" type="textarea" placeholder="请输入" :rows="4" maxlength="500" show-word-limit resize="none" />
  590. </div>
  591. </el-form-item>
  592. <!-- 第8行:项目描述 -->
  593. <el-form-item prop="projectDesc" class="form-full-row">
  594. <div class="form-item form-full-item form-item-vertical">
  595. <span class="field-label">项目描述</span>
  596. <el-input v-model="form.projectDesc" type="textarea" placeholder="请输入" :rows="4" maxlength="500" show-word-limit resize="none" />
  597. </div>
  598. </el-form-item>
  599. </div>
  600. </div>
  601. <!-- 附件 -->
  602. <div class="form-section">
  603. <div class="form-section-header">
  604. <span class="section-title">附件</span>
  605. <el-upload
  606. :action="uploadFileUrl"
  607. :headers="headers"
  608. :on-success="handleUploadSuccess"
  609. :show-file-list="false"
  610. multiple
  611. >
  612. <span class="upload-link"><el-icon><UploadIcon /></el-icon> 上传附件</span>
  613. </el-upload>
  614. </div>
  615. <el-table :data="(form.fileList || [])" class="attachment-table" empty-text="暂无附件" border>
  616. <el-table-column label="文件名称" align="left" prop="fileName" show-overflow-tooltip />
  617. <el-table-column label="文件类型" align="center" prop="fileType" width="100" />
  618. <el-table-column label="上传时间" align="center" prop="uploadTime" width="160" />
  619. <el-table-column label="操作" align="center" width="120">
  620. <template #default="scope">
  621. <el-button link type="primary" size="small" @click="handleDownloadFile(scope.row)">下载</el-button>
  622. <el-button link type="danger" size="small" @click="handleDeleteFile(scope.$index)">删除</el-button>
  623. </template>
  624. </el-table-column>
  625. </el-table>
  626. </div>
  627. </el-form>
  628. <div class="edit-drawer-footer">
  629. <el-button size="small" @click="handleCancelEdit">取消</el-button>
  630. <el-button type="primary" size="small" @click="submitForm">保存</el-button>
  631. </div>
  632. </div>
  633. </template>
  634. </el-drawer>
  635. <!-- 查看进度抽屉 -->
  636. <el-drawer
  637. v-model="showProgressDrawer"
  638. direction="rtl"
  639. size="480px"
  640. :with-header="false"
  641. class="progress-drawer"
  642. :close-on-click-modal="true"
  643. >
  644. <div class="progress-drawer-header">
  645. <span class="progress-drawer-title">查看进度</span>
  646. <el-icon class="progress-close-btn" @click="handleProgressClose"><CloseIcon /></el-icon>
  647. </div>
  648. <div class="progress-drawer-body">
  649. <div class="progress-input-wrapper">
  650. <el-input
  651. v-model="progressContent"
  652. type="textarea"
  653. placeholder="请输入进度描述"
  654. :maxlength="500"
  655. show-word-limit
  656. resize="none"
  657. :autosize="{ minRows: 6, maxRows: 6 }"
  658. />
  659. </div>
  660. <div class="publish-btn-row">
  661. <el-button type="primary" class="publish-btn" style="background-color: #409eff; border-color: #409eff;" @click="handlePublishProgress" :loading="progressLoading">
  662. <el-icon style="margin-right: 4px;"><PlusIcon /></el-icon> 发布
  663. </el-button>
  664. </div>
  665. <div class="record-list" v-loading="recordLoading">
  666. <div
  667. v-for="item in progressRecordList"
  668. :key="item.id"
  669. class="record-item"
  670. >
  671. <div class="record-header">
  672. <span class="record-user">{{ item.createByName || item.createBy || '' }}</span>
  673. <span class="record-time">{{ item.createTime || '' }}</span>
  674. </div>
  675. <div class="record-content">{{ item.followUpCondition || item.content || '' }}</div>
  676. </div>
  677. <el-empty v-if="!recordLoading && (!progressRecordList || progressRecordList.length === 0)" description="暂无进度记录" :image-size="60" />
  678. <div class="pagination-wrapper" v-if="progressTotal > 0">
  679. <el-pagination
  680. small
  681. layout="prev, pager, next"
  682. :total="progressTotal"
  683. v-model:current-page="progressQueryParams.pageNum"
  684. v-model:page-size="progressQueryParams.pageSize"
  685. @current-change="loadProgressRecordList"
  686. />
  687. </div>
  688. </div>
  689. </div>
  690. </el-drawer>
  691. <!-- 关联客户联系人弹窗 -->
  692. <el-dialog v-model="linkContactVisible" title="关联客户联系人" width="900px" append-to-body>
  693. <el-table :data="customerContactList" border @selection-change="handleContactSelectionChange">
  694. <el-table-column type="selection" width="55" align="center" />
  695. <el-table-column label="联系人" align="center" prop="name" />
  696. <el-table-column label="部门" align="center" prop="dept" />
  697. <el-table-column label="客户名称" align="center" prop="customerName" />
  698. <el-table-column label="职位" align="center" prop="job" />
  699. <el-table-column label="手机号码" align="center" prop="phone" />
  700. <el-table-column label="办公电话" align="center" prop="tel" />
  701. </el-table>
  702. <template #footer>
  703. <el-button @click="linkContactVisible = false">取消</el-button>
  704. <el-button type="primary" @click="submitLinkContact">确认</el-button>
  705. </template>
  706. </el-dialog>
  707. <!-- 新建项目联系人弹窗 -->
  708. <el-dialog v-model="addContactVisible" title="新建项目联系人" width="1000px" append-to-body>
  709. <el-form :model="contactForm" label-width="100px" size="small">
  710. <div class="form-section-header" style="margin-top: 0">
  711. <span class="section-title">基本信息</span>
  712. </div>
  713. <el-row :gutter="20">
  714. <el-col :span="8">
  715. <el-form-item label="姓名" required><el-input v-model="contactForm.name" placeholder="请输入" /></el-form-item>
  716. </el-col>
  717. <el-col :span="8">
  718. <el-form-item label="联系人类型">
  719. <el-radio-group v-model="contactForm.type">
  720. <el-radio label="1">公司职员</el-radio>
  721. <el-radio label="2">关系资源人</el-radio>
  722. </el-radio-group>
  723. </el-form-item>
  724. </el-col>
  725. <el-col :span="8">
  726. <el-form-item label="性别">
  727. <el-radio-group v-model="contactForm.gender">
  728. <el-radio label="1">男</el-radio>
  729. <el-radio label="2">女</el-radio>
  730. </el-radio-group>
  731. </el-form-item>
  732. </el-col>
  733. <el-col :span="8">
  734. <el-form-item label="年龄" required><el-input v-model="contactForm.age" placeholder="请输入" /></el-form-item>
  735. </el-col>
  736. <el-col :span="8">
  737. <el-form-item label="籍贯"><el-input v-model="contactForm.hometown" placeholder="请输入" /></el-form-item>
  738. </el-col>
  739. <el-col :span="8">
  740. <el-form-item label="生日"><el-date-picker v-model="contactForm.birthday" type="date" placeholder="请选择" style="width: 100%" /></el-form-item>
  741. </el-col>
  742. <el-col :span="24">
  743. <el-form-item label="描述"><el-input v-model="contactForm.description" type="textarea" placeholder="请输入" /></el-form-item>
  744. </el-col>
  745. </el-row>
  746. <div class="form-section-header">
  747. <span class="section-title">办公信息</span>
  748. </div>
  749. <el-row :gutter="20">
  750. <el-col :span="8">
  751. <el-form-item label="在职状态">
  752. <el-radio-group v-model="contactForm.status">
  753. <el-radio label="1">在职</el-radio>
  754. <el-radio label="2">离职</el-radio>
  755. </el-radio-group>
  756. </el-form-item>
  757. </el-col>
  758. <el-col :span="8">
  759. <el-form-item label="手机号码" required><el-input v-model="contactForm.phone" placeholder="请输入" /></el-form-item>
  760. </el-col>
  761. <el-col :span="8">
  762. <el-form-item label="部门" required><el-input v-model="contactForm.dept" placeholder="请输入" /></el-form-item>
  763. </el-col>
  764. <el-col :span="8">
  765. <el-form-item label="职位"><el-input v-model="contactForm.job" placeholder="请输入" /></el-form-item>
  766. </el-col>
  767. <el-col :span="8">
  768. <el-form-item label="办公座机"><el-input v-model="contactForm.tel" placeholder="请输入" /></el-form-item>
  769. </el-col>
  770. <el-col :span="24">
  771. <el-form-item label="办公地址">
  772. <div style="display: flex; gap: 10px; width: 100%">
  773. <el-select v-model="contactForm.area" placeholder="请选择" style="width: 200px" />
  774. <el-input v-model="contactForm.address" placeholder="请输入详细地址" style="flex: 1" />
  775. </div>
  776. </el-form-item>
  777. </el-col>
  778. <el-col :span="24">
  779. <el-form-item label="工作内容"><el-input v-model="contactForm.workContent" type="textarea" placeholder="请输入" /></el-form-item>
  780. </el-col>
  781. </el-row>
  782. <div class="form-section-header">
  783. <span class="section-title">项目决策</span>
  784. </div>
  785. <el-row :gutter="20">
  786. <el-col :span="8">
  787. <el-form-item label="项目角色"><el-select v-model="contactForm.role" placeholder="请选择" style="width: 100%" /></el-form-item>
  788. </el-col>
  789. <el-col :span="8">
  790. <el-form-item label="是否关键人"><el-select v-model="contactForm.isKey" placeholder="请选择" style="width: 100%" /></el-form-item>
  791. </el-col>
  792. <el-col :span="24">
  793. <el-form-item label="公关情况"><el-input v-model="contactForm.prStatus" type="textarea" placeholder="请输入" /></el-form-item>
  794. </el-col>
  795. </el-row>
  796. </el-form>
  797. <template #footer>
  798. <el-button @click="addContactVisible = false">取消</el-button>
  799. <el-button type="primary" @click="submitAddContact">保存</el-button>
  800. </template>
  801. </el-dialog>
  802. <!-- 添加团队成员弹窗 -->
  803. <el-dialog v-model="addMemberVisible" title="添加团队成员" width="460px" append-to-body class="member-dialog">
  804. <el-form :model="memberForm" label-width="100px">
  805. <el-form-item label="添加人员:" required>
  806. <el-select v-model="memberForm.userId" placeholder="请选择" filterable style="width: 100%">
  807. <el-option v-for="item in options.user" :key="item.userId || item.staffId" :label="item.nickName || item.staffName" :value="String(item.userId || item.staffId)" />
  808. </el-select>
  809. </el-form-item>
  810. <el-form-item label="成员角色:">
  811. <el-select v-model="memberForm.roleName" placeholder="请选择" style="width: 100%">
  812. <el-option v-for="item in options.teamRole" :key="item.dictValue" :label="item.dictLabel" :value="item.dictLabel" />
  813. </el-select>
  814. </el-form-item>
  815. <el-form-item label="权限:">
  816. <el-radio-group v-model="memberForm.permission">
  817. <el-radio v-for="dict in options.permission" :key="dict.dictValue" :value="parseInt(dict.dictValue)">{{ dict.dictLabel }}</el-radio>
  818. </el-radio-group>
  819. </el-form-item>
  820. </el-form>
  821. <template #footer>
  822. <div class="dialog-footer">
  823. <el-button type="primary" @click="submitAddMember" style="padding: 8px 24px;">确 认</el-button>
  824. <el-button @click="addMemberVisible = false" style="padding: 8px 24px;">取 消</el-button>
  825. </div>
  826. </template>
  827. </el-dialog>
  828. <!-- 编辑团队成员弹窗 -->
  829. <el-dialog v-model="editMemberVisible" title="编辑团队成员" width="460px" append-to-body class="member-dialog">
  830. <el-form :model="memberEditForm" label-width="100px">
  831. <el-form-item label="人员姓名:">
  832. <span>{{ memberEditForm.memberName || memberEditForm.staffName || memberEditForm.realName || memberEditForm.name }}{{ memberEditForm.deptName ? '/' + memberEditForm.deptName : '' }}</span>
  833. </el-form-item>
  834. <el-form-item label="成员角色:">
  835. <el-select v-model="memberEditForm.roleName" placeholder="请选择" style="width: 100%">
  836. <el-option v-for="item in options.teamRole" :key="item.dictValue" :label="item.dictLabel" :value="item.dictLabel" />
  837. </el-select>
  838. </el-form-item>
  839. <el-form-item label="权限:">
  840. <el-radio-group v-model="memberEditForm.permission">
  841. <el-radio v-for="dict in options.permission" :key="dict.dictValue" :value="parseInt(dict.dictValue)">{{ dict.dictLabel }}</el-radio>
  842. </el-radio-group>
  843. </el-form-item>
  844. </el-form>
  845. <template #footer>
  846. <div class="dialog-footer">
  847. <el-button type="primary" @click="submitEditMember" style="padding: 8px 24px;">确 认</el-button>
  848. <el-button @click="editMemberVisible = false" style="padding: 8px 24px;">取 消</el-button>
  849. </div>
  850. </template>
  851. </el-dialog>
  852. <!-- 完善后的跟进记录弹窗 -->
  853. <el-dialog title="跟进记录" v-model="addRecordVisible" width="700px" append-to-body class="member-dialog">
  854. <el-form :model="recordForm" :rules="recordRules" ref="recordFormRef" label-width="100px">
  855. <el-form-item label="客户:">
  856. <span style="color: #333; font-weight: 500;">{{ form.customerName }}</span>
  857. </el-form-item>
  858. <el-row :gutter="20">
  859. <el-col :span="12">
  860. <el-form-item label="拜访人:" prop="visitor">
  861. <el-select v-model="recordForm.visitor" placeholder="请选择" style="width: 100%" filterable>
  862. <el-option v-for="item in (form.memberList || [])" :key="item.staffId || item.userId || item.id" :label="item.memberName || item.staffName || item.realName || item.name" :value="String(item.staffId || item.userId)" />
  863. </el-select>
  864. </el-form-item>
  865. </el-col>
  866. <el-col :span="12">
  867. <el-form-item label="随访人:">
  868. <el-select v-model="recordForm.accompanyPerson" placeholder="请选择" style="width: 100%" filterable clearable>
  869. <el-option v-for="item in options.user" :key="item.staffId || item.userId" :label="item.staffName || item.nickName" :value="String(item.staffId || item.userId)" />
  870. </el-select>
  871. </el-form-item>
  872. </el-col>
  873. </el-row>
  874. <el-row :gutter="20">
  875. <el-col :span="12">
  876. <el-form-item label="拜访方式:" prop="visitType">
  877. <el-select v-model="recordForm.visitType" placeholder="请选择" style="width: 100%">
  878. <el-option v-for="item in options.visitType" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
  879. </el-select>
  880. </el-form-item>
  881. </el-col>
  882. <el-col :span="12">
  883. <el-form-item label="拜访时间:" prop="visitDate">
  884. <el-date-picker v-model="recordForm.visitDate" type="datetime" placeholder="请选择" style="width: 100%" format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm:ss" />
  885. </el-form-item>
  886. </el-col>
  887. </el-row>
  888. <el-form-item label="下次拜访时间:" class="label-nowrap">
  889. <el-date-picker v-model="recordForm.nextVisitDate" type="date" placeholder="请选择" style="width: 100%" value-format="YYYY-MM-DD" />
  890. </el-form-item>
  891. <el-form-item label="拜访目的:" prop="purpose">
  892. <el-input v-model="recordForm.purpose" type="textarea" :rows="3" placeholder="请输入内容" />
  893. </el-form-item>
  894. <el-form-item label="跟进情况:" prop="progress">
  895. <el-input v-model="recordForm.progress" type="textarea" :rows="3" placeholder="请输入内容" />
  896. </el-form-item>
  897. <el-form-item label="记录图片:">
  898. <el-upload
  899. :action="uploadFileUrl"
  900. :headers="headers"
  901. list-type="picture-card"
  902. v-model:file-list="recordImages"
  903. :on-success="handleRecordImgSuccess"
  904. >
  905. <el-icon><PlusIcon /></el-icon>
  906. </el-upload>
  907. </el-form-item>
  908. </el-form>
  909. <template #footer>
  910. <div class="dialog-footer">
  911. <el-button type="primary" @click="submitAddRecord">确认</el-button>
  912. <el-button @click="addRecordVisible = false">取消</el-button>
  913. </div>
  914. </template>
  915. </el-dialog>
  916. </template>
  917. <script setup>
  918. import { ref, reactive, watch, computed, onMounted, getCurrentInstance } from 'vue';
  919. import { useUserStore } from "@/store/modules/user";
  920. import { listCompanyOption, listCustomerInfo } from "@/api/customer/customerInfo/index";
  921. import { listCommonDict } from "@/api/customer/customerDict";
  922. import { listIndustryCategory } from "@/api/customer/industryCategory";
  923. import { selectStaffOptionList } from "@/api/system/comStaff/index";
  924. import {
  925. Upload as UploadIcon,
  926. Close as CloseIcon,
  927. Edit as EditIcon,
  928. Plus as PlusIcon,
  929. Search as SearchIcon,
  930. Delete as DeleteIcon,
  931. Download as DownloadIcon
  932. } from '@element-plus/icons-vue';
  933. import { globalHeaders } from '@/utils/request';
  934. import { listByIds } from "@/api/system/oss/index";
  935. import { publishProjectProgress, updateProjectSelection, getProjectSelection } from '@/api/saleManage/projectSelection/index';
  936. import { listTeamMember, addTeamMember, updateTeamMember, delTeamMember } from "@/api/saleManage/opportunity/teamMember";
  937. import { listOperationLog } from '@/api/customer/operationLog';
  938. import { listContactPerson, addContactPerson } from "@/api/customer/contactPerson";
  939. import { addRecord, listRecord } from "@/api/visit/record";
  940. import { deptTreeSelect } from "@/api/system/user";
  941. const props = defineProps({ modelValue: { type: Boolean, default: false }, data: Object, title: String });
  942. const emit = defineEmits(['update:modelValue', 'submit']);
  943. const { proxy } = getCurrentInstance();
  944. const userStore = useUserStore();
  945. const visible = ref(false);
  946. const activeTab = ref('info');
  947. const activeSideTab = ref('team');
  948. const form = ref({});
  949. const formRef = ref(null);
  950. const options = ref({
  951. company: [],
  952. customer: [],
  953. user: [],
  954. level: [],
  955. type: [],
  956. shortlisted: [],
  957. profession: [],
  958. status: [], // 项目状态字典
  959. industryList: [], // 行业分类数据
  960. teamRole: [], // 团队成员角色字典
  961. permission: [], // 团队成员权限字典
  962. visitType: [], // 拜访方式字典
  963. dept: [] // 部门数据
  964. });
  965. const recordFormRef = ref(null);
  966. const recordImages = ref([]);
  967. const isEdit = ref(false);
  968. const customerLoading = ref(false);
  969. // 查看进度相关
  970. const showProgressDrawer = ref(false);
  971. const progressContent = ref('');
  972. const progressLoading = ref(false);
  973. const recordLoading = ref(false);
  974. const progressRecordList = ref([]);
  975. const progressTotal = ref(0);
  976. const progressQueryParams = reactive({
  977. pageNum: 1,
  978. pageSize: 10,
  979. objectNo: undefined
  980. });
  981. // 联系人弹窗相关
  982. const linkContactVisible = ref(false);
  983. const addContactVisible = ref(false);
  984. const customerContactList = ref([]);
  985. const selectedContacts = ref([]);
  986. const contactForm = ref({
  987. gender: '1',
  988. type: '1',
  989. status: '1'
  990. });
  991. // 成员搜索与过滤
  992. const memberSearchKeyword = ref('');
  993. const addMemberVisible = ref(false);
  994. const editMemberVisible = ref(false);
  995. const memberForm = ref({
  996. userId: undefined,
  997. roleName: undefined,
  998. permission: 0 // 默认仅查看(0)
  999. });
  1000. const memberEditForm = ref({
  1001. name: '',
  1002. roleName: '',
  1003. permission: 0
  1004. });
  1005. // 跟进记录
  1006. const addRecordVisible = ref(false);
  1007. const recordForm = ref({
  1008. visitor: undefined,
  1009. accompanyPerson: undefined,
  1010. visitType: undefined,
  1011. visitDate: '',
  1012. nextVisitDate: '',
  1013. purpose: '',
  1014. progress: '',
  1015. recordPicture: ''
  1016. });
  1017. const recordRules = {
  1018. visitor: [{ required: true, message: "请选择拜访人", trigger: "change" }],
  1019. visitType: [{ required: true, message: "请选择拜访方式", trigger: "change" }],
  1020. visitDate: [{ required: true, message: "请选择拜访时间", trigger: "change" }],
  1021. purpose: [{ required: true, message: "请输入拜访目的", trigger: "blur" }],
  1022. progress: [{ required: true, message: "请输入跟进情况", trigger: "blur" }],
  1023. };
  1024. const filteredMemberList = computed(() => {
  1025. const list = (form.value.memberList || []);
  1026. if (!memberSearchKeyword.value) return list;
  1027. return list.filter(m =>
  1028. (m.name && m.name.includes(memberSearchKeyword.value)) ||
  1029. (m.deptName && m.deptName.includes(memberSearchKeyword.value)) ||
  1030. (m.roleName && m.roleName.includes(memberSearchKeyword.value))
  1031. );
  1032. });
  1033. // 跟进记录过滤
  1034. const recordFilterType = ref(null);
  1035. watch(() => recordFilterType.value, () => {
  1036. fetchFollowRecords();
  1037. });
  1038. // 上传相关
  1039. const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload');
  1040. const headers = ref(globalHeaders());
  1041. // 步骤条数据
  1042. const stepList = ['获取信息', '正式立项', '竞价/投标', '项目跟进', '结案'];
  1043. const rules = {
  1044. companyNo: [{ required: true, message: "请选择归属公司", trigger: "change" }],
  1045. customerName: [{ required: true, message: "请选择客户名称", trigger: "change" }],
  1046. projectLevel: [{ required: true, message: "请选择项目级别", trigger: "change" }],
  1047. businessType: [{ required: true, message: "请选择项目类型", trigger: "change" }],
  1048. projectName: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
  1049. amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
  1050. entryFee: [{ required: true, message: "请输入报名费", trigger: "blur" }],
  1051. winningRate: [{ required: true, message: "请输入赢单率", trigger: "blur" }],
  1052. signUpDeadline: [{ required: true, message: "请选择报名截止时间", trigger: "change" }],
  1053. tenderDeadline: [{ required: true, message: "请选择投标截止时间", trigger: "change" }],
  1054. standardPeriod: [{ required: true, message: "请输入服务期", trigger: "blur" }],
  1055. shortlistedType: [{ required: true, message: "请选择入围类型", trigger: "change" }],
  1056. profession: [{ required: true, message: "请选择物资类目", trigger: "change" }],
  1057. bidPeriodType: [{ required: true, message: "请选择标期类型", trigger: "change" }],
  1058. condition: [{ required: true, message: "请输入入围要求", trigger: "blur" }],
  1059. };
  1060. // 模式名称显示
  1061. const modeTitle = computed(() => {
  1062. if (!form.value.id) return '新增年度入围项目';
  1063. return isEdit.value ? '修改年度入围项目' : form.value.projectName;
  1064. });
  1065. // 数据匹配
  1066. const companyName = computed(() => {
  1067. const target = options.value.company.find(c => String(c.companyCode || c.id) === String(form.value.companyNo));
  1068. return target?.companyName || target?.name || form.value.companyNo || '--';
  1069. });
  1070. const projectLevelName = computed(() => options.value.level.find(o => String(o.dictValue) === String(form.value.projectLevel))?.dictLabel || form.value.projectLevel || '--');
  1071. const projectTypeName = computed(() => options.value.type.find(o => String(o.dictValue) === String(form.value.businessType))?.dictLabel || form.value.businessType || '--');
  1072. const shortlistedTypeName = computed(() => options.value.shortlisted.find(o => String(o.dictValue) === String(form.value.shortlistedType))?.dictLabel || form.value.shortlistedType || '--');
  1073. const projectStatusName = computed(() => options.value.status.find(o => String(o.dictValue) === String(form.value.projectStatus))?.dictLabel || form.value.projectStatus || '--');
  1074. const leaderName = computed(() => {
  1075. const target = options.value.user.find(u => String(u.staffId || u.userId) === String(form.value.leader));
  1076. return target?.staffName || target?.nickName || form.value.leaderName || form.value.leader || '--';
  1077. });
  1078. const professionName = computed(() => {
  1079. const val = String(form.value.profession || '');
  1080. if (!val) return '--';
  1081. const p = options.value.profession.find(item =>
  1082. String(item.id) === val ||
  1083. String(item.industryCategoryId) === val ||
  1084. String(item.industryId) === val ||
  1085. String(item.dictValue) === val
  1086. );
  1087. return p?.industryCategoryName || p?.name || p?.categoryName || p?.dictLabel || '--';
  1088. });
  1089. const deptName = computed(() => {
  1090. const val = String(form.value.deptNo || '');
  1091. if (!val) return '--';
  1092. const target = (options.value.dept || []).find(o => String(o.value) === val);
  1093. return target?.label || val;
  1094. });
  1095. /** 行业名称(使用行业分类数据,与列表页一致) */
  1096. const industryName = computed(() => {
  1097. const val = String(form.value.profession || '');
  1098. if (!val) return '--';
  1099. // 使用行业分类数据(与列表页 index.vue 一致)
  1100. const list = (options.value.industryList || []);
  1101. const p = list.find(i => String(i.id) === val || String(i.industryCategoryId) === val);
  1102. if (p?.industryCategoryName) return p.industryCategoryName;
  1103. // fallback: 尝试物资类目字典数据
  1104. const d = options.value.profession.find(o => String(o.dictValue) === val);
  1105. return d?.dictLabel || '--';
  1106. });
  1107. watch(() => props.modelValue, (val) => {
  1108. visible.value = val;
  1109. if (val) {
  1110. form.value = { ...props.data };
  1111. // 兼容字段
  1112. if (!form.value.customerName && form.value.customName) {
  1113. form.value.customerName = form.value.customName;
  1114. }
  1115. if (!form.value.id) {
  1116. isEdit.value = true;
  1117. } else {
  1118. isEdit.value = false;
  1119. fetchTeamMembers();
  1120. fetchOperationLogs();
  1121. fetchFollowRecords();
  1122. }
  1123. }
  1124. });
  1125. // 监听 data 变化,确保在不打开详情抽屉的情况下(如点击进度按钮),内部数据也能同步
  1126. watch(() => props.data, (newVal) => {
  1127. if (newVal) {
  1128. form.value = { ...newVal };
  1129. if (!form.value.customerName && form.value.customName) {
  1130. form.value.customerName = form.value.customName;
  1131. }
  1132. }
  1133. }, { deep: true });
  1134. /** 加载项目团队成员 */
  1135. const fetchTeamMembers = async () => {
  1136. if (!form.value.id) return;
  1137. try {
  1138. const res = await listTeamMember(form.value.id);
  1139. // 直接使用后端返回的原始数据,不做映射
  1140. form.value.memberList = res.data || [];
  1141. } catch (err) {
  1142. console.error('加载团队成员失败:', err);
  1143. }
  1144. };
  1145. /** 刷新项目详情(包含跟进记录) */
  1146. const refreshDetail = async () => {
  1147. if (!form.value.id) return;
  1148. try {
  1149. const res = await getProjectSelection(form.value.id);
  1150. form.value = res.data;
  1151. // 辅助字段兼容
  1152. if (!form.value.customerName && form.value.customName) {
  1153. form.value.customerName = form.value.customName;
  1154. }
  1155. // 同时刷新团队成员、操作日志、跟进记录
  1156. fetchTeamMembers();
  1157. fetchOperationLogs();
  1158. fetchFollowRecords();
  1159. } catch (err) {
  1160. console.error('刷新详情失败:', err);
  1161. }
  1162. };
  1163. /** 加载跟进记录 */
  1164. const fetchFollowRecords = async () => {
  1165. if (!form.value.id) return;
  1166. try {
  1167. const params = {
  1168. objectNo: form.value.id,
  1169. dataType: 2,
  1170. pageSize: 50 // 加大加载量,确保显示完整
  1171. };
  1172. if (recordFilterType.value) {
  1173. params.visitType = recordFilterType.value;
  1174. }
  1175. const res = await listRecord(params);
  1176. const records = res.rows || res.data || [];
  1177. // 处理图片 URL
  1178. for (const r of records) {
  1179. if (r.recordPicture && !r.imageList) {
  1180. const ids = r.recordPicture.split(',');
  1181. try {
  1182. const ossRes = await listByIds(ids.join(','));
  1183. r.imageList = (ossRes.data || []).map(img => img.url);
  1184. } catch (e) {
  1185. r.imageList = [];
  1186. }
  1187. }
  1188. // 初始化回复内容
  1189. r.replyContent = '';
  1190. }
  1191. form.value.followRecords = records;
  1192. } catch (err) {
  1193. console.error('加载跟进记录失败:', err);
  1194. }
  1195. };
  1196. /** 提交回复 */
  1197. const handleReplySubmit = async (record) => {
  1198. if (!record.replyContent?.trim()) {
  1199. proxy.$modal.msgWarning("请输入回复内容");
  1200. return;
  1201. }
  1202. try {
  1203. await publishProjectProgress({
  1204. objectNo: String(form.value.id),
  1205. followUpCondition: record.replyContent.trim(),
  1206. dataType: '2',
  1207. parentId: record.id // 假设接口支持 parentId 作为回复
  1208. });
  1209. proxy.$modal.msgSuccess("回复成功");
  1210. record.replyContent = '';
  1211. fetchFollowRecords(); // 刷新列表
  1212. } catch (err) {
  1213. console.error('回复失败:', err);
  1214. }
  1215. };
  1216. /** 加载操作日志 */
  1217. const fetchOperationLogs = async () => {
  1218. if (!form.value.id) return;
  1219. try {
  1220. const res = await listOperationLog({
  1221. objectNo: form.value.id,
  1222. dataType: 2 // 年度入围项目
  1223. });
  1224. form.value.operationLogs = res.rows || res.data || [];
  1225. } catch (err) {
  1226. console.error('加载日志失败:', err);
  1227. }
  1228. };
  1229. /** 翻译详情字段名 */
  1230. const translateDetails = (details) => {
  1231. if (!details) return '';
  1232. if (details.includes('projectStatus') || details.includes('年度入围')) {
  1233. return '年度入围(项目)';
  1234. }
  1235. return details;
  1236. };
  1237. /** 格式化日志描述 - 模仿商机详情逻辑 */
  1238. const formatLogAction = (log) => {
  1239. let details = log.actionDetails || '';
  1240. // 完美兼容历史:一律按原型图格式化进度变更的 action 文本
  1241. if (details.includes('projectStatus') || details.includes('年度入围')) {
  1242. if (log.actionType === 2) {
  1243. return '编辑了 年度入围';
  1244. } else if (log.actionType === 1) {
  1245. return '添加了 年度入围';
  1246. }
  1247. }
  1248. // 处理常见的字段名
  1249. const fieldMap = {
  1250. 'projectName': '项目名称',
  1251. 'projectStatus': '项目进度',
  1252. 'projectLevel': '项目类别',
  1253. 'businessType': '项目类型',
  1254. 'amount': '金额',
  1255. 'customerName': '客户名称',
  1256. 'companyNo': '归属公司'
  1257. };
  1258. Object.keys(fieldMap).forEach(key => {
  1259. if (details.includes(key)) {
  1260. details = details.replace(key, fieldMap[key]);
  1261. }
  1262. });
  1263. // 处理进度值的映射 (动态字典获取,不使用硬编码)
  1264. if (options.value && options.value.status) {
  1265. options.value.status.forEach((item) => {
  1266. const val = String(item.dictValue || item.value);
  1267. const label = item.dictLabel || item.label;
  1268. const reg = new RegExp(`(?<=[:\\s])${val}(?=[\\s]|$)`, 'g');
  1269. if (details.includes(val)) {
  1270. details = details.replace(reg, label);
  1271. }
  1272. });
  1273. }
  1274. return `${getLogActionText(log.actionType)} ${details}`;
  1275. };
  1276. /** 格式化日志目标对象 - 兼容老数据隐藏项目名称 */
  1277. const formatLogTarget = (log) => {
  1278. if (!log.targetObject) return '';
  1279. let details = log.actionDetails || '';
  1280. // 完美兼容历史:强制转换 target 文本以对齐原型
  1281. if (details.includes('projectStatus') || (details.includes('年度入围') && log.actionType === 2)) {
  1282. let stepName = log.targetObject;
  1283. if (log.targetObject === form.value.projectName) {
  1284. const match = details.match(/\d/);
  1285. if (match && options.value && options.value.status) {
  1286. const val = match[0];
  1287. const dict = options.value.status.find(o => String(o.dictValue || o.value) === String(val));
  1288. stepName = dict ? (dict.dictLabel || dict.label) : '';
  1289. } else {
  1290. stepName = '';
  1291. }
  1292. } else if (stepName.includes('进度状态变更')) {
  1293. const parts = stepName.split(',');
  1294. if (parts.length > 1 && /^\d+$/.test(parts[1]) && options.value && options.value.status) {
  1295. const val = parts[1];
  1296. const dict = options.value.status.find(o => String(o.dictValue || o.value) === String(val));
  1297. if (dict) {
  1298. return `进度状态变更,${dict.dictLabel || dict.label}`;
  1299. }
  1300. }
  1301. return stepName;
  1302. }
  1303. if (stepName) {
  1304. return `进度状态变更,${stepName}`;
  1305. }
  1306. return '';
  1307. }
  1308. return log.targetObject;
  1309. };
  1310. /** 获取日志动作文本 */
  1311. const getLogActionText = (actionType) => {
  1312. const map = {
  1313. 1: '添加了',
  1314. 2: '编辑了',
  1315. 3: '删除了',
  1316. 4: '认领了',
  1317. 5: '转移了',
  1318. 6: '分析了'
  1319. };
  1320. return map[actionType] || '操作了';
  1321. };
  1322. const handleClose = () => {
  1323. visible.value = false;
  1324. emit('update:modelValue', false);
  1325. };
  1326. /** 开启编辑模式 */
  1327. const handleEdit = () => {
  1328. isEdit.value = true;
  1329. };
  1330. /** 取消编辑 */
  1331. const handleCancelEdit = () => {
  1332. if (!form.value.id) {
  1333. handleClose();
  1334. } else {
  1335. isEdit.value = false;
  1336. form.value = { ...props.data };
  1337. }
  1338. };
  1339. /** 提交表单 */
  1340. const submitForm = () => {
  1341. formRef.value.validate((valid) => {
  1342. if (valid) {
  1343. emit('submit', form.value);
  1344. }
  1345. });
  1346. };
  1347. /** 打开外部链接 */
  1348. const handleOpenLink = (url) => {
  1349. if (url && (url.startsWith('http') || url.startsWith('https'))) {
  1350. window.open(url, '_blank');
  1351. }
  1352. };
  1353. /** 打开进度弹窗 */
  1354. const openProgressDrawer = (id) => {
  1355. showProgressDrawer.value = true;
  1356. const targetId = id || form.value.id;
  1357. if (targetId) {
  1358. progressQueryParams.objectNo = String(targetId);
  1359. progressQueryParams.pageNum = 1;
  1360. loadProgressRecordList();
  1361. }
  1362. };
  1363. /** 加载进度记录列表 */
  1364. const loadProgressRecordList = async () => {
  1365. if (!progressQueryParams.objectNo) return;
  1366. recordLoading.value = true;
  1367. try {
  1368. const res = await listRecord(progressQueryParams);
  1369. progressRecordList.value = res.rows || [];
  1370. progressTotal.value = res.total || 0;
  1371. } catch (err) {
  1372. console.error('加载进度记录失败:', err);
  1373. } finally {
  1374. recordLoading.value = false;
  1375. }
  1376. };
  1377. /** 关闭进度弹窗 */
  1378. const handleProgressClose = () => {
  1379. showProgressDrawer.value = false;
  1380. progressContent.value = '';
  1381. progressRecordList.value = [];
  1382. progressTotal.value = 0;
  1383. };
  1384. /** 状态及详情模式下的静默更新 */
  1385. const syncProjectData = async () => {
  1386. if (form.value.id) {
  1387. try {
  1388. await updateProjectSelection(form.value);
  1389. proxy.$modal.msgSuccess('操作成功');
  1390. fetchOperationLogs(); // 刷新日志
  1391. } catch (err) {
  1392. console.error('同步失败:', err);
  1393. }
  1394. }
  1395. };
  1396. /** 处理上传成功 */
  1397. const handleUploadSuccess = (res, file) => {
  1398. if (res.code === 200) {
  1399. if (!form.value.fileList) form.value.fileList = [];
  1400. const item = res.data;
  1401. const name = item.originalName || item.fileName || file.name;
  1402. const getExt = (n) => {
  1403. const parts = n.split('.');
  1404. return parts.length > 1 ? parts[parts.length - 1].toUpperCase() : '文件';
  1405. };
  1406. // 格式化文件大小
  1407. const formatSize = (bytes) => {
  1408. if (!bytes) return '0 B';
  1409. const k = 1024;
  1410. const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
  1411. const i = Math.floor(Math.log(bytes) / Math.log(k));
  1412. return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
  1413. };
  1414. form.value.fileList.push({
  1415. ossId: item.ossId,
  1416. fileName: name,
  1417. fileType: getExt(name),
  1418. fileSize: formatSize(file.size),
  1419. fileUrl: item.url,
  1420. url: item.url,
  1421. uploadTime: proxy.parseTime(new Date()),
  1422. uploader: userStore.nickname || userStore.name || '当前用户'
  1423. });
  1424. if (!isEdit.value) {
  1425. syncProjectData();
  1426. } else {
  1427. proxy.$modal.msgSuccess("操作成功");
  1428. }
  1429. } else {
  1430. proxy.$modal.msgError(res.msg || '操作失败');
  1431. }
  1432. };
  1433. /** 处理附件下载 */
  1434. const handleDownloadFile = (row) => {
  1435. if (row.ossId) {
  1436. proxy.$download.oss(row.ossId);
  1437. } else if (row.fileUrl || row.url) {
  1438. window.open(row.fileUrl || row.url, '_blank');
  1439. }
  1440. };
  1441. /** 处理附件删除 */
  1442. const handleDeleteFile = (index) => {
  1443. form.value.fileList.splice(index, 1);
  1444. if (!isEdit.value) syncProjectData();
  1445. };
  1446. /** 处理进度点击 */
  1447. const handleStepClick = async (clickedStatus) => {
  1448. const oldStatus = form.value.projectStatus || 0;
  1449. if (oldStatus === clickedStatus) return;
  1450. const newStatus = clickedStatus;
  1451. form.value.projectStatus = newStatus;
  1452. if (form.value.id) {
  1453. try {
  1454. await updateProjectSelection({ ...form.value, projectStatus: newStatus });
  1455. proxy.$modal.msgSuccess('操作成功');
  1456. fetchOperationLogs(); // 刷新操作日志,确保进度变更被记录并显示
  1457. } catch (err) {
  1458. form.value.projectStatus = oldStatus;
  1459. proxy.$modal.msgError('操作失败');
  1460. }
  1461. }
  1462. };
  1463. /** 发布进度 */
  1464. const handlePublishProgress = async () => {
  1465. if (!progressContent.value.trim()) return;
  1466. progressLoading.value = true;
  1467. try {
  1468. await addRecord({
  1469. objectNo: String(form.value.id),
  1470. followUpCondition: progressContent.value.trim(),
  1471. dataType: '2'
  1472. });
  1473. proxy.$modal.msgSuccess('操作成功');
  1474. progressContent.value = '';
  1475. progressQueryParams.pageNum = 1;
  1476. loadProgressRecordList();
  1477. } catch (err) {
  1478. console.error('进度发布失败:', err);
  1479. } finally {
  1480. progressLoading.value = false;
  1481. }
  1482. };
  1483. /** 联系人下拉指令处理 */
  1484. const handleContactCommand = async (command) => {
  1485. if (command === 'link') {
  1486. linkContactVisible.value = true;
  1487. try {
  1488. const res = await listContactPerson({ customerId: form.value.customerId });
  1489. customerContactList.value = res.rows || res.data || [];
  1490. } catch (err) {
  1491. console.error('获取联系人失败:', err);
  1492. }
  1493. } else if (command === 'create') {
  1494. contactForm.value = { gender: '1', type: '1', status: '1' };
  1495. addContactVisible.value = true;
  1496. }
  1497. };
  1498. /** 确认关联联系人 */
  1499. const submitLinkContact = async () => {
  1500. if (!selectedContacts.value.length) return;
  1501. if (!form.value.contactList) form.value.contactList = [];
  1502. const newContacts = selectedContacts.value.map(c => ({
  1503. contactId: c.id,
  1504. name: c.name,
  1505. dept: c.dept,
  1506. job: c.job,
  1507. phone: c.phone,
  1508. tel: c.tel,
  1509. customerName: c.customerName
  1510. }));
  1511. form.value.contactList.push(...newContacts);
  1512. linkContactVisible.value = false;
  1513. if (!isEdit.value) await syncProjectData();
  1514. };
  1515. /** 提交新建联系人 */
  1516. const submitAddContact = async () => {
  1517. try {
  1518. const contactData = { ...contactForm.value, customerId: form.value.customerId };
  1519. const res = await addContactPerson(contactData);
  1520. const newContactId = res.data?.id || res.id;
  1521. if (!form.value.contactList) form.value.contactList = [];
  1522. form.value.contactList.push({
  1523. ...contactForm.value,
  1524. contactId: newContactId,
  1525. });
  1526. addContactVisible.value = false;
  1527. proxy.$modal.msgSuccess("操作成功");
  1528. if (!isEdit.value) await syncProjectData();
  1529. } catch (err) {
  1530. console.error('新建联系人失败:', err);
  1531. }
  1532. };
  1533. /** 侧边栏操作处理 */
  1534. const handleAddMember = () => {
  1535. memberForm.value = {
  1536. userId: undefined,
  1537. roleName: undefined,
  1538. permission: 0
  1539. };
  1540. addMemberVisible.value = true;
  1541. };
  1542. const handleEditMember = (member) => {
  1543. memberEditForm.value = { ...member };
  1544. editMemberVisible.value = true;
  1545. };
  1546. /** 提交添加成员 */
  1547. const submitAddMember = async () => {
  1548. if (!memberForm.value.userId) {
  1549. proxy.$modal.msgError("请选择添加人员");
  1550. return;
  1551. }
  1552. const user = options.value.user.find(u => String(u.userId || u.staffId) === String(memberForm.value.userId));
  1553. if (!user) return;
  1554. if (form.value.id) {
  1555. // 详情模式:直接调接口存入数据表
  1556. try {
  1557. await addTeamMember({
  1558. staffId: memberForm.value.userId,
  1559. realName: user.nickName || user.staffName,
  1560. roleName: memberForm.value.roleName,
  1561. roleCode: options.value.teamRole.find(r => r.dictLabel === memberForm.value.roleName)?.dictValue,
  1562. updateAccredit: Number(memberForm.value.permission),
  1563. izManager: memberForm.value.roleName === '业务负责人' ? 1 : 0, // 核心负责人标识
  1564. objectNo: form.value.id,
  1565. dataType: 2,
  1566. platformCode: 'crm'
  1567. });
  1568. proxy.$modal.msgSuccess("操作成功");
  1569. addMemberVisible.value = false;
  1570. fetchTeamMembers();
  1571. fetchOperationLogs(); // 刷新日志记录成员变动
  1572. } catch (err) {
  1573. console.error('添加成员失败:', err);
  1574. }
  1575. } else {
  1576. // 新增模式:先存入本地列表,随主表一同提交
  1577. const newMember = {
  1578. userId: memberForm.value.userId,
  1579. name: user.nickName || user.staffName,
  1580. roleName: memberForm.value.roleName,
  1581. permission: memberForm.value.permission,
  1582. isLeader: memberForm.value.roleName === '业务负责人'
  1583. };
  1584. if (!form.value.memberList) form.value.memberList = [];
  1585. form.value.memberList.push(newMember);
  1586. addMemberVisible.value = false;
  1587. proxy.$modal.msgSuccess("操作成功");
  1588. }
  1589. };
  1590. /** 提交编辑成员 */
  1591. const submitEditMember = async () => {
  1592. if (memberEditForm.value.id) {
  1593. // 调接口更新数据表
  1594. try {
  1595. await updateTeamMember({
  1596. id: memberEditForm.value.id,
  1597. staffId: memberEditForm.value.userId,
  1598. roleName: memberEditForm.value.roleName,
  1599. roleCode: options.value.teamRole.find(r => r.dictLabel === memberEditForm.value.roleName)?.dictValue,
  1600. updateAccredit: Number(memberEditForm.value.permission),
  1601. izManager: memberEditForm.value.roleName === '业务负责人' ? 1 : 0,
  1602. objectNo: form.value.id,
  1603. dataType: 2,
  1604. platformCode: 'crm'
  1605. });
  1606. proxy.$modal.msgSuccess("操作成功");
  1607. editMemberVisible.value = false;
  1608. fetchTeamMembers();
  1609. fetchOperationLogs(); // 刷新日志记录成员变动
  1610. } catch (err) {
  1611. console.error('更新成员失败:', err);
  1612. }
  1613. } else {
  1614. // 更新本地列表
  1615. const index = form.value.memberList.findIndex(m => m.userId === memberEditForm.value.userId && m.name === memberEditForm.value.name);
  1616. if (index > -1) {
  1617. form.value.memberList[index] = { ...memberEditForm.value };
  1618. editMemberVisible.value = false;
  1619. proxy.$modal.msgSuccess("操作成功");
  1620. }
  1621. }
  1622. };
  1623. /** 移除成员 */
  1624. const handleRemoveMember = (member, index) => {
  1625. proxy?.$modal.confirm('确认要移除该团队成员吗?').then(async () => {
  1626. if (member.id) {
  1627. // 调接口从数据表移除
  1628. try {
  1629. await delTeamMember(member.id);
  1630. proxy.$modal.msgSuccess("操作成功");
  1631. fetchTeamMembers();
  1632. } catch (err) {
  1633. console.error('移除成员失败:', err);
  1634. }
  1635. } else {
  1636. // 从本地列表移除
  1637. form.value.memberList.splice(index, 1);
  1638. if (!isEdit.value) syncProjectData();
  1639. }
  1640. });
  1641. };
  1642. const handleAddRecord = () => {
  1643. recordForm.value = {
  1644. visitor: undefined, // 响应用户要求,不设置默认值
  1645. accompanyPerson: undefined,
  1646. visitType: undefined,
  1647. visitDate: proxy.parseTime(new Date()),
  1648. nextVisitDate: '',
  1649. purpose: '',
  1650. progress: '',
  1651. recordPicture: ''
  1652. };
  1653. recordImages.value = [];
  1654. addRecordVisible.value = true;
  1655. };
  1656. /** 记录图片上传成功 */
  1657. const handleRecordImgSuccess = (res) => {
  1658. if (res.code === 200) {
  1659. const urls = recordImages.value.map(f => f.url || f.response?.data?.url).filter(Boolean);
  1660. recordForm.value.recordPicture = urls.join(',');
  1661. }
  1662. };
  1663. /** 提交跟进记录 */
  1664. const submitAddRecord = async () => {
  1665. recordFormRef.value.validate(async (valid) => {
  1666. if (valid) {
  1667. try {
  1668. const data = {
  1669. ...recordForm.value,
  1670. projectId: form.value.id,
  1671. projectName: form.value.projectName,
  1672. customerName: form.value.customerName,
  1673. customerNo: form.value.customerId,
  1674. objectNo: form.value.id,
  1675. dataType: 2 // 表示年度入围项目
  1676. };
  1677. await addRecord(data);
  1678. proxy.$modal.msgSuccess("操作成功");
  1679. addRecordVisible.value = false;
  1680. // 刷新详情以加载最新记录
  1681. refreshDetail();
  1682. } catch (err) {
  1683. console.error('新建跟进记录失败:', err);
  1684. }
  1685. }
  1686. });
  1687. };
  1688. // 暴露方法给父组件调用
  1689. defineExpose({ openProgressDrawer });
  1690. onMounted(() => {
  1691. // 完全对齐 index.vue 的数据加载方式
  1692. listCommonDict('XMJB0001').then(r => options.value.level = r.data);
  1693. listCommonDict('L0001').then(r => options.value.type = r.data);
  1694. listCommonDict('R0001').then(r => options.value.shortlisted = r.data);
  1695. listCommonDict('ZBPL0001').then(r => options.value.profession = r.data);
  1696. listCommonDict('J0001').then(r => options.value.status = r.data);
  1697. // 成员角色字典
  1698. listCommonDict('T0001').then(r => options.value.teamRole = r.data);
  1699. // 拜访方式字典
  1700. listCommonDict('visit_type').then(r => options.value.visitType = r.data || []);
  1701. // 成员权限字典
  1702. listCommonDict('team_permission').then(r => options.value.permission = r.data || []);
  1703. // 行业分类数据(与列表页一致,用于显示行业名称)
  1704. listIndustryCategory().then(r => { options.value.industryList = r.data; });
  1705. listCompanyOption().then(r => options.value.company = r.data);
  1706. remoteLoadCustomers(); // 默认加载前 500 条客户
  1707. selectStaffOptionList().then(r => options.value.user = r.data);
  1708. // 加载部门数据并打平
  1709. deptTreeSelect().then(res => {
  1710. const flatList = (list) => {
  1711. let arr = [];
  1712. for (const item of list || []) {
  1713. arr.push({ label: item.label, value: String(item.id) });
  1714. if (item.children?.length) arr.push(...flatList(item.children));
  1715. }
  1716. return arr;
  1717. };
  1718. options.value.dept = flatList(res.data);
  1719. });
  1720. });
  1721. /** 远程加载客户信息 */
  1722. const remoteLoadCustomers = (query) => {
  1723. customerLoading.value = true;
  1724. // 增加对空查询的处理,默认加载前500条数据,搜索时检索匹配项
  1725. const params = {
  1726. customerName: query || undefined,
  1727. pageSize: query ? 50 : 500
  1728. };
  1729. listCustomerInfo(params).then(res => {
  1730. options.value.customer = res.rows || res.data || [];
  1731. customerLoading.value = false;
  1732. }).catch(err => {
  1733. console.error('加载客户数据失败:', err);
  1734. customerLoading.value = false;
  1735. });
  1736. };
  1737. </script>
  1738. <style scoped lang="scss">
  1739. .custom-status-tag {
  1740. border-radius: 4px;
  1741. border-width: 1px;
  1742. padding: 0 8px;
  1743. height: 24px;
  1744. line-height: 22px;
  1745. font-weight: 500;
  1746. &.status-follow {
  1747. background-color: #fff7e8;
  1748. border-color: #ffe4ba;
  1749. color: #ff7d00; // 橙色文字
  1750. }
  1751. &.status-done {
  1752. background-color: #e8ffea;
  1753. border-color: #aff0b5;
  1754. color: #00b42a; // 绿色文字
  1755. }
  1756. }
  1757. /* 强制重置 el-drawer 的内部 body 样式,方便 flex 布局 */
  1758. :deep(.el-drawer) {
  1759. top: 0 !important;
  1760. padding: 0 !important;
  1761. }
  1762. :deep(.el-drawer__header) {
  1763. display: none !important;
  1764. }
  1765. :deep(.el-drawer__body) {
  1766. padding: 0 !important;
  1767. display: flex;
  1768. flex-direction: column;
  1769. overflow: hidden;
  1770. }
  1771. /* ===== 顶部标题栏 ===== */
  1772. .detail-header {
  1773. height: 48px;
  1774. flex-shrink: 0;
  1775. display: flex;
  1776. justify-content: space-between;
  1777. align-items: center;
  1778. padding: 0 20px;
  1779. border-bottom: none; // 移除边框以实现无缝衔接
  1780. background-color: var(--el-bg-color);
  1781. .project-title {
  1782. font-size: 25px;
  1783. color: var(--el-text-color-primary);
  1784. line-height: 48px;
  1785. }
  1786. .close-btn {
  1787. font-size: 16px;
  1788. color: var(--el-text-color-placeholder);
  1789. cursor: pointer;
  1790. transition: color 0.2s;
  1791. &:hover { color: var(--el-color-danger); }
  1792. }
  1793. }
  1794. /* ===== 项目进度区 - 高颜值优化版 ===== */
  1795. .progress-section {
  1796. padding: 16px 24px 4px; // 减小垂直间距
  1797. flex-shrink: 0;
  1798. border-bottom: 1px solid #f2f3f5; // 增加浅色底边分隔
  1799. .section-label {
  1800. font-size: 14px;
  1801. font-weight: 600;
  1802. color: #409eff;
  1803. margin-bottom: 12px;
  1804. display: flex;
  1805. align-items: center;
  1806. &::before {
  1807. content: '';
  1808. display: inline-block;
  1809. width: 4px;
  1810. height: 14px;
  1811. background: #409eff;
  1812. border-radius: 2px;
  1813. margin-right: 8px;
  1814. }
  1815. }
  1816. /* 步骤条主体 */
  1817. .step-bar {
  1818. display: flex;
  1819. align-items: center;
  1820. margin: 8px 0 16px;
  1821. height: 30px;
  1822. width: 100%;
  1823. .step {
  1824. flex: 1;
  1825. height: 100%;
  1826. position: relative;
  1827. cursor: pointer;
  1828. display: flex;
  1829. align-items: center;
  1830. justify-content: center;
  1831. background: #f2f3f5;
  1832. margin-right: 4px;
  1833. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  1834. /* 核心:倒序 z-index */
  1835. &:nth-child(1) { z-index: 5; }
  1836. &:nth-child(2) { z-index: 4; }
  1837. &:nth-child(3) { z-index: 3; }
  1838. &:nth-child(4) { z-index: 2; }
  1839. &:nth-child(5) { z-index: 1; }
  1840. .step-text {
  1841. font-size: 12px;
  1842. color: #86909c;
  1843. z-index: 10;
  1844. white-space: nowrap;
  1845. font-weight: 500;
  1846. transition: color 0.3s;
  1847. }
  1848. /* 箭头尖端形状 - 优化路径 */
  1849. &::after {
  1850. content: "";
  1851. position: absolute;
  1852. top: 0;
  1853. right: -15px;
  1854. width: 30px;
  1855. height: 30px;
  1856. background: inherit;
  1857. transform: scale(0.707) rotate(45deg);
  1858. z-index: 5;
  1859. border-right: 2px solid #fff;
  1860. border-top: 2px solid #fff;
  1861. border-radius: 0 4px 0 0;
  1862. transition: all 0.3s;
  1863. }
  1864. /* 第一个步骤 */
  1865. &:first-child {
  1866. border-radius: 4px 0 0 4px;
  1867. padding-left: 10px;
  1868. }
  1869. /* 最后一个步骤 */
  1870. &:last-child {
  1871. border-radius: 0 4px 4px 0;
  1872. padding-right: 10px;
  1873. margin-right: 0;
  1874. &::after { display: none; }
  1875. }
  1876. /* 选中态:使用更有活力的渐变绿 */
  1877. &.active {
  1878. background: linear-gradient(90deg, #2bc48d, #3bd9a0) !important;
  1879. .step-text { color: #ffffff !important; font-weight: normal; }
  1880. &::after {
  1881. background: #3bd9a0 !important;
  1882. }
  1883. }
  1884. /* 已完成态:使用稳重的浅蓝绿 */
  1885. &.finished {
  1886. background-color: #2bc48d;
  1887. opacity: 0.8;
  1888. .step-text { color: #ffffff !important; }
  1889. &::after {
  1890. background-color: #2bc48d !important;
  1891. }
  1892. }
  1893. /* 悬停效果 */
  1894. &:hover:not(.active):not(.finished) {
  1895. background-color: #e5e6eb;
  1896. .step-text { color: #2bc48d; }
  1897. &::after { background-color: #e5e6eb; }
  1898. }
  1899. }
  1900. }
  1901. /* 最新进度行 */
  1902. .progress-link-row {
  1903. margin-top: 2px;
  1904. font-size: 12px;
  1905. display: inline-flex;
  1906. align-items: center;
  1907. gap: 8px;
  1908. .progress-label { color: var(--el-text-color-secondary); }
  1909. .progress-link {
  1910. color: var(--el-color-primary);
  1911. cursor: pointer;
  1912. }
  1913. }
  1914. }
  1915. /* 详情主容器 */
  1916. .detail-container {
  1917. display: flex;
  1918. flex: 1;
  1919. overflow: hidden;
  1920. background-color: #fff;
  1921. border-top: 1px solid #f2f3f5;
  1922. .detail-left {
  1923. flex: 7;
  1924. display: flex;
  1925. flex-direction: column;
  1926. overflow: hidden;
  1927. position: relative;
  1928. padding: 0 24px;
  1929. border-right: 1px solid #f2f3f5;
  1930. }
  1931. .detail-right {
  1932. flex: 3;
  1933. display: flex;
  1934. flex-direction: column;
  1935. overflow: hidden;
  1936. padding: 0 20px;
  1937. }
  1938. }
  1939. /* 严格还原的原型图 Tab 样式 */
  1940. .custom-tabs {
  1941. height: 100%;
  1942. :deep(.el-tabs__header) {
  1943. margin-bottom: 0;
  1944. border-bottom: 1px solid #f2f3f5;
  1945. }
  1946. :deep(.el-tabs__item) {
  1947. font-size: 14px;
  1948. color: #1d2129 !important; // 非激活文字为黑色
  1949. padding: 0 16px !important;
  1950. height: 48px;
  1951. line-height: 48px;
  1952. font-weight: 400;
  1953. background: transparent !important;
  1954. &.is-active {
  1955. color: #f53f3f !important; // 激活文字为红色
  1956. font-weight: normal;
  1957. }
  1958. &:hover { color: #f53f3f !important; }
  1959. }
  1960. :deep(.el-tabs__content) {
  1961. padding-top: 16px;
  1962. }
  1963. :deep(.el-tabs__active-bar) {
  1964. background-color: #f53f3f !important; // 红色动态横线
  1965. height: 3px;
  1966. border-radius: 2px;
  1967. }
  1968. .el-tabs__nav-wrap::after {
  1969. display: none;
  1970. }
  1971. }
  1972. /* 详情信息块 */
  1973. .info-block {
  1974. padding-bottom: 16px;
  1975. position: relative;
  1976. .block-header {
  1977. display: flex;
  1978. justify-content: space-between;
  1979. align-items: center;
  1980. margin-bottom: 16px;
  1981. .block-title {
  1982. font-size: 15px;
  1983. font-weight: normal;
  1984. color: #409eff;
  1985. position: relative;
  1986. display: flex;
  1987. align-items: center;
  1988. }
  1989. }
  1990. }
  1991. .floating-edit-btn {
  1992. position: absolute;
  1993. top: -44px;
  1994. right: 0;
  1995. background-color: #165dff;
  1996. border: none;
  1997. border-radius: 4px;
  1998. height: 30px;
  1999. padding: 0 14px;
  2000. font-size: 13px;
  2001. z-index: 10;
  2002. }
  2003. /* 信息网格 */
  2004. .info-grid {
  2005. display: grid;
  2006. gap: 8px 40px;
  2007. margin-bottom: 8px;
  2008. /* 2列布局 - 基本信息: label + value | label + value */
  2009. &.info-grid-2col {
  2010. grid-template-columns: auto 1fr auto 1fr;
  2011. }
  2012. /* 3列布局 - 项目情况: label + value | label + value | label + value */
  2013. &.info-grid-3col {
  2014. grid-template-columns: auto 1fr auto 1fr auto 1fr;
  2015. }
  2016. .info-item {
  2017. display: contents;
  2018. .label {
  2019. color: var(--el-text-color-secondary);
  2020. min-width: 80px;
  2021. text-align: left;
  2022. padding-right: 12px;
  2023. line-height: 24px;
  2024. white-space: nowrap;
  2025. font-size: 12px;
  2026. }
  2027. .value {
  2028. color: var(--el-text-color-primary);
  2029. line-height: 24px;
  2030. min-width: 120px;
  2031. word-break: break-all;
  2032. font-size: 12px;
  2033. }
  2034. .status-text { color: var(--el-text-color-primary); }
  2035. .grade-text { font-weight: normal; color: var(--el-text-color-primary); }
  2036. .link-text { color: var(--el-color-primary); cursor: pointer; }
  2037. .wrap-text { white-space: pre-wrap; line-height: 1.6; }
  2038. }
  2039. /* 基本信息区 - 项目名称独占整行 */
  2040. > .info-item.full-row {
  2041. display: flex;
  2042. grid-column: 1 / -1;
  2043. .label { min-width: 80px; text-align: left; font-size: 12px; line-height: 28px; }
  2044. .value { flex: 1; font-size: 16px; line-height: 28px; color: var(--el-text-color-primary); }
  2045. }
  2046. /* 基本信息区 - 项目类型独占左侧(右侧空) */
  2047. > .info-item.left-only {
  2048. display: contents;
  2049. .label { grid-column: 1; text-align: left; font-size: 12px; }
  2050. .value { grid-column: 2; font-size: 12px; }
  2051. }
  2052. /* 项目情况区 - 独占整行 (招标链接/入围要求/项目描述) */
  2053. > .info-item.full-row-3col {
  2054. display: flex;
  2055. grid-column: 1 / -1;
  2056. .label { min-width: 80px; text-align: left; font-size: 12px; line-height: 24px; }
  2057. .value { flex: 1; font-size: 12px; line-height: 24px; }
  2058. }
  2059. /* 占位空白单元格 */
  2060. > .info-item.empty-cell {
  2061. display: contents;
  2062. &::before, &::after { content: ''; }
  2063. }
  2064. }
  2065. /* 侧边栏内容 */
  2066. .member-list {
  2067. .member-card {
  2068. display: flex;
  2069. align-items: center;
  2070. justify-content: space-between;
  2071. padding: 10px 12px;
  2072. border-radius: 6px;
  2073. transition: background-color 0.2s;
  2074. &:hover { background-color: #f7f8fa; }
  2075. .member-info {
  2076. display: flex;
  2077. align-items: center;
  2078. flex: 1;
  2079. .member-avatar {
  2080. margin-right: 16px;
  2081. background-color: #f2f3f5;
  2082. color: #fff;
  2083. border: none;
  2084. :deep(.el-icon) { font-size: 24px; }
  2085. }
  2086. .member-detail {
  2087. .member-main-info {
  2088. display: flex;
  2089. align-items: center;
  2090. gap: 20px; // 调大间距以匹配图片
  2091. .member-name { font-size: 14px; color: #1d2129; }
  2092. .leader-tag {
  2093. height: 18px;
  2094. line-height: 16px;
  2095. padding: 0 4px;
  2096. color: #00b42a;
  2097. border: 1px solid #00b42a;
  2098. background-color: transparent;
  2099. font-size: 12px;
  2100. border-radius: 2px;
  2101. }
  2102. .sub-info {
  2103. font-size: 13px;
  2104. color: #86909c;
  2105. }
  2106. }
  2107. }
  2108. }
  2109. .member-ops {
  2110. display: flex;
  2111. gap: 16px;
  2112. .op-btn {
  2113. font-size: 13px;
  2114. cursor: pointer;
  2115. &.edit { color: #fa8c16; } // 橙色
  2116. &.delete { color: #86909c; } // 灰色
  2117. &:hover { opacity: 0.7; }
  2118. }
  2119. }
  2120. }
  2121. }
  2122. /* 跟进记录与日志共有样式 */
  2123. .record-header {
  2124. display: flex;
  2125. justify-content: space-between;
  2126. align-items: center;
  2127. margin-bottom: 16px;
  2128. .filter-item {
  2129. display: flex;
  2130. align-items: center;
  2131. gap: 8px;
  2132. .filter-label { font-size: 12px; color: #86909c; }
  2133. }
  2134. }
  2135. .log-list {
  2136. padding-top: 8px;
  2137. .log-item {
  2138. padding: 10px 0;
  2139. border-bottom: none;
  2140. font-size: 13px;
  2141. line-height: 1.6;
  2142. color: #4e5969;
  2143. display: flex;
  2144. flex-wrap: wrap;
  2145. align-items: center;
  2146. .log-time {
  2147. width: 100%;
  2148. font-size: 12px;
  2149. color: #86909c;
  2150. margin-bottom: 4px;
  2151. }
  2152. .log-user {
  2153. color: #409eff;
  2154. font-weight: normal;
  2155. margin-right: 8px;
  2156. cursor: default;
  2157. }
  2158. .log-action {
  2159. color: #86909c;
  2160. margin-right: 4px;
  2161. }
  2162. .log-target {
  2163. color: #409eff;
  2164. font-weight: 400;
  2165. }
  2166. }
  2167. }
  2168. .record-list {
  2169. .log-item {
  2170. padding: 12px 0;
  2171. border-bottom: 1px dashed #f2f3f5;
  2172. &:last-child { border-bottom: none; }
  2173. .log-time { font-size: 12px; color: #c9cdd4; margin-bottom: 4px; }
  2174. .log-content { font-size: 13px; color: #1d2129; line-height: 1.5; }
  2175. }
  2176. }
  2177. /* 管理信息布局 */
  2178. .manage-info-container {
  2179. padding: 16px 4px;
  2180. }
  2181. .manage-info-grid {
  2182. display: grid;
  2183. grid-template-columns: 1fr 1fr;
  2184. gap: 24px 16px;
  2185. .manage-item {
  2186. display: flex;
  2187. flex-direction: column;
  2188. gap: 6px;
  2189. .label { font-size: 13px; color: #86909c; }
  2190. .value { font-size: 14px; color: #1d2129; font-weight: normal; }
  2191. }
  2192. }
  2193. /* 侧边栏基础布局 */
  2194. .side-content {
  2195. height: 100%;
  2196. display: flex;
  2197. flex-direction: column;
  2198. padding-top: 8px;
  2199. .member-count {
  2200. font-size: 14px;
  2201. font-weight: normal;
  2202. color: #1d2129;
  2203. margin-bottom: 12px;
  2204. display: flex;
  2205. justify-content: space-between;
  2206. align-items: center;
  2207. .add-icon { cursor: pointer; color: #86909c; font-size: 16px; &:hover { color: #165dff; } }
  2208. }
  2209. .search-box {
  2210. margin: 8px 0 16px;
  2211. :deep(.el-input__wrapper) {
  2212. background-color: #fff;
  2213. box-shadow: none;
  2214. border: 1px solid #e5e6eb;
  2215. height: 32px;
  2216. border-radius: 2px;
  2217. &:hover { border-color: #c9cdd4; }
  2218. &.is-focus { border-color: #f53f3f; }
  2219. }
  2220. }
  2221. }
  2222. /* ===== 编辑表单模式 - 精确还原原型图 ===== */
  2223. .edit-form-container {
  2224. flex: 1;
  2225. display: flex;
  2226. flex-direction: column;
  2227. background-color: #fff;
  2228. overflow: hidden;
  2229. .el-form {
  2230. flex: 1;
  2231. overflow-y: auto;
  2232. padding: 20px 24px;
  2233. &::-webkit-scrollbar { width: 4px; }
  2234. &::-webkit-scrollbar-thumb { background-color: #e5e6eb; border-radius: 2px; }
  2235. }
  2236. }
  2237. /* 区块标题 */
  2238. .form-section { margin-bottom: 24px; }
  2239. .form-section-header {
  2240. display: flex;
  2241. align-items: center;
  2242. justify-content: space-between;
  2243. margin-bottom: 20px;
  2244. background-color: #f0f7ff;
  2245. height: 34px;
  2246. padding: 0 12px;
  2247. position: relative;
  2248. .section-title {
  2249. font-size: 14px;
  2250. font-weight: normal;
  2251. color: #409eff;
  2252. padding-left: 8px;
  2253. }
  2254. .upload-link {
  2255. font-size: 13px;
  2256. color: var(--el-color-primary);
  2257. cursor: pointer;
  2258. display: flex;
  2259. align-items: center;
  2260. gap: 4px;
  2261. &:hover { opacity: 0.8; }
  2262. }
  2263. }
  2264. /* 表单网格 - 3列布局 */
  2265. .form-grid {
  2266. padding: 0 12px;
  2267. &.form-grid-3col {
  2268. display: grid;
  2269. grid-template-columns: repeat(3, 1fr);
  2270. gap: 12px 32px;
  2271. }
  2272. /* 每个表单项 */
  2273. > .el-form-item {
  2274. margin-bottom: 18px;
  2275. }
  2276. }
  2277. /* 单个表单字段容器 */
  2278. .form-item {
  2279. display: flex;
  2280. align-items: center;
  2281. gap: 12px;
  2282. width: 100%;
  2283. .field-label {
  2284. white-space: nowrap;
  2285. font-size: 13px;
  2286. color: var(--el-text-color-placeholder);
  2287. min-width: fit-content;
  2288. text-align: right;
  2289. line-height: 32px;
  2290. .required-star { color: var(--el-color-danger); margin-right: 2px; }
  2291. }
  2292. /* 输入框/选择器自适应宽度 */
  2293. :deep(.el-input),
  2294. :deep(.el-select) { flex: 1; }
  2295. :deep(.el-input__wrapper) {
  2296. background-color: var(--el-bg-color) !important;
  2297. box-shadow: none !important;
  2298. border: 1px solid var(--el-border-color-light) !important;
  2299. border-radius: 2px;
  2300. transition: all 0.2s;
  2301. padding: 0 10px;
  2302. &:hover { border-color: var(--el-border-color) !important; }
  2303. &.is-focus {
  2304. border-color: var(--el-color-primary) !important;
  2305. }
  2306. }
  2307. :deep(.el-input__inner) {
  2308. color: var(--el-text-color-primary);
  2309. height: 30px;
  2310. font-size: 13px;
  2311. &::placeholder {
  2312. color: var(--el-text-color-placeholder);
  2313. }
  2314. }
  2315. /* 针对 append 样式的优化 */
  2316. :deep(.el-input-group__append) {
  2317. background-color: var(--el-fill-color-light);
  2318. color: var(--el-text-color-placeholder);
  2319. padding: 0 10px;
  2320. border: 1px solid var(--el-border-color-light);
  2321. border-left: none;
  2322. font-size: 12px;
  2323. }
  2324. :deep(.el-textarea__inner) {
  2325. background-color: var(--el-bg-color);
  2326. box-shadow: none !important;
  2327. border: 1px solid var(--el-border-color-light) !important;
  2328. border-radius: 2px;
  2329. padding: 6px 10px;
  2330. color: var(--el-text-color-primary);
  2331. font-size: 13px;
  2332. &::placeholder { color: var(--el-text-color-placeholder); }
  2333. &:hover { border-color: var(--el-border-color) !important; }
  2334. &:focus { border-color: var(--el-color-primary) !important; }
  2335. }
  2336. :deep(.el-select) {
  2337. --el-border-color: var(--el-border-color-light);
  2338. --el-hover-border-color: var(--el-border-color);
  2339. --el-input-text-color: var(--el-text-color-primary);
  2340. --el-input-placeholder-color: var(--el-text-color-placeholder);
  2341. :deep(.el-input__suffix-inner) {
  2342. .el-icon { font-size: 12px; color: var(--el-border-color-light) !important; }
  2343. }
  2344. }
  2345. :deep(.el-date-editor.el-input) { width: 100%; }
  2346. }
  2347. /* 整行字段(项目名称、标期类型等)*/
  2348. .form-full-row { grid-column: span 3; }
  2349. .form-full-item {
  2350. display: flex;
  2351. align-items: center;
  2352. gap: 12px;
  2353. }
  2354. .form-item-vertical {
  2355. align-items: flex-start !important;
  2356. .field-label { line-height: 34px; }
  2357. :deep(.el-textarea) { flex: 1; }
  2358. :deep(.el-input__count) { bottom: 2px; right: 10px; }
  2359. }
  2360. /* 底部按钮栏 */
  2361. .edit-drawer-footer {
  2362. flex-shrink: 0;
  2363. display: flex;
  2364. justify-content: flex-end;
  2365. align-items: center;
  2366. gap: 12px;
  2367. padding: 16px 24px;
  2368. background-color: #fff;
  2369. border-top: 1px solid #e5e6eb;
  2370. .el-button {
  2371. height: 32px;
  2372. padding: 0 20px;
  2373. font-size: 14px;
  2374. border-radius: 2px;
  2375. &.el-button--primary {
  2376. background-color: #165dff;
  2377. border-color: #165dff;
  2378. &:hover { background-color: #4080ff; border-color: #4080ff; }
  2379. }
  2380. }
  2381. }
  2382. /* 附件表格 */
  2383. .attachment-table {
  2384. width: 100%;
  2385. :deep(th.el-table__cell) { background-color: #f8fafc !important; font-size: 13px; font-weight: normal; color: #4e5969; }
  2386. :deep(td.el-table__cell) { font-size: 13px; }
  2387. }
  2388. .mt-24 { margin-top: 24px; }
  2389. /* ===== Tab页面通用样式 ===== */
  2390. .tab-contact, .tab-analysis, .tab-files, .tab-quotes {
  2391. height: 100%;
  2392. }
  2393. .tab-empty {
  2394. text-align: center;
  2395. padding: 60px 0;
  2396. color: #c9cdd4;
  2397. font-size: 13px;
  2398. }
  2399. /* ===== 项目联系人 ===== */
  2400. .tab-contact {
  2401. .add-contact-btn {
  2402. border-radius: 4px;
  2403. }
  2404. .contact-table {
  2405. :deep(th.el-table__cell) { background-color: #f8fafc !important; color: #475569; font-weight: normal; font-size: 13px; }
  2406. :deep(td.el-table__cell) { font-size: 13px; }
  2407. :deep(.el-table__empty-text) { display: none; }
  2408. }
  2409. }
  2410. /* ===== 结果分析 ===== */
  2411. .tab-analysis {
  2412. .analysis-form {
  2413. padding: 4px 0;
  2414. .form-field {
  2415. margin-bottom: 24px;
  2416. &:last-child { margin-bottom: 0; }
  2417. .field-label {
  2418. font-size: 13px;
  2419. color: var(--el-text-color-placeholder);
  2420. margin-bottom: 8px;
  2421. line-height: 1.5;
  2422. }
  2423. :deep(.el-radio-group) {
  2424. .el-radio { color: var(--el-text-color-regular); font-size: 13px; margin-right: 28px; }
  2425. }
  2426. :deep(.el-textarea__inner) {
  2427. border-radius: 4px;
  2428. box-shadow: 0 0 0 1px var(--el-border-color-light) inset;
  2429. padding: 8px 12px;
  2430. font-size: 13px;
  2431. line-height: 22px;
  2432. color: var(--el-text-color-regular);
  2433. &::placeholder { color: var(--el-text-color-placeholder); }
  2434. &:hover { box-shadow: 0 0 0 1px var(--el-border-color) inset; }
  2435. &:focus { box-shadow: 0 0 0 1px var(--el-color-primary) inset; }
  2436. }
  2437. :deep(.el-input__count) {
  2438. bottom: 6px;
  2439. right: 10px;
  2440. font-size: 12px;
  2441. color: #86909c;
  2442. background: transparent;
  2443. }
  2444. }
  2445. }
  2446. }
  2447. /* ===== 附件 ===== */
  2448. .tab-files {
  2449. .file-table {
  2450. :deep(th.el-table__cell) { background-color: #f8fafc !important; color: #475569; font-weight: normal; font-size: 13px; }
  2451. :deep(td.el-table__cell) { font-size: 13px; }
  2452. :deep(.el-table__empty-text) { display: none; }
  2453. }
  2454. }
  2455. /* ===== 查看进度抽屉 - 精确还原原型图 ===== */
  2456. .progress-drawer {
  2457. :deep(.el-drawer__body) {
  2458. padding: 0 !important;
  2459. display: flex;
  2460. flex-direction: column;
  2461. }
  2462. }
  2463. .progress-drawer-header {
  2464. height: 48px;
  2465. flex-shrink: 0;
  2466. display: flex;
  2467. justify-content: space-between;
  2468. align-items: center;
  2469. padding: 0 20px;
  2470. border-bottom: 1px solid #e5e6eb;
  2471. background-color: #fff;
  2472. .progress-drawer-title {
  2473. font-size: 15px;
  2474. font-weight: normal;
  2475. color: var(--el-text-color-primary);
  2476. }
  2477. .progress-close-btn {
  2478. font-size: 16px;
  2479. color: var(--el-text-color-placeholder);
  2480. cursor: pointer;
  2481. transition: color 0.2s;
  2482. &:hover { color: var(--el-color-danger); }
  2483. }
  2484. }
  2485. .progress-drawer-body {
  2486. padding: 24px 20px;
  2487. flex: 1;
  2488. .progress-input-wrapper {
  2489. :deep(.el-textarea__inner) {
  2490. border-radius: 4px;
  2491. box-shadow: 0 0 0 1px #c9cdd4 inset;
  2492. padding: 8px 12px;
  2493. font-size: 13px;
  2494. line-height: 22px;
  2495. color: #4e5969;
  2496. &::placeholder { color: #c9cdd4; }
  2497. &:hover { box-shadow: 0 0 0 1px #86909c inset; }
  2498. &:focus { box-shadow: 0 0 0 1px #165dff inset; }
  2499. }
  2500. :deep(.el-input__count) {
  2501. bottom: 6px;
  2502. right: 10px;
  2503. font-size: 12px;
  2504. color: #86909c;
  2505. background: transparent;
  2506. }
  2507. }
  2508. .publish-btn-row {
  2509. display: flex;
  2510. justify-content: flex-end;
  2511. margin-top: 16px;
  2512. }
  2513. .publish-btn {
  2514. border-radius: 4px;
  2515. height: 32px;
  2516. padding: 0 20px;
  2517. font-size: 13px;
  2518. }
  2519. .record-list {
  2520. margin-top: 24px;
  2521. .record-item {
  2522. background: #fff;
  2523. border-radius: 4px;
  2524. padding: 14px 18px;
  2525. margin-bottom: 12px;
  2526. .record-header {
  2527. display: flex;
  2528. align-items: center;
  2529. gap: 16px;
  2530. margin-bottom: 8px;
  2531. .record-user {
  2532. font-size: 14px;
  2533. color: #333;
  2534. }
  2535. .record-time {
  2536. font-size: 13px;
  2537. color: #999;
  2538. }
  2539. }
  2540. .record-content {
  2541. font-size: 14px;
  2542. color: #606266;
  2543. line-height: 1.6;
  2544. }
  2545. }
  2546. .pagination-wrapper {
  2547. display: flex;
  2548. justify-content: center;
  2549. margin-top: 16px;
  2550. }
  2551. }
  2552. }
  2553. /* 团队成员及跟进记录弹窗优化 */
  2554. :deep(.member-dialog) {
  2555. border-radius: 8px;
  2556. overflow: hidden;
  2557. .el-dialog__header {
  2558. margin-right: 0;
  2559. padding: 16px 20px;
  2560. border-bottom: 1px solid #f2f3f5;
  2561. .el-dialog__title {
  2562. font-size: 16px;
  2563. font-weight: 600;
  2564. color: #1d2129;
  2565. }
  2566. }
  2567. .el-dialog__body {
  2568. padding: 24px 24px 8px;
  2569. }
  2570. .el-dialog__footer {
  2571. padding: 16px 24px 20px;
  2572. border-top: none;
  2573. }
  2574. .dialog-footer {
  2575. display: flex;
  2576. justify-content: flex-end;
  2577. gap: 12px;
  2578. .el-button {
  2579. padding: 8px 18px;
  2580. height: 32px;
  2581. font-size: 13px;
  2582. border-radius: 4px;
  2583. &--primary {
  2584. background-color: #165dff;
  2585. border-color: #165dff;
  2586. }
  2587. }
  2588. }
  2589. .el-form-item {
  2590. margin-bottom: 20px;
  2591. &:last-child { margin-bottom: 0; }
  2592. display: flex;
  2593. flex-wrap: nowrap;
  2594. align-items: center;
  2595. .el-form-item__label {
  2596. color: #4e5969;
  2597. font-weight: 400;
  2598. font-size: 13px;
  2599. line-height: 32px;
  2600. margin-bottom: 0;
  2601. display: flex;
  2602. align-items: center;
  2603. white-space: nowrap;
  2604. flex-shrink: 0;
  2605. }
  2606. .el-form-item__content {
  2607. flex: 1;
  2608. margin-left: 0 !important;
  2609. line-height: normal;
  2610. min-width: 0;
  2611. }
  2612. }
  2613. }
  2614. .label-nowrap :deep(.el-form-item__label) {
  2615. white-space: nowrap !important;
  2616. display: block;
  2617. }
  2618. /* 团队成员区域 */
  2619. .team-header {
  2620. display: flex;
  2621. justify-content: space-between;
  2622. align-items: center;
  2623. margin-bottom: 15px;
  2624. font-size: 14px;
  2625. font-weight: bold;
  2626. color: #333;
  2627. .add-icon {
  2628. cursor: pointer;
  2629. color: #86909C;
  2630. font-size: 20px;
  2631. &:hover {
  2632. color: #00B881;
  2633. }
  2634. }
  2635. }
  2636. .search-box {
  2637. margin-bottom: 20px;
  2638. :deep(.el-input__wrapper) {
  2639. background-color: #fff;
  2640. box-shadow: 0 0 0 1px #E5E6EB inset;
  2641. border-radius: 2px;
  2642. height: 32px;
  2643. &.is-focus {
  2644. box-shadow: 0 0 0 1px #00B881 inset;
  2645. }
  2646. .el-input__inner {
  2647. font-size: 13px;
  2648. &::placeholder {
  2649. color: #C9CDD4;
  2650. }
  2651. }
  2652. }
  2653. }
  2654. .team-list {
  2655. display: flex;
  2656. flex-direction: column;
  2657. .team-item {
  2658. display: flex;
  2659. align-items: center;
  2660. background: transparent;
  2661. padding: 12px 0;
  2662. transition: all 0.2s;
  2663. border-bottom: 1px solid #f2f3f5;
  2664. &:last-child {
  2665. border-bottom: none;
  2666. }
  2667. .member-info {
  2668. flex: 1;
  2669. margin-left: 12px;
  2670. display: flex;
  2671. flex-direction: column;
  2672. .info-top {
  2673. display: flex;
  2674. align-items: center;
  2675. flex-wrap: wrap;
  2676. gap: 8px;
  2677. .member-name {
  2678. font-size: 14px;
  2679. font-weight: 500;
  2680. color: #1d2129;
  2681. }
  2682. .leader-tag {
  2683. font-size: 12px;
  2684. height: 20px;
  2685. line-height: 18px;
  2686. padding: 0 6px;
  2687. color: #00B42A;
  2688. background-color: #fff;
  2689. border: 1px solid #00B42A;
  2690. border-radius: 2px;
  2691. margin-right: 4px;
  2692. }
  2693. .role-desc, .permission-desc {
  2694. font-size: 12px;
  2695. color: #86909C;
  2696. }
  2697. }
  2698. }
  2699. .member-actions {
  2700. display: flex;
  2701. gap: 12px;
  2702. .el-button {
  2703. padding: 0;
  2704. font-size: 12px;
  2705. &.btn-edit {
  2706. color: #FF7D00;
  2707. }
  2708. &.btn-delete {
  2709. color: #86909C;
  2710. }
  2711. &:hover { opacity: 0.8; }
  2712. }
  2713. }
  2714. }
  2715. }
  2716. .empty-data {
  2717. text-align: center;
  2718. color: #86909C;
  2719. padding: 30px 0;
  2720. font-size: 13px;
  2721. }
  2722. /* 全局覆盖标签字体 */
  2723. :deep(.el-form-item__label),
  2724. :deep(.el-drawer__header) {
  2725. font-weight: normal !important;
  2726. }
  2727. </style>