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.

3234 lines
117 KiB

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