index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div>
  3. <basicLayout
  4. ref="list"
  5. formPath="salerPrivatecustomer"
  6. tableName="salerPrivatecustomerTable"
  7. idName="sa_customersid"
  8. :apiId="{query:20221012164402,del:''}"
  9. :autoQuery="false"
  10. :detailPath="{path:'/customerDetail',param:{tabIndex:tabIndex}}"
  11. @listCreate="list">
  12. <template #custom>
  13. <div class="mt-10">
  14. <label class="search__label">范围:</label>
  15. <el-select class="inline-16" v-model="value" size="small" placeholder="请选择数据分类" @change="selectChange" >
  16. <el-option
  17. v-for="item in editableTabs"
  18. :key="item.index"
  19. :label="item.title"
  20. :value="item.name">
  21. </el-option>
  22. </el-select>
  23. </div>
  24. <div class="mt-10">
  25. <label class="search__label">客户类型:</label>
  26. <el-select class="inline-16" v-model="selectParam.type" size="small" placeholder="请选择" @change="selectChange" clearable>
  27. <el-option
  28. v-for="item in option.typeData"
  29. :key="item.value"
  30. :label="item.value"
  31. :value="item.value">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="mt-10">
  36. <label class="search__label">客户分类:</label>
  37. <el-select class="inline-16" v-model="selectParam.customergrade" size="small" placeholder="请选择" @change="selectChange" clearable>
  38. <el-option
  39. v-for="item in option.customerClassification"
  40. :key="item.value"
  41. :label="item.value"
  42. :value="item.value">
  43. </el-option>
  44. </el-select>
  45. </div>
  46. <div class="mt-10">
  47. <label class="search__label">客户等级:</label>
  48. <el-select class="inline-16" v-model="selectParam.grade" size="small" placeholder="请选择" @change="selectChange" clearable>
  49. <el-option
  50. v-for="item in option.customerGrade"
  51. :key="item.value"
  52. :label="item.value"
  53. :value="item.value">
  54. </el-option>
  55. </el-select>
  56. </div>
  57. <div class="mt-10">
  58. <label class="search__label">所属行业:</label>
  59. <el-select class="inline-16" v-model="selectParam.industry" size="small" placeholder="请选择" @change="selectChange" clearable>
  60. <el-option
  61. v-for="item in option.industryData"
  62. :key="item.value"
  63. :label="item.value"
  64. :value="item.value">
  65. </el-option>
  66. </el-select>
  67. </div>
  68. <div class="mt-10">
  69. <label class="search__label">合作状态:</label>
  70. <el-select class="inline-16" v-model="selectParam.status" size="small" placeholder="请选择" @change="selectChange" clearable>
  71. <el-option
  72. v-for="item in option.status"
  73. :key="item.value"
  74. :label="item.value"
  75. :value="item.value">
  76. </el-option>
  77. </el-select>
  78. </div>
  79. <div class="mt-10">
  80. <label class="search__label">成交状态:</label>
  81. <el-select class="inline-16" v-model="selectParam.tradingstatus" size="small" placeholder="请选择" @change="selectChange" clearable>
  82. <el-option
  83. v-for="item in option.tradingstatus"
  84. :key="item.value"
  85. :label="item.value"
  86. :value="item.value">
  87. </el-option>
  88. </el-select>
  89. </div>
  90. <div class="mt-10">
  91. <label class="search__label" >创建时间:</label>
  92. <el-date-picker
  93. style="margin-right: 24px !important;"
  94. size="small"
  95. @change="selectChange"
  96. value-format="yyyy-MM-dd"
  97. v-model="dateSelect"
  98. type="daterange"
  99. range-separator="至"
  100. start-placeholder="开始日期"
  101. end-placeholder="结束日期"
  102. clearable>
  103. </el-date-picker>
  104. </div>
  105. </template>
  106. <template v-slot:tbList="scope">
  107. <div v-if="scope.data.column.columnname === 'isleader'">
  108. <span v-if="scope.data.column.data['leader'].length !== 0">已分配</span>
  109. <span v-else>未分配</span>
  110. </div>
  111. <div v-else-if="scope.data.column.columnname === 'tag'">
  112. <div v-for="item in scope.data.column.data.tag_sys" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
  113. <el-tag color="#FA8C16" size="mini" type="warning" effect="dark">
  114. <span>{{item}}</span>
  115. </el-tag>
  116. </div>
  117. <div v-for="item in scope.data.column.data.tag" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
  118. <el-tag color="#FAAB16" size="mini" type="warning" effect="dark">
  119. <span>{{item}}</span>
  120. </el-tag>
  121. </div>
  122. </div>
  123. <div v-else-if="scope.data.column.columnname === 'industry'">
  124. <span v-if="JSON.stringify(scope.data.column.data.industry) !== '[]' && scope.data.column.data.industry">
  125. <div v-for="item in scope.data.column.data.industry" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
  126. <el-tag size="mini" effect="dark">
  127. <span>{{item}}</span>
  128. </el-tag>
  129. </div>
  130. </span>
  131. <div v-else>
  132. {{'--'}}
  133. </div>
  134. </div>
  135. <div v-else-if="scope.data.column.columnname === 'tradingstatus'">
  136. <span style="color:#3874f6" v-if="scope.data.column.data[[scope.data.column.columnname]] == '未成交'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
  137. <span style="color:#fa8c16" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '已成交'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
  138. <span style="color:#333333" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '多次成交'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
  139. </div>
  140. <div v-else-if="scope.data.column.columnname === 'status'">
  141. <span style="color:#3874f6" v-if="scope.data.column.data[[scope.data.column.columnname]] == '潜在'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
  142. <span style="color:#52c41a" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '合作中'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
  143. <span style="color:#999999" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '已终止'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
  144. </div>
  145. <div v-else-if="scope.data.column.columnname === 'contact'">
  146. <span>{{scope.data.column.data['leader'][0]?scope.data.column.data['leader'][0].name:'--'}}</span>
  147. </div>
  148. <div v-else>
  149. {{scope.data.column.data[[scope.data.column.columnname]]?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
  150. </div>
  151. </template>
  152. </basicLayout>
  153. </div>
  154. </template>
  155. <script>
  156. export default {
  157. name: "index",
  158. data() {
  159. return {
  160. value:'1',
  161. editableTabsValue: "我负责的",
  162. editableTabs: [
  163. {
  164. title: '我负责的',
  165. name: "1",
  166. },
  167. {
  168. title: '我参与的',
  169. name: "2",
  170. },
  171. {
  172. title: '我创建的',
  173. name: "5",
  174. },
  175. {
  176. title: '我下属负责的',
  177. name: "3",
  178. },
  179. {
  180. title: '我下属参与的',
  181. name: "4",
  182. }
  183. ],
  184. tabIndex:"1",
  185. options:[],
  186. listData:[],
  187. option:{
  188. typeData:[],
  189. customerClassification:[],
  190. customerGrade:[],
  191. industryData:[],
  192. status:[
  193. {
  194. value:'潜在'
  195. },
  196. {
  197. value:'合作中'
  198. },
  199. {
  200. value:'已终止'
  201. }
  202. ],
  203. tradingstatus:[
  204. {
  205. value:'未成交'
  206. },
  207. {
  208. value:'已成交'
  209. },
  210. {
  211. value:'多次成交'
  212. }
  213. ]
  214. },
  215. selectParam: {
  216. status:'',
  217. type:'',
  218. grade:'',
  219. customergrade:'',
  220. industry:'',
  221. startdate:'',
  222. enddate:'',
  223. tradingstatus:'',
  224. },
  225. dateSelect:''
  226. }
  227. },
  228. mounted() {
  229. this.queryData('1')
  230. this.typeList()
  231. this.gradeList()
  232. this.queryCustomerGrade()
  233. this.industryList()
  234. },
  235. methods:{
  236. list (param) {
  237. param.content.isend = 0
  238. param.content.type = 0
  239. param.content.isExport = 0
  240. },
  241. queryData(id){
  242. this.$refs['list'].param.content.type = id
  243. this.$refs['list'].param.content.isExport = false
  244. this.$refs.list.param.content.deleted = 0
  245. this.$refs.list.param.content.isend = 0
  246. this.$refs['list'].listData()
  247. // this.$store.dispatch('sendDataToForm',)
  248. },
  249. handleCommand(command){
  250. this.tabIndex = command.name
  251. this.editableTabsValue = command.title
  252. this.selectChange()
  253. /*this.$refs['list'].param.content.type = command.name
  254. this.$refs['list'].param.content.isExport = 0
  255. this.$refs['list'].listData()*/
  256. // this.$store.dispatch('sendDataToForm',)
  257. },
  258. /*客户类型列表*/
  259. async typeList(){
  260. const res = await this.$api.requested({
  261. "classname": "sysmanage.develop.optiontype.optiontype",
  262. "method": "optiontypeselect",
  263. "content": {
  264. "pageNumber": 1,
  265. "pageSize": 20,
  266. "typename": "customertypemx",
  267. "parameter": {
  268. "siteid": "YOSTEST2"
  269. }
  270. }
  271. })
  272. this.option.typeData = res.data
  273. console.log("客户类型",res.data)
  274. console.log(this.option.typeData)
  275. },
  276. /*客户分类*/
  277. async gradeList(){
  278. const res = await this.$api.requested({
  279. "classname": "sysmanage.develop.optiontype.optiontype",
  280. "method": "optiontypeselect",
  281. "content": {
  282. "pageNumber": 1,
  283. "pageSize": 20,
  284. "typename": "customergrade",
  285. "parameter": {
  286. "siteid": "YOSTEST2"
  287. }
  288. }
  289. })
  290. console.log("客户等级",res.data)
  291. /*for (var i=0;i<res.data.length; i++){
  292. if (res.data[i].remarks !== ''){
  293. this.options.gradeData[i] = res.data[i].value + "——" + res.data[i].remarks
  294. }else{
  295. this.options.gradeData[i] = res.data[i].value
  296. }
  297. }*/
  298. this.option.customerClassification = res.data
  299. console.log("处理后客户等级",this.options.customerClassification)
  300. },
  301. /*客户等级*/
  302. queryCustomerGrade(){
  303. this.$store.dispatch('optiontypeselect','agentgrade').then(res=>{
  304. this.option.customerGrade = res.data
  305. })
  306. },
  307. /*行业列表*/
  308. async industryList(){
  309. const res = await this.$api.requested({
  310. "classname": "sysmanage.develop.optiontype.optiontype",
  311. "method": "optiontypeselect",
  312. "content": {
  313. "pageNumber": 1,
  314. "pageSize": 20,
  315. "typename": "industry",
  316. "parameter": {
  317. "siteid": "YOSTEST2"
  318. }
  319. }
  320. })
  321. this.option.industryData = res.data
  322. },
  323. selectChange(){
  324. this.tabIndex = this.value
  325. if (this.dateSelect !== '' && this.dateSelect !== null){
  326. this.selectParam.startdate = this.dateSelect[0]
  327. this.selectParam.enddate = this.dateSelect[1]
  328. }else {
  329. this.selectParam.startdate = ''
  330. this.selectParam.enddate = ''
  331. }
  332. this.$refs.list.param.content.type = this.tabIndex
  333. this.$refs.list.param.content.where = Object.assign({},this.$refs.list.param.content.where,this.selectParam)
  334. this.$refs.list.param.content.phonenumber = 1
  335. this.$refs['list'].listData()
  336. },
  337. async queryUserInfo() {
  338. let res = await this.$api.requested({
  339. "classname": "common.usercenter.usercenter",
  340. "method": "queryUserMsg",
  341. "content": {
  342. }
  343. })
  344. console.log(res.data);
  345. this.userInfo = {
  346. isAuth : res.data.hr.isleader,
  347. userid: res.data.hr.userid
  348. }
  349. console.log(this.userInfo,'user')
  350. window.sessionStorage.setItem('userInfo',JSON.stringify(this.userInfo))
  351. console.log(JSON.parse(window.sessionStorage.getItem('userInfo')));
  352. },
  353. },
  354. created() {
  355. this.queryUserInfo()
  356. },
  357. }
  358. </script>
  359. <style scoped>
  360. .el-dropdown-link {
  361. cursor: pointer;
  362. color: #151515;
  363. font-size: 16px;
  364. }
  365. .el-divider--vertical{
  366. margin: 0 16px;
  367. }
  368. .el-icon-arrow-down {
  369. font-size: 16px;
  370. }
  371. .s_panel {
  372. margin-bottom:10px
  373. }
  374. </style>