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.

3297 lines
108 KiB

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