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.

3144 lines
113 KiB

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