pageFour.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  1. <template>
  2. <view class="page-container">
  3. <!-- 入库信息卡片 -->
  4. <view class="card_wrap">
  5. <u--form labelPosition="top" :model="warehouseInfo" ref="form" class="address-section">
  6. <view class="address-header">
  7. <u-icon name="car-fill" size="36rpx" color="#108cff" class="location-icon"></u-icon>
  8. <text class="address-title">入库信息</text>
  9. </view>
  10. <!-- 编码和快递单号同一行 -->
  11. <u-row class="info-row" justify="space-between">
  12. <u-col span="4.5">
  13. <u-form-item label="编码" prop="codeStorage">
  14. <u--input v-model="warehouseInfo.codeStorage" placeholder="请输入编码" class="info-input" />
  15. </u-form-item>
  16. </u-col>
  17. <u-col span="4.5">
  18. <u-form-item label="快递单号" prop="expressOrderNo">
  19. <u--input v-model="warehouseInfo.expressOrderNo" placeholder="请输入快递单号" class="info-input" />
  20. </u-form-item>
  21. </u-col>
  22. <u-col span="2">
  23. <u-form-item label="物流图片" prop="uploadedImage">
  24. <view class="image-uploader" @click="selectImage">
  25. <u-icon v-if="!warehouseInfo.uploadedImage" name="camera-fill" size="48rpx"
  26. color="#909399" class="camera-icon"></u-icon>
  27. <image v-else :src="warehouseInfo.uploadedImage" mode="aspectFill"
  28. class="image-preview">
  29. </image>
  30. </view>
  31. </u-form-item>
  32. </u-col>
  33. </u-row>
  34. <!-- 单独一行的收单物品 -->
  35. <u-row class="info-row">
  36. <u-col span="12">
  37. <u-form-item label="收单物品" prop="item">
  38. <u--input v-model="warehouseInfo.item" placeholder="请输入收单物品" class="info-input" />
  39. </u-form-item>
  40. </u-col>
  41. </u-row>
  42. <!-- 查码费和表款同一行 -->
  43. <u-row class="info-row" justify="space-between">
  44. <u-col span="5.8">
  45. <u-form-item label="查码费">
  46. <u--input v-model="warehouseInfo.checkCodeFee" placeholder="请输入查码费" class="info-input"
  47. type="number" />
  48. </u-form-item>
  49. </u-col>
  50. <u-col span="5.8">
  51. <u-form-item label="表款">
  52. <u--input v-model="warehouseInfo.watchPrice" placeholder="请输入表款" class="info-input"
  53. type="number" />
  54. </u-form-item>
  55. </u-col>
  56. </u-row>
  57. <u-row class="info-row" justify="space-between">
  58. <u-col span="5.8">
  59. <u-form-item label="好处费">
  60. <u--input v-model="warehouseInfo.benefitFee" placeholder="请输入好处费" class="info-input"
  61. type="number" />
  62. </u-form-item>
  63. </u-col>
  64. <u-col span="5.8">
  65. <u-form-item label="运费">
  66. <u--input v-model="warehouseInfo.freight" placeholder="请输入运费" class="info-input"
  67. type="number" />
  68. </u-form-item>
  69. </u-col>
  70. </u-row>
  71. <!-- 维修金额和毛业绩同一行 -->
  72. <u-row class="info-row" justify="space-between">
  73. <u-col span="5.8">
  74. <u-form-item label="维修金额">
  75. <u--input v-model="warehouseInfo.repairAmount" placeholder="请输入维修金额" class="info-input"
  76. type="number" />
  77. </u-form-item>
  78. </u-col>
  79. <u-col span="5.8">
  80. <u-form-item label="毛业绩">
  81. <u--input v-model="warehouseInfo.grossPerformance" placeholder="请输入毛业绩" class="info-input"
  82. type="number" />
  83. </u-form-item>
  84. </u-col>
  85. </u-row>
  86. <!-- 收单备注 -->
  87. <u-row class="info-row">
  88. <u-col span="12">
  89. <u-form-item label="收单备注">
  90. <u--textarea v-model="warehouseInfo.remarks" placeholder="请输入收单备注" class="info-input"
  91. confirmType="done" rows="4" />
  92. </u-form-item>
  93. </u-col>
  94. </u-row>
  95. </u--form>
  96. </view>
  97. <!-- 新添加的卡片 -->
  98. <view class="card_wrap">
  99. <view class="address-section">
  100. <view class="address-header">
  101. <u-icon name="list" size="36rpx" color="#108cff" class="location-icon"></u-icon>
  102. <text class="address-title">分成信息</text>
  103. <u-button type="primary" plain shape="circle" size="mini" class="add-button" @click="addSplit">
  104. <u-icon name="plus" size="24rpx" color="#108cff"></u-icon>
  105. <text>添加</text>
  106. </u-button>
  107. </view>
  108. <!-- 分成信息表格 -->
  109. <view class="split-table">
  110. <u-row class="split-table-header">
  111. <u-col span="4">
  112. <text class="header-text">关联</text>
  113. </u-col>
  114. <u-col span="2">
  115. <text class="header-text">分成人</text>
  116. </u-col>
  117. <u-col span="2">
  118. <text class="header-text">比例</text>
  119. </u-col>
  120. <u-col span="1">
  121. <text class="header-text">类型</text>
  122. </u-col>
  123. <u-col span="1">
  124. <text class="header-text">公司</text>
  125. </u-col>
  126. <u-col span="2" class="action-column">
  127. <text class="header-text">操作</text>
  128. </u-col>
  129. </u-row>
  130. <u-row v-for="(item, index) in profitSharingList" :key="item.uuid" class="split-table-row">
  131. <u-col span="4">
  132. <view class="table-cell">
  133. <!-- <select v-model="item.deptId" class="custom-select">
  134. <option v-for="option in associationOptions" :key="option.id" :value="option.id">
  135. {{ option.label }}
  136. </option>
  137. </select> -->
  138. <u-button @click='handleSelectOrg(item)' :text="item.orgName" plain></u-button>
  139. </view>
  140. </u-col>
  141. <u-col span="2">
  142. <view class="table-cell">
  143. <!-- <select v-model="item.userId" class="custom-select">
  144. <option value="">无</option>
  145. <option v-for="person in item.personOptions" :key="person.id" :value="person.id">
  146. {{ person.label }}
  147. </option>
  148. </select> -->
  149. <u-button @click="handleSelectPerson(item)" :text="item.userName" plain></u-button>
  150. </view>
  151. </u-col>
  152. <u-col span="2">
  153. <view class="table-cell">
  154. <u--input v-model="item.commissionRate" type="number" class="percentage-input"
  155. @input="handlePercentageInput(item)" min="0" max="100" precision="0" />
  156. </view>
  157. </u-col>
  158. <u-col span="1">
  159. <view class="table-cell">
  160. <view :class="['account-type', item.accountType == '1' ? 'frontend' : 'backend']"
  161. @click="toggleAccountType(item)" style="cursor: pointer;">
  162. {{ item.accountType == '1' ? '前' : '后' }}
  163. </view>
  164. </view>
  165. </u-col>
  166. <u-col span="1">
  167. <view class="table-cell">
  168. <view class="radio-wrapper" @click="toggleBelongToCompany(item)">
  169. <view :class="['radio-circle', item.isCompanyPerformance == '1' ? 'active' : '']">
  170. <u-icon v-if="item.isCompanyPerformance == '1'" name="checkmark" size="20rpx"
  171. color="#fff"></u-icon>
  172. </view>
  173. </view>
  174. </view>
  175. </u-col>
  176. <u-col span="2" class="action-column">
  177. <view class="table-cell">
  178. <u-button type="error" plain shape="circle" size="mini"
  179. @click="deleteRow(item.id, item.uuid)" class='delectBtn'>
  180. <u-icon name="trash" size="20rpx" color="#ff6b6b"></u-icon>
  181. </u-button>
  182. </view>
  183. </u-col>
  184. </u-row>
  185. </view>
  186. </view>
  187. </view>
  188. <!-- 确认入库按钮 -->
  189. <div class="confirm-button-container">
  190. <u-button type="success" @click="confirmWarehouseEntry" style="border-radius: 11px;">
  191. <u-icon name="checkmark-circle-fill" size="28rpx" color="#fff"></u-icon>
  192. <text style="margin-left: 8rpx;">确认入库</text>
  193. </u-button>
  194. </div>
  195. <!-- 组织选择 -->
  196. <u-picker :show="showOrgPicker" title="请选择组织" :columns="columnsOrgList" keyName="label"
  197. @confirm="handleOrgConfirmOrg" @cancel='showOrgPicker = false'></u-picker>
  198. <!-- 人员选择 -->
  199. <u-picker :show="showPersonPicker" title="请选择分成人" :columns="columnsPersonList" keyName="label"
  200. @confirm="handleConfirmPerson" @cancel='handleCancelPerson'></u-picker>
  201. <u-toast ref="uToast"></u-toast>
  202. </view>
  203. </template>
  204. <script>
  205. export default {
  206. props: {
  207. orderDetail: {
  208. type: Object,
  209. default: () => { },
  210. },
  211. currentReceipt: {
  212. type: Object,
  213. default: () => { },
  214. },
  215. },
  216. watch: {
  217. currentReceipt: {
  218. handler(newVal) {
  219. if (newVal) {
  220. console.log('这里是page4', newVal)
  221. // "searchValue": null,
  222. // "createBy": "12234",
  223. // "createTime": "2025-12-25 13:39:25",
  224. // "updateBy": "12234",
  225. // "updateTime": "2025-12-27 09:33:05",
  226. // "remark": null,
  227. // "params": {},
  228. // "id": "4347",
  229. // "sendFormId": "5464",
  230. // "clueId": "1973381744953516033",
  231. // "item": "测试发单-VV", //收单物品
  232. // "brand": "LV",
  233. // "needCheckCode": 1,
  234. // "code": "111",
  235. // "paymentAmount": 99.00,
  236. // "phone": "18692257000",
  237. // "tableFee": 999999.00,
  238. // "benefitFee": 666.00, //好处费
  239. // "freight": 666666.00, //运费
  240. // "checkCodeFee": 666.00, //查码费
  241. // "totalCost": null,
  242. // "sellingPrice": 125000.00,
  243. // "performance": null,
  244. // "receiptRemark": null,
  245. // "repairAmount": 666.00, //维修金额
  246. // "grossPerformance": 666.00, //毛业绩
  247. // "expressOrderNo": "666", //快递单号
  248. // "fileIds": "",
  249. // "model": "lvvvv",
  250. // "splitRatio": null,
  251. // "customerServiceName": "1",
  252. // "deptId": "373",
  253. // "category": "2",
  254. // "delFlag": null,
  255. // "idCard": "444",
  256. // "paymentMethod": null,
  257. // "bankCardNumber": "333",
  258. // "bankName": "222",
  259. // "customName": "111"
  260. const data = newVal
  261. this.warehouseInfo = {
  262. codeStorage: data.code,//编码
  263. expressOrderNo: data.expressOrderNo || '',//快递单号
  264. uploadedImage: data.receiptRemark?.split(';')[1] || '',//物流图片 截取备注第二部分
  265. item: data.item || '',//收单物品
  266. checkCodeFee: data.checkCodeFee || '',//查码费
  267. watchPrice: data.tableFee || '',//表款
  268. benefitFee: data.benefitFee || '',//好处费
  269. freight: data.freight || '',//运费
  270. repairAmount: data.repairAmount || '',//维修金额
  271. grossPerformance: data.grossPerformance || '',//毛业绩
  272. remarks: data.receiptRemark?.split(';')[0] || '',//收单备注 截取备注第一部分
  273. }
  274. this.getShareList()
  275. }
  276. },
  277. }
  278. },
  279. data() {
  280. return {
  281. // 入库信息相关的数据
  282. warehouseInfo: {
  283. codeStorage: '',//编码
  284. expressOrderNo: '',//快递单号
  285. uploadedImage: '',//物流图片
  286. item: '',//收单物品
  287. checkCodeFee: '',//查码费
  288. watchPrice: '',//表款
  289. benefitFee: '',//好处费
  290. freight: '',//运费
  291. repairAmount: '',//维修金额
  292. grossPerformance: '',//毛业绩
  293. remarks: '',//收单备注
  294. },
  295. // 分成信息相关的数据
  296. profitSharingList: [
  297. ],
  298. // 关联选项列表
  299. // associationOptions: [],
  300. // 分成人选项列表
  301. // personOptions: [],
  302. // 表单验证规则
  303. showOrgPicker: false,
  304. showPersonPicker: false,
  305. columnsOrgList: [],
  306. //传入的分成人名单
  307. columnsPersonList: [],
  308. };
  309. },
  310. mounted() {
  311. // 获取分成人名单
  312. this.$nextTick(() => {
  313. this.getCommissionUserList();
  314. })
  315. },
  316. methods: {
  317. // 选择物流图片
  318. selectImage() {
  319. uni.chooseImage({
  320. count: 1,
  321. sizeType: ['compressed'],
  322. sourceType: ['album', 'camera'],
  323. success: async (res) => {
  324. const tempFilePath = res.tempFilePaths[0];
  325. //把选择的图片上传给服务器,然后获取返回路径
  326. const rep = await uni.$u.api.uploadFile(tempFilePath)
  327. if (rep.code == 200) {
  328. console.log('上传成功=====>', rep.data.url)
  329. this.warehouseInfo.uploadedImage = rep.data.url
  330. }
  331. }
  332. });
  333. },
  334. // 添加分成行
  335. addSplit() {
  336. // 添加新行
  337. this.profitSharingList.push({
  338. deptId: '',
  339. accountType: '1',
  340. userId: '',
  341. commissionRate: 0,
  342. isCompanyPerformance: '2',
  343. orgName: '',
  344. userName: '',
  345. id: '',
  346. uuid: Math.random()//唯一标识,仅vfor使用
  347. });
  348. //重新计算全部行的分成比例
  349. this.calculateTotalPercentage();
  350. },
  351. // 重新计算全部行的分成比例
  352. calculateTotalPercentage() {
  353. //获取选择前端的行的数量
  354. const frontItems = this.profitSharingList.filter(item => item.accountType == '1');
  355. const backItems = this.profitSharingList.filter(item => item.accountType == '2');
  356. const totalFrontItems = frontItems.length;
  357. const totalBackItems = backItems.length;
  358. console.log('选择前端的行的数量====>', totalFrontItems)
  359. console.log('选择后端的行的数量====>', totalBackItems)
  360. //把profitSharingList中的前端行的分成比例按照 100/数量 重新计算
  361. this.profitSharingList.map(item => {
  362. if (item.accountType == '1') {
  363. item.commissionRate = (100 / totalFrontItems).toFixed()
  364. }
  365. if (item.accountType == '2') {
  366. item.commissionRate = (100 / totalBackItems).toFixed()
  367. }
  368. })
  369. },
  370. // 切换账户类型
  371. toggleAccountType(item) {
  372. item.accountType = item.accountType == '1' ? '2' : '1';
  373. // 重新计算分成比例
  374. this.calculateTotalPercentage();
  375. },
  376. // 处理百分比输入
  377. handlePercentageInput(item) {
  378. // 确保输入是数字
  379. let value = Number(item.percentage);
  380. // 验证输入值是否在有效范围内(0-100)
  381. if (isNaN(value)) {
  382. item.percentage = 0;
  383. } else if (value < 0) {
  384. item.percentage = 0;
  385. } else if (value > 100) {
  386. item.percentage = 100;
  387. } else {
  388. // 确保是整数
  389. item.percentage = Math.floor(value);
  390. }
  391. },
  392. // 切换归属公司状态
  393. toggleBelongToCompany(item) {
  394. item.isCompanyPerformance = item.isCompanyPerformance == '1' ? '2' : '1';
  395. },
  396. // 确认入库方法
  397. async confirmWarehouseEntry() {
  398. console.log('确认入库', this.orderDetail.id)
  399. uni.showModal({
  400. title: '确认入库',
  401. content: `是否确认入库改订单:${this.orderDetail.item}?`,
  402. success: async (res) => {
  403. if (res.confirm) {
  404. //修改状态
  405. await uni.$u.api.oderForm({
  406. status: "3",
  407. id: this.orderDetail.id,
  408. });
  409. await uni.$u.api.updateReceiptForm({
  410. id: this.currentReceipt.id,
  411. code: this.warehouseInfo.codeStorage || '',//编码
  412. expressOrderNo: this.warehouseInfo.expressOrderNo || '',//快递单号
  413. item: this.warehouseInfo.item || '',//收单物品
  414. checkCodeFee: this.warehouseInfo.checkCodeFee || '',//查码费
  415. tableFee: this.warehouseInfo.watchPrice || '',//表款
  416. benefitFee: this.warehouseInfo.benefitFee || '',//好处费
  417. freight: this.warehouseInfo.freight || '',//运费
  418. repairAmount: this.warehouseInfo.repairAmount || '',//维修金额
  419. grossPerformance: this.warehouseInfo.grossPerformance || '',//毛业绩
  420. receiptRemark: this.warehouseInfo.remarks + ';' + this.warehouseInfo.uploadedImage || '',//收单备注
  421. });
  422. //上传物流表单数据
  423. // this.$emit('confirmInterStore', {
  424. // warehouseInfo: this.warehouseInfo,
  425. // })
  426. //保存入库信息
  427. //上传分成数据
  428. await this.addShare()
  429. this.$refs.uToast.show({
  430. type: "success",
  431. message: "入库成功",
  432. iconUrl: "https://uviewui.com/demo/toast/success.png",
  433. complete() {
  434. uni.navigateTo({
  435. url: '/pages/pagereceivecenter/pagereceivecenter',
  436. })
  437. },
  438. });
  439. } else if (res.cancel) {
  440. // 用户点击了取消,不执行任何操作
  441. uni.$u.toast('已取消入库');
  442. }
  443. }
  444. })
  445. },
  446. // 获取分成人名单
  447. async getCommissionUserList() {
  448. const commissionUserList = await uni.$u.api.getCustomerManagerAllList()
  449. console.log('分成人名单', commissionUserList.data[0].children)
  450. // this.associationOptions = commissionUserList.data[0].children
  451. this.columnsOrgList = [commissionUserList.data[0].children]
  452. },
  453. //初始化分成比例
  454. async getShareList() {
  455. console.log('当前收单信息', this.currentReceipt.id)
  456. const { rows, total } = await uni.$u.api.selectCommissionList({
  457. pageSize: 9999,
  458. pageNum: 1,
  459. }, { sendFormId: this.currentReceipt.sendFormId, });
  460. console.log('分成比例表格数据', rows)
  461. const newRows = rows.filter(item => item.receiptFormId == this.currentReceipt.id)
  462. newRows.map(item => {
  463. item.uuid = Math.random()//唯一标识
  464. })
  465. this.profitSharingList = newRows
  466. },
  467. //上传分成
  468. addShare() {
  469. this.profitSharingList.forEach(async item => {
  470. const data = {
  471. id: item.id || '',
  472. accountType: item.accountType == '1' ? 1 : 2,
  473. clueId: this.currentReceipt.clueId,
  474. commissionRate: item.commissionRate,
  475. isCompanyPerformance: item.isCompanyPerformance == '1' ? 1 : 2,
  476. sendFormId: this.currentReceipt.sendFormId,
  477. userId: item.userId,
  478. userName: item.userName,
  479. receiptFormId: this.currentReceipt.id,//关联的收单id
  480. }
  481. if (item.id) {
  482. //更新
  483. await uni.$u.api.clueCommissionUpdate(data);
  484. } else {
  485. //新增
  486. await uni.$u.api.clueCommissionAdd(data);
  487. }
  488. });
  489. },
  490. //删除分成
  491. async deleteRow(id, uuid) {
  492. console.log(id, 'id', uuid, 'uuid')
  493. // 确认删除
  494. uni.showModal({
  495. title: '确认删除',
  496. content: '是否确认删除当前行分成比例?',
  497. success: async (res) => {
  498. if (res.confirm) {
  499. //如果没有id说明是新增的,直接删除数组中的项
  500. if (!id) {
  501. this.profitSharingList = this.profitSharingList.filter(item => item.uuid != uuid)
  502. uni.$u.toast('删除成功')
  503. this.calculateTotalPercentage();
  504. return
  505. }
  506. try {
  507. await uni.$u.api.deleteClueCommissionForm(id)
  508. uni.$u.toast('删除成功')
  509. this.getShareList()
  510. } catch (error) {
  511. uni.$u.toast('删除失败,请稍后重试')
  512. }
  513. //重新计算全部行的分成比例
  514. this.calculateTotalPercentage();
  515. } else {
  516. uni.$u.toast('已取消删除')
  517. }
  518. }
  519. })
  520. },
  521. //打开选择框
  522. handleSelectOrg(item) {
  523. console.log(item.uuid, '当前选择的行的uuid')
  524. this.currentEditItem = item.uuid
  525. // this.showOrgPicker = true
  526. this.showPersonPicker = true
  527. //把当前的组织赋值给当前的组件
  528. this.columnsPersonList = this.columnsOrgList//获取到的分成人名单
  529. },
  530. //选择当前的分成人
  531. handleSelectPerson(item) {
  532. console.log(item, '当前选择的行')
  533. this.currentEditItem = item.uuid
  534. //获取当前选择组织的分成人名单
  535. // 获取当前行的关联id
  536. const deptId = item.deptId
  537. //递归查找当前选择的组织
  538. const org = this.findOrg(this.columnsOrgList[0], deptId)
  539. // const org = this.columnsOrgList[0].find(org => org.id == deptId)
  540. console.log(org, '当前选择的组织')
  541. if (org) {
  542. this.columnsPersonList = [org.children]
  543. }
  544. // 把当前选择组织的分成人名单赋值给当前行的分成人选项列表
  545. this.showPersonPicker = true
  546. },
  547. //递归查找当前选择的组织
  548. findOrg(orgList, deptId) {
  549. for (const org of orgList) {
  550. if (org.id == deptId) {
  551. return org
  552. }
  553. if (org.children && org.children.length > 0) {
  554. const found = this.findOrg(org.children, deptId)
  555. if (found) {
  556. return found
  557. }
  558. }
  559. }
  560. return null
  561. },
  562. //确认选择组织
  563. handleOrgConfirmOrg({ columnIndex, value, values },) {
  564. console.log(value, '选择的组织')
  565. //把值赋值给当前行
  566. this.profitSharingList.forEach(item => {
  567. if (item.uuid == this.currentEditItem) {
  568. item.orgName = value[0].label
  569. item.deptId = value[0].id
  570. // item.personOptions = value[0].children
  571. //将当前的行的分成人清空
  572. item.userId = ''
  573. item.userName = ''
  574. }
  575. })
  576. this.showOrgPicker = false
  577. },
  578. //确认选择人
  579. handleConfirmPerson({ columnIndex, value, values },) {
  580. console.log(value[0], '选择的人')
  581. console.log(value[0].isUser, '是否是用户')
  582. //把值赋值给当前行
  583. if (value[0].isUser) {
  584. //当前选择是用户
  585. this.profitSharingList.forEach(item => {
  586. if (item.uuid == this.currentEditItem) {
  587. item.userName = value[0].label
  588. item.userId = value[0].id
  589. }
  590. })
  591. this.columnsPersonList = []
  592. this.showPersonPicker = false
  593. } else {
  594. //当前选择是组织
  595. // 把组织的label赋值给当前的行的关联
  596. this.profitSharingList.forEach(item => {
  597. if (item.uuid == this.currentEditItem) {
  598. item.orgName = value[0].label
  599. item.deptId = value[0].id
  600. }
  601. })
  602. const childrens = value[0].children
  603. console.log('当前分公司的内部分成人', childrens)
  604. this.columnsPersonList = [childrens]
  605. }
  606. },
  607. // 取消选择人
  608. handleCancelPerson() {
  609. this.columnsPersonList = []
  610. this.showPersonPicker = false
  611. }
  612. }
  613. };
  614. </script>
  615. <style lang="scss" scoped>
  616. // 导入公共样式
  617. @import './common.scss';
  618. // 主样式
  619. .page-container {
  620. box-sizing: border-box;
  621. padding: 0;
  622. background-color: map-get($colors, bg);
  623. font-family: map-get($font, family);
  624. -webkit-font-smoothing: map-get($font, smoothing);
  625. font-smoothing: map-get($font, smoothing);
  626. }
  627. .address-section {
  628. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  629. .u-col {
  630. padding: 0;
  631. box-sizing: border-box;
  632. }
  633. .u-col:first-child {
  634. padding-right: 15rpx;
  635. }
  636. .u-col:last-child {
  637. padding-left: 15rpx;
  638. }
  639. }
  640. // 表单行样式
  641. .info-row {
  642. margin-bottom: 20rpx;
  643. box-sizing: border-box;
  644. padding: 0;
  645. }
  646. // 表单标签样式
  647. .info-label {
  648. @include font-styles($size: tiny, $weight: regular, $color: tertiary);
  649. margin-bottom: 8rpx;
  650. display: block;
  651. }
  652. // 输入框样式
  653. .info-input {
  654. height: 65rpx;
  655. border-radius: 8rpx;
  656. border: 1rpx solid #e5e7eb;
  657. padding: 20rpx 16rpx;
  658. width: 100%;
  659. box-sizing: border-box;
  660. @include font-styles($size: small, $weight: regular, $color: secondary);
  661. // textarea特殊样式
  662. &[type="textarea"] {
  663. min-height: 160rpx;
  664. resize: vertical;
  665. padding-top: 20rpx;
  666. padding-bottom: 20rpx;
  667. }
  668. }
  669. // 防止表单label换行
  670. ::v-deep .u-form-item__body__left__content__label {
  671. white-space: nowrap;
  672. }
  673. // 图片上传样式
  674. .image-uploader {
  675. width: 100%;
  676. height: 65rpx;
  677. border: 2rpx dashed #409eff;
  678. border-radius: 8rpx;
  679. display: flex;
  680. align-items: center;
  681. justify-content: center;
  682. cursor: pointer;
  683. background-color: #ecf5ff;
  684. box-sizing: border-box;
  685. overflow: hidden;
  686. transition: all 0.3s ease;
  687. &:hover {
  688. border-color: #66b1ff;
  689. background-color: #f0f9ff;
  690. transform: scale(1.02);
  691. }
  692. }
  693. .camera-icon {
  694. margin: 0;
  695. font-size: 32rpx;
  696. color: #409eff;
  697. transition: all 0.3s ease;
  698. }
  699. .image-uploader:hover .camera-icon {
  700. color: #66b1ff;
  701. transform: scale(1.1);
  702. }
  703. .image-preview {
  704. width: 100%;
  705. height: 100%;
  706. object-fit: cover;
  707. border-radius: 10rpx;
  708. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  709. transition: all 0.3s ease;
  710. }
  711. .image-uploader:hover .image-preview {
  712. transform: scale(1.02);
  713. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
  714. }
  715. .hidden-input {
  716. display: none;
  717. }
  718. // 分成信息卡片样式
  719. .address-header {
  720. display: flex;
  721. align-items: center;
  722. justify-content: space-between;
  723. margin-bottom: 20rpx;
  724. .address-title {
  725. @include font-styles($size: small, $weight: medium, $color: primary);
  726. margin-left: 10rpx;
  727. }
  728. }
  729. .split-content {
  730. padding: 10rpx 0;
  731. }
  732. .split-item {
  733. display: flex;
  734. justify-content: space-between;
  735. align-items: center;
  736. padding: 15rpx 0;
  737. border-bottom: 1rpx solid map-get($colors, border);
  738. &:last-child {
  739. border-bottom: none;
  740. }
  741. }
  742. .split-label {
  743. @include font-styles($size: tiny, $weight: regular, $color: tertiary);
  744. }
  745. .split-value {
  746. @include font-styles($size: small, $weight: regular, $color: secondary);
  747. }
  748. .add-button {
  749. padding: 0;
  750. width: 50rpx;
  751. height: 50rpx;
  752. display: flex;
  753. align-items: center;
  754. justify-content: center;
  755. }
  756. /* 分成信息表格样式 */
  757. .split-table {
  758. width: 100%;
  759. margin-top: 20rpx;
  760. background-color: #fff;
  761. border-radius: 8rpx;
  762. overflow: hidden;
  763. }
  764. .split-table-header {
  765. background-color: #f5f7fa;
  766. padding: 15rpx 0;
  767. border-bottom: 1rpx solid #e4e7ed;
  768. }
  769. .split-table-row {
  770. padding: 15rpx 0;
  771. border-bottom: 1rpx solid #e4e7ed;
  772. align-items: center;
  773. &:last-child {
  774. border-bottom: none;
  775. }
  776. }
  777. .header-text {
  778. @include font-styles($size: tiny, $weight: regular, $color: tertiary);
  779. text-align: center;
  780. display: block;
  781. }
  782. .table-cell {
  783. display: flex;
  784. align-items: center;
  785. justify-content: center;
  786. padding: 0 10rpx;
  787. box-sizing: border-box;
  788. }
  789. .action-column {
  790. display: flex;
  791. align-items: center;
  792. justify-content: center;
  793. }
  794. /* 自定义下拉框样式 - 隐藏原生箭头 */
  795. .custom-select {
  796. width: 100%;
  797. height: 50rpx;
  798. border-radius: 0;
  799. border: 1rpx solid #e5e7eb;
  800. text-align: center;
  801. /* 增加右侧内边距,为自定义箭头留出空间 */
  802. @include font-styles($size: tiny, $weight: regular, $color: secondary);
  803. background-color: #fff;
  804. /* 确保隐藏所有浏览器的原生箭头 */
  805. appearance: none !important;
  806. -webkit-appearance: none !important;
  807. -moz-appearance: none !important;
  808. -o-appearance: none !important;
  809. cursor: pointer;
  810. /* 使用自定义SVG箭头 */
  811. background-repeat: no-repeat;
  812. background-position: right 8rpx center;
  813. background-size: 12rpx 12rpx;
  814. box-sizing: border-box;
  815. position: relative;
  816. /* 防止箭头在焦点状态下显示 */
  817. &:focus {
  818. outline: none;
  819. border-color: #409eff;
  820. box-shadow: 0 0 0 2rpx rgba(64, 158, 255, 0.2);
  821. }
  822. /* 针对IE/Edge浏览器的特殊处理 */
  823. &::-ms-expand {
  824. display: none !important;
  825. }
  826. /* 针对某些旧版浏览器的额外处理 */
  827. &::-webkit-select-arrow {
  828. display: none !important;
  829. }
  830. /* 添加伪元素覆盖可能残留的箭头 */
  831. &::after {
  832. content: '';
  833. position: absolute;
  834. right: 8rpx;
  835. top: 50%;
  836. transform: translateY(-50%);
  837. width: 12rpx;
  838. height: 12rpx;
  839. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23909399' d='M6 8l-4-4h8z'/%3E%3C/svg%3E");
  840. background-repeat: no-repeat;
  841. background-size: 100% 100%;
  842. pointer-events: none;
  843. z-index: 1;
  844. }
  845. }
  846. /* 百分比输入框样式 */
  847. .percentage-input {
  848. text-align: center;
  849. background-color: #f9f9f9;
  850. color: #606266;
  851. text-align: center;
  852. padding: 0rpx !important;
  853. }
  854. /* 账户类型标签样式 */
  855. .account-type {
  856. padding: 4rpx 16rpx;
  857. border-radius: 12rpx;
  858. font-size: 24rpx;
  859. font-weight: 500;
  860. color: #fff;
  861. text-align: center;
  862. }
  863. .account-type.frontend {
  864. background-color: #409eff;
  865. }
  866. .account-type.backend {
  867. background-color: #909399;
  868. }
  869. /* 调整表格布局,使其更紧凑 */
  870. .split-table {
  871. width: 100%;
  872. margin-top: 10rpx;
  873. }
  874. .split-table-header,
  875. .split-table-row {
  876. padding: 10rpx 0;
  877. }
  878. .table-cell {
  879. padding: 0 5rpx;
  880. }
  881. /* 归属公司单选框样式 */
  882. .radio-wrapper {
  883. cursor: pointer;
  884. display: flex;
  885. align-items: center;
  886. justify-content: center;
  887. }
  888. .radio-circle {
  889. width: 32rpx;
  890. height: 32rpx;
  891. border-radius: 50%;
  892. border: 2rpx solid #dcdfe6;
  893. display: flex;
  894. align-items: center;
  895. justify-content: center;
  896. transition: all 0.3s ease;
  897. }
  898. .radio-circle.active {
  899. border-color: #67c23a;
  900. background-color: #67c23a;
  901. }
  902. /* 确认入库按钮样式 */
  903. .confirm-button-container {
  904. display: flex;
  905. justify-content: center;
  906. align-items: center;
  907. padding: 40rpx 0;
  908. margin-top: 20rpx;
  909. }
  910. /* 响应式布局调整 */
  911. @media screen and (max-width: 750rpx) {
  912. .split-table {
  913. overflow-x: auto;
  914. }
  915. .custom-select {
  916. width: 100%;
  917. }
  918. .account-type {
  919. padding: 2rpx 10rpx;
  920. font-size: 22rpx;
  921. }
  922. }
  923. @media screen and (min-width: 751rpx) {
  924. .table-cell {
  925. padding: 0 10rpx;
  926. }
  927. }
  928. .u-button {
  929. height: 60rpx;
  930. }
  931. .delectBtn {
  932. height: 40rpx;
  933. .u-button {
  934. width: 40rpx;
  935. }
  936. }
  937. .delectBtn ::v-deep .u-button--mini {
  938. min-width: 20rpx !important;
  939. }
  940. </style>