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.

3240 lines
114 KiB

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