You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProjectDetail.vue 14 KiB

2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <a-form-model ref="ruleForm" class="project-preview" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
  3. <ButtonBox
  4. v-if="checkPermission('Integrations.ProjectManagement.Update') ||
  5. checkPermission('Integrations.ProductSeriesManagement') ||
  6. checkPermission('Integrations.ProductManagement.Create') ||
  7. checkPermission('Integrations.ProjectManagement.SettlementTemplate.Update') ||
  8. checkPermission('Integrations.ProjectManagement.Industry.Update') ||
  9. checkPermission('Integrations.ProjectManagement.Sync') ||
  10. checkPermission('Integrations.ProjectManagement.Delete')"
  11. class="mb-20"
  12. >
  13. <a-space :size="10">
  14. <a-button ghost type="primary" v-if="checkPermission('Integrations.ProjectManagement.Update')" @click="showEditProject">编辑项目</a-button>
  15. <a-button ghost type="primary" v-if="checkPermission('Integrations.ProductSeriesManagement')" @click="showProductSeries">+新增系列</a-button>
  16. <a-button ghost type="primary" v-if="checkPermission('Integrations.ProductManagement.Create')" @click="showAddProduct">+新增产品</a-button>
  17. <a-button ghost type="primary" v-if="checkPermission('Integrations.ProjectManagement.SettlementTemplate.Update')" @click="showPayTypeList">+付款方式</a-button>
  18. <a-button ghost type="primary" v-if="checkPermission('Integrations.ProjectManagement.Industry.Update')" @click="showIndustryEdit">+市场调研</a-button>
  19. <a-button ghost type="primary" v-if="checkPermission('Integrations.ProjectManagement.Sync')" @click="handlePushProject">同步</a-button>
  20. <a-button ghost type="danger" v-if="checkPermission('Integrations.ProjectManagement.Delete')" @click="handleDeleteProject">删除</a-button>
  21. </a-space>
  22. </ButtonBox>
  23. <a-card class="mb-10">
  24. <div class="contentCls">
  25. <div class="imgCls">
  26. <img :src="projectInfo.logo" alt="" v-if="projectInfo.logo" />
  27. <SvgIcon iconClass="icon-liebiaomorenwu" v-else />
  28. </div>
  29. <div class="wrapCls">
  30. <p>{{ projectInfo.projectName }}({{ projectInfo.projectCode }})</p>
  31. <div class="itemCls">
  32. <div class="item">
  33. 项目类型<span>{{ projectInfo.industry }}</span>
  34. </div>
  35. <div class="item">
  36. 产品交付数量<span>{{ projectInfo.productDeliveryCount }}</span>
  37. </div>
  38. <div class="item">
  39. 销售客户单价<span>{{ projectInfo.customerAmount | money }}</span>
  40. </div>
  41. </div>
  42. <div class="itemCls">
  43. <div class="item">
  44. 交付周期<span>{{ projectInfo.deliveryCycle }}月</span>
  45. </div>
  46. <div class="item">
  47. 月度交付<span>{{ projectInfo.monthDeliveryCount }}</span>
  48. </div>
  49. <div class="item">
  50. 预计合同金额<span>{{ projectInfo.contractAmount | money }}</span>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </a-card>
  56. <OpenCloseBox class="mb-10">
  57. <div class="form-title">市场调研</div>
  58. <a-row class="widthstyle">
  59. <a-col :span="12">
  60. <a-form-model-item label="所在行业">
  61. <span>{{ projectInfo.industry }}</span>
  62. </a-form-model-item>
  63. </a-col>
  64. <a-col :span="12">
  65. <a-form-model-item label="主营业务">
  66. <span>{{ projectInfo.businessScope }}</span>
  67. </a-form-model-item>
  68. </a-col>
  69. <a-col :span="12">
  70. <a-form-model-item label="从业领域">
  71. <span>{{ projectInfo.businessDomain }}</span>
  72. </a-form-model-item>
  73. </a-col>
  74. <a-col :span="12">
  75. <a-form-model-item label="行业地位">
  76. <span>{{ projectInfo.rank }}</span>
  77. </a-form-model-item>
  78. </a-col>
  79. <a-col :span="12">
  80. <a-form-model-item label="领域详情">
  81. <span>{{ projectInfo.domainDetail }}</span>
  82. </a-form-model-item>
  83. </a-col>
  84. <a-col :span="12">
  85. <a-form-model-item label="市场占有">
  86. <span>{{ projectInfo.marketShare }}%</span>
  87. </a-form-model-item>
  88. </a-col>
  89. <a-col :span="12">
  90. <a-form-model-item label="市场客户">
  91. <span>{{ projectInfo.marketCustomer }}</span>
  92. </a-form-model-item>
  93. </a-col>
  94. <a-col :span="12">
  95. <a-form-model-item label="年度销售金额">
  96. <span>{{ projectInfo.yearSalesAmount }}</span>
  97. </a-form-model-item>
  98. </a-col>
  99. <a-col :span="12">
  100. <a-form-model-item label="年度销售数量">
  101. <span>{{ projectInfo.yearSalesNum }}</span>
  102. </a-form-model-item>
  103. </a-col>
  104. </a-row>
  105. </OpenCloseBox>
  106. <OpenCloseBox class="mb-10">
  107. <div class="form-title">付款方式</div>
  108. <a-row class="widthstyle">
  109. <a-col :span="12">
  110. <a-form-model-item label="付款方式">
  111. <span>{{ settlementInfo.paymentTypeStr }}</span>
  112. </a-form-model-item>
  113. </a-col>
  114. <a-col :span="12">
  115. <a-form-model-item label="账单生成日期">
  116. <span>{{ settlementInfo.reconciliatioDateType }}</span>
  117. </a-form-model-item>
  118. </a-col>
  119. <a-col :span="12">
  120. <a-form-model-item label="账单结算周期">
  121. <span>{{ settlementInfo.reconciliationCycle
  122. }}{{ settlementInfo.reconciliationCycleType }}</span>
  123. </a-form-model-item>
  124. </a-col>
  125. <a-col :span="12">
  126. <a-form-model-item label="账单还款天数">
  127. <span>{{ settlementInfo.repaymentDays }}</span>
  128. </a-form-model-item>
  129. </a-col>
  130. </a-row>
  131. </OpenCloseBox>
  132. <a-card class="mb-5">
  133. <a-space :size="10">
  134. <a-input class="custom-search-input" v-model.trim="queryParam.keyWord" placeholder="请输入客户编号、项目编号" allow-clear>
  135. <SvgIcon slot="prefix" iconClass="icon-sousuo"></SvgIcon>
  136. </a-input>
  137. <a-button type="primary" @click="refresh">搜索</a-button>
  138. </a-space>
  139. </a-card>
  140. <a-table class="table-img" :rowKey="(r, i) => i" :columns="columns" :data-source="list" :pagination="pagination"
  141. :customRow="customRow" @change="changeTable">
  142. <span slot="customTitle2">
  143. <SvgIcon iconClass="icon-biaozhi" /> 项目图片
  144. </span>
  145. <span slot="customTitle7">
  146. <SvgIcon iconClass="icon-kehujiancheng" /> 项目名称
  147. </span>
  148. <span slot="customTitle4">
  149. <SvgIcon iconClass="icon-kehubianhao" /> 项目编号
  150. </span>
  151. <span slot="customTitle8">
  152. <SvgIcon iconClass="icon-kehubianhao" /> 产品编号
  153. </span>
  154. <span slot="customTitle5">
  155. <SvgIcon iconClass="icon-kehujiancheng" /> 产品系列
  156. </span>
  157. <span slot="customTitle6">
  158. <SvgIcon iconClass="icon-kehujiancheng" /> 产品型号
  159. </span>
  160. <span slot="customTitle11">
  161. <SvgIcon iconClass="icon-kehujiancheng" /> 产品类型
  162. </span>
  163. <span slot="customTitle3">
  164. <SvgIcon iconClass="icon-kehujiancheng" /> 产品配置
  165. </span>
  166. <span slot="customTitle1">
  167. <SvgIcon iconClass="icon-chuangjianshijian" /> 日期
  168. </span>
  169. <div slot="orderDate" slot-scope="text">
  170. {{ text | moment("YYYY-MM-DD") }}
  171. </div>
  172. <div slot="logo">
  173. <viewer :images="[projectInfo.logo]" v-if="projectInfo.logo">
  174. <img :src="projectInfo.logo" class="common-img" />
  175. </viewer>
  176. <SvgIcon iconClass="icon-liebiaomorenwu" v-else />
  177. </div>
  178. <div slot="projectName" slot-scope="text, record">
  179. <StringSubstr :content="record.projectName" :length="15" />
  180. </div>
  181. <div slot="productName" slot-scope="text">
  182. <StringSubstr :content="text" :length="15" />
  183. </div>
  184. <div slot="subtitle" slot-scope="text">
  185. <StringSubstr :content="text" :length="15" />
  186. </div>
  187. </a-table>
  188. <!-- 市场调研 -->
  189. <IndustryEdit ref="IndustryEdit" :isCompany="false" @ok="getInfo" />
  190. <!-- 付款方式 -->
  191. <PayTypeList ref="payTypeList" :isCompany="false" @ok="getInfo" />
  192. <!-- 新增系列 -->
  193. <ProductSeries ref="ProductSeries" />
  194. <!-- 新增产品 -->
  195. <ProductAdd ref="ProductAdd" @ok="handleReset" />
  196. <!-- 编辑项目 -->
  197. <ProjectAdd ref="ProjectAdd" @ok="getInfo" />
  198. </a-form-model>
  199. </template>
  200. <script>
  201. import { checkPermission } from '@/utils/abp';
  202. import {
  203. getProjectDetail,
  204. getProductList,
  205. getSettlementDetail,
  206. deleteProject,
  207. pushProject,
  208. } from '@/services/fileManagement/customer';
  209. import IndustryEdit from '@/pages/customerManagement/modules/IndustryEdit';
  210. import PayTypeList from '@/pages/customerManagement/modules/PayTypeList';
  211. import ProductSeries from '@/pages/customerManagement/modules/ProductSeries';
  212. import ProductAdd from '@/pages/customerManagement/modules/ProductAdd';
  213. import ProjectAdd from './modules/ProjectAdd';
  214. const columns = [
  215. {
  216. slots: { title: 'customTitle2' },
  217. dataIndex: 'logo',
  218. scopedSlots: { customRender: 'logo' },
  219. align: 'center',
  220. width: 110,
  221. },
  222. {
  223. slots: { title: 'customTitle7' },
  224. scopedSlots: { customRender: 'projectName' },
  225. },
  226. {
  227. slots: { title: 'customTitle4' },
  228. dataIndex: 'projectCode',
  229. },
  230. {
  231. slots: { title: 'customTitle8' },
  232. dataIndex: 'code',
  233. },
  234. {
  235. slots: { title: 'customTitle5' },
  236. dataIndex: 'productSeriesName',
  237. },
  238. {
  239. slots: { title: 'customTitle6' },
  240. dataIndex: 'productName',
  241. scopedSlots: { customRender: 'productName' },
  242. },
  243. {
  244. slots: { title: 'customTitle11' },
  245. dataIndex: 'productTypeStr',
  246. },
  247. {
  248. slots: { title: 'customTitle3' },
  249. dataIndex: 'subtitle',
  250. scopedSlots: { customRender: 'subtitle' },
  251. },
  252. {
  253. slots: { title: 'customTitle1' },
  254. dataIndex: 'orderDate',
  255. scopedSlots: { customRender: 'orderDate' },
  256. width: 110,
  257. },
  258. ];
  259. export default {
  260. components: {
  261. IndustryEdit,
  262. PayTypeList,
  263. ProductSeries,
  264. ProductAdd,
  265. ProjectAdd,
  266. },
  267. data() {
  268. return {
  269. projectInfo: {},
  270. settlementInfo: {},
  271. labelCol: { span: 9 },
  272. wrapperCol: { span: 15 },
  273. form: {},
  274. queryParam: {},
  275. id: '',
  276. companyCode: '',
  277. settlementTemplateId: '',
  278. columns,
  279. list: [],
  280. pagination: this.$store.state.setting.pagination,
  281. };
  282. },
  283. activated() {
  284. const { id, companyCode } = this.$route.query;
  285. this.companyCode = companyCode;
  286. this.id = id;
  287. this.getInfo();
  288. this.getList();
  289. },
  290. methods: {
  291. checkPermission,
  292. showIndustryEdit() {
  293. this.$refs.IndustryEdit.showDrawer(this.id, this.projectInfo);
  294. },
  295. showPayTypeList() {
  296. this.$refs.payTypeList.showDrawer({
  297. companyCode: this.companyCode,
  298. id: this.id,
  299. settlementTemplateId: this.settlementTemplateId,
  300. });
  301. },
  302. showProductSeries() {
  303. this.$refs.ProductSeries.showDrawer({
  304. companyCode: this.companyCode,
  305. projectId: this.id,
  306. });
  307. },
  308. showAddProduct() {
  309. this.$refs.ProductAdd.showDrawer({
  310. companyCode: this.companyCode,
  311. projectId: this.id,
  312. });
  313. },
  314. showEditProject() {
  315. this.$refs.ProjectAdd.showDrawer(this.companyCode, this.projectInfo);
  316. },
  317. handlePushProject() {
  318. pushProject(this.id).then(() => {
  319. this.$message.success('同步成功');
  320. });
  321. },
  322. handleDeleteProject() {
  323. this.$confirm({
  324. title: '确认删除该项目?',
  325. onOk: () => {
  326. deleteProject(this.id).then(() => {
  327. this.$message.success('删除成功');
  328. if (this.$route.query.from == 'list') {
  329. this.$bus.$emit('closeCurrentPage');
  330. } else {
  331. this.$router.go(-1);
  332. }
  333. });
  334. },
  335. });
  336. },
  337. getInfo() {
  338. getProjectDetail(this.id).then((res) => {
  339. this.settlementTemplateId = res.settlementTemplateId;
  340. if (this.settlementTemplateId > 0) {
  341. this.getSettlement();
  342. }
  343. const arr = res.categoryName?.split('|') || [];
  344. this.projectInfo = {
  345. ...res,
  346. industry: arr[0],
  347. businessDomain: arr[1],
  348. };
  349. });
  350. },
  351. getSettlement() {
  352. getSettlementDetail(this.settlementTemplateId).then((res) => {
  353. this.settlementInfo = res;
  354. });
  355. },
  356. getList() {
  357. this.loading = true;
  358. let params = {
  359. ...this.pagination,
  360. ...this.queryParam,
  361. projectId: this.id,
  362. };
  363. getProductList(params)
  364. .then((res) => {
  365. const arr = [];
  366. res.items.forEach((item) => {
  367. arr.push({
  368. ...item,
  369. ...item.chargeDetail,
  370. });
  371. });
  372. this.list = arr;
  373. const pagination = { ...this.pagination };
  374. pagination.total = res.totalCount;
  375. this.pagination = pagination;
  376. })
  377. .finally(() => {
  378. this.loading = false;
  379. });
  380. },
  381. handleReset() {
  382. this.queryParam = {};
  383. this.refresh();
  384. },
  385. refresh() {
  386. this.pagination.current = 1;
  387. this.getList();
  388. },
  389. changeTable(pagination) {
  390. const pager = { ...this.pagination };
  391. pager.current = pagination.current;
  392. this.pagination = pager;
  393. this.getList();
  394. },
  395. customRow(record) {
  396. return {
  397. on: {
  398. // 事件
  399. click: (event) => {
  400. if (event.srcElement.nodeName == 'IMG') return;
  401. this.$router.push({
  402. path: 'productDetail',
  403. query: {
  404. id: record.id,
  405. companyCode: record.companyCode,
  406. },
  407. });
  408. },
  409. },
  410. };
  411. },
  412. },
  413. };
  414. </script>
  415. <style lang="less" scoped>
  416. @import "@/pages/customerManagement/product/style/product.less";
  417. .project-preview {
  418. /deep/ .ant-form-item {
  419. height: 40px;
  420. margin-bottom: 0;
  421. color: #333;
  422. .ant-form-item-label>label {
  423. color: #999;
  424. }
  425. }
  426. }
  427. </style>