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.

3046 lines
109 KiB

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