plm前端
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.

1579 lines
53 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item :label="'项目编号'">
  5. <el-input v-model="searchData.projectId" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item >
  8. <span slot="label" style="" @click="getBaseList(1010,1)"><a herf="#">项目类型</a></span>
  9. <el-input v-model="searchData.projectType" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'项目责任人'">
  12. <el-input v-model="searchData.projectOwnerName" style="width: 130px"></el-input>
  13. </el-form-item>
  14. <el-form-item label=" ">
  15. <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
  16. <el-button @click="addOrUpdateHandle('save')" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>
  17. <download-excel
  18. :fields="fields()"
  19. :data="exportData"
  20. type="xls"
  21. :name="exportName"
  22. :header="exportHeader"
  23. :footer="exportFooter"
  24. :fetch="createExportData"
  25. :before-generate="startDownload"
  26. :before-finish="finishDownload"
  27. worksheet="导出信息"
  28. class="el-button el-button--primary el-button--medium">
  29. {{ '导出' }}
  30. </download-excel>
  31. </el-form-item>
  32. </el-form>
  33. <el-table
  34. :height="height"
  35. :data="dataList1"
  36. border
  37. ref="mainTable"
  38. @row-click="changeData"
  39. highlight-current-row
  40. v-loading="dataListLoading"
  41. style="width: 100%;">
  42. <el-table-column
  43. header-align="center"
  44. align="center"
  45. width="150"
  46. fixed="right"
  47. label="操作">
  48. <template slot-scope="scope">
  49. <a type="text" size="small" @click="addOrUpdateHandle(scope.row.projectId)">新增</a>
  50. <a type="text" size="small" @click="UpdateHandle(scope.row)">修改</a>
  51. <a type="text" size="small" @click="deleteProjectInfo(scope.row)">删除</a>
  52. </template>
  53. </el-table-column>
  54. <el-table-column
  55. v-for="(item,index) in columnList1" :key="index"
  56. :sortable="item.columnSortable"
  57. :prop="item.columnProp"
  58. :header-align="item.headerAlign"
  59. :show-overflow-tooltip="item.showOverflowTooltip"
  60. :align="item.align"
  61. :fixed="item.fixed==''?false:item.fixed"
  62. :min-width="item.columnWidth"
  63. :label="item.columnLabel">
  64. <template slot-scope="scope">
  65. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  66. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  67. style="width: 100px; height: 80px"/></span>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <el-pagination
  72. @size-change="sizeChangeHandle"
  73. @current-change="currentChangeHandle"
  74. :current-page="pageIndex"
  75. :page-sizes="[20, 50, 100, 1000]"
  76. :page-size="pageSize"
  77. :total="totalPage"
  78. layout="total, sizes, prev, pager, next, jumper">
  79. </el-pagination>
  80. <el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  81. <el-tab-pane label="项目信息" name="info">
  82. <el-form label-position="top" style="margin-top: 0px; margin-left: 0px;">
  83. <el-row :gutter="20">
  84. <el-col :span="5"><div class="grid-content bg-purple">
  85. <el-form-item :label="'项目号'">
  86. <el-input v-model="projectData.projectId" readonly ></el-input>
  87. </el-form-item>
  88. </div></el-col>
  89. <el-col :span="5"><div class="grid-content bg-purple">
  90. <el-form-item :label="'项目类型'">
  91. <el-input v-model="projectData.projectType" readonly ></el-input>
  92. </el-form-item>
  93. </div></el-col>
  94. <el-col :span="5"><div class="grid-content bg-purple">
  95. <el-form-item :label="'项目来源'">
  96. <el-input v-model="projectData.projectSourceDesc" readonly ></el-input>
  97. </el-form-item>
  98. </div></el-col>
  99. <el-col :span="5"><div class="grid-content bg-purple">
  100. <el-form-item :label="'优先级'">
  101. <el-input v-model="projectData.priorityDesc" readonly></el-input>
  102. </el-form-item>
  103. </div></el-col>
  104. <el-col :span="4"><div class="grid-content bg-purple">
  105. <el-form-item :label="'需求日期'">
  106. <el-input v-model="projectData.needDate" readonly ></el-input>
  107. </el-form-item>
  108. </div></el-col>
  109. </el-row>
  110. <el-row :gutter="20">
  111. <el-col :span="5"><div class="grid-content bg-purple">
  112. <el-form-item :label="'BU'">
  113. <el-input v-model="projectData.buDesc" readonly style="" ></el-input>
  114. </el-form-item>
  115. </div></el-col>
  116. <el-col :span="5"><div class="grid-content bg-purple">
  117. <el-form-item :label="'项目名称'">
  118. <el-input v-model="projectData.projectName" readonly style="" ></el-input>
  119. </el-form-item>
  120. </div></el-col>
  121. <el-col :span="14"><div class="grid-content bg-purple">
  122. <el-form-item :label="'项目描述'">
  123. <el-input v-model="projectData.projectDesc" readonly style="" ></el-input>
  124. </el-form-item>
  125. </div></el-col>
  126. </el-row>
  127. <el-row :gutter="20">
  128. <el-col :span="8"><div class="grid-content bg-purple">
  129. <el-form-item :label="'项目经理'">
  130. <el-input v-model="projectData.projectManagerName" readonly style="" ></el-input>
  131. </el-form-item>
  132. </div></el-col>
  133. <el-col :span="8"><div class="grid-content bg-purple">
  134. <el-form-item :label="'项目责任人'">
  135. <el-input v-model="projectData.projectOwnerName" readonly style="" ></el-input>
  136. </el-form-item>
  137. </div></el-col>
  138. <el-col :span="8"><div class="grid-content bg-purple">
  139. <el-form-item :label="'项目权限'">
  140. <el-input v-model="projectData.userRoleName" readonly style="" ></el-input>
  141. </el-form-item>
  142. </div></el-col>
  143. </el-row>
  144. <el-row :gutter="20">
  145. <el-col :span="24"><div class="grid-content bg-purple">
  146. <el-form-item :label="'客户应用/要求'">
  147. <el-input v-model="projectData.customerRemark" readonly style="" ></el-input>
  148. </el-form-item>
  149. </div></el-col>
  150. </el-row>
  151. <el-row :gutter="20">
  152. <el-col :span="24"><div class="grid-content bg-purple">
  153. <el-form-item :label="'其他特殊要求'">
  154. <el-input v-model="projectData.remark" readonly style="" ></el-input>
  155. </el-form-item>
  156. </div></el-col>
  157. </el-row>
  158. </el-form>
  159. </el-tab-pane>
  160. <el-tab-pane label="客户信息" name="customer">
  161. <el-form label-position="top" label-width="100px" >
  162. <el-row :gutter="20">
  163. <el-col :span="4"><div class="grid-content bg-purple">
  164. <el-form-item :label="'客户代码'">
  165. <el-input v-model="customerData.customerNo" readonly ></el-input>
  166. </el-form-item>
  167. </div></el-col>
  168. <el-col :span="8"><div class="grid-content bg-purple">
  169. <el-form-item :label="'客户名称'">
  170. <el-input v-model="customerData.customerDesc" readonly ></el-input>
  171. </el-form-item>
  172. </div></el-col>
  173. <el-col :span="4"><div class="grid-content bg-purple">
  174. <el-form-item :label="'客户币种'">
  175. <el-input v-model="customerData.customerCurrency" readonly ></el-input>
  176. </el-form-item>
  177. </div></el-col>
  178. <el-col :span="4"><div class="grid-content bg-purple">
  179. <el-form-item :label="'年营业额'">
  180. <el-input v-model="customerData.turnoverOfYear" readonly ></el-input>
  181. </el-form-item>
  182. </div></el-col>
  183. <el-col :span="4"><div class="grid-content bg-purple">
  184. <el-form-item :label="'年度潜在收入'">
  185. <el-input v-model="customerData.potentialRevenueOfYear" readonly ></el-input>
  186. </el-form-item>
  187. </div></el-col>
  188. </el-row>
  189. <el-row :gutter="20">
  190. <el-col :span="4"><div class="grid-content bg-purple">
  191. <el-form-item :label="'关键客户'">
  192. <el-input v-model="customerData.importantCustomer" readonly ></el-input>
  193. </el-form-item>
  194. </div></el-col>
  195. <el-col :span="4"><div class="grid-content bg-purple">
  196. <el-form-item :label="'客户状态'">
  197. <el-input v-model="customerData.customerStatus" readonly ></el-input>
  198. </el-form-item>
  199. </div></el-col>
  200. <el-col :span="16"><div class="grid-content bg-purple">
  201. <el-form-item :label="'备注信息'">
  202. <el-input v-model="customerData.remark" readonly ></el-input>
  203. </el-form-item>
  204. </div></el-col>
  205. </el-row>
  206. </el-form>
  207. </el-tab-pane>
  208. <el-tab-pane label="客户联系人" name="customer_contact">
  209. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  210. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  211. <el-button type="primary" @click="contactChooseModal()">编辑</el-button>
  212. <download-excel
  213. :fields="fields2()"
  214. :data="exportData2"
  215. type="xls"
  216. :name="exportName2"
  217. :header="exportHeader2"
  218. :footer="exportFooter2"
  219. :fetch="createExportData2"
  220. :before-generate="startDownload2"
  221. :before-finish="finishDownload2"
  222. worksheet="导出信息"
  223. class="el-button el-button--primary el-button--medium">
  224. {{ '导出' }}
  225. </download-excel>
  226. </el-form>
  227. </el-form>
  228. <el-table
  229. :data="contactList"
  230. height="240"
  231. border
  232. v-loading="dataListLoading"
  233. style="width: 100%; ">
  234. <el-table-column
  235. v-for="(item,index) in columnList2" :key="index"
  236. :sortable="item.columnSortable"
  237. :prop="item.columnProp"
  238. :header-align="item.headerAlign"
  239. :show-overflow-tooltip="item.showOverflowTooltip"
  240. :align="item.align"
  241. :fixed="item.fixed==''?false:item.fixed"
  242. :min-width="item.columnWidth"
  243. :label="item.columnLabel">
  244. <template slot-scope="scope">
  245. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  246. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  247. style="width: 100px; height: 80px"/></span>
  248. </template>
  249. </el-table-column>
  250. </el-table>
  251. </el-tab-pane>
  252. <el-tab-pane label="文档管理" name="down">
  253. <!--文件上传-->
  254. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  255. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  256. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  257. </el-form>
  258. </el-form>
  259. <el-table
  260. :data="fileContentList"
  261. height="240"
  262. border
  263. v-loading="dataListLoading"
  264. style="width: 100%; ">
  265. <el-table-column
  266. v-for="(item,index) in columnFileContentArray" :key="index"
  267. :sortable="item.columnSortable"
  268. :prop="item.columnProp"
  269. :header-align="item.headerAlign"
  270. :show-overflow-tooltip="item.showOverflowTooltip"
  271. :align="item.align"
  272. :fixed="item.fixed==''?false:item.fixed"
  273. :min-width="item.columnWidth"
  274. :label="item.columnLabel">
  275. <template slot-scope="scope">
  276. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  277. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  278. style="width: 100px; height: 80px"/></span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column
  282. fixed="right"
  283. header-align="center"
  284. align="center"
  285. width="100"
  286. label="操作">
  287. <template slot-scope="scope">
  288. <!-- <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>-->
  289. <a @click="downloadFile(scope.row)" >下载</a>
  290. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  291. </template>
  292. </el-table-column>
  293. </el-table>
  294. </el-tab-pane>
  295. <el-tab-pane label="项目物料" name="part">
  296. <projectPart ref="projectPart" ></projectPart>
  297. </el-tab-pane>
  298. <el-tab-pane label="询价信息" name="quotation">
  299. <projectQuotation ref="projectQuotation" ></projectQuotation>
  300. </el-tab-pane>
  301. <el-tab-pane label="报价信息" name="quotationHeader">
  302. <quotationHeader ref="quotationHeader"></quotationHeader>
  303. </el-tab-pane>
  304. <el-tab-pane label="打样信息" name="sample">
  305. <sample ref="sample" ></sample>
  306. </el-tab-pane>
  307. <el-tab-pane label="测试记录" name="test">
  308. <test ref="test" ></test>
  309. </el-tab-pane>
  310. <el-tab-pane label="刀模申请" name="purchase">
  311. <purchase ref="purchase" ></purchase>
  312. </el-tab-pane>
  313. <el-tab-pane label="技术参数卡" name="technicalSpecification">
  314. <technicalSpecification ref="technicalSpecification" ></technicalSpecification>
  315. </el-tab-pane>
  316. </el-tabs>
  317. <el-dialog
  318. width="530px"
  319. title="项目联系人"
  320. :close-on-click-modal="false"
  321. :visible.sync="contactChooseFlag">
  322. <el-transfer v-model="contactChooseList1" :props="{
  323. key: 'contactName',
  324. label: 'contactName'
  325. }" :data="contactChooseList2" :titles="['未选择', '已选择']"></el-transfer>
  326. <span slot="footer" class="dialog-footer">
  327. <div style="margin-top: 5px">
  328. <el-button type="primary" @click="saveProjectContactList()">确定</el-button>
  329. <el-button @click="contactChooseFlag = false" type="primary">取消</el-button>
  330. </div>
  331. </span>
  332. </el-dialog>
  333. <!-- 上传文件的modal -->
  334. <projectUploadFile ref="projectUploadFile" @refreshPageTables="getFileContentData()" v-drag></projectUploadFile>
  335. <add-or-update v-if="addOrUpdateVisible" v-model="addOrUpdate" ref="addOrUpdate" @refreshDataList="search" v-drag></add-or-update>
  336. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  337. </div>
  338. </template>
  339. <script>
  340. import {
  341. customerInformationSearch, // 客户信息列表查询`
  342. } from '@/api/customer/customerInformation.js'
  343. import AddOrUpdate from './com_projectInfo-add-or-update'
  344. import {
  345. getTableDefaultListLanguage,
  346. getTableUserListLanguage,
  347. } from "@/api/table.js"
  348. import Chooselist from '@/views/modules/common/Chooselist'
  349. import {projectInfoSearch,
  350. deleteProjectFile,
  351. getFileContentList,
  352. downLoadProjectFile,
  353. getCustomerContactData,
  354. getContactChooseData,
  355. saveProjectContactList,
  356. deleteProjectInfo,
  357. getProjectUserRole,
  358. } from "@/api/project/project.js"
  359. import projectUploadFile from "./com_project_upload_file";/*上传文件的組件*/
  360. import projectPart from "./com_project_info_part";/*組件*/
  361. import projectQuotation from "./com_project_puotation";/*組件*/
  362. import sample from "./com_project_sample";/*組件*/
  363. import test from "./com_project_test";/*組件*/
  364. import purchase from "./com_project_info_purchase_request";/*組件*/
  365. import technicalSpecification from "./com_project_technicalSpecification";
  366. import quotationHeader from "./com_project_info_quotation.vue";
  367. /*組件*/
  368. export default {
  369. components: {
  370. Chooselist,
  371. AddOrUpdate,
  372. projectUploadFile,
  373. projectPart,
  374. projectQuotation,
  375. sample,
  376. test,
  377. purchase,
  378. technicalSpecification,
  379. quotationHeader,
  380. },
  381. name: "null",
  382. data() {
  383. return {
  384. // addOrUpdate
  385. addOrUpdate:'0',
  386. //项目已选联系人
  387. contactChooseList1:[],
  388. //客户可选联系人
  389. contactChooseList2:[],
  390. contactList: [],
  391. fileContentList: [],
  392. activeName: 'info',
  393. addOrUpdateVisible:false,
  394. searchData:{
  395. page: 1,
  396. limit: 100,
  397. site:this.$store.state.user.site,
  398. projectId:'',
  399. projectType:'',
  400. projectOwnerName:'',
  401. userName:this.$store.state.user.name,
  402. },
  403. contactChooseFlag:false,
  404. currentRow:'',
  405. height: 200,
  406. dataList1:[],
  407. dataListLoading: false,
  408. // 导出 start
  409. exportData: [],
  410. exportName: "项目清单" + this.dayjs().format('YYYYMMDDHHmmss'),
  411. exportHeader: ["项目清单"],
  412. exportFooter: [],
  413. exportList:[],
  414. // 导出 start
  415. exportData2: [],
  416. exportName2: "项目客户联系人" + this.dayjs().format('YYYYMMDDHHmmss'),
  417. exportHeader2: ["项目客户联系人"],
  418. exportFooter2: [],
  419. exportList2:[],
  420. tagNo:'',
  421. tagNo2:'',
  422. pageIndex: 1,
  423. pageSize: 100,
  424. totalPage: 0,
  425. // 导出 end
  426. columnList1: [
  427. {
  428. userId: this.$store.state.user.name,
  429. functionId: 101002001,
  430. serialNumber: '101002001Table1ProjectId',
  431. tableId: "101002001Table1",
  432. tableName: "项目信息主表",
  433. columnProp: "projectId",
  434. headerAlign: "center",
  435. align: "left",
  436. columnLabel: "项目号",
  437. columnHidden: false,
  438. columnImage: false,
  439. columnSortable: false,
  440. sortLv: 0,
  441. status: true,
  442. fixed: '',
  443. columnWidth: 120
  444. },
  445. {
  446. userId: this.$store.state.user.name,
  447. functionId: 101002001,
  448. serialNumber: '101002001Table1ProjectType',
  449. tableId: "101002001Table1",
  450. tableName: "项目信息主表",
  451. columnProp: "projectType",
  452. headerAlign: "center",
  453. align: "left",
  454. columnLabel: "项目类型",
  455. columnHidden: false,
  456. columnImage: false,
  457. columnSortable: false,
  458. sortLv: 0,
  459. status: true,
  460. fixed: '',
  461. columnWidth: 80
  462. },
  463. {
  464. userId: this.$store.state.user.name,
  465. functionId: 101002001,
  466. serialNumber: '101002001Table1ProjectName',
  467. tableId: "101002001Table1",
  468. tableName: "项目信息主表",
  469. columnProp: "projectName",
  470. headerAlign: "center",
  471. align: "left",
  472. columnLabel: "项目名称",
  473. columnHidden: false,
  474. columnImage: false,
  475. columnSortable: false,
  476. sortLv: 0,
  477. status: true,
  478. fixed: '',
  479. columnWidth: 80
  480. },
  481. {
  482. userId: this.$store.state.user.name,
  483. functionId: 101002001,
  484. serialNumber: '101002001Table1Status',
  485. tableId: "101002001Table1",
  486. tableName: "项目信息主表",
  487. columnProp: "status",
  488. headerAlign: "center",
  489. align: "left",
  490. columnLabel: "项目状态",
  491. columnHidden: false,
  492. columnImage: false,
  493. columnSortable: false,
  494. sortLv: 0,
  495. status: true,
  496. fixed: '',
  497. columnWidth: 80
  498. },
  499. {
  500. userId: this.$store.state.user.name,
  501. functionId: 101002001,
  502. serialNumber: '101002001Table1Priority',
  503. tableId: "101002001Table1",
  504. tableName: "项目信息主表",
  505. columnProp: "priority",
  506. headerAlign: "center",
  507. align: "left",
  508. columnLabel: "优先级",
  509. columnHidden: false,
  510. columnImage: false,
  511. columnSortable: false,
  512. sortLv: 0,
  513. status: true,
  514. fixed: '',
  515. columnWidth: 40
  516. },
  517. {
  518. userId: this.$store.state.user.name,
  519. functionId: 101002001,
  520. serialNumber: '101002001Table1BuNo',
  521. tableId: "101002001Table1",
  522. tableName: "项目信息主表",
  523. columnProp: "buNo",
  524. headerAlign: "center",
  525. align: "left",
  526. columnLabel: "BU编码",
  527. columnHidden: false,
  528. columnImage: false,
  529. columnSortable: false,
  530. sortLv: 0,
  531. status: true,
  532. fixed: '',
  533. columnWidth: 40
  534. },
  535. {
  536. userId: this.$store.state.user.name,
  537. functionId: 101002001,
  538. serialNumber: '101002001Table1BuDesc',
  539. tableId: "101002001Table1",
  540. tableName: "项目信息主表",
  541. columnProp: "buDesc",
  542. headerAlign: "center",
  543. align: "left",
  544. columnLabel: "BU名称",
  545. columnHidden: false,
  546. columnImage: false,
  547. columnSortable: false,
  548. sortLv: 0,
  549. status: true,
  550. fixed: '',
  551. columnWidth: 40
  552. },
  553. {
  554. userId: this.$store.state.user.name,
  555. functionId: 101002001,
  556. serialNumber: '101002001Table1ProjectOwnerName',
  557. tableId: "101002001Table1",
  558. tableName: "项目信息主表",
  559. columnProp: "projectOwnerName",
  560. headerAlign: "center",
  561. align: "left",
  562. columnLabel: "项目负责人",
  563. columnHidden: false,
  564. columnImage: false,
  565. columnSortable: false,
  566. sortLv: 0,
  567. status: true,
  568. fixed: '',
  569. columnWidth: 80
  570. },
  571. {
  572. userId: this.$store.state.user.name,
  573. functionId: 101002001,
  574. serialNumber: '101002001Table1ProjectSource',
  575. tableId: "101002001Table1",
  576. tableName: "项目信息主表",
  577. columnProp: "projectSource",
  578. headerAlign: "center",
  579. align: "left",
  580. columnLabel: "项目来源",
  581. columnHidden: false,
  582. columnImage: false,
  583. columnSortable: false,
  584. sortLv: 0,
  585. status: true,
  586. fixed: '',
  587. columnWidth: 80
  588. },
  589. {
  590. userId: this.$store.state.user.name,
  591. functionId: 101002001,
  592. serialNumber: '101002001Table1CustomerId',
  593. tableId: "101002001Table1",
  594. tableName: "项目信息主表",
  595. columnProp: "customerId",
  596. headerAlign: "center",
  597. align: "left",
  598. columnLabel: "客户代码",
  599. columnHidden: false,
  600. columnImage: false,
  601. columnSortable: false,
  602. sortLv: 0,
  603. status: true,
  604. fixed: '',
  605. columnWidth: 80
  606. },
  607. {
  608. userId: this.$store.state.user.name,
  609. functionId: 101002001,
  610. serialNumber: '101002001Table1CustomerName',
  611. tableId: "101002001Table1",
  612. tableName: "项目信息主表",
  613. columnProp: "customerName",
  614. headerAlign: "center",
  615. align: "left",
  616. columnLabel: "客户名称",
  617. columnHidden: false,
  618. columnImage: false,
  619. columnSortable: false,
  620. sortLv: 0,
  621. status: true,
  622. fixed: '',
  623. columnWidth: 120
  624. },
  625. {
  626. userId: this.$store.state.user.name,
  627. functionId: 101002001,
  628. serialNumber: '101002001Table1CreateDate',
  629. tableId: "101002001Table1",
  630. tableName: "项目信息主表",
  631. columnProp: "createDate",
  632. headerAlign: "center",
  633. align: "left",
  634. columnLabel: "创建时间",
  635. columnHidden: false,
  636. columnImage: false,
  637. columnSortable: false,
  638. sortLv: 0,
  639. status: true,
  640. fixed: '',
  641. columnWidth: 120
  642. },
  643. {
  644. userId: this.$store.state.user.name,
  645. functionId: 101002001,
  646. serialNumber: '101002001Table1CreateBy',
  647. tableId: "101002001Table1",
  648. tableName: "项目信息主表",
  649. columnProp: "createBy",
  650. headerAlign: "center",
  651. align: "left",
  652. columnLabel: "创建人",
  653. columnHidden: false,
  654. columnImage: false,
  655. columnSortable: false,
  656. sortLv: 0,
  657. status: true,
  658. fixed: '',
  659. columnWidth: 80
  660. },
  661. {
  662. userId: this.$store.state.user.name,
  663. functionId: 101002001,
  664. serialNumber: '101002001Table1UpdateDate',
  665. tableId: "101002001Table1",
  666. tableName: "项目信息主表",
  667. columnProp: "updateDate",
  668. headerAlign: "center",
  669. align: "left",
  670. columnLabel: "修改时间",
  671. columnHidden: false,
  672. columnImage: false,
  673. columnSortable: false,
  674. sortLv: 0,
  675. status: true,
  676. fixed: '',
  677. columnWidth: 120
  678. },
  679. {
  680. userId: this.$store.state.user.name,
  681. functionId: 101002001,
  682. serialNumber: '101002001Table1UpdateBy',
  683. tableId: "101002001Table1",
  684. tableName: "项目信息主表",
  685. columnProp: "updateBy",
  686. headerAlign: "center",
  687. align: "left",
  688. columnLabel: "修改人",
  689. columnHidden: false,
  690. columnImage: false,
  691. columnSortable: false,
  692. sortLv: 0,
  693. status: true,
  694. fixed: '',
  695. columnWidth: 80
  696. },
  697. ],
  698. columnList2: [
  699. {
  700. userId: this.$store.state.user.name,
  701. functionId: 101002001,
  702. serialNumber: '101002001Table2ContactName',
  703. tableId: '101002001Table2',
  704. tableName: '项目联系人表',
  705. columnProp: 'contactName',
  706. headerAlign: 'center',
  707. align: 'center',
  708. columnLabel: '联系人',
  709. columnHidden: false,
  710. columnImage: false,
  711. columnSortable: false,
  712. sortLv: 0,
  713. status: true,
  714. fixed: '',
  715. columnWidth: 80
  716. },
  717. {
  718. userId: this.$store.state.user.name,
  719. functionId: 101002001,
  720. serialNumber: '101002001Table2ContactPhoneNumber1',
  721. tableId: '101002001Table2',
  722. tableName: '项目联系人表',
  723. columnProp: 'contactPhoneNumber1',
  724. headerAlign: 'center',
  725. align: 'center',
  726. columnLabel: '联系电话',
  727. columnHidden: false,
  728. columnImage: false,
  729. columnSortable: false,
  730. sortLv: 0,
  731. status: true,
  732. fixed: '',
  733. columnWidth: 80
  734. },
  735. {
  736. userId: this.$store.state.user.name,
  737. functionId: 101002001,
  738. serialNumber: '101002001Table2ContactLandlineNumber',
  739. tableId: '101002001Table2',
  740. tableName: '项目联系人表',
  741. columnProp: 'contactLandlineNumber',
  742. headerAlign: 'center',
  743. align: 'center',
  744. columnLabel: '座机',
  745. columnHidden: false,
  746. columnImage: false,
  747. columnSortable: false,
  748. sortLv: 0,
  749. status: true,
  750. fixed: '',
  751. columnWidth: 80
  752. },
  753. {
  754. userId: this.$store.state.user.name,
  755. functionId: 101002001,
  756. serialNumber: '101002001Table2Position',
  757. tableId: '101002001Table2',
  758. tableName: '项目联系人表',
  759. columnProp: 'position',
  760. headerAlign: 'center',
  761. align: 'center',
  762. columnLabel: '公司职务',
  763. columnHidden: false,
  764. columnImage: false,
  765. columnSortable: false,
  766. sortLv: 0,
  767. status: true,
  768. fixed: '',
  769. columnWidth: 80
  770. },
  771. {
  772. userId: this.$store.state.user.name,
  773. functionId: 101002001,
  774. serialNumber: '101002001Table2Mailbox',
  775. tableId: '101002001Table2',
  776. tableName: '项目联系人表',
  777. columnProp: 'mailbox',
  778. headerAlign: 'center',
  779. align: 'center',
  780. columnLabel: '邮箱',
  781. columnHidden: false,
  782. columnImage: false,
  783. columnSortable: false,
  784. sortLv: 0,
  785. status: true,
  786. fixed: '',
  787. columnWidth: 80
  788. },
  789. {
  790. userId: this.$store.state.user.name,
  791. functionId: 101002001,
  792. serialNumber: '101002001Table2PrimaryContact',
  793. tableId: '101002001Table2',
  794. tableName: '项目联系人表',
  795. columnProp: 'primaryContact',
  796. headerAlign: 'center',
  797. align: 'center',
  798. columnLabel: '主联系人',
  799. columnHidden: false,
  800. columnImage: false,
  801. columnSortable: false,
  802. sortLv: 0,
  803. status: true,
  804. fixed: '',
  805. columnWidth: 40
  806. },
  807. {
  808. userId: this.$store.state.user.name,
  809. functionId: 101002001,
  810. serialNumber: '101002001Table2ContactStatus',
  811. tableId: '101002001Table2',
  812. tableName: '项目联系人表',
  813. columnProp: 'contactStatus',
  814. headerAlign: 'center',
  815. align: 'center',
  816. columnLabel: '状态',
  817. columnHidden: false,
  818. columnImage: false,
  819. columnSortable: false,
  820. sortLv: 0,
  821. status: true,
  822. fixed: '',
  823. columnWidth: 40
  824. },
  825. {
  826. userId: this.$store.state.user.name,
  827. functionId: 101002001,
  828. serialNumber: '101002001Table2CreateDate',
  829. tableId: '101002001Table2',
  830. tableName: '项目联系人表',
  831. columnProp: 'createDate',
  832. headerAlign: 'center',
  833. align: 'center',
  834. columnLabel: '创建时间',
  835. columnHidden: false,
  836. columnImage: false,
  837. columnSortable: false,
  838. sortLv: 0,
  839. status: true,
  840. fixed: '',
  841. columnWidth: 120
  842. },
  843. {
  844. userId: this.$store.state.user.name,
  845. functionId: 101002001,
  846. serialNumber: '101002001Table2CreateBy',
  847. tableId: '101002001Table2',
  848. tableName: '项目联系人表',
  849. columnProp: 'createBy',
  850. headerAlign: 'center',
  851. align: 'center',
  852. columnLabel: '创建人',
  853. columnHidden: false,
  854. columnImage: false,
  855. columnSortable: false,
  856. sortLv: 0,
  857. status: true,
  858. fixed: '',
  859. columnWidth: 80
  860. },
  861. {
  862. userId: this.$store.state.user.name,
  863. functionId: 101002001,
  864. serialNumber: '101002001Table2UpdateDate',
  865. tableId: '101002001Table2',
  866. tableName: '项目联系人表',
  867. columnProp: 'updateDate',
  868. headerAlign: 'center',
  869. align: 'center',
  870. columnLabel: '更新时间',
  871. columnHidden: false,
  872. columnImage: false,
  873. columnSortable: false,
  874. sortLv: 0,
  875. status: true,
  876. fixed: '',
  877. columnWidth: 120
  878. },
  879. {
  880. userId: this.$store.state.user.name,
  881. functionId: 101002001,
  882. serialNumber: '101002001Table2UpdateBy',
  883. tableId: '101002001Table2',
  884. tableName: '项目联系人表',
  885. columnProp: 'updateBy',
  886. headerAlign: 'center',
  887. align: 'center',
  888. columnLabel: '更新人',
  889. columnHidden: false,
  890. columnImage: false,
  891. columnSortable: false,
  892. sortLv: 0,
  893. status: true,
  894. fixed: '',
  895. columnWidth: 80
  896. }
  897. ],
  898. projectData: {
  899. id: 0,
  900. site:this.$store.state.user.site,
  901. projectLevel:'',
  902. projectId:'',
  903. projectTypeDb:'',
  904. projectType:'',
  905. customerName:'',
  906. customerId:'',
  907. projectName:'',
  908. projectDesc:'',
  909. needDate:'',
  910. priority:'',
  911. projectSource:'',
  912. priorityDesc:'',
  913. projectSourceDesc:'',
  914. projectManagerName:'',
  915. projectOwnerName:'',
  916. customerRemark:'',
  917. remark:'',
  918. userRoleName:'',
  919. buDesc:'',
  920. buNo:'',
  921. },
  922. customerData:{
  923. site: '',
  924. customerNo: '',
  925. customerDesc: '',
  926. customerDescription: '',
  927. customerIndustry: '',
  928. customerCurrency: '',
  929. turnoverOfYear: '',
  930. potentialRevenueOfYear: '',
  931. importantCustomer: '',
  932. customerStatus: '',
  933. companyName: '',
  934. jobDescription: '',
  935. remark: '',
  936. contactName: '',
  937. contactPhoneNumber1: '',
  938. primaryContact: '',
  939. contactStatus: '',
  940. addressName: ''
  941. },
  942. columnFileContentArray: [
  943. {
  944. columnProp: 'fileName',
  945. headeralign: 'left',
  946. align: 'left',
  947. columnLabel: '文件名称',
  948. columnHidden: false,
  949. columnImage: false,
  950. columnSortable: false,
  951. sortLv: 0,
  952. status: true,
  953. fixed: false
  954. // }, {
  955. // columnProp: 'createdBy',
  956. // headeralign: 'left',
  957. // align: 'left',
  958. // columnLabel: '上传人',
  959. // columnHidden: false,
  960. // columnImage: false,
  961. // columnSortable: true,
  962. // sortLv: 0,
  963. // status: true,
  964. // fixed: false
  965. }, {
  966. columnProp: 'createDate',
  967. headeralign: 'left',
  968. align: 'left',
  969. columnLabel: '上传时间',
  970. columnHidden: false,
  971. columnImage: false,
  972. columnSortable: true,
  973. sortLv: 0,
  974. status: true,
  975. fixed: false
  976. }, {
  977. columnProp: 'orderRef3',
  978. headeralign: 'left',
  979. align: 'left',
  980. columnLabel: '类型',
  981. columnHidden: false,
  982. columnImage: false,
  983. columnSortable: true,
  984. sortLv: 0,
  985. status: true,
  986. fixed: false
  987. },
  988. ],
  989. }
  990. },
  991. watch: {
  992. // columnList1: {
  993. // deep: true,
  994. // handler: function (newV, oldV) {
  995. // debugger
  996. //
  997. // }
  998. // }
  999. },
  1000. mounted() {
  1001. this.$nextTick(() => {
  1002. this.height = window.innerHeight - 520;
  1003. })
  1004. },
  1005. methods: {
  1006. // 获取基础数据列表S
  1007. getBaseList (val, type) {
  1008. this.tagNo = val
  1009. this.tagNo2 = type
  1010. this.$nextTick(() => {
  1011. let strVal = ''
  1012. if (val === 1010) {
  1013. if(type==1) {
  1014. strVal = this.searchData.projectType
  1015. }
  1016. }
  1017. this.$refs.baseList.init(val, strVal)
  1018. })
  1019. },
  1020. /* 列表方法的回调 */
  1021. getBaseData (val) {
  1022. if (this.tagNo === 1010) {
  1023. if(this.tagNo2==1) {
  1024. this.searchData.projectType = val.Base_desc
  1025. }
  1026. }
  1027. },
  1028. // 新增 / 修改
  1029. addOrUpdateHandle (id) {
  1030. this.addOrUpdateVisible = true
  1031. this.addOrUpdate = id;
  1032. this.$nextTick(() => {
  1033. this.$refs.addOrUpdate.init();
  1034. if (id && id !== 'save' && id !== 'update'){
  1035. this.$refs.addOrUpdate.updateDataForm(id);
  1036. }
  1037. })
  1038. },
  1039. UpdateHandle (row) {
  1040. let inData={
  1041. site:row.site,
  1042. username:this.$store.state.user.name,
  1043. projectId:row.projectId
  1044. }
  1045. getProjectUserRole(inData).then(({data}) => {
  1046. if(this.$store.state.user.name=='admin'||data.row.updateFlag=='Y') {
  1047. this.addOrUpdateVisible = true
  1048. this.addOrUpdate = 'update';
  1049. this.$nextTick(() => {
  1050. this.$refs.addOrUpdate.init(row.id)
  1051. })
  1052. }else {
  1053. this.$alert('没有权限修改这个项目信息!', '错误', {
  1054. confirmButtonText: '确定'
  1055. })
  1056. }
  1057. })
  1058. },
  1059. //导出excel
  1060. async createExportData() {
  1061. this.searchData.limit = -1
  1062. this.searchData.page = 1
  1063. await projectInfoSearch(this.searchData).then(({data}) => {
  1064. this.exportList= data.page.list;
  1065. })
  1066. return this.exportList;
  1067. },
  1068. startDownload() {
  1069. // this.exportData = this.dataList
  1070. },
  1071. finishDownload() {
  1072. },
  1073. fields() {
  1074. let json = "{"
  1075. this.columnList1.forEach((item, index) => {
  1076. if (index == this.columnList1.length - 1) {
  1077. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1078. } else {
  1079. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1080. }
  1081. })
  1082. json += "}"
  1083. let s = eval("(" + json + ")")
  1084. return s
  1085. },
  1086. //导出excel
  1087. async createExportData2() {
  1088. return this.contactList;
  1089. },
  1090. startDownload2() {
  1091. // this.exportData = this.dataList
  1092. },
  1093. finishDownload2() {
  1094. },
  1095. fields2() {
  1096. let json = "{"
  1097. this.columnList2.forEach((item, index) => {
  1098. if (index == this.columnList2.length - 1) {
  1099. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1100. } else {
  1101. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1102. }
  1103. })
  1104. json += "}"
  1105. let s = eval("(" + json + ")")
  1106. return s
  1107. },
  1108. // 导出 end
  1109. // 获取数据列表
  1110. search () {
  1111. this.searchData.limit = this.pageSize
  1112. this.searchData.page = this.pageIndex
  1113. projectInfoSearch(this.searchData).then(({data}) => {
  1114. if (data.code == 0) {
  1115. this.dataList1 = data.page.list
  1116. this.pageIndex = data.page.currPage
  1117. this.pageSize = data.page.pageSize
  1118. this.totalPage = data.page.totalCount
  1119. if(this.dataList1.length>0){
  1120. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  1121. this.changeData(this.dataList1[0])
  1122. }
  1123. }
  1124. this.dataListLoading = false
  1125. })
  1126. },
  1127. //单击切换订单
  1128. changeData(row) {
  1129. this.currentRow = JSON.parse(JSON.stringify(row));
  1130. this.projectData=row;
  1131. let inData= {
  1132. site:row.site,
  1133. customerNo:row.customerId,
  1134. page: 1,
  1135. limit: 10,
  1136. }
  1137. this.refreshCurrentTabTable ();
  1138. customerInformationSearch(inData).then(({data}) => {
  1139. if (data.code == 0) {
  1140. if(data.page.list.length>0){
  1141. this.customerData=data.page.list[0]
  1142. }
  1143. }
  1144. })
  1145. },
  1146. addUploadFileModal(){
  1147. let currentData = {
  1148. site: this.currentRow.site,
  1149. createBy: this.$store.state.user.name,
  1150. projectId: this.currentRow.projectId,
  1151. projectName: this.currentRow.projectName,
  1152. remark: '',
  1153. };
  1154. //打开组件 去做新增业务
  1155. this.$nextTick(() => {
  1156. this.$refs.projectUploadFile.init(currentData);
  1157. })
  1158. },
  1159. deleteFile(row){
  1160. this.$confirm('确定要删除此文件?', '提示', {
  1161. confirmButtonText: '确定',
  1162. cancelButtonText: '取消',
  1163. type: 'warning'
  1164. }).then(() => {
  1165. deleteProjectFile(row).then(({data}) => {
  1166. if (data && data.code == 0) {
  1167. this.getFileContentData();
  1168. this.$message({
  1169. message: '操作成功',
  1170. type: 'success',
  1171. duration: 1500,
  1172. onClose: () => {
  1173. }
  1174. })
  1175. } else {
  1176. this.$alert(data.msg, '错误', {
  1177. confirmButtonText: '确定'
  1178. })
  1179. }
  1180. })
  1181. }).catch(() => {
  1182. })
  1183. },
  1184. // 刷新页签的table数据
  1185. refreshCurrentTabTable () {
  1186. if (this.activeName == 'down') {
  1187. this.getFileContentData();
  1188. }
  1189. if (this.activeName == 'customer_contact') {
  1190. this.getCustomerContactData();
  1191. }
  1192. if (this.activeName == 'part') {
  1193. this.refreshPartTable();
  1194. }
  1195. if (this.activeName == 'quotation') {
  1196. this.refreshQuotationTable();
  1197. }
  1198. if (this.activeName == 'quotationHeader') {
  1199. this.refreshQuotationHeaderTable();
  1200. }
  1201. if (this.activeName == 'sample') {
  1202. this.refreshSampleTable();
  1203. }
  1204. if (this.activeName == 'test') {
  1205. this.refreshTestTable();
  1206. }
  1207. if (this.activeName == 'purchase') {
  1208. this.refreshPurchaseTable();
  1209. }
  1210. if (this.activeName == 'technicalSpecification') {
  1211. this.refreshTechnicalSpecificationTable();
  1212. }
  1213. },
  1214. refreshPartTable(){
  1215. let inData={
  1216. site: this.currentRow.site,
  1217. projectId: this.currentRow.projectId,
  1218. username:this.$store.state.user.name
  1219. }
  1220. this.$refs.projectPart.init(inData)
  1221. },
  1222. refreshTechnicalSpecificationTable(){
  1223. let inData={
  1224. site: this.currentRow.site,
  1225. projectId: this.currentRow.projectId,
  1226. page: 1,
  1227. limit: 1000
  1228. }
  1229. this.$refs.technicalSpecification.init(inData)
  1230. },
  1231. refreshQuotationHeaderTable(){
  1232. let inData={
  1233. site: this.currentRow.site,
  1234. projectId: this.currentRow.projectId,
  1235. username:this.$store.state.user.name,
  1236. no: 1,
  1237. size: 1000
  1238. }
  1239. this.$refs.quotationHeader.init(inData)
  1240. },
  1241. refreshQuotationTable(){
  1242. let inData={
  1243. site: this.currentRow.site,
  1244. projectId: this.currentRow.projectId,
  1245. username:this.$store.state.user.name,
  1246. page: 1,
  1247. limit: 1000
  1248. }
  1249. this.$refs.projectQuotation.init(inData)
  1250. },
  1251. refreshSampleTable(){
  1252. let inData={
  1253. site: this.currentRow.site,
  1254. projectId: this.currentRow.projectId,
  1255. username:this.$store.state.user.name,
  1256. page: 1,
  1257. limit: 1000
  1258. }
  1259. this.$refs.sample.init(inData)
  1260. },
  1261. refreshTestTable(){
  1262. let inData={
  1263. site: this.currentRow.site,
  1264. projectId: this.currentRow.projectId,
  1265. username:this.$store.state.user.name,
  1266. page: 1,
  1267. limit: 1000
  1268. }
  1269. this.$refs.test.init(inData)
  1270. },
  1271. refreshPurchaseTable(){
  1272. let inData={
  1273. site: this.currentRow.site,
  1274. projectId: this.currentRow.projectId,
  1275. username:this.$store.state.user.name,
  1276. }
  1277. this.$refs.purchase.init(inData)
  1278. },
  1279. //刷新派设备文档的列表
  1280. getFileContentData() {
  1281. let currentData = {orderRef2: this.currentRow.projectId};
  1282. getFileContentList(currentData).then(({data}) => {
  1283. //区分请求成功和失败的状况
  1284. if (data && data.code == 200) {
  1285. this.fileContentList = data.rows;
  1286. } else {
  1287. this.fileContentList = [];
  1288. }
  1289. });
  1290. },
  1291. // 下载
  1292. downloadFile(row){
  1293. // axios.get('/proxyApi/pms/eamProject/downLoadProjectFile/' + row.id, {
  1294. // responseType: 'blob',
  1295. // headers: {
  1296. // 'Content-Type': 'application/json',
  1297. // 'token': Vue.cookie.get('token')
  1298. // }
  1299. // })
  1300. let inData={
  1301. site:this.currentRow.site,
  1302. username:this.$store.state.user.name,
  1303. projectId:this.currentRow.projectId
  1304. }
  1305. getProjectUserRole(inData).then(({data}) => {
  1306. if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') {
  1307. downLoadProjectFile(row)
  1308. .then(({data}) => {
  1309. // 不限制文件下载类型
  1310. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  1311. // 下载文件名称
  1312. const fileName = row.fileName
  1313. // a标签下载
  1314. const linkNode = document.createElement('a')
  1315. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  1316. linkNode.style.display = 'none'
  1317. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  1318. console.log(linkNode)
  1319. // if(val == 'Y'){
  1320. // this.pdfVisible = true
  1321. // this.pdfUrl = linkNode.href
  1322. // }else {
  1323. document.body.appendChild(linkNode)
  1324. linkNode.click() // 模拟在按钮上的一次鼠标单击
  1325. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  1326. document.body.removeChild(linkNode)
  1327. // }
  1328. })
  1329. }else {
  1330. this.$alert('没有权限下载这个项目的文件!', '错误', {
  1331. confirmButtonText: '确定'
  1332. })
  1333. }
  1334. })
  1335. },
  1336. // 每页数
  1337. sizeChangeHandle (val) {
  1338. this.pageSize = val
  1339. this.pageIndex = 1
  1340. this.search()
  1341. },
  1342. // 当前页
  1343. currentChangeHandle (val) {
  1344. this.pageIndex = val
  1345. this.search()
  1346. },
  1347. // 动态列开始 获取 用户保存的 格式列
  1348. async getTableUserColumn(tableId, columnId) {
  1349. let queryTableUser = {
  1350. userId: this.$store.state.user.name,
  1351. functionId: this.$route.meta.menuId,
  1352. tableId: tableId,
  1353. status: true,
  1354. languageCode: this.$i18n.locale
  1355. }
  1356. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1357. if (data.rows.length > 0) {
  1358. //this.columnList = []
  1359. switch (columnId) {
  1360. case 1:
  1361. this.columnList1 = data.rows
  1362. this.checkField();
  1363. break;
  1364. // case 2:
  1365. // this.columnList1 = data.rows
  1366. // break;
  1367. // case 3:
  1368. // this.columnList2 = data.rows
  1369. // break;
  1370. // case 4:
  1371. // this.columnList3 = data.rows
  1372. // break;
  1373. }
  1374. } else {
  1375. this.getColumnList(tableId, columnId)
  1376. }
  1377. })
  1378. },
  1379. // 获取 tableDefault 列
  1380. async getColumnList(tableId, columnId) {
  1381. let queryTable= {
  1382. functionId: this.$route.meta.menuId,
  1383. tableId: tableId,
  1384. languageCode: this.$i18n.locale
  1385. }
  1386. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1387. if (!data.rows.length == 0) {
  1388. switch (columnId) {
  1389. case 1:
  1390. this.columnList1 = data.rows
  1391. this.checkField();
  1392. break;
  1393. // case 2:
  1394. // this.columnList1 = data.rows
  1395. // break;
  1396. // case 3:
  1397. // this.columnList2 = data.rows
  1398. // break;
  1399. // case 4:
  1400. // this.columnList3 = data.rows
  1401. // break;
  1402. }
  1403. } else {
  1404. // this.showDefault = true.
  1405. }
  1406. })
  1407. },
  1408. //动态列结束
  1409. // 列表表格选择替换
  1410. tabClick (tab, event) {
  1411. // 刷新列表数据
  1412. this.refreshCurrentTabTable()
  1413. },
  1414. getCustomerContactData(){
  1415. let inData={
  1416. site:this.currentRow.site,
  1417. customerId:this.currentRow.customerId,
  1418. projectId:this.currentRow.projectId,
  1419. }
  1420. getCustomerContactData(inData).then(({data}) => {
  1421. //区分请求成功和失败的状况
  1422. if (data && data.code == 0) {
  1423. this.contactList = data.rows;
  1424. } else {
  1425. this.contactList = [];
  1426. }
  1427. });
  1428. },
  1429. contactChooseModal(){
  1430. if(this.currentRow==null||this.currentRow==''){
  1431. this.$alert('请选择项目!', '错误', {
  1432. confirmButtonText: '确定'
  1433. })
  1434. return false;
  1435. }
  1436. let inData={
  1437. site:this.currentRow.site,
  1438. customerId:this.currentRow.customerId,
  1439. projectId:this.currentRow.projectId,
  1440. }
  1441. getContactChooseData(inData).then(({data}) => {
  1442. //区分请求成功和失败的状况
  1443. if (data && data.code == 0) {
  1444. this.contactChooseList1 = data.rows1;
  1445. this.contactChooseList2 = data.rows2;
  1446. } else {
  1447. this.contactChooseList1 = [];
  1448. this.contactChooseList2 = [];
  1449. }
  1450. });
  1451. this.contactChooseFlag=true;
  1452. },
  1453. saveProjectContactList(){
  1454. let data={
  1455. site:this.currentRow.site,
  1456. customerId:this.currentRow.customerId,
  1457. projectId:this.currentRow.projectId,
  1458. contactList:this.contactChooseList1
  1459. }
  1460. saveProjectContactList(data).then(({data}) => {
  1461. if (data && data.code === 0) {
  1462. this.$message.success( '操作成功')
  1463. this.contactChooseFlag = false
  1464. this.refreshCurrentTabTable()
  1465. } else {
  1466. this.$message.error(data.msg)
  1467. }
  1468. })
  1469. },
  1470. deleteProjectInfo(row){
  1471. let inData={
  1472. site:row.site,
  1473. username:this.$store.state.user.name,
  1474. projectId:row.projectId
  1475. }
  1476. getProjectUserRole(inData).then(({data}) => {
  1477. if(this.$store.state.user.name=='admin'||data.row.deleteFlag=='Y') {
  1478. this.$confirm(`确定删除当前记录?`, '提示', {
  1479. confirmButtonText: '确定',
  1480. cancelButtonText: '取消',
  1481. type: 'warning'
  1482. }).then(() => {
  1483. deleteProjectInfo(row).then(({data}) => {
  1484. if (data && data.code === 0) {
  1485. this.$message.success( '操作成功')
  1486. this.contactChooseFlag = false
  1487. this.search()
  1488. } else {
  1489. this.$message.error(data.msg)
  1490. }
  1491. })
  1492. }).catch(() => {})
  1493. }else {
  1494. this.$alert('没有权限删除这个项目信息!', '错误', {
  1495. confirmButtonText: '确定'
  1496. })
  1497. }
  1498. })
  1499. },
  1500. checkField(){
  1501. if(!this.accessField('10202001')){
  1502. this.columnList1=this.columnList1.filter(item => item.columnProp !== 'customerId');
  1503. this.columnList1=this.columnList1.filter(item => item.columnProp !== 'customerName');
  1504. }
  1505. if(!this.accessField('10202002')){
  1506. this.columnList1=this.columnList1.filter(item => item.columnProp !== 'projectSource');
  1507. }
  1508. },
  1509. },
  1510. activated() {
  1511. if (this.$route.params.projectId){
  1512. this.searchData.projectId = this.$route.params.projectId
  1513. }
  1514. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1515. },
  1516. }
  1517. </script>
  1518. <style >
  1519. .el-transfer-panel {
  1520. border: 2px solid #17b3a3;
  1521. border-radius: 4px;
  1522. overflow: hidden;
  1523. background: #fff;
  1524. display: inline-block;
  1525. vertical-align: middle;
  1526. width: 200px;
  1527. max-height: 100%;
  1528. -webkit-box-sizing: border-box;
  1529. box-sizing: border-box;
  1530. position: relative;
  1531. }
  1532. .el-transfer-panel .el-transfer-panel__header {
  1533. height: 40px;
  1534. line-height: 40px;
  1535. background: #17b3a3;
  1536. margin: 0;
  1537. padding-left: 15px;
  1538. border-bottom: 1px solid #17b3a3;
  1539. -webkit-box-sizing: border-box;
  1540. box-sizing: border-box;
  1541. color: #000;
  1542. }
  1543. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  1544. font-size: 14px;
  1545. color: #303133;
  1546. font-weight: 400;
  1547. }
  1548. </style>