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.

3321 lines
109 KiB

1 year ago
3 months ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12 months ago
12 months ago
2 years ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  5. <el-form-item :label="'客户代码'">
  6. <el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'客户名称'">
  9. <el-input v-model="searchData.customerDesc" clearable style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'客户状态'">
  12. <el-select v-model="searchData.customerStatus" style="width: 120px">
  13. <el-option label="全部" value=""></el-option>
  14. <el-option label="启用" value="Y"></el-option>
  15. <el-option label="停用" value="N"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item :label="' '">
  19. <el-button @click="getDataList">查询</el-button>
  20. <el-button type="primary" v-if="isAuth('101001001:save')" @click="addModal">新增</el-button>
  21. <el-button type="primary" v-if="isAuth('101001001:remove')" @click="delModal">删除</el-button>
  22. <download-excel
  23. :fields="fields()"
  24. :data="exportData"
  25. type="xls"
  26. :name="exportName"
  27. :header="exportHeader"
  28. :footer="exportFooter"
  29. :fetch="createExportData"
  30. :before-generate="startDownload"
  31. :before-finish="finishDownload"
  32. worksheet="导出信息"
  33. :class="['el-button', 'el-button--primary', 'el-button--medium', {'is-loading': exportLoading}]">
  34. <i v-if="exportLoading" class="el-icon-loading"></i>
  35. <span>{{ "导出" }}</span>
  36. </download-excel>
  37. </el-form-item>
  38. </el-form>
  39. <!-- 客户列表 -->
  40. <el-table
  41. :height="height"
  42. :data="dataList"
  43. border
  44. ref="customerTable"
  45. :row-style="rowStyle"
  46. @row-click="customerClickRow"
  47. @selection-change="selectionCustomer"
  48. style="width: 100%;">
  49. <el-table-column
  50. type="selection"
  51. header-align="center"
  52. align="center"
  53. width="50">
  54. </el-table-column>
  55. <el-table-column
  56. v-for="(item,index) in columnList" :key="index"
  57. :sortable="item.columnSortable"
  58. :prop="item.columnProp"
  59. :header-align="item.headerAlign"
  60. :show-overflow-tooltip="item.showOverflowTooltip"
  61. :align="item.align"
  62. :fixed="item.fixed === ''?false:item.fixed"
  63. :min-width="item.columnWidth"
  64. :label="item.columnLabel">
  65. <template slot-scope="scope">
  66. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  67. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  68. style="width: 100px; height: 80px"/></span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column
  72. fixed="right"
  73. header-align="center"
  74. align="center"
  75. width="100"
  76. label="操作">
  77. <template slot-scope="scope">
  78. <el-link style="cursor: pointer" v-if="isAuth('101001001:update')" @click="updateModal(scope.row)">编辑</el-link>
  79. <el-link style="cursor: pointer" @click="detailModal(scope.row)">详情</el-link>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <!-- 分页插件 -->
  84. <el-pagination style="margin-top: 0px"
  85. @size-change="sizeChangeHandle"
  86. @current-change="currentChangeHandle"
  87. :current-page="pageIndex"
  88. :page-sizes="[20, 50, 100, 200, 500]"
  89. :page-size="pageSize"
  90. :total="totalPage"
  91. layout="total, sizes, prev, pager, next, jumper">
  92. </el-pagination>
  93. <!-- 客户模态框 -->
  94. <el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px">
  95. <el-form label-position="top" :model="modalData" :rules="rules">
  96. <el-row :gutter="10">
  97. <el-col :span="24">
  98. <el-form-item label="客户名称" prop="customerDesc" :rules="rules.customerDesc">
  99. <el-input v-model="modalData.customerDesc" :readonly="detailModalFlag"></el-input>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="8">
  103. <el-form-item label="行业">
  104. <dict-data-select v-if="modalFlag" v-model="modalData.customerIndustry" :use-default-value="false" :disabled="detailModalFlag" dict-type="plm_customer_information_customer_industry"></dict-data-select>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="16">
  108. <el-form-item label=" ">
  109. <el-checkbox-group :disabled="modalData.title === '客户详情'" v-model="customerGroupList" :max="1">
  110. <el-checkbox label="品牌客户" value="品牌客户"></el-checkbox>
  111. <el-checkbox label="直接客户" value="直接客户"></el-checkbox>
  112. </el-checkbox-group>
  113. </el-form-item>
  114. </el-col>
  115. </el-row>
  116. <el-row :gutter="10">
  117. <el-col :span="8">
  118. <el-form-item label="客户组分类(1)">
  119. <span style="cursor: pointer" v-if="modalData.title !== '客户详情'" slot="label" @click="getBaseList(120)"><a herf="#">客户组分类(1)</a></span>
  120. <el-input v-model="modalData.customerGroupId1" :disabled="modalData.title === '客户详情'" @blur="customerGroupBlur(120)"></el-input>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="16">
  124. <el-form-item label=" ">
  125. <el-input v-model="modalData.customerGroupName1" disabled></el-input>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="8">
  129. <el-form-item label="客户组分类(2)">
  130. <span style="cursor: pointer" v-if="modalData.title !== '客户详情'" slot="label" @click="getBaseList(121)"><a herf="#">客户组分类(2)</a></span>
  131. <el-input v-model="modalData.customerGroupId2" :disabled="modalData.title === '客户详情'" @blur="customerGroupBlur2(121)"></el-input>
  132. </el-form-item>
  133. </el-col>
  134. <el-col :span="16">
  135. <el-form-item label=" ">
  136. <el-input v-model="modalData.customerGroupName2" disabled></el-input>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="8">
  140. <el-form-item label="重要程度" prop="importantCustomer" :rules="rules.importantCustomer">
  141. <dict-data-select v-if="modalFlag" v-model="modalData.importantCustomer" :disabled="detailModalFlag" dict-type="plm_customer_information_important_customer"></dict-data-select>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="8">
  145. <el-form-item label="客户状态" prop="customerStatus" :rules="rules.customerStatus">
  146. <el-select v-model="modalData.customerStatus" style="width: 100%" :disabled="detailModalFlag">
  147. <el-option label="启用" value="Y"></el-option>
  148. <el-option label="停用" value="N"></el-option>
  149. </el-select>
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="8">
  153. <el-form-item label="客户类型" prop="customerStatus" :rules="rules.customerType">
  154. <el-select v-model="modalData.customerType" style="width: 100%" :disabled="detailModalFlag">
  155. <el-option label="潜在客户" value="潜在客户"></el-option>
  156. <el-option label="正式客户" value="正式客户"></el-option>
  157. </el-select>
  158. </el-form-item>
  159. </el-col>
  160. <el-col :span="24">
  161. <el-form-item label="客户描述" class="auto">
  162. <el-input
  163. type="textarea"
  164. v-model="modalData.customerDescription"
  165. readonly
  166. :rows="2"
  167. resize='none'
  168. show-word-limit
  169. :readonly="detailModalFlag">
  170. </el-input>
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. </el-form>
  175. <el-footer style="height:auto;line-height:1.5;padding: 10px 0;text-align:center">
  176. <el-button v-if="modalData.flag !== '3'" type="primary" @click="saveData()">保存</el-button>
  177. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  178. </el-footer>
  179. </el-dialog>
  180. <!-- 客户联系人模态框 -->
  181. <el-dialog :title="contactModalData.title" :close-on-click-modal="false" v-drag :visible.sync="contactModalFlag"
  182. width="500px">
  183. <el-form :inline="true" label-position="top" :model="contactModalData" :rules="contactRules"
  184. style="margin-left: 7px;margin-top: -5px;">
  185. <el-form-item label="联系人" prop="contactName" :rules="contactRules.contactName">
  186. <el-input v-model="contactModalData.contactName" style="width: 222px"></el-input>
  187. </el-form-item>
  188. <el-form-item label="座机">
  189. <el-input v-model="contactModalData.contactLandlineNumber" :readonly="contactDetailModalFlag"
  190. style="width: 222px"></el-input>
  191. </el-form-item>
  192. </el-form>
  193. <el-form :inline="true" label-position="top" :model="contactModalData" :rules="contactRules"
  194. style="margin-left: 7px;margin-top: -5px;">
  195. <el-form-item label="联系电话(1)" prop="contactPhoneNumber1" :rules="contactRules.contactPhoneNumber1">
  196. <el-input v-model="contactModalData.contactPhoneNumber1" :readonly="contactDetailModalFlag"
  197. style="width: 222px"></el-input>
  198. </el-form-item>
  199. <el-form-item label="联系电话(2)">
  200. <el-input v-model="contactModalData.contactPhoneNumber2" :readonly="contactDetailModalFlag"
  201. style="width: 222px"></el-input>
  202. </el-form-item>
  203. </el-form>
  204. <el-form :inline="true" label-position="top" :model="contactModalData" :rules="contactRules"
  205. style="margin-left: 7px;margin-top: -5px;">
  206. <el-form-item label="联系电话(3)">
  207. <el-input v-model="contactModalData.contactPhoneNumber3" :readonly="contactDetailModalFlag"
  208. style="width: 222px"></el-input>
  209. </el-form-item>
  210. <el-form-item label="公司职务">
  211. <el-input v-model="contactModalData.position" :readonly="contactDetailModalFlag"
  212. style="width: 222px"></el-input>
  213. </el-form-item>
  214. </el-form>
  215. <el-form :inline="true" label-position="top" :model="contactModalData" :rules="contactRules"
  216. style="margin-left: 7px;margin-top: -5px;">
  217. <el-form-item label="部门">
  218. <el-input v-model="contactModalData.departmentName" :readonly="contactDetailModalFlag"
  219. style="width: 144px"></el-input>
  220. </el-form-item>
  221. <el-form-item label="默认联系人" prop="primaryContact" :rules="contactRules.primaryContact">
  222. <el-select v-model="contactModalData.primaryContact" :disabled="contactDetailModalFlag" style="width: 143px">
  223. <el-option label="是" value="Y"></el-option>
  224. <el-option label="否" value="N"></el-option>
  225. </el-select>
  226. </el-form-item>
  227. <el-form-item label="状态" prop="contactStatus" :rules="contactRules.contactStatus">
  228. <el-select v-model="contactModalData.contactStatus" :disabled="contactDetailModalFlag" style="width: 144px">
  229. <el-option label="启用" value="启用"></el-option>
  230. <el-option label="停用" value="停用"></el-option>
  231. </el-select>
  232. </el-form-item>
  233. </el-form>
  234. <el-form :inline="true" label-position="top" :model="contactModalData" style="margin-left: 7px;margin-top: -5px;">
  235. <el-form-item label="邮箱">
  236. <el-input v-model="contactModalData.mailbox" :readonly="contactDetailModalFlag"
  237. style="width: 457px"></el-input>
  238. </el-form-item>
  239. </el-form>
  240. <el-form :inline="true" label-position="top" :model="contactModalData" style="margin-left: 7px;margin-top: -5px;">
  241. <el-form-item label="备注信息">
  242. <el-input
  243. type="textarea"
  244. v-model="contactModalData.remark"
  245. readonly
  246. :rows="2"
  247. resize='none'
  248. show-word-limit
  249. :readonly="contactDetailModalFlag"
  250. style="width: 457px;height: 20px">
  251. </el-input>
  252. </el-form-item>
  253. </el-form>
  254. <!-- <el-form :inline="true" label-position="top" :model="contactModalData" style="margin-left: 7px;margin-top: -5px;">-->
  255. <!-- <el-form-item label="备注信息">-->
  256. <!-- <el-input v-model="contactModalData.remark" :readonly="contactDetailModalFlag" style="width: 457px"></el-input>-->
  257. <!-- </el-form-item>-->
  258. <!-- </el-form>-->
  259. <el-footer style="height:40px;margin-top: 34px;text-align:center">
  260. <el-button v-if="contactModalData.flag !== '3'" type="primary" @click="saveContactData()">保存</el-button>
  261. <el-button type="primary" @click="contactModalFlag = false">关闭</el-button>
  262. </el-footer>
  263. </el-dialog>
  264. <!-- 客户联系地址模态框 -->
  265. <el-dialog :title="addressModalData.title" :close-on-click-modal="false" v-drag :visible.sync="addressModalFlag" width="500px">
  266. <el-form label-position="top" :model="addressModalData" :rules="addressRules">
  267. <el-row :gutter="10">
  268. <el-col :span="8">
  269. <el-form-item label="地址类型" prop="addressType" :rules="addressRules.addressType">
  270. <dict-data-select v-if="addressModalFlag" v-model="addressModalData.addressType"
  271. :disabled="addressDetailModalFlag"
  272. dict-type="plm_customer_address_address_type"></dict-data-select>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="16">
  276. <el-form-item label="公司名称">
  277. <el-input v-model="addressModalData.companyName" :disabled="addressDetailModalFlag" :readonly="addressDetailModalFlag"></el-input>
  278. </el-form-item>
  279. </el-col>
  280. <el-col :span="24">
  281. <el-form-item label="地址" prop="addressName" :rules="addressRules.addressName">
  282. <el-input v-model="addressModalData.addressName" :disabled="addressDetailModalFlag"></el-input>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="8">
  286. <el-form-item label="状态" prop="addressStatus" :rules="addressRules.addressStatus">
  287. <el-select v-model="addressModalData.addressStatus" style="width: 100%" :disabled="addressDetailModalFlag">
  288. <el-option label="启用" value="启用"></el-option>
  289. <el-option label="停用" value="停用"></el-option>
  290. </el-select>
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="8">
  294. <el-form-item label=" " >
  295. <el-checkbox v-model="addressModalData.defaultAddress" false-label="N" true-label="Y"
  296. :disabled="addressDetailModalFlag">默认地址</el-checkbox>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="24">
  300. <el-form-item label="备注信息">
  301. <el-input type="textarea" v-model="addressModalData.remark" :rows="3" :readonly="addressDetailModalFlag" resize='none' show-word-limit></el-input>
  302. </el-form-item>
  303. </el-col>
  304. </el-row>
  305. </el-form>
  306. <el-footer style="height:42px;margin-top: 53px;text-align:center">
  307. <el-button v-if="addressModalData.flag !== '3'" type="primary" @click="saveAddressData()">保存</el-button>
  308. <el-button type="primary" @click="addressModalFlag = false">关闭</el-button>
  309. </el-footer>
  310. </el-dialog>
  311. <!-- 客户项目信息模态框 -->
  312. <el-dialog :title="projectInformationModalData.title" :close-on-click-modal="false" v-drag
  313. :visible.sync="projectInformationModalFlag" width="40%">
  314. <el-form ref="saveForm" :model="projectInformationModalData" label-position="top" label-width="100px"
  315. :rules="projectInformationModalData">
  316. <el-row :gutter="25">
  317. <el-col :span="6">
  318. <el-form-item label="项目号">
  319. <el-input readonly v-model="projectInformationModalData.projectId" disabled></el-input>
  320. </el-form-item>
  321. </el-col>
  322. <el-col :span="12">
  323. <el-form-item label="项目名称" prop="projectName">
  324. <el-input readonly v-model="projectInformationModalData.projectName"></el-input>
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="6">
  328. <el-form-item prop="projectTypeDb" label="项目类型">
  329. <dict-data-select disabled dict-type="project_info_type_db" v-if="projectInformationModalFlag"
  330. v-model="projectInformationModalData.projectTypeDb"></dict-data-select>
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="6">
  334. <el-form-item prop="projectSource" :rules="projectInformationModalData.projectSourceDesc" label="项目来源">
  335. <dict-data-select disabled dict-type="project_info_source" v-if="projectInformationModalFlag"
  336. v-model="projectInformationModalData.projectSource"></dict-data-select>
  337. </el-form-item>
  338. </el-col>
  339. <el-col :span="6">
  340. <el-form-item prop="priority" label="优先级">
  341. <dict-data-select disabled dict-type="project_info_priority" v-if="projectInformationModalFlag"
  342. v-model="projectInformationModalData.priority"></dict-data-select>
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="6">
  346. <el-form-item label="要求日期:" prop="needDate">
  347. <el-date-picker
  348. style="width: 100%"
  349. readonly
  350. v-model="projectInformationModalData.needDate"
  351. type="date"
  352. value-format="yyyy-MM-dd"
  353. placeholder="选择日期">
  354. </el-date-picker>
  355. </el-form-item>
  356. </el-col>
  357. <el-col :span="6">
  358. <el-form-item prop="projectManagerName" :rules="projectInformationModalData.projectManagerName"
  359. label="项目经理">
  360. <el-input v-model="projectInformationModalData.projectManagerName" readonly></el-input>
  361. </el-form-item>
  362. </el-col>
  363. <el-col :span="6">
  364. <el-form-item prop="projectOwnerName" :rules="projectInformationModalData.projectOwnerName"
  365. label="项目负责人">
  366. <el-input v-model="projectInformationModalData.projectOwnerName" readonly></el-input>
  367. </el-form-item>
  368. </el-col>
  369. <el-col :span="6">
  370. <el-form-item label="直接客户">
  371. <el-input v-model="projectInformationModalData.customerId" readonly></el-input>
  372. </el-form-item>
  373. </el-col>
  374. <el-col :span="12">
  375. <el-form-item prop="customerName" label="直接客户名称:">
  376. <el-input v-model="projectInformationModalData.customerName" readonly ></el-input>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="6">
  380. <el-form-item label="终端客户:">
  381. <el-input v-model="projectInformationModalData.finalCustomerId" readonly></el-input>
  382. </el-form-item>
  383. </el-col>
  384. <el-col :span="12">
  385. <el-form-item label="终端客户名称:">
  386. <el-input v-model="projectInformationModalData.finalCustomerName" readonly ></el-input>
  387. </el-form-item>
  388. </el-col>
  389. </el-row>
  390. <el-form-item label="项目描述" style="height: 70px">
  391. <el-input type="textarea" readonly resize="none" :autosize="{minRows: 2, maxRows: 2}"
  392. v-model="projectInformationModalData.projectDesc"></el-input>
  393. </el-form-item>
  394. <el-form-item label="客户应用/要求" style="height: 70px">
  395. <el-input type="textarea" readonly resize="none" :autosize="{minRows: 2, maxRows: 2}"
  396. v-model="projectInformationModalData.customerRemark"></el-input>
  397. </el-form-item>
  398. <el-form-item label="其他要求" style="height: 70px">
  399. <el-input type="textarea" readonly resize="none" :autosize="{minRows: 2, maxRows: 2}"
  400. v-model="projectInformationModalData.remark"></el-input>
  401. </el-form-item>
  402. <el-form-item prop="userRoleName" :rules="projectInformationRules.userRoleName" label="项目权限">
  403. <el-input readonly v-model="projectInformationModalData.userRoleName"></el-input>
  404. </el-form-item>
  405. </el-form>
  406. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  407. <el-button v-if="projectInformationModalData.flag !== '3'" type="primary" @click="saveProjectInformationData()">
  408. 保存
  409. </el-button>
  410. <el-button type="primary" @click="projectInformationModalFlag = false">关闭</el-button>
  411. </el-footer>
  412. </el-dialog>
  413. <!-- 页签 -->
  414. <el-tabs v-model="activeTable" style="margin-top: 0px; width: 100%; height: 100%;" type="border-card"
  415. @tab-click="tabClick" class="customer-tab">
  416. <!-- 联系人页签 -->
  417. <el-tab-pane label="联系人" name="customer_contact">
  418. <el-form label-position="top" style="margin-top: 5px; margin-left: 0px;">
  419. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  420. <el-button type="primary" @click="contactSaveModal()">新增</el-button>
  421. <el-button type="primary" @click="contactDeleteModal()">删除</el-button>
  422. </el-form>
  423. </el-form>
  424. <el-table
  425. :data="contactList"
  426. :height="secondHeight"
  427. border
  428. ref="contactTable"
  429. @row-click="contactClickRow"
  430. @selection-change="selectionContact"
  431. style="width: 100%; ">
  432. <el-table-column
  433. type="selection"
  434. header-align="center"
  435. align="center"
  436. width="50">
  437. </el-table-column>
  438. <el-table-column
  439. v-for="(item,index) in customerContactArray" :key="index"
  440. :sortable="item.columnSortable"
  441. :prop="item.columnProp"
  442. :header-align="item.headerAlign"
  443. :show-overflow-tooltip="item.showOverflowTooltip"
  444. :align="item.align"
  445. :fixed="item.fixed === '' ? false : item.fixed"
  446. :min-width="item.columnWidth"
  447. :label="item.columnLabel">
  448. <template slot-scope="scope">
  449. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  450. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  451. </template>
  452. </el-table-column>
  453. <el-table-column
  454. fixed="right"
  455. header-align="center"
  456. align="center"
  457. width="100"
  458. label="操作">
  459. <template slot-scope="scope">
  460. <el-link style="cursor: pointer" @click="updateContactModal(scope.row)">编辑</el-link>
  461. <el-link style="cursor: pointer" @click="detailContactModal(scope.row)">详情</el-link>
  462. </template>
  463. </el-table-column>
  464. </el-table>
  465. </el-tab-pane>
  466. <!-- 联系地址页签 -->
  467. <el-tab-pane label="联系地址" name="customer_address">
  468. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  469. <el-button type="primary" @click="addressSaveModal()">新增</el-button>
  470. <el-button type="primary" @click="addressDeleteModal()">删除</el-button>
  471. </el-form>
  472. <el-table
  473. :data="addressList"
  474. :height="secondHeight"
  475. border
  476. ref="addressTable"
  477. @row-click="addressClickRow"
  478. @selection-change="selectionAddress"
  479. style="width: 100%;">
  480. <el-table-column
  481. type="selection"
  482. header-align="center"
  483. align="center"
  484. width="50">
  485. </el-table-column>
  486. <el-table-column
  487. v-for="(item,index) in customerAddressArray" :key="index"
  488. :sortable="item.columnSortable"
  489. :prop="item.columnProp"
  490. :header-align="item.headerAlign"
  491. :show-overflow-tooltip="item.showOverflowTooltip"
  492. :align="item.align"
  493. :fixed="item.fixed === '' ? false : item.fixed"
  494. :min-width="item.columnWidth"
  495. :label="item.columnLabel">
  496. <template slot-scope="scope">
  497. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  498. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  499. </template>
  500. </el-table-column>
  501. <el-table-column
  502. fixed="right"
  503. header-align="center"
  504. align="center"
  505. width="100"
  506. label="操作">
  507. <template slot-scope="scope">
  508. <el-link style="cursor: pointer" @click="updateAddressModal(scope.row)">编辑</el-link>
  509. <el-link style="cursor: pointer" @click="detailAddressModal(scope.row)">详情</el-link>
  510. </template>
  511. </el-table-column>
  512. </el-table>
  513. </el-tab-pane>
  514. <!-- 项目信息页签 -->
  515. <el-tab-pane label="项目信息" name="project_information">
  516. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  517. <el-button type="primary" @click="projectInformationSaveModal()">新增</el-button>
  518. </el-form>
  519. <el-table
  520. :data="projectInformationList"
  521. :height="secondHeight"
  522. border
  523. ref="projectInformationTable"
  524. @row-click="projectInformationClickRow"
  525. @selection-change="selectionProjectInformation"
  526. style="width: 100%;">
  527. <el-table-column
  528. type="selection"
  529. header-align="center"
  530. align="center"
  531. width="50">
  532. </el-table-column>
  533. <el-table-column
  534. header-align="center"
  535. align="left"
  536. prop="projectId"
  537. width="160"
  538. label="项目号">
  539. <template slot-scope="{row,$index}">
  540. <el-link style="cursor: pointer" @click="clickProjectId(row.projectId)">{{ row.projectId }}</el-link>
  541. </template>
  542. </el-table-column>
  543. <el-table-column
  544. v-for="(item,index) in projectInformationArray" :key="index"
  545. :sortable="item.columnSortable"
  546. :prop="item.columnProp"
  547. :header-align="item.headerAlign"
  548. :show-overflow-tooltip="item.showOverflowTooltip"
  549. :align="item.align"
  550. :fixed="item.fixed === '' ? false : item.fixed"
  551. :min-width="item.columnWidth"
  552. :label="item.columnLabel">
  553. <template slot-scope="scope">
  554. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  555. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  556. </template>
  557. </el-table-column>
  558. <el-table-column
  559. fixed="right"
  560. header-align="center"
  561. align="center"
  562. width="100"
  563. label="操作">
  564. <template slot-scope="scope">
  565. <el-link style="cursor: pointer" @click="updateProjectInformationModal(scope.row)">编辑</el-link>
  566. <el-link style="cursor: pointer" @click="detailProjectInformationModal(scope.row)">详情</el-link>
  567. </template>
  568. </el-table-column>
  569. </el-table>
  570. </el-tab-pane>
  571. </el-tabs>
  572. <!-- 项目经理选择模态框 -->
  573. <el-dialog
  574. width="620px"
  575. title="项目经理"
  576. :close-on-click-modal="false"
  577. :visible.sync="managerFlag">
  578. <el-transfer
  579. ref="managerTransfer"
  580. v-model="projectManagerList"
  581. :props="{key: 'operatorId',label: 'operatorName'}"
  582. :data="operatorList"
  583. :titles="['未选择', '已选择']">
  584. </el-transfer>
  585. <span slot="footer" class="dialog-footer">
  586. <div style="margin-top: 5px">
  587. <el-button type="primary" @click="saveManagerList()">确定</el-button>
  588. <el-button type="primary" @click="managerFlag=false">取消</el-button>
  589. </div>
  590. </span>
  591. </el-dialog>
  592. <!-- 项目负责人选择模态框 -->
  593. <el-dialog
  594. width="620px"
  595. title="项目负责人"
  596. :close-on-click-modal="false"
  597. :visible.sync="ownerFlag">
  598. <el-transfer
  599. ref="ownerTransfer"
  600. v-model="projectOwnerList"
  601. :props="{key: 'operatorId',label: 'operatorName'}"
  602. :data="operatorList"
  603. :titles="['未选择', '已选择']">
  604. </el-transfer>
  605. <span slot="footer" class="dialog-footer">
  606. <div style="margin-top: 5px">
  607. <el-button type="primary" @click="saveOwnerList()">确定</el-button>
  608. <el-button type="primary" @click="ownerFlag=false">取消</el-button>
  609. </div>
  610. </span>
  611. </el-dialog>
  612. <!-- 项目权限选择模态框 -->
  613. <el-dialog
  614. width="530px"
  615. title="权限"
  616. :close-on-click-modal="false"
  617. :visible.sync="userRoleFlag">
  618. <el-table
  619. :data="userRoleList"
  620. border
  621. :height="300"
  622. v-loading="false"
  623. style="width: 100%;">
  624. <el-table-column
  625. prop="username"
  626. header-align="center"
  627. align="center"
  628. min-width="35"
  629. label="账号">
  630. </el-table-column>
  631. <el-table-column
  632. prop="userDisplay"
  633. header-align="center"
  634. align="center"
  635. min-width="35"
  636. label="姓名">
  637. </el-table-column>
  638. <el-table-column
  639. prop=""
  640. header-align="center"
  641. align="center"
  642. min-width="30"
  643. label="">
  644. <template slot-scope="scope">
  645. <!-- 如果数据为Y显示勾选框否则不勾选 -->
  646. <el-checkbox v-model="scope.row.checkAll" @change="changeAll(scope.row)"></el-checkbox>
  647. </template>
  648. </el-table-column>
  649. <el-table-column
  650. prop=""
  651. header-align="center"
  652. align="center"
  653. min-width="30"
  654. label="查询">
  655. <template slot-scope="scope">
  656. <!-- 如果数据为Y显示勾选框否则不勾选 -->
  657. <el-checkbox v-model="scope.row.searchCheck" @change="changeCheck(scope.row,1)"></el-checkbox>
  658. </template>
  659. </el-table-column>
  660. <el-table-column
  661. prop=""
  662. header-align="center"
  663. align="center"
  664. min-width="30"
  665. label="修改">
  666. <template slot-scope="scope">
  667. <!-- 如果数据为Y显示勾选框否则不勾选 -->
  668. <el-checkbox v-model="scope.row.updateCheck" @change="changeCheck(scope.row,2)"></el-checkbox>
  669. </template>
  670. </el-table-column>
  671. <el-table-column
  672. prop=""
  673. header-align="center"
  674. align="center"
  675. min-width="30"
  676. label="下载">
  677. <template slot-scope="scope">
  678. <!-- 如果数据为Y显示勾选框否则不勾选 -->
  679. <el-checkbox v-model="scope.row.downCheck" @change="changeCheck(scope.row,3)"></el-checkbox>
  680. </template>
  681. </el-table-column>
  682. <el-table-column
  683. prop=""
  684. header-align="center"
  685. align="center"
  686. min-width="30"
  687. label="删除">
  688. <template slot-scope="scope">
  689. <!-- 如果数据为Y显示勾选框否则不勾选 -->
  690. <el-checkbox v-model="scope.row.deleteCheck" @change="changeCheck(scope.row,4)"></el-checkbox>
  691. </template>
  692. </el-table-column>
  693. </el-table>
  694. <span slot="footer" class="dialog-footer">
  695. <div style="margin-top: 5px">
  696. <el-button type="primary" @click="saveUserList()">确定</el-button>
  697. <el-button type="primary" @click="userRoleFlag = false">取消</el-button>
  698. </div>
  699. </span>
  700. </el-dialog>
  701. <add-or-update v-if="addOrUpdateVisible" v-model="addOrUpdate" ref="addOrUpdate" @refreshDataList="getDataList"
  702. v-drag></add-or-update>
  703. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  704. </div>
  705. </template>
  706. <script>
  707. import {
  708. customerInformationSearch, // 客户信息列表查询
  709. customerInformationSave, // 客户信息新增
  710. customerInformationEdit, // 客户信息编辑
  711. customerInformationDelete, // 客户信息删除
  712. checkCustomerGroup, // 客户组ID输入校验
  713. } from '@/api/customer/customerInformation.js'
  714. import {
  715. customerContactSearch, // 客户联系人列表查询
  716. customerContactSave, // 客户联系人新增
  717. customerContactEdit, // 客户联系人编辑
  718. customerContactDelete, // 客户联系人删除
  719. } from '@/api/customer/customerContact.js'
  720. import {
  721. customerAddressSearch, // 客户联系地址列表查询
  722. customerAddressSave, // 客户联系地址新增
  723. customerAddressEdit, // 客户联系地址编辑
  724. customerAddressDelete, // 客户联系地址删除
  725. } from '@/api/customer/customerAddress.js'
  726. import {
  727. projectInformationSearch, // 客户项目信息列表查询
  728. projectInformationSave, // 客户项目信息新增
  729. projectInformationEdit, // 客户项目信息编辑
  730. projectInformationDelete, // 客户项目信息删除
  731. } from '@/api/customer/projectInformation.js'
  732. import {
  733. searchOperatorWithSite,
  734. searchProjectTeamStr,
  735. searchUserRoll,
  736. saveProjectInfo
  737. } from "@/api/project/project.js"
  738. import Chooselist from '@/views/modules/common/Chooselist'
  739. import {verifyData} from "@/api/chooselist/chooselist.js"
  740. import DictDataSelect from '../sys/dict-data-select.vue'
  741. import saveOrUpdate from '../project/projectInfo/com_projectInfo-add-or-update.vue'
  742. import partUploadFile from '../part/part_upload_file.vue'
  743. import AddOrUpdate from "../project/projectInfo/com_projectInfo-add-or-update.vue";
  744. import {projectInformationSearchByCustomers} from "../../../api/customer/projectInformation";
  745. export default {
  746. components: {
  747. AddOrUpdate,
  748. DictDataSelect,
  749. Chooselist,
  750. saveOrUpdate
  751. },
  752. watch: {
  753. searchData: {
  754. deep: true,
  755. handler: function (newV, oldV) {
  756. this.searchData.customerNo = this.searchData.customerNo.toUpperCase()
  757. }
  758. },
  759. modalData: {
  760. deep: true,
  761. handler: function (newV, oldV) {
  762. this.modalData.customerNo = this.modalData.customerNo.toUpperCase()
  763. this.modalData.customerGroupId1 = this.modalData.customerGroupId1.toUpperCase()
  764. this.modalData.customerGroupId2 = this.modalData.customerGroupId2.toUpperCase()
  765. if (this.modalData.customerGroupId1 == null || this.modalData.customerGroupId1 === '') {
  766. this.modalData.customerGroupName1 = ''
  767. }
  768. if (this.modalData.customerGroupId2 == null || this.modalData.customerGroupId2 === '') {
  769. this.modalData.customerGroupName2 = ''
  770. }
  771. }
  772. },
  773. customerCurrentRow(newVal,oldVal){
  774. if (newVal){
  775. this.refreshCurrentTabTable();
  776. }
  777. },
  778. modalFlag(newVal,oldVal){
  779. if (newVal === false){
  780. this.customerGroupList = [];
  781. }
  782. }
  783. },
  784. data() {
  785. return {
  786. exportLoading: false,
  787. // 新增 项目
  788. addOrUpdateVisible: false,
  789. // addOrUpdate
  790. addOrUpdate: '0',
  791. components: {
  792. DictDataSelect,
  793. Chooselist
  794. },
  795. // 导出
  796. exportData: [],
  797. exportName: '客户信息' + this.dayjs().format('YYYYMMDDHHmmss'),
  798. exportHeader: ['客户信息'],
  799. exportFooter: [],
  800. resultList: [],
  801. // ======== 行高 ========
  802. height: 200,
  803. secondHeight: 200,
  804. // ======== 分页 ========
  805. pageIndex: 1,
  806. pageSize: 20,
  807. totalPage: 0,
  808. // 条件查询
  809. searchData: {
  810. site: this.$store.state.user.site,
  811. customerNo: '',
  812. customerDesc: '',
  813. customerStatus: '',
  814. active: 'Y',
  815. page: 1,
  816. limit: 10
  817. },
  818. // 初始页签
  819. activeTable: 'customer_contact',
  820. // ======== 数据对象 ========
  821. modalData: {
  822. flag: '',
  823. title: '',
  824. site: this.$store.state.user.site,
  825. customerNo: '',
  826. customerDesc: '',
  827. customerDescription: '',
  828. customerIndustry: '',
  829. customerCurrency: '',
  830. turnoverOfYear: '',
  831. potentialRevenueOfYear: '',
  832. importantCustomer: '',
  833. customerType: '',
  834. customerStatus: '',
  835. companyName: '',
  836. jobDescription: '',
  837. remark: '',
  838. contactName: '',
  839. contactPhoneNumber1: '',
  840. createDate: '',
  841. createBy: '',
  842. updateDate: '',
  843. updateBy: '',
  844. primaryContact: '',
  845. contactStatus: '',
  846. addressName: '',
  847. customerAddress: '',
  848. customerGroupId1: '',
  849. customerGroupId2: '',
  850. customerGroupName1: '',
  851. customerGroupName2: '',
  852. type: ''
  853. },
  854. contactModalData: {
  855. flag: '',
  856. title: '',
  857. site: this.$store.state.user.site,
  858. customerNo: '',
  859. customerDesc: '',
  860. contactId: '',
  861. contactName: '',
  862. contactLandlineNumber: '',
  863. contactPhoneNumber1: '',
  864. contactPhoneNumber2: '',
  865. contactPhoneNumber3: '',
  866. position: '',
  867. departmentName: '',
  868. mailbox: '',
  869. primaryContact: '',
  870. contactStatus: '',
  871. remark: '',
  872. createDate: '',
  873. createBy: '',
  874. updateDate: '',
  875. updateBy: ''
  876. },
  877. addressModalData: {
  878. flag: '',
  879. title: '',
  880. site: this.$store.state.user.site,
  881. customerNo: '',
  882. customerDesc: '',
  883. addressId: '',
  884. addressName: '',
  885. companyName: '',
  886. defaultAddress: '',
  887. addressStatus: '',
  888. addressType: '',
  889. remark: '',
  890. createDate: '',
  891. createBy: '',
  892. updateDate: '',
  893. updateBy: ''
  894. },
  895. projectInformationModalData: {
  896. flag: '',
  897. title: '',
  898. site: this.$store.state.user.site,
  899. customerNo: '',
  900. customerDesc: '',
  901. addressId: '',
  902. addressName: '',
  903. companyName: '',
  904. defaultAddress: '',
  905. addressStatus: '',
  906. addressType: '',
  907. remark: '',
  908. createDate: '',
  909. createBy: '',
  910. updateDate: '',
  911. updateBy: '',
  912. projectManagerList: []
  913. },
  914. // ======== 数据列表 ========
  915. dataList: [],
  916. contactList: [],
  917. addressList: [],
  918. projectInformationList: [],
  919. // ======== 列表表头 ========
  920. columnList: [
  921. {
  922. userId: this.$store.state.user.name,
  923. functionId: 101001,
  924. serialNumber: '101001Table1CustomerNo',
  925. tableId: '101001Table1',
  926. tableName: '客户信息表',
  927. columnProp: 'customerNo',
  928. headerAlign: 'center',
  929. align: 'left',
  930. columnLabel: '客户代码',
  931. columnHidden: false,
  932. columnImage: false,
  933. columnSortable: false,
  934. sortLv: 0,
  935. status: true,
  936. fixed: '',
  937. columnWidth: 160
  938. },{
  939. userId: this.$store.state.user.name,
  940. functionId: 101001,
  941. serialNumber: '101001Table1CustomerDesc',
  942. tableId: '101001Table1',
  943. tableName: '客户信息表',
  944. columnProp: 'customerDesc',
  945. headerAlign: 'center',
  946. align: 'left',
  947. columnLabel: '客户名称',
  948. columnHidden: false,
  949. columnImage: false,
  950. columnSortable: false,
  951. sortLv: 0,
  952. status: true,
  953. fixed: '',
  954. columnWidth: 160
  955. },
  956. {
  957. userId: this.$store.state.user.name,
  958. functionId: 101001,
  959. serialNumber: '101001Table1CustomerGroupName1',
  960. tableId: '101001Table1',
  961. tableName: '客户信息表',
  962. columnProp: 'customerGroupName1',
  963. headerAlign: 'center',
  964. align: 'left',
  965. columnLabel: '客户组分类(1)',
  966. columnHidden: false,
  967. columnImage: false,
  968. columnSortable: false,
  969. sortLv: 0,
  970. status: true,
  971. fixed: '',
  972. columnWidth: 160
  973. },
  974. {
  975. userId: this.$store.state.user.name,
  976. functionId: 101001,
  977. serialNumber: '101001Table1CustomerGroupName2',
  978. tableId: '101001Table1',
  979. tableName: '客户信息表',
  980. columnProp: 'customerGroupName2',
  981. headerAlign: 'center',
  982. align: 'left',
  983. columnLabel: '客户组分类(2)',
  984. columnHidden: false,
  985. columnImage: false,
  986. columnSortable: false,
  987. sortLv: 0,
  988. status: true,
  989. fixed: '',
  990. columnWidth: 160
  991. },
  992. {
  993. userId: this.$store.state.user.name,
  994. functionId: 101001,
  995. serialNumber: '101001Table1CustomerGroup',
  996. tableId: '101001Table1',
  997. tableName: '客户信息表',
  998. columnProp: 'customerGroup',
  999. headerAlign: 'center',
  1000. align: 'center',
  1001. columnLabel: '客户分组',
  1002. columnHidden: false,
  1003. columnImage: false,
  1004. columnSortable: false,
  1005. sortLv: 0,
  1006. status: true,
  1007. fixed: '',
  1008. columnWidth: 100
  1009. },
  1010. {
  1011. userId: this.$store.state.user.name,
  1012. functionId: 101001,
  1013. serialNumber: '101001Table1ImportantCustomer',
  1014. tableId: '101001Table1',
  1015. tableName: '客户信息表',
  1016. columnProp: 'importantCustomerLabel',
  1017. headerAlign: 'center',
  1018. align: 'center',
  1019. columnLabel: '重要程度',
  1020. columnHidden: false,
  1021. columnImage: false,
  1022. columnSortable: false,
  1023. sortLv: 0,
  1024. status: true,
  1025. fixed: '',
  1026. columnWidth: 100
  1027. },
  1028. {
  1029. userId: this.$store.state.user.name,
  1030. functionId: 101001,
  1031. serialNumber: '101001Table1CustomerStatus',
  1032. tableId: '101001Table1',
  1033. tableName: '客户信息表',
  1034. columnProp: 'customerStatusDesc',
  1035. headerAlign: 'center',
  1036. align: 'center',
  1037. columnLabel: '客户状态',
  1038. columnHidden: false,
  1039. columnImage: false,
  1040. columnSortable: false,
  1041. sortLv: 0,
  1042. status: true,
  1043. fixed: '',
  1044. columnWidth: 100
  1045. },
  1046. {
  1047. userId: this.$store.state.user.name,
  1048. functionId: 101001,
  1049. serialNumber: '101001Table1CustomerType',
  1050. tableId: '101001Table1',
  1051. tableName: '客户信息表',
  1052. columnProp: 'customerType',
  1053. headerAlign: 'center',
  1054. align: 'center',
  1055. columnLabel: '客户类型',
  1056. columnHidden: false,
  1057. columnImage: false,
  1058. columnSortable: false,
  1059. sortLv: 0,
  1060. status: true,
  1061. fixed: '',
  1062. columnWidth: 100
  1063. },
  1064. {
  1065. userId: this.$store.state.user.name,
  1066. functionId: 101001,
  1067. serialNumber: '101001Table1CreateDate',
  1068. tableId: '101001Table1',
  1069. tableName: '客户信息表',
  1070. columnProp: 'createDate',
  1071. headerAlign: 'center',
  1072. align: 'center',
  1073. columnLabel: '创建时间',
  1074. columnHidden: false,
  1075. columnImage: false,
  1076. columnSortable: false,
  1077. sortLv: 0,
  1078. status: true,
  1079. fixed: '',
  1080. columnWidth: 170
  1081. },
  1082. {
  1083. userId: this.$store.state.user.name,
  1084. functionId: 101001,
  1085. serialNumber: '101001Table1CreateBy',
  1086. tableId: '101001Table1',
  1087. tableName: '客户信息表',
  1088. columnProp: 'createBy',
  1089. headerAlign: 'center',
  1090. align: 'center',
  1091. columnLabel: '创建人',
  1092. columnHidden: false,
  1093. columnImage: false,
  1094. columnSortable: false,
  1095. sortLv: 0,
  1096. status: true,
  1097. fixed: '',
  1098. columnWidth: 100
  1099. },
  1100. {
  1101. userId: this.$store.state.user.name,
  1102. functionId: 101001,
  1103. serialNumber: '101001Table1UpdateDate',
  1104. tableId: '101001Table1',
  1105. tableName: '客户信息表',
  1106. columnProp: 'updateDate',
  1107. headerAlign: 'center',
  1108. align: 'center',
  1109. columnLabel: '更新时间',
  1110. columnHidden: false,
  1111. columnImage: false,
  1112. columnSortable: false,
  1113. sortLv: 0,
  1114. status: true,
  1115. fixed: '',
  1116. columnWidth: 170
  1117. },
  1118. {
  1119. userId: this.$store.state.user.name,
  1120. functionId: 101001,
  1121. serialNumber: '101001Table1UpdateBy',
  1122. tableId: '101001Table1',
  1123. tableName: '客户信息表',
  1124. columnProp: 'updateBy',
  1125. headerAlign: 'center',
  1126. align: 'center',
  1127. columnLabel: '更新人',
  1128. columnHidden: false,
  1129. columnImage: false,
  1130. columnSortable: false,
  1131. sortLv: 0,
  1132. status: true,
  1133. fixed: '',
  1134. columnWidth: 100
  1135. }
  1136. ],
  1137. customerContactArray: [
  1138. {
  1139. userId: this.$store.state.user.name,
  1140. functionId: 101001,
  1141. serialNumber: '101001Table2ContactName',
  1142. tableId: '101001Table2',
  1143. tableName: '客户联系人表',
  1144. columnProp: 'contactName',
  1145. headerAlign: 'center',
  1146. align: 'left',
  1147. columnLabel: '联系人',
  1148. columnHidden: false,
  1149. columnImage: false,
  1150. columnSortable: false,
  1151. sortLv: 0,
  1152. status: true,
  1153. fixed: '',
  1154. columnWidth: 120
  1155. },
  1156. {
  1157. userId: this.$store.state.user.name,
  1158. functionId: 101001,
  1159. serialNumber: '101001Table2ContactPhoneNumber1',
  1160. tableId: '101001Table2',
  1161. tableName: '客户联系人表',
  1162. columnProp: 'contactPhoneNumber1',
  1163. headerAlign: 'center',
  1164. align: 'left',
  1165. columnLabel: '联系电话',
  1166. columnHidden: false,
  1167. columnImage: false,
  1168. columnSortable: false,
  1169. sortLv: 0,
  1170. status: true,
  1171. fixed: '',
  1172. columnWidth: 160
  1173. },
  1174. {
  1175. userId: this.$store.state.user.name,
  1176. functionId: 101001,
  1177. serialNumber: '101001Table2ContactLandlineNumber',
  1178. tableId: '101001Table2',
  1179. tableName: '客户联系人表',
  1180. columnProp: 'contactLandlineNumber',
  1181. headerAlign: 'center',
  1182. align: 'left',
  1183. columnLabel: '座机',
  1184. columnHidden: false,
  1185. columnImage: false,
  1186. columnSortable: false,
  1187. sortLv: 0,
  1188. status: true,
  1189. fixed: '',
  1190. columnWidth: 160
  1191. },
  1192. {
  1193. userId: this.$store.state.user.name,
  1194. functionId: 101001,
  1195. serialNumber: '101001Table2Position',
  1196. tableId: '101001Table2',
  1197. tableName: '客户联系人表',
  1198. columnProp: 'position',
  1199. headerAlign: 'center',
  1200. align: 'left',
  1201. columnLabel: '公司职务',
  1202. columnHidden: false,
  1203. columnImage: false,
  1204. columnSortable: false,
  1205. sortLv: 0,
  1206. status: true,
  1207. fixed: '',
  1208. columnWidth: 100
  1209. },
  1210. {
  1211. userId: this.$store.state.user.name,
  1212. functionId: 101001,
  1213. serialNumber: '101001Table2DepartmentName',
  1214. tableId: '101001Table2',
  1215. tableName: '客户联系人表',
  1216. columnProp: 'departmentName',
  1217. headerAlign: 'center',
  1218. align: 'left',
  1219. columnLabel: '部门',
  1220. columnHidden: false,
  1221. columnImage: false,
  1222. columnSortable: false,
  1223. sortLv: 0,
  1224. status: true,
  1225. fixed: '',
  1226. columnWidth: 100
  1227. },
  1228. {
  1229. userId: this.$store.state.user.name,
  1230. functionId: 101001,
  1231. serialNumber: '101001Table2Mailbox',
  1232. tableId: '101001Table2',
  1233. tableName: '客户联系人表',
  1234. columnProp: 'mailbox',
  1235. headerAlign: 'center',
  1236. align: 'left',
  1237. columnLabel: '邮箱',
  1238. columnHidden: false,
  1239. columnImage: false,
  1240. columnSortable: false,
  1241. sortLv: 0,
  1242. status: true,
  1243. fixed: '',
  1244. columnWidth: 160
  1245. },
  1246. {
  1247. userId: this.$store.state.user.name,
  1248. functionId: 101001,
  1249. serialNumber: '101001Table2PrimaryContact',
  1250. tableId: '101001Table2',
  1251. tableName: '客户联系人表',
  1252. columnProp: 'primaryContact',
  1253. headerAlign: 'center',
  1254. align: 'center',
  1255. columnLabel: '默认联系人',
  1256. columnHidden: false,
  1257. columnImage: false,
  1258. columnSortable: false,
  1259. sortLv: 0,
  1260. status: true,
  1261. fixed: '',
  1262. columnWidth: 100
  1263. },
  1264. {
  1265. userId: this.$store.state.user.name,
  1266. functionId: 101001,
  1267. serialNumber: '101001Table2ContactStatus',
  1268. tableId: '101001Table2',
  1269. tableName: '客户联系人表',
  1270. columnProp: 'contactStatus',
  1271. headerAlign: 'center',
  1272. align: 'center',
  1273. columnLabel: '状态',
  1274. columnHidden: false,
  1275. columnImage: false,
  1276. columnSortable: false,
  1277. sortLv: 0,
  1278. status: true,
  1279. fixed: '',
  1280. columnWidth: 100
  1281. },
  1282. {
  1283. userId: this.$store.state.user.name,
  1284. functionId: 101001,
  1285. serialNumber: '101001Table2CreateDate',
  1286. tableId: '101001Table2',
  1287. tableName: '客户联系人表',
  1288. columnProp: 'createDate',
  1289. headerAlign: 'center',
  1290. align: 'center',
  1291. columnLabel: '创建时间',
  1292. columnHidden: false,
  1293. columnImage: false,
  1294. columnSortable: false,
  1295. sortLv: 0,
  1296. status: true,
  1297. fixed: '',
  1298. columnWidth: 170
  1299. },
  1300. {
  1301. userId: this.$store.state.user.name,
  1302. functionId: 101001,
  1303. serialNumber: '101001Table2CreateBy',
  1304. tableId: '101001Table2',
  1305. tableName: '客户联系人表',
  1306. columnProp: 'createBy',
  1307. headerAlign: 'center',
  1308. align: 'center',
  1309. columnLabel: '创建人',
  1310. columnHidden: false,
  1311. columnImage: false,
  1312. columnSortable: false,
  1313. sortLv: 0,
  1314. status: true,
  1315. fixed: '',
  1316. columnWidth: 100
  1317. },
  1318. {
  1319. userId: this.$store.state.user.name,
  1320. functionId: 101001,
  1321. serialNumber: '101001Table2UpdateDate',
  1322. tableId: '101001Table2',
  1323. tableName: '客户联系人表',
  1324. columnProp: 'updateDate',
  1325. headerAlign: 'center',
  1326. align: 'center',
  1327. columnLabel: '更新时间',
  1328. columnHidden: false,
  1329. columnImage: false,
  1330. columnSortable: false,
  1331. sortLv: 0,
  1332. status: true,
  1333. fixed: '',
  1334. columnWidth: 170
  1335. },
  1336. {
  1337. userId: this.$store.state.user.name,
  1338. functionId: 101001,
  1339. serialNumber: '101001Table2UpdateBy',
  1340. tableId: '101001Table2',
  1341. tableName: '客户联系人表',
  1342. columnProp: 'updateBy',
  1343. headerAlign: 'center',
  1344. align: 'center',
  1345. columnLabel: '更新人',
  1346. columnHidden: false,
  1347. columnImage: false,
  1348. columnSortable: false,
  1349. sortLv: 0,
  1350. status: true,
  1351. fixed: '',
  1352. columnWidth: 100
  1353. }
  1354. ],
  1355. customerAddressArray: [
  1356. {
  1357. userId: this.$store.state.user.name,
  1358. functionId: 101001,
  1359. serialNumber: '101001Table3AddressType',
  1360. tableId: '101001Table3',
  1361. tableName: '客户联系地址表',
  1362. columnProp: 'addressTypeName',
  1363. headerAlign: 'center',
  1364. align: 'center',
  1365. columnLabel: '地址类型',
  1366. columnHidden: false,
  1367. columnImage: false,
  1368. columnSortable: false,
  1369. sortLv: 0,
  1370. status: true,
  1371. fixed: '',
  1372. columnWidth: 100
  1373. },
  1374. {
  1375. userId: this.$store.state.user.name,
  1376. functionId: 101001,
  1377. serialNumber: '101001Table3CompanyName',
  1378. tableId: '101001Table3',
  1379. tableName: '客户联系地址表',
  1380. columnProp: 'companyName',
  1381. headerAlign: 'center',
  1382. align: 'left',
  1383. columnLabel: '公司名称',
  1384. columnHidden: false,
  1385. columnImage: false,
  1386. columnSortable: false,
  1387. sortLv: 0,
  1388. status: true,
  1389. fixed: '',
  1390. columnWidth: 160
  1391. },
  1392. {
  1393. userId: this.$store.state.user.name,
  1394. functionId: 101001,
  1395. serialNumber: '101001Table3AddressName',
  1396. tableId: '101001Table3',
  1397. tableName: '客户联系地址表',
  1398. columnProp: 'addressName',
  1399. headerAlign: 'center',
  1400. align: 'left',
  1401. columnLabel: '地址',
  1402. columnHidden: false,
  1403. columnImage: false,
  1404. columnSortable: false,
  1405. sortLv: 0,
  1406. status: true,
  1407. fixed: '',
  1408. columnWidth: 160
  1409. },
  1410. {
  1411. userId: this.$store.state.user.name,
  1412. functionId: 101001,
  1413. serialNumber: '101001Table3DefaultAddress',
  1414. tableId: '101001Table3',
  1415. tableName: '客户联系地址表',
  1416. columnProp: 'defaultAddress',
  1417. headerAlign: 'center',
  1418. align: 'center',
  1419. columnLabel: '默认地址',
  1420. columnHidden: false,
  1421. columnImage: false,
  1422. columnSortable: false,
  1423. sortLv: 0,
  1424. status: true,
  1425. fixed: '',
  1426. columnWidth: 100
  1427. },
  1428. {
  1429. userId: this.$store.state.user.name,
  1430. functionId: 101001,
  1431. serialNumber: '101001Table3AddressStatus',
  1432. tableId: '101001Table3',
  1433. tableName: '客户联系地址表',
  1434. columnProp: 'addressStatus',
  1435. headerAlign: 'center',
  1436. align: 'center',
  1437. columnLabel: '状态',
  1438. columnHidden: false,
  1439. columnImage: false,
  1440. columnSortable: false,
  1441. sortLv: 0,
  1442. status: true,
  1443. fixed: '',
  1444. columnWidth: 100
  1445. },
  1446. {
  1447. userId: this.$store.state.user.name,
  1448. functionId: 101001,
  1449. serialNumber: '101001Table3CreateDate',
  1450. tableId: '101001Table3',
  1451. tableName: '客户联系地址表',
  1452. columnProp: 'createDate',
  1453. headerAlign: 'center',
  1454. align: 'center',
  1455. columnLabel: '创建时间',
  1456. columnHidden: false,
  1457. columnImage: false,
  1458. columnSortable: false,
  1459. sortLv: 0,
  1460. status: true,
  1461. fixed: '',
  1462. columnWidth: 170
  1463. },
  1464. {
  1465. userId: this.$store.state.user.name,
  1466. functionId: 101001,
  1467. serialNumber: '101001Table3CreateBy',
  1468. tableId: '101001Table3',
  1469. tableName: '客户联系地址表',
  1470. columnProp: 'createBy',
  1471. headerAlign: 'center',
  1472. align: 'center',
  1473. columnLabel: '创建人',
  1474. columnHidden: false,
  1475. columnImage: false,
  1476. columnSortable: false,
  1477. sortLv: 0,
  1478. status: true,
  1479. fixed: '',
  1480. columnWidth: 100
  1481. },
  1482. {
  1483. userId: this.$store.state.user.name,
  1484. functionId: 101001,
  1485. serialNumber: '101001Table3UpdateDate',
  1486. tableId: '101001Table3',
  1487. tableName: '客户联系地址表',
  1488. columnProp: 'updateDate',
  1489. headerAlign: 'center',
  1490. align: 'center',
  1491. columnLabel: '更新时间',
  1492. columnHidden: false,
  1493. columnImage: false,
  1494. columnSortable: false,
  1495. sortLv: 0,
  1496. status: true,
  1497. fixed: '',
  1498. columnWidth: 170
  1499. },
  1500. {
  1501. userId: this.$store.state.user.name,
  1502. functionId: 101001,
  1503. serialNumber: '101001Table3UpdateBy',
  1504. tableId: '101001Table3',
  1505. tableName: '客户联系地址表',
  1506. columnProp: 'updateBy',
  1507. headerAlign: 'center',
  1508. align: 'center',
  1509. columnLabel: '更新人',
  1510. columnHidden: false,
  1511. columnImage: false,
  1512. columnSortable: false,
  1513. sortLv: 0,
  1514. status: true,
  1515. fixed: '',
  1516. columnWidth: 100
  1517. }
  1518. ],
  1519. projectInformationArray: [
  1520. {
  1521. userId: this.$store.state.user.name,
  1522. functionId: 101001,
  1523. serialNumber: '101001Table4ProjectName',
  1524. tableId: '101001Table4',
  1525. tableName: '客户项目信息表',
  1526. columnProp: 'projectName',
  1527. headerAlign: 'center',
  1528. align: 'left',
  1529. columnLabel: '项目名称',
  1530. columnHidden: false,
  1531. columnImage: false,
  1532. columnSortable: false,
  1533. sortLv: 0,
  1534. status: true,
  1535. fixed: '',
  1536. columnWidth: 160
  1537. },
  1538. {
  1539. userId: this.$store.state.user.name,
  1540. functionId: 101001,
  1541. serialNumber: '101001Table4ProjectType',
  1542. tableId: '101001Table4',
  1543. tableName: '客户项目信息表',
  1544. columnProp: 'projectType',
  1545. headerAlign: 'center',
  1546. align: 'center',
  1547. columnLabel: '项目类型',
  1548. columnHidden: false,
  1549. columnImage: false,
  1550. columnSortable: false,
  1551. sortLv: 0,
  1552. status: true,
  1553. fixed: '',
  1554. columnWidth: 100
  1555. },
  1556. {
  1557. userId: this.$store.state.user.name,
  1558. functionId: 101001,
  1559. serialNumber: '101001Table4ProjectDesc',
  1560. tableId: '101001Table4',
  1561. tableName: '客户项目信息表',
  1562. columnProp: 'projectDesc',
  1563. headerAlign: 'center',
  1564. align: 'left',
  1565. columnLabel: '项目描述',
  1566. columnHidden: false,
  1567. columnImage: false,
  1568. columnSortable: false,
  1569. sortLv: 0,
  1570. status: true,
  1571. fixed: '',
  1572. columnWidth: 160
  1573. },
  1574. // {
  1575. // userId: this.$store.state.user.name,
  1576. // functionId: 101001,
  1577. // serialNumber: '101001Table4Status',
  1578. // tableId: '101001Table4',
  1579. // tableName: '客户项目信息表',
  1580. // columnProp: 'status',
  1581. // headerAlign: 'center',
  1582. // align: 'center',
  1583. // columnLabel: '项目状态',
  1584. // columnHidden: false,
  1585. // columnImage: false,
  1586. // columnSortable: false,
  1587. // sortLv: 0,
  1588. // status: true,
  1589. // fixed: '',
  1590. // columnWidth: 100
  1591. // },
  1592. {
  1593. userId: this.$store.state.user.name,
  1594. functionId: 101001,
  1595. serialNumber: '101001Table4ProjectOwnerName',
  1596. tableId: '101001Table4',
  1597. tableName: '客户项目信息表',
  1598. columnProp: 'projectOwnerName',
  1599. headerAlign: 'center',
  1600. align: 'left',
  1601. columnLabel: '项目负责人',
  1602. columnHidden: false,
  1603. columnImage: false,
  1604. columnSortable: false,
  1605. sortLv: 0,
  1606. status: true,
  1607. fixed: '',
  1608. columnWidth: 130
  1609. },
  1610. {
  1611. userId: this.$store.state.user.name,
  1612. functionId: 101001,
  1613. serialNumber: '101001Table4CreateDate',
  1614. tableId: '101001Table4',
  1615. tableName: '客户项目信息表',
  1616. columnProp: 'createDate',
  1617. headerAlign: 'center',
  1618. align: 'center',
  1619. columnLabel: '创建时间',
  1620. columnHidden: false,
  1621. columnImage: false,
  1622. columnSortable: false,
  1623. sortLv: 0,
  1624. status: true,
  1625. fixed: '',
  1626. columnWidth: 170
  1627. },
  1628. {
  1629. userId: this.$store.state.user.name,
  1630. functionId: 101001,
  1631. serialNumber: '101001Table4CreateBy',
  1632. tableId: '101001Table4',
  1633. tableName: '客户项目信息表',
  1634. columnProp: 'createBy',
  1635. headerAlign: 'center',
  1636. align: 'center',
  1637. columnLabel: '创建人',
  1638. columnHidden: false,
  1639. columnImage: false,
  1640. columnSortable: false,
  1641. sortLv: 0,
  1642. status: true,
  1643. fixed: '',
  1644. columnWidth: 100
  1645. },
  1646. {
  1647. userId: this.$store.state.user.name,
  1648. functionId: 101001,
  1649. serialNumber: '101001Table4UpdateDate',
  1650. tableId: '101001Table4',
  1651. tableName: '客户项目信息表',
  1652. columnProp: 'updateDate',
  1653. headerAlign: 'center',
  1654. align: 'center',
  1655. columnLabel: '更新时间',
  1656. columnHidden: false,
  1657. columnImage: false,
  1658. columnSortable: false,
  1659. sortLv: 0,
  1660. status: true,
  1661. fixed: '',
  1662. columnWidth: 170
  1663. },
  1664. {
  1665. userId: this.$store.state.user.name,
  1666. functionId: 101001,
  1667. serialNumber: '101001Table4UpdateBy',
  1668. tableId: '101001Table4',
  1669. tableName: '客户项目信息表',
  1670. columnProp: 'updateBy',
  1671. headerAlign: 'center',
  1672. align: 'center',
  1673. columnLabel: '更新人',
  1674. columnHidden: false,
  1675. columnImage: false,
  1676. columnSortable: false,
  1677. sortLv: 0,
  1678. status: true,
  1679. fixed: '',
  1680. columnWidth: 100
  1681. }
  1682. ],
  1683. // ======== 必填规则 ========
  1684. rules: {
  1685. customerNo: [
  1686. {
  1687. required: true,
  1688. message: ' ',
  1689. trigger: ['blur', 'change']
  1690. }
  1691. ],
  1692. customerDesc: [
  1693. {
  1694. required: true,
  1695. message: ' ',
  1696. trigger: ['blur', 'change']
  1697. }
  1698. ],
  1699. customerCurrency: [
  1700. {
  1701. required: true,
  1702. message: ' ',
  1703. trigger: ['blur', 'change']
  1704. }
  1705. ],
  1706. contactName: [
  1707. {
  1708. required: true,
  1709. message: ' ',
  1710. trigger: ['blur', 'change']
  1711. }
  1712. ],
  1713. contactPhoneNumber1: [
  1714. {
  1715. required: true,
  1716. message: ' ',
  1717. trigger: ['blur', 'change']
  1718. }
  1719. ],
  1720. importantCustomer: [
  1721. {
  1722. required: true,
  1723. message: ' ',
  1724. trigger: ['blur', 'change']
  1725. }
  1726. ],
  1727. customerStatus: [
  1728. {
  1729. required: true,
  1730. message: ' ',
  1731. trigger: ['blur', 'change']
  1732. }
  1733. ],
  1734. customerType: [
  1735. {
  1736. required: true,
  1737. message: ' ',
  1738. trigger: ['blur', 'change']
  1739. }
  1740. ],
  1741. },
  1742. contactRules: {
  1743. contactName: [
  1744. {
  1745. required: true,
  1746. message: ' ',
  1747. trigger: ['blur', 'change']
  1748. }
  1749. ],
  1750. position: [
  1751. {
  1752. required: true,
  1753. message: ' ',
  1754. trigger: ['blur', 'change']
  1755. }
  1756. ],
  1757. primaryContact: [
  1758. {
  1759. required: true,
  1760. message: ' ',
  1761. trigger: ['blur', 'change']
  1762. }
  1763. ],
  1764. contactStatus: [
  1765. {
  1766. required: true,
  1767. message: ' ',
  1768. trigger: ['blur', 'change']
  1769. }
  1770. ],
  1771. contactPhoneNumber1: [
  1772. {
  1773. required: true,
  1774. message: ' ',
  1775. trigger: ['blur', 'change']
  1776. }
  1777. ]
  1778. },
  1779. addressRules: {
  1780. addressName: [
  1781. {
  1782. required: true,
  1783. message: ' ',
  1784. trigger: ['blur', 'change']
  1785. }
  1786. ],
  1787. defaultAddress: [
  1788. {
  1789. required: true,
  1790. message: ' ',
  1791. trigger: ['blur', 'change']
  1792. }
  1793. ],
  1794. addressStatus: [
  1795. {
  1796. required: true,
  1797. message: ' ',
  1798. trigger: ['blur', 'change']
  1799. }
  1800. ],
  1801. addressType: [
  1802. {
  1803. required: true,
  1804. message: ' ',
  1805. trigger: ['blur', 'change']
  1806. }
  1807. ]
  1808. },
  1809. projectInformationRules: {
  1810. projectType: [
  1811. {
  1812. required: true,
  1813. message: ' ',
  1814. trigger: ['blur', 'change']
  1815. }
  1816. ],
  1817. projectName: [
  1818. {
  1819. required: true,
  1820. message: ' ',
  1821. trigger: ['blur', 'change']
  1822. }
  1823. ],
  1824. projectSourceDesc: [
  1825. {
  1826. required: true,
  1827. message: ' ',
  1828. trigger: ['blur', 'change']
  1829. }
  1830. ],
  1831. priorityDesc: [
  1832. {
  1833. required: true,
  1834. message: ' ',
  1835. trigger: ['blur', 'change']
  1836. }
  1837. ],
  1838. needDate: [
  1839. {
  1840. required: true,
  1841. message: ' ',
  1842. trigger: ['blur', 'change']
  1843. }
  1844. ],
  1845. projectManagerName: [
  1846. {
  1847. required: true,
  1848. message: ' ',
  1849. trigger: ['blur', 'change']
  1850. }
  1851. ],
  1852. projectOwnerName: [
  1853. {
  1854. required: true,
  1855. message: ' ',
  1856. trigger: ['blur', 'change']
  1857. }
  1858. ],
  1859. userRoleName: [
  1860. {
  1861. required: true,
  1862. message: ' ',
  1863. trigger: ['blur', 'change']
  1864. }
  1865. ]
  1866. },
  1867. // ======== 复选数据集 ========
  1868. customerSelections: [],
  1869. contactSelections: [],
  1870. addressSelections: [],
  1871. projectInformationSelections: [],
  1872. // ======== 选中的当前行数据 ========
  1873. customerCurrentRow: {},
  1874. contactCurrentRow: {},
  1875. addressCurrentRow: {},
  1876. projectInformationCurrentRow: {},
  1877. // ======== 模态框开关控制 ========
  1878. modalFlag: false,
  1879. modalDisableFlag: false,
  1880. detailModalFlag: false,
  1881. contactModalFlag: false,
  1882. contactDetailModalFlag: false,
  1883. addressModalFlag: false,
  1884. addressDetailModalFlag: false,
  1885. projectInformationModalFlag: false,
  1886. projectInformationDetailModalFlag: false,
  1887. // ======== 客户项目相关 ========
  1888. operatorList: [],
  1889. projectManagerList: [],
  1890. projectOwnerList: [],
  1891. userRoleList: [],
  1892. managerFlag: false,
  1893. ownerFlag: false,
  1894. userRoleFlag: false,
  1895. customerGroupList:[],//只允许勾选一个
  1896. }
  1897. },
  1898. mounted() {
  1899. this.$nextTick(() => {
  1900. this.height = window.innerHeight / 2 - 50
  1901. /*第二个表格高度的动态调整*/
  1902. this.secondHeight = window.innerHeight / 2 - 190
  1903. })
  1904. },
  1905. created() {
  1906. this.getDataList()
  1907. },
  1908. methods: {
  1909. // ======== 分页相关方法 ========
  1910. /**
  1911. * 每页数
  1912. * @param val
  1913. */
  1914. sizeChangeHandle(val) {
  1915. this.pageSize = val
  1916. this.pageIndex = 1
  1917. this.getDataList()
  1918. },
  1919. /**
  1920. * 当前页
  1921. * @param val
  1922. */
  1923. currentChangeHandle(val) {
  1924. this.pageIndex = val
  1925. this.getDataList()
  1926. },
  1927. // ======== 页签切换相关方法 ========
  1928. /**
  1929. * 列表表格选择替换
  1930. * @param tab
  1931. * @param event
  1932. */
  1933. tabClick(tab, event) {
  1934. // 刷新列表数据
  1935. this.refreshCurrentTabTable()
  1936. },
  1937. /**
  1938. * 当前值发生变化的时候修改
  1939. * @param row
  1940. * @param oldRow
  1941. */
  1942. changeCurrentRow(row, oldRow) {
  1943. // 判断是否是获取焦点的事件
  1944. if (row) {
  1945. this.customerCurrentRow = JSON.parse(JSON.stringify(row))
  1946. //刷新当前页表
  1947. this.refreshCurrentTabTable()
  1948. }
  1949. },
  1950. /**
  1951. * 刷新页签的table数据
  1952. */
  1953. refreshCurrentTabTable() {
  1954. this.getCustomerContactList()
  1955. this.getCustomerAddressList()
  1956. this.getProjectInformationList()
  1957. },
  1958. // ======== 列表数据刷新方法 ========
  1959. /**
  1960. * 获取数据列表
  1961. */
  1962. getDataList() {
  1963. this.searchData.limit = this.pageSize
  1964. this.searchData.page = this.pageIndex
  1965. customerInformationSearch(this.searchData).then(({data}) => {
  1966. if (data.code === 0) {
  1967. this.dataList = data.page.list
  1968. this.pageIndex = data.page.currPage
  1969. this.pageSize = data.page.pageSize
  1970. this.totalPage = data.page.totalCount
  1971. // 判断是否全部存在数据
  1972. if (this.dataList.length > 0) {
  1973. this.customerCurrentRow = {...this.dataList[0]}
  1974. }
  1975. }
  1976. })
  1977. },
  1978. /**
  1979. * 刷新客户联系人的列表
  1980. */
  1981. getCustomerContactList() {
  1982. let tempData = {
  1983. site: this.$store.state.user.site,
  1984. customerNo: this.customerCurrentRow.customerNo
  1985. }
  1986. customerContactSearch(tempData).then(({data}) => {
  1987. if (data && data.code === 0) {
  1988. this.contactList = data.rows
  1989. } else {
  1990. this.contactList = []
  1991. }
  1992. });
  1993. },
  1994. /**
  1995. * 刷新客户联系地址的列表
  1996. */
  1997. getCustomerAddressList() {
  1998. let tempData = {
  1999. site: this.$store.state.user.site,
  2000. customerNo: this.customerCurrentRow.customerNo,
  2001. customerDesc: this.customerCurrentRow.customerDesc
  2002. }
  2003. customerAddressSearch(tempData).then(({data}) => {
  2004. if (data && data.code === 0) {
  2005. this.addressList = data.rows
  2006. } else {
  2007. this.addressList = []
  2008. }
  2009. });
  2010. },
  2011. /**
  2012. * 刷新客户项目信息的列表
  2013. */
  2014. getProjectInformationList() {
  2015. let tempData = {
  2016. site: this.$store.state.user.site,
  2017. customerId: this.customerCurrentRow.customerNo
  2018. }
  2019. projectInformationSearch(tempData).then(({data}) => {
  2020. if (data && data.code === 0) {
  2021. this.projectInformationList = data.rows
  2022. } else {
  2023. this.projectInformationList = []
  2024. }
  2025. });
  2026. },
  2027. // ======== 新增模态框 ========
  2028. /**
  2029. * 客户信息新增模态框
  2030. */
  2031. addModal() {
  2032. this.modalData = {
  2033. flag: '1',
  2034. title: '客户新增',
  2035. site: this.$store.state.user.site,
  2036. customerNo: '',
  2037. customerDesc: '',
  2038. customerDescription: '',
  2039. customerIndustry: '',
  2040. customerCurrency: '',
  2041. turnoverOfYear: '',
  2042. potentialRevenueOfYear: '',
  2043. importantCustomer: '',
  2044. customerGroupId1: '',
  2045. customerGroupId2: '',
  2046. customerGroupName1: '',
  2047. customerGroupName2: '',
  2048. customerStatus: 'Y',
  2049. customerType: '潜在客户',
  2050. addressName: '',
  2051. defaultAddress: '',
  2052. addressStatus: '启用',
  2053. addressType: '类型一',
  2054. createBy: this.$store.state.user.name,
  2055. type: '',
  2056. customerGroup: undefined,
  2057. }
  2058. this.modalDisableFlag = false
  2059. this.detailModalFlag = false
  2060. this.modalFlag = true
  2061. },
  2062. /**
  2063. * 客户联系人新增模态框
  2064. */
  2065. contactSaveModal() {
  2066. this.contactModalData = {
  2067. flag: '1',
  2068. title: '联系人新增',
  2069. site: this.$store.state.user.site,
  2070. customerNo: this.customerCurrentRow.customerNo,
  2071. contactId: '',
  2072. contactName: '',
  2073. contactLandlineNumber: '',
  2074. contactPhoneNumber1: '',
  2075. contactPhoneNumber2: '',
  2076. contactPhoneNumber3: '',
  2077. position: '',
  2078. departmentName: '',
  2079. mailbox: '',
  2080. primaryContact: 'N',
  2081. contactStatus: '启用',
  2082. remark: '',
  2083. createDate: '',
  2084. createBy: this.$store.state.user.name,
  2085. }
  2086. if (this.contactList.length === 0) {
  2087. this.contactModalData.primaryContact = 'Y'
  2088. }
  2089. this.contactDetailModalFlag = false
  2090. this.contactModalFlag = true
  2091. },
  2092. /**
  2093. * 客户联系地址新增模态框
  2094. */
  2095. addressSaveModal() {
  2096. this.addressModalData = {
  2097. flag: '1',
  2098. title: '联系地址新增',
  2099. site: this.$store.state.user.site,
  2100. customerNo: this.customerCurrentRow.customerNo,
  2101. addressId: '',
  2102. addressName: '',
  2103. companyName: this.customerCurrentRow.customerDesc,
  2104. defaultAddress: 'N',
  2105. addressStatus: '启用',
  2106. addressType: '',
  2107. remark: '',
  2108. createDate: '',
  2109. createBy: this.$store.state.user.name,
  2110. }
  2111. if (this.addressList.length === 0) {
  2112. this.addressModalData.defaultAddress = 'Y'
  2113. }
  2114. this.addressDetailModalFlag = false
  2115. this.addressModalFlag = true
  2116. },
  2117. /**
  2118. * 客户项目信息新增模态框
  2119. */
  2120. projectInformationSaveModal() {
  2121. this.projectInformationModalData = {
  2122. flag: '1',
  2123. title: '项目信息新增',
  2124. site: this.$store.state.user.site,
  2125. id: 0,
  2126. projectLevel: '',
  2127. projectId: '',
  2128. projectType: '',
  2129. projectTypeDb: '',
  2130. customerId: this.customerCurrentRow.customerNo,
  2131. customerName: this.customerCurrentRow.customerDesc,
  2132. projectName: '',
  2133. projectDesc: '',
  2134. projectSource: '',
  2135. projectSourceDesc: '',
  2136. priority: '',
  2137. priorityDesc: '',
  2138. needDate: '',
  2139. projectManagerName: '',
  2140. projectOwnerName: '',
  2141. customerRemark: '',
  2142. remark: '',
  2143. status: '',
  2144. userRoleName: '',
  2145. projectManagerList: [],
  2146. projectOwnerList: [],
  2147. userRoleList: [],
  2148. createDate: '',
  2149. createBy: this.$store.state.user.name
  2150. }
  2151. this.projectInformationDetailModalFlag = false
  2152. // this.projectInformationModalFlag = true
  2153. this.addOrUpdateVisible = true;
  2154. this.addOrUpdate = "save";
  2155. this.$nextTick(() => {
  2156. this.$refs.addOrUpdate.initCustomer(this.projectInformationModalData);
  2157. this.$refs.addOrUpdate.init();
  2158. })
  2159. },
  2160. // ======== 编辑模态框 ========
  2161. /**
  2162. * 客户信息编辑模态框
  2163. * @param row
  2164. */
  2165. updateModal(row) {
  2166. this.modalData = {
  2167. flag: '2',
  2168. title: '客户编辑',
  2169. site: row.site,
  2170. customerNo: row.customerNo,
  2171. customerDesc: row.customerDesc,
  2172. customerDescription: row.customerDescription,
  2173. customerIndustry: row.customerIndustry,
  2174. customerCurrency: row.customerCurrency,
  2175. turnoverOfYear: row.turnoverOfYear,
  2176. potentialRevenueOfYear: row.potentialRevenueOfYear,
  2177. customerGroupId1: row.customerGroupId1,
  2178. customerGroupId2: row.customerGroupId2,
  2179. customerGroupName1: row.customerGroupName1,
  2180. customerGroupName2: row.customerGroupName2,
  2181. importantCustomer: row.importantCustomer,
  2182. customerStatus: row.customerStatus,
  2183. customerType: row.customerType,
  2184. companyName: row.companyName,
  2185. jobDescription: row.jobDescription,
  2186. contactStatus: row.contactStatus,
  2187. addressName: row.addressName,
  2188. defaultAddress: 'Y',
  2189. updateBy: this.$store.state.user.name,
  2190. type: ''
  2191. }
  2192. this.modalDisableFlag = true
  2193. this.detailModalFlag = false
  2194. // 客户组修改
  2195. this.customerGroupList = row.customerGroup?[row.customerGroup]:[]
  2196. this.modalFlag = true
  2197. },
  2198. /**
  2199. * 客户联系人编辑模态框
  2200. * @param row
  2201. */
  2202. updateContactModal(row) {
  2203. this.contactModalData = {
  2204. flag: '2',
  2205. title: '联系人编辑',
  2206. site: row.site,
  2207. customerNo: row.customerNo,
  2208. contactId: row.contactId,
  2209. contactName: row.contactName,
  2210. contactLandlineNumber: row.contactLandlineNumber,
  2211. contactPhoneNumber1: row.contactPhoneNumber1,
  2212. contactPhoneNumber2: row.contactPhoneNumber2,
  2213. contactPhoneNumber3: row.contactPhoneNumber3,
  2214. position: row.position,
  2215. departmentName: row.departmentName,
  2216. mailbox: row.mailbox,
  2217. primaryContact: row.primaryContact,
  2218. contactStatus: row.contactStatus,
  2219. remark: row.remark,
  2220. updateDate: '',
  2221. updateBy: this.$store.state.user.name
  2222. }
  2223. this.contactDetailModalFlag = false
  2224. this.contactModalFlag = true
  2225. },
  2226. /**
  2227. * 客户联系地址编辑模态框
  2228. * @param row
  2229. */
  2230. updateAddressModal(row) {
  2231. this.addressModalData = {
  2232. flag: '2',
  2233. title: '联系地址编辑',
  2234. site: row.site,
  2235. customerNo: row.customerNo,
  2236. addressId: row.addressId,
  2237. addressName: row.addressName,
  2238. companyName: row.companyName,
  2239. defaultAddress: row.defaultAddress,
  2240. addressStatus: row.addressStatus,
  2241. addressType: row.addressType,
  2242. remark: row.remark,
  2243. updateDate: '',
  2244. updateBy: this.$store.state.user.name
  2245. }
  2246. this.addressDetailModalFlag = false
  2247. this.addressModalFlag = true
  2248. },
  2249. /**
  2250. * 客户项目信息编辑模态框
  2251. * @param row
  2252. */
  2253. updateProjectInformationModal(row) {
  2254. this.projectInformationModalData = {
  2255. flag: '2',
  2256. title: '项目信息编辑',
  2257. site: row.site,
  2258. id: row.id,
  2259. projectLevel: row.projectLevel,
  2260. projectId: row.projectId,
  2261. projectType: row.projectType,
  2262. projectTypeDb: row.projectTypeDb,
  2263. customerId: row.customerId,
  2264. customerName: row.customerName,
  2265. projectName: row.projectName,
  2266. projectDesc: row.projectDesc,
  2267. projectSource: row.projectSource,
  2268. projectSourceDesc: row.projectSourceDesc,
  2269. priority: row.priority,
  2270. priorityDesc: row.priorityDesc,
  2271. needDate: row.needDate,
  2272. projectManagerName: row.projectManagerName,
  2273. projectOwnerName: row.projectOwnerName,
  2274. customerRemark: row.customerRemark,
  2275. remark: row.remark,
  2276. status: row.status,
  2277. userRoleName: row.userRoleName,
  2278. projectManagerList: [],
  2279. projectOwnerList: [],
  2280. userRoleList: [],
  2281. updateDate: '',
  2282. updateBy: this.$store.state.user.name
  2283. }
  2284. // 查询项目经理、负责人、权限列表
  2285. let inData = {
  2286. site: this.projectInformationModalData.site,
  2287. projectId: this.projectInformationModalData.projectId,
  2288. type: 'manager'
  2289. }
  2290. searchProjectTeamStr(inData).then(({data}) => {
  2291. this.projectInformationModalData.projectManagerList = data.rows
  2292. })
  2293. let inData2 = {
  2294. site: this.projectInformationModalData.site,
  2295. projectId: this.projectInformationModalData.projectId,
  2296. type: 'owner'
  2297. }
  2298. searchProjectTeamStr(inData2).then(({data}) => {
  2299. this.projectInformationModalData.projectOwnerList = data.rows
  2300. })
  2301. let inData3 = {
  2302. site: this.projectInformationModalData.site,
  2303. projectId: this.projectInformationModalData.projectId
  2304. }
  2305. searchUserRoll(inData3).then(({data}) => {
  2306. this.projectInformationModalData.userRoleList = data.rows
  2307. })
  2308. this.projectInformationDetailModalFlag = false
  2309. // this.projectInformationModalFlag = true
  2310. this.addOrUpdateVisible = true
  2311. this.addOrUpdate = "update";
  2312. this.$nextTick(() => {
  2313. this.$refs.addOrUpdate.init(row.id)
  2314. })
  2315. },
  2316. // ======== 详情模态框 ========
  2317. /**
  2318. * 客户信息详情模态框
  2319. * @param row
  2320. */
  2321. detailModal(row) {
  2322. this.modalData = {
  2323. flag: '3',
  2324. title: '客户详情',
  2325. site: row.site,
  2326. customerNo: row.customerNo,
  2327. customerDesc: row.customerDesc,
  2328. customerDescription: row.customerDescription,
  2329. customerIndustry: row.customerIndustry,
  2330. customerCurrency: row.customerCurrency,
  2331. turnoverOfYear: row.turnoverOfYear,
  2332. potentialRevenueOfYear: row.potentialRevenueOfYear,
  2333. customerGroupId1: row.customerGroupId1,
  2334. customerGroupId2: row.customerGroupId2,
  2335. customerGroupName1: row.customerGroupName1,
  2336. customerGroupName2: row.customerGroupName2,
  2337. importantCustomer: row.importantCustomer,
  2338. customerStatus: row.customerStatus,
  2339. customerType: row.customerType,
  2340. companyName: row.companyName,
  2341. jobDescription: row.jobDescription,
  2342. contactStatus: row.contactStatus,
  2343. addressName: row.addressName,
  2344. type: ''
  2345. }
  2346. this.modalDisableFlag = true
  2347. this.detailModalFlag = true
  2348. // 客户组修改
  2349. this.customerGroupList = row.customerGroup?[row.customerGroup]:[]
  2350. this.modalFlag = true
  2351. },
  2352. /**
  2353. * 客户联系人详情模态框
  2354. * @param row
  2355. */
  2356. detailContactModal(row) {
  2357. this.contactModalData = {
  2358. flag: '3',
  2359. title: '联系人详情',
  2360. site: row.site,
  2361. customerNo: row.customerNo,
  2362. contactId: row.contactId,
  2363. contactName: row.contactName,
  2364. contactLandlineNumber: row.contactLandlineNumber,
  2365. contactPhoneNumber1: row.contactPhoneNumber1,
  2366. contactPhoneNumber2: row.contactPhoneNumber2,
  2367. contactPhoneNumber3: row.contactPhoneNumber3,
  2368. position: row.position,
  2369. departmentName: row.departmentName,
  2370. mailbox: row.mailbox,
  2371. primaryContact: row.primaryContact,
  2372. contactStatus: row.contactStatus,
  2373. remark: row.remark
  2374. }
  2375. this.contactDetailModalFlag = true
  2376. this.contactModalFlag = true
  2377. },
  2378. /**
  2379. * 客户联系地址详情模态框
  2380. * @param row
  2381. */
  2382. detailAddressModal(row) {
  2383. this.addressModalData = {
  2384. flag: '3',
  2385. title: '联系地址详情',
  2386. site: row.site,
  2387. customerNo: row.customerNo,
  2388. addressId: row.addressId,
  2389. addressName: row.addressName,
  2390. companyName: row.companyName,
  2391. defaultAddress: row.defaultAddress,
  2392. addressStatus: row.addressStatus,
  2393. addressType: row.addressType,
  2394. remark: row.remark,
  2395. }
  2396. this.addressDetailModalFlag = true
  2397. this.addressModalFlag = true
  2398. },
  2399. /**
  2400. * 客户项目信息详情模态框
  2401. * @param row
  2402. */
  2403. detailProjectInformationModal(row) {
  2404. this.projectInformationModalData = {
  2405. flag: '3',
  2406. title: '项目信息详情',
  2407. site: row.site,
  2408. projectId: row.projectId,
  2409. projectType: row.projectType,
  2410. projectTypeDb: row.projectTypeDb,
  2411. customerId: row.customerId,
  2412. customerName: row.customerName,
  2413. projectName: row.projectName,
  2414. projectDesc: row.projectDesc,
  2415. projectSource: row.projectSource,
  2416. projectSourceDesc: row.projectSourceDesc,
  2417. priority: row.priority,
  2418. priorityDesc: row.priorityDesc,
  2419. needDate: row.needDate,
  2420. projectManagerName: row.projectManagerName,
  2421. projectOwnerName: row.projectOwnerName,
  2422. customerRemark: row.customerRemark,
  2423. remark: row.remark,
  2424. status: row.status,
  2425. userRoleName: row.userRoleName,
  2426. buNo: row.buNo,
  2427. buDesc: row.buDesc
  2428. }
  2429. this.projectInformationDetailModalFlag = true
  2430. this.projectInformationModalFlag = true
  2431. },
  2432. // ======== 删除方法 ========
  2433. /**
  2434. * 客户信息删除
  2435. */
  2436. delModal() {
  2437. if (this.customerSelections.length === 0) {
  2438. this.$message.warning('请勾选要删除的客户!')
  2439. return
  2440. }
  2441. this.$confirm(`是否删除这 ` + this.customerSelections.length + ` 条客户信息?`, '提示', {
  2442. confirmButtonText: '确定',
  2443. cancelButtonText: '取消',
  2444. type: 'warning'
  2445. }).then(() => {
  2446. let tempData1 = {
  2447. projectList: this.customerSelections.map(item => ({
  2448. ...item,
  2449. customerId: item.customerNo
  2450. }))
  2451. }
  2452. projectInformationSearchByCustomers(tempData1).then((data) => {
  2453. if (data.data && data.data.code === 0) {
  2454. if (data.data.rows.length > 0){
  2455. this.$message.warning('该客户已关联项目信息,不允许删除!')
  2456. }
  2457. else {
  2458. let tempData = {
  2459. informationList: this.customerSelections
  2460. }
  2461. customerInformationDelete(tempData).then(({data}) => {
  2462. if (data && data.code === 0) {
  2463. this.getDataList()
  2464. this.customerSelections = []
  2465. this.$message({
  2466. message: '操作成功',
  2467. type: 'success',
  2468. duration: 1500,
  2469. onClose: () => {
  2470. }
  2471. })
  2472. } else {
  2473. this.$alert(data.msg, '错误', {
  2474. confirmButtonText: '确定'
  2475. })
  2476. }
  2477. })
  2478. }
  2479. } else {
  2480. this.$alert(data.msg, '错误', {
  2481. confirmButtonText: '确定'
  2482. })
  2483. }
  2484. })
  2485. }).catch(() => {
  2486. })
  2487. },
  2488. /**
  2489. * 客户联系人删除
  2490. */
  2491. contactDeleteModal() {
  2492. if (this.contactSelections.length === 0) {
  2493. this.$message.warning('请勾选要删除的联系人!')
  2494. return
  2495. }
  2496. this.$confirm(`是否删除这 ` + this.contactSelections.length + ` 条联系人信息?`, '提示', {
  2497. confirmButtonText: '确定',
  2498. cancelButtonText: '取消',
  2499. type: 'warning'
  2500. }).then(() => {
  2501. let tempContactName = null
  2502. for (let i = 0; i < this.contactSelections.length; i++) {
  2503. // 判断是否有默认联系人
  2504. if (this.contactSelections[i].primaryContact === 'Y') {
  2505. tempContactName = this.contactSelections[i].contactName
  2506. }
  2507. }
  2508. if (tempContactName !== '' || tempContactName != null) {
  2509. this.$confirm(tempContactName + ` 为默认联系人,是否确认删除?`, '提示', {
  2510. confirmButtonText: '确定',
  2511. cancelButtonText: '取消',
  2512. type: 'warning'
  2513. }).then(() => {
  2514. let tempData = {
  2515. contactList: this.contactSelections
  2516. }
  2517. customerContactDelete(tempData).then(({data}) => {
  2518. if (data && data.code === 0) {
  2519. this.getCustomerContactList()
  2520. this.contactSelections = []
  2521. this.$message({
  2522. message: '操作成功',
  2523. type: 'success',
  2524. duration: 1500,
  2525. onClose: () => {
  2526. }
  2527. })
  2528. } else {
  2529. this.$alert(data.msg, '错误', {
  2530. confirmButtonText: '确定'
  2531. })
  2532. }
  2533. })
  2534. }).catch(() => {
  2535. })
  2536. } else {
  2537. let tempData = {
  2538. contactList: this.contactSelections
  2539. }
  2540. customerContactDelete(tempData).then(({data}) => {
  2541. if (data && data.code === 0) {
  2542. this.getCustomerContactList()
  2543. this.contactSelections = []
  2544. this.$message({
  2545. message: '操作成功',
  2546. type: 'success',
  2547. duration: 1500,
  2548. onClose: () => {
  2549. }
  2550. })
  2551. } else {
  2552. this.$alert(data.msg, '错误', {
  2553. confirmButtonText: '确定'
  2554. })
  2555. }
  2556. })
  2557. }
  2558. }).catch(() => {
  2559. })
  2560. },
  2561. /**
  2562. * 客户联系地址删除
  2563. */
  2564. addressDeleteModal() {
  2565. if (this.addressSelections.length === 0) {
  2566. this.$message.warning('请勾选要删除的地址!')
  2567. return
  2568. }
  2569. this.$confirm(`是否删除这 ` + this.addressSelections.length + ` 条地址?`, '提示', {
  2570. confirmButtonText: '确定',
  2571. cancelButtonText: '取消',
  2572. type: 'warning'
  2573. }).then(() => {
  2574. let tempAddressName = null
  2575. for (let i = 0; i < this.addressSelections.length; i++) {
  2576. // 判断是否有主联系地址
  2577. if (this.addressSelections[i].defaultAddress === 'Y') {
  2578. tempAddressName = this.addressSelections[i].addressName
  2579. }
  2580. }
  2581. if (tempAddressName !== '' || tempAddressName != null) {
  2582. this.$confirm(tempAddressName + ` 为主联系地址,是否确认删除?`, '提示', {
  2583. confirmButtonText: '确定',
  2584. cancelButtonText: '取消',
  2585. type: 'warning'
  2586. }).then(() => {
  2587. let tempData = {
  2588. addressList: this.addressSelections
  2589. }
  2590. customerAddressDelete(tempData).then(({data}) => {
  2591. if (data && data.code === 0) {
  2592. this.getCustomerAddressList()
  2593. this.addressSelections = []
  2594. this.$message({
  2595. message: '操作成功',
  2596. type: 'success',
  2597. duration: 1500,
  2598. onClose: () => {
  2599. }
  2600. })
  2601. } else {
  2602. this.$alert(data.msg, '错误', {
  2603. confirmButtonText: '确定'
  2604. })
  2605. }
  2606. })
  2607. }).catch(() => {
  2608. })
  2609. } else {
  2610. let tempData = {
  2611. addressList: this.addressSelections
  2612. }
  2613. customerAddressDelete(tempData).then(({data}) => {
  2614. if (data && data.code === 0) {
  2615. this.getCustomerAddressList()
  2616. this.addressSelections = []
  2617. this.$message({
  2618. message: '操作成功',
  2619. type: 'success',
  2620. duration: 1500,
  2621. onClose: () => {
  2622. }
  2623. })
  2624. } else {
  2625. this.$alert(data.msg, '错误', {
  2626. confirmButtonText: '确定'
  2627. })
  2628. }
  2629. })
  2630. }
  2631. }).catch(() => {
  2632. })
  2633. },
  2634. // ======== 新增/编辑方法 ========
  2635. /**
  2636. * 客户信息新增/编辑
  2637. */
  2638. saveData() {
  2639. if (this.modalData.customerDesc === '' || this.modalData.customerDesc == null) {
  2640. this.$message.warning('请输入客户名称!')
  2641. return
  2642. }
  2643. if (this.modalData.importantCustomer === '' || this.modalData.importantCustomer == null) {
  2644. this.$message.warning('请选择重要程度!')
  2645. return
  2646. }
  2647. if (this.modalData.customerStatus === '' || this.modalData.customerStatus == null) {
  2648. this.$message.warning('请选择客户状态!')
  2649. return
  2650. }
  2651. if (this.modalData.customerType === '' || this.modalData.customerType == null) {
  2652. this.$message.warning('请选择客户类型!')
  2653. return
  2654. }
  2655. if (this.customerGroupList.length > 0){
  2656. this.modalData.customerGroup = this.customerGroupList[0]
  2657. }else {
  2658. this.modalData.customerGroup = ''
  2659. }
  2660. if (this.modalData.flag === '1') {
  2661. customerInformationSave(this.modalData).then(({data}) => {
  2662. if (data && data.code === 0) {
  2663. this.getDataList()
  2664. this.modalFlag = false
  2665. this.$message({
  2666. message: '操作成功',
  2667. type: 'success',
  2668. duration: 1500,
  2669. onClose: () => {
  2670. }
  2671. })
  2672. } else {
  2673. this.$alert(data.msg, '错误', {
  2674. confirmButtonText: '确定'
  2675. })
  2676. }
  2677. })
  2678. } else {
  2679. customerInformationEdit(this.modalData).then(({data}) => {
  2680. if (data && data.code === 0) {
  2681. this.getDataList()
  2682. this.modalFlag = false
  2683. this.$message({
  2684. message: '操作成功',
  2685. type: 'success',
  2686. duration: 1500,
  2687. onClose: () => {
  2688. }
  2689. })
  2690. } else {
  2691. this.$alert(data.msg, '错误', {
  2692. confirmButtonText: '确定'
  2693. })
  2694. }
  2695. })
  2696. }
  2697. },
  2698. /**
  2699. * 客户联系人新增/编辑
  2700. */
  2701. saveContactData() {
  2702. if (this.contactModalData.contactName === '' || this.contactModalData.contactName == null) {
  2703. this.$message.warning('请输入联系人!')
  2704. return
  2705. }
  2706. if (this.contactModalData.contactPhoneNumber1 === '' || this.contactModalData.contactPhoneNumber1 == null) {
  2707. this.$message.warning('请输入联系人电话(1)!')
  2708. return
  2709. }
  2710. if (this.contactModalData.primaryContact === '' || this.contactModalData.primaryContact == null) {
  2711. this.$message.warning('请选择是否为默认联系人!')
  2712. return
  2713. }
  2714. if (this.contactModalData.contactStatus === '' || this.contactModalData.contactStatus == null) {
  2715. this.$message.warning('请选择状态!')
  2716. return
  2717. }
  2718. if (this.contactModalData.flag === '1') {
  2719. customerContactSave(this.contactModalData).then(({data}) => {
  2720. if (data && data.code === 0) {
  2721. this.getCustomerContactList()
  2722. this.contactModalFlag = false
  2723. this.$message({
  2724. message: '操作成功',
  2725. type: 'success',
  2726. duration: 1500,
  2727. onClose: () => {
  2728. }
  2729. })
  2730. } else {
  2731. this.$alert(data.msg, '错误', {
  2732. confirmButtonText: '确定'
  2733. })
  2734. }
  2735. })
  2736. } else {
  2737. customerContactEdit(this.contactModalData).then(({data}) => {
  2738. if (data && data.code === 0) {
  2739. this.getCustomerContactList()
  2740. this.contactModalFlag = false
  2741. this.$message({
  2742. message: '操作成功',
  2743. type: 'success',
  2744. duration: 1500,
  2745. onClose: () => {
  2746. }
  2747. })
  2748. } else {
  2749. this.$alert(data.msg, '错误', {
  2750. confirmButtonText: '确定'
  2751. })
  2752. }
  2753. })
  2754. }
  2755. },
  2756. /**
  2757. * 客户联系地址新增/编辑
  2758. */
  2759. saveAddressData() {
  2760. if (this.addressModalData.addressName === '' || this.addressModalData.addressName == null) {
  2761. this.$message.warning('请输入地址!')
  2762. return
  2763. }
  2764. if (this.addressModalData.defaultAddress === '' || this.addressModalData.defaultAddress == null) {
  2765. this.$message.warning('请选择是否为主要地址!')
  2766. return
  2767. }
  2768. if (this.addressModalData.addressStatus === '' || this.addressModalData.addressStatus == null) {
  2769. this.$message.warning('请选择状态!')
  2770. return
  2771. }
  2772. if (this.addressModalData.addressType === '' || this.addressModalData.addressType == null) {
  2773. this.$message.warning('请选择地址类型!')
  2774. return
  2775. }
  2776. if (this.addressModalData.flag === '1') {
  2777. customerAddressSave(this.addressModalData).then(({data}) => {
  2778. if (data && data.code === 0) {
  2779. this.getCustomerAddressList()
  2780. this.addressModalFlag = false
  2781. this.$message({
  2782. message: '操作成功',
  2783. type: 'success',
  2784. duration: 1500,
  2785. onClose: () => {
  2786. }
  2787. })
  2788. } else {
  2789. this.$alert(data.msg, '错误', {
  2790. confirmButtonText: '确定'
  2791. })
  2792. }
  2793. })
  2794. } else {
  2795. customerAddressEdit(this.addressModalData).then(({data}) => {
  2796. if (data && data.code === 0) {
  2797. this.getCustomerAddressList()
  2798. this.addressModalFlag = false
  2799. this.$message({
  2800. message: '操作成功',
  2801. type: 'success',
  2802. duration: 1500,
  2803. onClose: () => {
  2804. }
  2805. })
  2806. } else {
  2807. this.$alert(data.msg, '错误', {
  2808. confirmButtonText: '确定'
  2809. })
  2810. }
  2811. })
  2812. }
  2813. },
  2814. /**
  2815. * 客户项目信息新增/编辑
  2816. */
  2817. saveProjectInformationData() {
  2818. if (this.projectInformationModalData.projectTypeDb === '' || this.projectInformationModalData.projectTypeDb == null) {
  2819. this.$message.warning('请选择项目类型!')
  2820. return
  2821. }
  2822. if (this.projectInformationModalData.projectName === '' || this.projectInformationModalData.projectName == null) {
  2823. this.$message.warning('请输入项目名称!')
  2824. return
  2825. }
  2826. if (this.projectInformationModalData.projectSource === '' || this.projectInformationModalData.projectSource == null) {
  2827. this.$message.warning('请选择项目来源!')
  2828. return
  2829. }
  2830. if (this.projectInformationModalData.priority === '' || this.projectInformationModalData.priority == null) {
  2831. this.$message.warning('请选择优先级!')
  2832. return
  2833. }
  2834. if (this.projectInformationModalData.needDate === '' || this.projectInformationModalData.needDate == null) {
  2835. this.$message.warning('请选择要求日期!')
  2836. return
  2837. }
  2838. if (this.projectInformationModalData.projectManagerName === '' || this.projectInformationModalData.projectManagerName == null) {
  2839. this.$message.warning('请选择项目经理!')
  2840. return
  2841. }
  2842. if (this.projectInformationModalData.projectOwnerName === '' || this.projectInformationModalData.projectOwnerName == null) {
  2843. this.$message.warning('请选择项目负责人!')
  2844. return
  2845. }
  2846. if (this.projectInformationModalData.userRoleName === '' || this.projectInformationModalData.userRoleName == null) {
  2847. this.$message.warning('请选择权限!')
  2848. return
  2849. }
  2850. saveProjectInfo(this.projectInformationModalData).then(({data}) => {
  2851. if (data && data.code === 0) {
  2852. this.getProjectInformationList()
  2853. this.projectInformationModalFlag = false
  2854. this.$message({
  2855. message: '操作成功',
  2856. type: 'success',
  2857. duration: 1500,
  2858. onClose: () => {
  2859. }
  2860. })
  2861. } else {
  2862. this.$alert(data.msg, '错误', {
  2863. confirmButtonText: '确定'
  2864. })
  2865. }
  2866. })
  2867. },
  2868. // ======== 列表单机选中方法 ========
  2869. /**
  2870. * 单机选中客户信息
  2871. * @param row
  2872. */
  2873. customerClickRow(row) {
  2874. this.customerCurrentRow = {...row}
  2875. },
  2876. /**
  2877. * 单机选中客户联系人
  2878. * @param row
  2879. */
  2880. contactClickRow(row) {
  2881. this.$refs.contactTable.toggleRowSelection(row)
  2882. this.contactCurrentRow = JSON.parse(JSON.stringify(row))
  2883. },
  2884. /**
  2885. * 单机选中客户联系地址
  2886. * @param row
  2887. */
  2888. addressClickRow(row) {
  2889. this.$refs.addressTable.toggleRowSelection(row)
  2890. this.addressCurrentRow = JSON.parse(JSON.stringify(row))
  2891. },
  2892. /**
  2893. * 单机选中客户项目信息
  2894. * @param row
  2895. */
  2896. projectInformationClickRow(row, column) {
  2897. if (column.label !== '项目号') {
  2898. this.$refs.projectInformationTable.toggleRowSelection(row)
  2899. this.projectInformationCurrentRow = JSON.parse(JSON.stringify(row))
  2900. }
  2901. },
  2902. // ======== 列表复选方法 ========
  2903. /**
  2904. * 复选客户信息
  2905. * @param val
  2906. */
  2907. selectionCustomer(val) {
  2908. this.customerSelections = val
  2909. },
  2910. /**
  2911. * 复选客户联系人
  2912. * @param val
  2913. */
  2914. selectionContact(val) {
  2915. this.contactSelections = val
  2916. },
  2917. /**
  2918. * 复选客户联系人
  2919. * @param val
  2920. */
  2921. selectionAddress(val) {
  2922. this.addressSelections = val
  2923. },
  2924. /**
  2925. * 复选客户项目信息
  2926. * @param val
  2927. */
  2928. selectionProjectInformation(val) {
  2929. this.projectInformationSelections = val
  2930. },
  2931. // 客户组1输入校验
  2932. customerGroupBlur(tagNo) {
  2933. if (this.modalData.customerGroupId1 != null && this.modalData.customerGroupId1 !== '') {
  2934. let tempData = {
  2935. tagno: tagNo,
  2936. conditionSql: " and customer_group_id = '" + this.modalData.customerGroupId1 + "'" + " and site = '" + this.modalData.site + "'"
  2937. }
  2938. verifyData(tempData).then(({data}) => {
  2939. if (data && data.code === 0) {
  2940. if (data.baseListData.length > 0) {
  2941. this.modalData.customerGroupId1 = data.baseListData[0].customer_group_id
  2942. this.modalData.customerGroupName1 = data.baseListData[0].customer_group_name
  2943. return
  2944. }
  2945. }
  2946. })
  2947. }
  2948. this.modalData.customerGroupName1 = ''
  2949. },
  2950. // 客户组2输入校验
  2951. customerGroupBlur2(tagNo) {
  2952. if (this.modalData.customerGroupId2 != null && this.modalData.customerGroupId2 !== '') {
  2953. let tempData = {
  2954. tagno: tagNo,
  2955. conditionSql: " and customer_group_id = '" + this.modalData.customerGroupId2 + "'" + " and site = '" + this.modalData.site + "'"
  2956. }
  2957. verifyData(tempData).then(({data}) => {
  2958. if (data && data.code === 0) {
  2959. if (data.baseListData.length > 0) {
  2960. this.modalData.customerGroupId2 = data.baseListData[0].customer_group_id
  2961. this.modalData.customerGroupName2 = data.baseListData[0].customer_group_name
  2962. return
  2963. }
  2964. }
  2965. })
  2966. }
  2967. this.modalData.customerGroupName2 = ''
  2968. },
  2969. // ======== chooseList相关方法 ========
  2970. /**
  2971. * 获取基础数据列表S
  2972. * @param val
  2973. * @param type
  2974. */
  2975. getBaseList(val, type) {
  2976. this.tagNo = val
  2977. this.tagNo1 = type
  2978. this.$nextTick(() => {
  2979. let strVal = ''
  2980. if (val === 1010) {
  2981. if (type === 1) {
  2982. strVal = this.projectInformationModalData.projectTypeDb
  2983. }
  2984. }
  2985. if (val === 102) {
  2986. if (type === 1) {
  2987. strVal = this.projectInformationModalData.customerId
  2988. }
  2989. }
  2990. if (val === 1011) {
  2991. if (type === 1) {
  2992. strVal = this.projectInformationModalData.projectSource
  2993. }
  2994. }
  2995. if (val === 1012) {
  2996. if (type === 1) {
  2997. strVal = this.projectInformationModalData.priority
  2998. }
  2999. }
  3000. if (val === 120) {
  3001. strVal = this.modalData.customerGroupId1
  3002. } else if (val === 121) {
  3003. strVal = this.modalData.customerGroupId2
  3004. }
  3005. this.$refs.baseList.init(val, strVal)
  3006. })
  3007. },
  3008. /**
  3009. * 列表方法的回调
  3010. * @param val
  3011. */
  3012. getBaseData(val) {
  3013. if (this.tagNo === 1010) {
  3014. if (this.tagNo1 === 1) {
  3015. this.projectInformationModalData.projectTypeDb = val.Base_id
  3016. this.projectInformationModalData.projectType = val.Base_desc
  3017. }
  3018. }
  3019. if (this.tagNo === 102) {
  3020. if (this.tagNo1 === 1) {
  3021. this.projectInformationModalData.customerId = val.Customer_no
  3022. this.projectInformationModalData.customerName = val.Customer_desc
  3023. }
  3024. }
  3025. if (this.tagNo === 1011) {
  3026. if (this.tagNo1 === 1) {
  3027. this.projectInformationModalData.projectSource = val.Base_id
  3028. this.projectInformationModalData.projectSourceDesc = val.Base_desc
  3029. }
  3030. }
  3031. if (this.tagNo === 1012) {
  3032. if (this.tagNo1 === 1) {
  3033. this.projectInformationModalData.priority = val.Base_id
  3034. this.projectInformationModalData.priorityDesc = val.Base_desc
  3035. }
  3036. }
  3037. if (this.tagNo === 120) {
  3038. this.modalData.customerGroupId1 = val.customer_group_id
  3039. this.modalData.customerGroupName1 = val.customer_group_name
  3040. } else if (this.tagNo === 121) {
  3041. this.modalData.customerGroupId2 = val.customer_group_id
  3042. this.modalData.customerGroupName2 = val.customer_group_name
  3043. }
  3044. },
  3045. /**
  3046. * 项目经理选择模态框
  3047. */
  3048. managerChooseModal() {
  3049. // 清空穿梭框的选中值
  3050. this.$nextTick(() => {
  3051. this.$refs.managerTransfer.$refs.leftPanel.checked = []
  3052. this.$refs.managerTransfer.$refs.rightPanel.checked = []
  3053. })
  3054. let inData = {
  3055. site: this.projectInformationModalData.site,
  3056. projectId: this.projectInformationModalData.projectId,
  3057. }
  3058. searchOperatorWithSite(inData).then(({data}) => {
  3059. this.operatorList = data.rows
  3060. })
  3061. this.projectManagerList = JSON.parse(JSON.stringify(this.projectInformationModalData.projectManagerList))
  3062. this.managerFlag = true
  3063. },
  3064. /**
  3065. * 项目经理选择
  3066. */
  3067. saveManagerList() {
  3068. let projectManagerName = ''
  3069. for (let i = 0; i < this.projectManagerList.length; i++) {
  3070. let select = this.operatorList.filter(item => item.operatorId === this.projectManagerList[i])
  3071. if (select.length > 0) {
  3072. projectManagerName += select[0].operatorName + ';'
  3073. }
  3074. }
  3075. this.projectInformationModalData.projectManagerName = projectManagerName
  3076. this.projectInformationModalData.projectManagerList = JSON.parse(JSON.stringify(this.projectManagerList))
  3077. this.managerFlag = false
  3078. },
  3079. /**
  3080. * 项目负责人选择模态框
  3081. */
  3082. ownerChooseModal() {
  3083. // 清空穿梭框的选中值
  3084. this.$nextTick(() => {
  3085. this.$refs.ownerTransfer.$refs.leftPanel.checked = []
  3086. this.$refs.ownerTransfer.$refs.rightPanel.checked = []
  3087. })
  3088. let inData = {
  3089. site: this.projectInformationModalData.site,
  3090. projectId: this.projectInformationModalData.projectId,
  3091. }
  3092. searchOperatorWithSite(inData).then(({data}) => {
  3093. this.operatorList = data.rows
  3094. })
  3095. this.projectOwnerList = JSON.parse(JSON.stringify(this.projectInformationModalData.projectOwnerList))
  3096. this.ownerFlag = true
  3097. },
  3098. /**
  3099. * 项目负责人选择
  3100. */
  3101. saveOwnerList() {
  3102. let projectOwnerName = ''
  3103. for (let i = 0; i < this.projectOwnerList.length; i++) {
  3104. let select = this.operatorList.filter(item => item.operatorId === this.projectOwnerList[i])
  3105. if (select.length > 0) {
  3106. projectOwnerName += select[0].operatorName + ';'
  3107. }
  3108. }
  3109. this.projectInformationModalData.projectOwnerName = projectOwnerName
  3110. this.projectInformationModalData.projectOwnerList = JSON.parse(JSON.stringify(this.projectOwnerList))
  3111. this.ownerFlag = false
  3112. },
  3113. /**
  3114. * 项目权限模态框
  3115. */
  3116. userRollModal() {
  3117. this.userRoleList = JSON.parse(JSON.stringify(this.projectInformationModalData.userRoleList))
  3118. this.userRoleFlag = true
  3119. },
  3120. changeAll(row) {
  3121. if (row.checkAll) {
  3122. row.searchCheck = true
  3123. row.updateCheck = true
  3124. row.downCheck = true
  3125. row.deleteCheck = true
  3126. row.searchFlag = 'Y'
  3127. row.updateFlag = 'Y'
  3128. row.downFlag = 'Y'
  3129. row.deleteFlag = 'Y'
  3130. } else {
  3131. row.searchCheck = false
  3132. row.updateCheck = false
  3133. row.downCheck = false
  3134. row.deleteCheck = false
  3135. row.searchFlag = 'N'
  3136. row.updateFlag = 'N'
  3137. row.downFlag = 'N'
  3138. row.deleteFlag = 'N'
  3139. }
  3140. },
  3141. changeCheck(row, type) {
  3142. if (type === 1) {
  3143. if (row.searchCheck) {
  3144. row.searchFlag = 'Y'
  3145. } else {
  3146. row.searchFlag = 'N'
  3147. }
  3148. }
  3149. if (type === 2) {
  3150. if (row.updateCheck) {
  3151. row.updateFlag = 'Y'
  3152. } else {
  3153. row.updateFlag = 'N'
  3154. }
  3155. }
  3156. if (type === 3) {
  3157. if (row.downCheck) {
  3158. row.downFlag = 'Y'
  3159. } else {
  3160. row.downFlag = 'N'
  3161. }
  3162. }
  3163. if (type === 4) {
  3164. if (row.deleteCheck) {
  3165. row.deleteFlag = 'Y'
  3166. } else {
  3167. row.deleteFlag = 'N'
  3168. }
  3169. }
  3170. if (row.searchCheck && row.updateCheck && row.downCheck && row.deleteCheck) {
  3171. row.checkAll = true
  3172. } else {
  3173. row.checkAll = false
  3174. }
  3175. this.$forceUpdate();
  3176. },
  3177. saveUserList() {
  3178. let name = ''
  3179. for (let i = 0; i < this.userRoleList.length; i++) {
  3180. if (this.userRoleList[i].searchCheck || this.userRoleList[i].updateCheck || this.userRoleList[i].downCheck || this.userRoleList[i].deleteCheck) {
  3181. name += this.userRoleList[i].userDisplay + ';'
  3182. }
  3183. }
  3184. this.projectInformationModalData.userRoleName = name
  3185. this.projectInformationModalData.userRoleList = JSON.parse(JSON.stringify(this.userRoleList))
  3186. this.userRoleFlag = false
  3187. },
  3188. // ======== 导出相关方法 ========
  3189. /**
  3190. * 导出excel
  3191. */
  3192. async createExportData() {
  3193. this.searchData.limit = -1
  3194. this.searchData.page = 1
  3195. await customerInformationSearch(this.searchData).then(({data}) => {
  3196. this.resultList = data.page.list
  3197. })
  3198. return this.resultList
  3199. },
  3200. startDownload() {
  3201. this.exportLoading = true
  3202. },
  3203. finishDownload() {
  3204. this.exportLoading = false
  3205. },
  3206. fields() {
  3207. let json = '{'
  3208. this.columnList.forEach((item, index) => {
  3209. if (index == this.columnList.length - 1) {
  3210. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  3211. } else {
  3212. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  3213. }
  3214. })
  3215. json += '}'
  3216. let s = eval('(' + json + ')')
  3217. return s
  3218. },
  3219. clickProjectId(projectId) {
  3220. if (this.$router.resolve('project-projectInfo/projectInfo').resolved.name === '404') {
  3221. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  3222. } else {
  3223. this.$router.push({name: "project-projectInfo/projectInfo", params: {projectId: projectId},})
  3224. }
  3225. },
  3226. rowStyle({row}) {
  3227. if (this.customerCurrentRow.customerNo === row.customerNo && this.customerCurrentRow.site === row.site) {
  3228. return {'background-color': '#E8F7F6', cursor: 'pointer'};
  3229. }
  3230. },
  3231. }
  3232. }
  3233. </script>
  3234. <style scoped lang="scss">
  3235. /deep/ .customer-tab .el-tabs__content {
  3236. padding: 0px !important;
  3237. }
  3238. .el-transfer-panel {
  3239. border: 2px solid #17b3a3;
  3240. border-radius: 4px;
  3241. overflow: hidden;
  3242. background: #fff;
  3243. display: inline-block;
  3244. vertical-align: middle;
  3245. width: 200px;
  3246. max-height: 100%;
  3247. -webkit-box-sizing: border-box;
  3248. box-sizing: border-box;
  3249. position: relative;
  3250. }
  3251. .el-transfer-panel .el-transfer-panel__header {
  3252. height: 40px;
  3253. line-height: 40px;
  3254. background: #17b3a3;
  3255. margin: 0;
  3256. padding-left: 15px;
  3257. border-bottom: 1px solid #17b3a3;
  3258. -webkit-box-sizing: border-box;
  3259. box-sizing: border-box;
  3260. color: #000;
  3261. }
  3262. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  3263. font-size: 14px;
  3264. color: #303133;
  3265. font-weight: 400;
  3266. }
  3267. .numInput /deep/ .el-input__inner {
  3268. text-align: right;
  3269. }
  3270. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  3271. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  3272. -webkit-appearance: none;
  3273. }
  3274. /deep/ .inlineNumber input[type="number"] {
  3275. -moz-appearance: textfield;
  3276. padding-right: 5px !important;
  3277. }
  3278. </style>