detailsPage.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList(0)">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button class="el-button&#45;&#45;small-yh" style="margin-left: 6px;" type="primary" size="small"
  11. v-if="!editButton" @click="confirmEditing">编 辑
  12. </el-button>
  13. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
  14. @click="editCustomer">保 存
  15. </el-button>
  16. <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
  17. :disabled="isDisabledTask" @click="generateOutbound">
  18. {{ buttonText }}
  19. </el-button>
  20. <el-dropdown style="padding: 0 6px;line-height: 0">
  21. <el-button type="danger" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
  22. 售 后<i class="el-icon-arrow-down el-icon--right"></i>
  23. </el-button>
  24. <el-dropdown-menu slot="dropdown">
  25. <el-dropdown-item @click.native="applySettlement('申请')" :disabled="isApplySettlement">申请退款
  26. </el-dropdown-item>
  27. <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
  28. </el-dropdown-item>
  29. <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest">撤销请核
  30. </el-dropdown-item>
  31. </el-dropdown-menu>
  32. </el-dropdown>
  33. <el-dropdown style="line-height: 0">
  34. <el-button type="warning" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
  35. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  36. </el-button>
  37. <el-dropdown-menu slot="dropdown">
  38. <el-dropdown-item @click.native="examineBtn('审批')" :disabled="isExamineBtn">审批
  39. </el-dropdown-item>
  40. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">请核进度
  41. </el-dropdown-item>
  42. </el-dropdown-menu>
  43. </el-dropdown>
  44. </div>
  45. </div>
  46. <div style="margin-top: 50px">
  47. <trade-card title="基础信息">
  48. <avue-form :option="optionForm" v-model="form" ref="form">
  49. <template slot-scope="{row,index}" slot="contacts">
  50. <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" filterable
  51. @change="contactsChange($event)" :disabled=isContacts>
  52. <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
  53. :value="item.contacts" />
  54. </el-select>
  55. </template>
  56. </avue-form>
  57. </trade-card>
  58. <trade-card title="明细信息">
  59. <el-tabs v-model="activeName" type="card">
  60. <el-tab-pane label="销售明细" name="sale_detail">
  61. <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
  62. :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
  63. @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
  64. @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
  65. <template slot-scope="{scope,row}" slot="menuLeft">
  66. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
  67. @click="rowAdd(row)">添加轮胎</el-button>
  68. <el-button type="primary" icon="el-icon-printer" size="small"
  69. @click="handlePrint">打印</el-button>
  70. </template>
  71. <!-- <template slot-scope="{scope,row}" slot="goodsNum">
  72. <el-input size="small" v-model="formContacts.goodsNum" style="width: 100%">
  73. <template slot="inventory">{{ inventory }}吨</template>
  74. </el-input>
  75. </template> -->
  76. <!-- <template slot="goodsId" slot-scope="{ row, index }">
  77. <span style="display:flex">
  78. <el-select v-model="row.goodsId" placeholder="请选择" size="small" filterable
  79. style="width:60%" >
  80. <el-option v-for="item in goodsIdoptions" :key="item.id" :label="item.cname"
  81. :value="item.id">
  82. </el-option>
  83. </el-select>
  84. <el-button icon="el-icon-search" size="small" @click="rePick(row, index)"></el-button>
  85. </span>
  86. </template> -->
  87. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  88. <el-button :size="size" :disabled="disabled" :type="type"
  89. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="editBtn(row, index)">编辑
  90. </el-button>
  91. <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
  92. :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
  93. </el-button>
  94. </template>
  95. </avue-crud>
  96. </el-tab-pane>
  97. <el-tab-pane label="支付明细" name="payment_details">
  98. <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
  99. :data="dataList" @row-save="rowSave" @row-update="rowUpdate"
  100. @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
  101. @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)">
  102. <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  103. <el-button :size="size" :disabled="disabled" :type="type"
  104. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  105. @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
  106. </el-button>
  107. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  108. @click="rowDelBox(row, index, 'paymentRecordsList')">删除
  109. </el-button>
  110. </template> -->
  111. </avue-crud>
  112. </el-tab-pane>
  113. <el-tab-pane label="出库记录" name="outbound_records">
  114. <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
  115. :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
  116. @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
  117. @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
  118. <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  119. <el-button :size="size" :disabled="disabled" :type="type"
  120. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  121. @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
  122. </el-button>
  123. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  124. @click="rowDelBox(row, index)">删除
  125. </el-button>
  126. </template> -->
  127. </avue-crud>
  128. </el-tab-pane>
  129. </el-tabs>
  130. </trade-card>
  131. <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-销售订单" :reportId="form.id"
  132. @onClose="onClose()"></report-dialog>
  133. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  134. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  135. <check :checkData="checkData" :checkDetail="true" :idList="[]" @operationType="operationType"
  136. @choceCheckFun="choceCheckFun">
  137. </check>
  138. </el-dialog>
  139. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  140. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  141. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  142. </el-dialog>
  143. </div>
  144. </div>
  145. </template>
  146. <script>
  147. import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
  148. import { getDetails, submit, generateShipTask, tradingBox, delOrderItem, checkOrder, confirmRefund, revokeCheckOrder, revokeGenerateShipTask, goodsListXs } from "@/api/tirePartsMall/salesManagement/saleOrder";
  149. import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
  150. import reportDialog from "@/components/report-dialog/main";
  151. import checkSchedule from "@/components/check/checkSchedule";
  152. import check from "@/components/check/check";
  153. import { getList } from "@/api/paymentManagement/paymentRecord"
  154. import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
  155. import M from "minimatch";
  156. export default {
  157. name: "detailsPage",
  158. data() {
  159. return {
  160. inventory: 0,
  161. goodsIdoptions: [],
  162. dataList: [],
  163. dicUrlWithCustomId: '',
  164. isAddBtn: true,
  165. isDisabled: false,
  166. isDisabledTask: false,
  167. contactsOption: [],
  168. isContacts: false,
  169. checkData: {},
  170. buttonText: '生成任务',
  171. buttonColor: 'success', // 初始颜色为success
  172. checkScheduleDialog: false,
  173. isApplySettlement: true,
  174. isConfirmRefundBtn: true,
  175. isExamineBtn: true,
  176. isRevocationRequest: true,
  177. checkDialog: false,
  178. checkId: '',
  179. batchNo: '',
  180. switchDialog: false,
  181. activeName: "sale_detail",
  182. disabled: false,
  183. key: 0,
  184. form: {
  185. orderItemsList: [],
  186. paymentRecordsList: [],
  187. outboundRecordsList: []
  188. },
  189. optionForm: {
  190. menuBtn: false,
  191. span: 8,
  192. disabled: false,
  193. column: [{
  194. label: '客户',
  195. prop: "customerId",
  196. disabled: false,
  197. remote: true,
  198. type: 'select',
  199. props: {
  200. label: 'cname',
  201. value: 'id'
  202. },
  203. cascader: ['recAddress'],
  204. change: (data) => {
  205. if (!this.onLoad.id) {
  206. // this.$set(this.optionContactsBack, "addBtn", true)
  207. // this['optionContacts'] = this['optionContactsBack'];
  208. // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
  209. }
  210. if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
  211. getCustom({ id: data.value }).then(res => {
  212. this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
  213. // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
  214. // this.form.storageId = res.data.data.deliveryWarehouseId
  215. this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
  216. this.form.contacts = res.data.data.corpsAttnList[0].cname
  217. this.form.phone = res.data.data.corpsAttnList[0].tel
  218. this.contactsOption = res.data.data.corpsAddrList
  219. this.form.recAddress = res.data.data.corpsAddrList[0].id
  220. })
  221. }
  222. // if (this.$refs.form.DIC.customerId || data.value) {
  223. // for (let item of this.$refs.form.DIC.customerId) {
  224. // if (item.id == data.value) {
  225. // console.log(data);
  226. // console.log(this.$refs.form);
  227. // console.log(item);
  228. // // 后端返回数据暂无联系人、地址等数据,无法下拉默认
  229. // this.form.phone = item.tel
  230. // }
  231. // }
  232. // }
  233. },
  234. dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
  235. rules: [{
  236. required: true,
  237. message: " ",
  238. trigger: "blur"
  239. }]
  240. }, {
  241. label: '仓库',
  242. prop: "storageId",
  243. type: 'select',
  244. disabled: false,
  245. props: {
  246. label: 'cname',
  247. value: 'id'
  248. },
  249. dicUrl: '/api/blade-sales-part/storageDesc/listAll',
  250. rules: [{
  251. required: true,
  252. message: " ",
  253. trigger: "blur"
  254. }]
  255. }, {
  256. label: '单据编号',
  257. prop: "ordNo",
  258. disabled: true
  259. }, {
  260. label: '来源单号',
  261. prop: "srcOrdNo",
  262. disabled: true
  263. }, {
  264. label: '业务来源',
  265. prop: "businessSource",
  266. disabled: true
  267. }, {
  268. label: '应收类别',
  269. prop: "receivableType",
  270. type: "select",
  271. disabled: false,
  272. dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
  273. props: {
  274. label: "dictValue",
  275. value: "dictValue"
  276. },
  277. value: '网络支付'
  278. }, {
  279. label: '联系人',
  280. type: "select",
  281. prop: "contacts",
  282. disabled: false,
  283. props: {
  284. label: 'address',
  285. value: 'id'
  286. },
  287. dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
  288. }, {
  289. label: '电话',
  290. disabled: false,
  291. prop: "phone",
  292. }, {
  293. label: '收货地址',
  294. prop: "recAddress",
  295. type: 'select',
  296. disabled: true,
  297. props: {
  298. label: 'address',
  299. value: 'id'
  300. },
  301. dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
  302. }, {
  303. label: '配送方式',
  304. type: 'select',
  305. prop: "shipType",
  306. disabled: false,
  307. dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
  308. props: {
  309. label: "dictValue",
  310. value: "dictValue"
  311. },
  312. value: '物流'
  313. }, {
  314. label: '物流公司',
  315. disabled: false,
  316. prop: "logisticsCorpName"
  317. }, {
  318. label: '成本',
  319. prop: "cost",
  320. display: true,
  321. disabled: true
  322. }, {
  323. label: '毛利',
  324. prop: "grossProfit",
  325. disabled: true
  326. }, {
  327. label: '销售金额',
  328. prop: "salesAmount",
  329. disabled: true
  330. }, {
  331. label: '运费',
  332. prop: "freight",
  333. disabled: true
  334. }, {
  335. label: '总金额',
  336. prop: "totalMoney",
  337. disabled: true
  338. }, {
  339. label: '备注',
  340. prop: "remarks",
  341. type: 'textarea',
  342. disabled: false,
  343. span: 16,
  344. minRows: 1
  345. }]
  346. },
  347. formContacts: {},
  348. optionContacts: {},
  349. optionContactsBack: {
  350. disabled: false,
  351. border: true,
  352. align: 'center',
  353. index: true,
  354. showSummary: true,
  355. sumColumnList: [
  356. {
  357. name: 'goodsNum',
  358. type: 'sum',
  359. },
  360. {
  361. name: 'sendNum',
  362. type: 'sum',
  363. },
  364. {
  365. name: 'subTotalMoney',
  366. type: 'sum',
  367. },
  368. {
  369. name: 'costprie',
  370. type: 'sum',
  371. },
  372. {
  373. name: 'grossProfit',
  374. type: 'sum',
  375. }
  376. ],
  377. addBtnText: "添加轮胎",
  378. refreshBtn: false,
  379. dialogDrag: true,
  380. addBtn: false,
  381. span: 8,
  382. height: 500,
  383. addRowBtn: false,
  384. editBtn: false,
  385. delBtn: false,
  386. menuWidth: 140,
  387. dialogTop: 25,
  388. dialogWidth: "80%",
  389. // summaryText: "合计",
  390. // showSummary: true,
  391. // sumColumnList:[{
  392. // name: "goodsNum",
  393. // type: "sum",
  394. // decimals: 2
  395. // },{
  396. // name: "sendNum",
  397. // type: "sum",
  398. // decimals: 2
  399. // },{
  400. // name: "profit",
  401. // type: "sum",
  402. // decimals: 2
  403. // },{
  404. // name: "subTotalMoney",
  405. // type: "sum",
  406. // decimals: 2
  407. // },{
  408. // name: "thisAmount",
  409. // type: "sum",
  410. // decimals: 2
  411. // },{
  412. // name: "costprie",
  413. // type: "sum",
  414. // decimals: 2
  415. // },{
  416. // name: "grossProfit",
  417. // type: "sum",
  418. // decimals: 2
  419. // }],
  420. column: [{
  421. label: '轮胎名称',
  422. prop: 'goodsId',
  423. width: 200,
  424. disabled: false,
  425. remote: true,
  426. overHidden: true,
  427. type: 'select',
  428. dicData: [],
  429. props: {
  430. label: 'cname',
  431. value: 'id'
  432. },
  433. // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
  434. dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=1658279303722418177&enableOrNot=0"
  435. // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
  436. }, {
  437. label: '数量',
  438. prop: 'goodsNum',
  439. overHidden: true,
  440. disabled: false,
  441. width: 100,
  442. rules: [{
  443. required: true,
  444. message: " ",
  445. trigger: "blur"
  446. },{
  447. validator: (rule, value, callback) => {
  448. if (value < 0) {
  449. callback(new Error("数量不能小于0"));
  450. } else {
  451. callback();
  452. }
  453. },
  454. trigger: "blur"
  455. }]
  456. },
  457. {
  458. label: '价格',
  459. prop: 'price',
  460. overHidden: true,
  461. width: 100,
  462. disabled: false,
  463. rules: [{
  464. required: true,
  465. message: " ",
  466. trigger: "blur"
  467. },{
  468. validator: (rule, value, callback) => {
  469. if (value < 0) {
  470. callback(new Error("价格不能小于0"));
  471. } else {
  472. callback();
  473. }
  474. },
  475. trigger: "blur"
  476. }]
  477. },
  478. {
  479. label: '库存',
  480. prop: 'inventory',
  481. overHidden: true,
  482. hide: true,
  483. width: 100
  484. },{
  485. label: '批次号',
  486. prop: 'dot',
  487. type: "select",
  488. disabled: true,
  489. allowCreate: true,
  490. filterable: true,
  491. dicData: [],
  492. props: {
  493. label: "dot",
  494. value: "dot"
  495. },
  496. dicUrl: "/api/blade-sales-part/stockDesc/dotList",
  497. overHidden: true,
  498. }, {
  499. label: '轮胎编码',
  500. prop: 'goodsNo',
  501. overHidden: true,
  502. disabled: false,
  503. width: 100
  504. },
  505. {
  506. label: '品牌',
  507. prop: 'brandId',
  508. disabled: false,
  509. width: 100,
  510. overHidden: true,
  511. type: 'select',
  512. props: {
  513. label: 'cname',
  514. value: 'id'
  515. },
  516. dicUrl: '/api/blade-sales-part/brandDesc/listAll'
  517. },
  518. {
  519. label: '规格型号',
  520. prop: 'propertyName',
  521. overHidden: true,
  522. disabled: false,
  523. width: 100
  524. }, {
  525. label: '花纹',
  526. prop: 'pattern',
  527. overHidden: true,
  528. disabled: false,
  529. width: 100
  530. }, {
  531. label: '轮胎描述',
  532. prop: 'goodsDescription',
  533. disabled: false,
  534. overHidden: true,
  535. width: 100
  536. },
  537. {
  538. label: '单位',
  539. prop: 'units',
  540. type: "select",
  541. disabled: false,
  542. props: {
  543. label: "dictValue",
  544. value: "dictValue"
  545. },
  546. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  547. overHidden: true,
  548. width: 100
  549. },
  550. {
  551. label: '发货数量',
  552. prop: 'sendNum',
  553. disabled: false,
  554. overHidden: true,
  555. width: 100,
  556. disabled: true,
  557. editDisplay: false,
  558. addDisplay: false
  559. },
  560. // {
  561. // label: '利润',
  562. // prop: 'profit',
  563. // overHidden: true,
  564. // width: 100
  565. // },
  566. {
  567. label: '小计',
  568. prop: 'subTotalMoney',
  569. overHidden: true,
  570. width: 100,
  571. disabled: true,
  572. editDisplay: false,
  573. addDisplay: false
  574. },
  575. // {
  576. // label: '返利',
  577. // prop: 'thisAmount',
  578. // overHidden: true,
  579. // width: 100
  580. // },
  581. {
  582. label: '成本',
  583. prop: 'costprie',
  584. overHidden: true,
  585. width: 100,
  586. disabled: true,
  587. editDisplay: false,
  588. addDisplay: false
  589. },
  590. {
  591. label: '毛利',
  592. prop: 'grossProfit',
  593. overHidden: true,
  594. width: 100,
  595. disabled: true,
  596. editDisplay: false,
  597. addDisplay: false
  598. },
  599. {
  600. label: '备注',
  601. prop: "remarks",
  602. overHidden: true,
  603. width: 100,
  604. disabled: false,
  605. }
  606. ]
  607. },
  608. optionPaymentDetails: {},
  609. optionPaymentDetailsBack: {
  610. align: 'center',
  611. index: true,
  612. addBtnText: "录入明细",
  613. menu:false,
  614. refreshBtn: false,
  615. dialogDrag: true,
  616. addBtn: false,
  617. span: 8,
  618. height: 600,
  619. addRowBtn: false,
  620. editBtn: false,
  621. delBtn: false,
  622. menuWidth: 140,
  623. dialogTop: 25,
  624. dialogWidth: "80%",
  625. column: [{
  626. label: '支付编号',
  627. prop: 'serialNumber'
  628. }, {
  629. label: '金额',
  630. prop: 'amount'
  631. }, {
  632. label: '类型',
  633. prop: 'type'
  634. }, {
  635. label: '支付时间',
  636. prop: 'createTime'
  637. }]
  638. },
  639. optionOutboundRecords: {},
  640. optionOutboundRecordsBack: {
  641. align: 'center',
  642. index: true,
  643. menu:false,
  644. addBtnText: "录入明细",
  645. refreshBtn: false,
  646. dialogDrag: true,
  647. addBtn: false,
  648. span: 8,
  649. height: 600,
  650. addRowBtn: false,
  651. editBtn: false,
  652. delBtn: false,
  653. // menuWidth: 140,
  654. dialogTop: 25,
  655. dialogWidth: "80%",
  656. column: [{
  657. label: '出库单号',
  658. prop: 'billno'
  659. }, {
  660. label: '来源单号',
  661. prop: 'ordNo'
  662. }, {
  663. label: '数量',
  664. prop: 'goodsTotalNum'
  665. }, {
  666. label: '状态',
  667. prop: 'statusName'
  668. }, {
  669. label: '业务时间',
  670. prop: 'createTime'
  671. }]
  672. }
  673. }
  674. },
  675. components: { reportDialog, check, checkSchedule },
  676. props: {
  677. onLoad: Object,
  678. detailData: Object
  679. },
  680. async created() {
  681. // console.log(this.$route);
  682. // if(this.$route.query.check.actId){
  683. // this.isExamineBtn = false
  684. // }
  685. this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
  686. if (this.formContacts.goodsId !== value) {
  687. goodsDetail({ id: value, customId: this.dicUrlWithCustomId }).then(res => {
  688. this.formContacts.goodsNo = res.data.data.code
  689. this.formContacts.brandId = res.data.data.brandId
  690. this.formContacts.inventory = res.data.data.inventory
  691. // this.formContacts.brandId = res.data.data.brandName
  692. // this.formContacts.brandName = res.data.data.brandId
  693. this.formContacts.propertyName = res.data.data.specificationAndModel
  694. this.formContacts.pattern = res.data.data.brandItem
  695. this.formContacts.goodsDescription = res.data.data.goodsDescription
  696. this.formContacts.units = res.data.data.unit
  697. this.formContacts.price = res.data.data.price
  698. if (res.data.data.whether == 0) {
  699. this.findObject(this.optionContactsBack.column, "dot").disabled = true
  700. } else {
  701. this.findObject(this.optionContactsBack.column, "dot").disabled = false
  702. dotList({
  703. storageId: this.form.storageId,
  704. goodsId: this.formContacts.goodsId
  705. }).then(res => {
  706. this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
  707. })
  708. }
  709. // this.formContacts.goodsId = res.data.data.cname
  710. // this.formContacts.goodsName = res.data.data.id
  711. })
  712. }
  713. }
  714. this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
  715. this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
  716. if (this.formContacts.goodsId !== value) {
  717. goodsDetail({ id: value }).then(res => {
  718. this.formContacts.goodsNo = res.data.data.code
  719. this.formContacts.brandId = res.data.data.brandId
  720. this.formContacts.inventory = res.data.data.inventory
  721. // this.formContacts.brandId = res.data.data.brandName
  722. // this.formContacts.brandName = res.data.data.brandId
  723. this.formContacts.propertyName = res.data.data.specificationAndModel
  724. this.formContacts.pattern = res.data.data.brandItem
  725. this.formContacts.goodsDescription = res.data.data.goodsDescription
  726. this.formContacts.units = res.data.data.unit
  727. if (res.data.data.whether == 0) {
  728. this.findObject(this.optionContacts.column, "dot").disabled = true
  729. } else {
  730. this.findObject(this.optionContacts.column, "dot").disabled = false
  731. dotList({
  732. storageId: this.form.storageId,
  733. goodsId: this.formContacts.goodsId
  734. }).then(res => {
  735. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
  736. })
  737. }
  738. // this.formContacts.goodsId = res.data.data.cname
  739. // this.formContacts.goodsName = res.data.data.id
  740. })
  741. }
  742. }
  743. this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
  744. this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
  745. this.key++
  746. if (this.onLoad.id && this.detailData.id) {
  747. this.$set(this.optionForm, 'disabled', true)
  748. this.$set(this.optionContactsBack, 'disabled', true)
  749. this.isContacts = true
  750. this.isDisabled = true
  751. this.refresh(this.onLoad.id, true)
  752. } else if (this.onLoad.id) {
  753. console.log(2);
  754. this.refresh(this.onLoad.id, true)
  755. }
  756. if (!this.form.id) {
  757. console.log(3);
  758. this.optionContactsBack.column.forEach(its => {
  759. if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
  760. its.disabled = false
  761. } else {
  762. its.disabled = true
  763. }
  764. })
  765. // this.$set(this.optionContactsBack, "addBtn", false)
  766. this['optionContacts'] = this['optionContactsBack'];
  767. this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
  768. }
  769. if (!this.detailData.id) {
  770. this.isAddBtn = false
  771. this.form.businessSource = '内部销售'
  772. }
  773. if (this.detailData.check) {
  774. this.isExamineBtn = false
  775. // this.batchNo = this.detailData.check.batchNo
  776. }
  777. },
  778. watch: {
  779. dicUrlWithCustomId() {
  780. // this.findObject(this.optionContactsBack.column, "goodsId").dicUrl = `/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=0`
  781. goodsListXs(this.dicUrlWithCustomId).then(res => {
  782. this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
  783. })
  784. },
  785. $route(to, from) {
  786. if (this.onLoad.id && this.detailData.id) {
  787. this.$set(this.optionForm, 'disabled', true)
  788. this.$set(this.optionContactsBack, 'disabled', true)
  789. this.isContacts = true
  790. this.isDisabled = true
  791. this.refresh(this.onLoad.id, true)
  792. } else if (this.onLoad.id) {
  793. console.log(2);
  794. this.refresh(this.onLoad.id, true)
  795. }
  796. // if (!this.form.id) {
  797. // console.log(3);
  798. // // this.$set(this.optionContactsBack, "addBtn", false)
  799. // this['optionContacts'] = this['optionContactsBack'];
  800. // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
  801. // }
  802. // if (!this.detailData.id) {
  803. // this.form.businessSource = '内部销售'
  804. // }
  805. if (this.detailData.status == 1) {
  806. this.isExamineBtn = false;
  807. }
  808. // if (to.name == '销售订单') {
  809. // console.log('销售订单');
  810. // this.isExamineBtn = false;
  811. // }
  812. }
  813. },
  814. methods: {
  815. editBtn(row, index) {
  816. console.log(123);
  817. this.confirmEditing()
  818. this.$refs.formContacts.rowEdit(row, index);
  819. dotList({
  820. storageId: this.form.storageId,
  821. goodsId: this.formContacts.goodsId
  822. }).then(res => {
  823. this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
  824. })
  825. goodsListXs(this.dicUrlWithCustomId).then(res => {
  826. this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
  827. })
  828. },
  829. //表头编辑
  830. confirmEditing() {
  831. this.isAddBtn = false
  832. if (this.form.status == '已取消' || this.form.status == '退款请核') {
  833. this.isAddBtn = true
  834. // this.$message.error('当前状态不允许编辑')
  835. // this.optionForm.column.forEach(item=>{
  836. // if(item.prop= 'contacts'){
  837. // item.disabled = true
  838. // }
  839. // })
  840. }
  841. this.optionContactsBack.column.forEach(its => {
  842. if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
  843. its.disabled = false
  844. } else {
  845. its.disabled = true
  846. }
  847. })
  848. this.$set(this.optionForm, 'disabled', false)
  849. this.$set(this.optionContactsBack, 'disabled', false)
  850. this.isDisabled = false
  851. if (this.form.businessSource == "外部销售") {
  852. if (this.form.status == '待确认') {
  853. const loadings = this.$loading({
  854. lock: true,
  855. text: '加载中',
  856. spinner: 'el-icon-loading',
  857. background: 'rgba(255,255,255,0.7)'
  858. });
  859. console.log('外部销售');
  860. this.optionForm.column.forEach(its => {
  861. if (its.prop == 'customerId') {
  862. this.$set(its, 'disabled', true)
  863. }
  864. })
  865. //不能录入不能删除
  866. this.isDisabled = true
  867. this.$set(this.form, 'shipType', '物流')
  868. this.$set(this.form, 'receivableType', '网络支付')
  869. this.optionContactsBack.column.forEach(item => {
  870. this.$set(item, 'disabled', true)
  871. if (item.label == '批次号' || item.label == '备注') {
  872. item.disabled = false
  873. }
  874. })
  875. loadings.close()
  876. } else {
  877. const loadin = this.$loading({
  878. lock: true,
  879. text: '加载中',
  880. spinner: 'el-icon-loading',
  881. background: 'rgba(255,255,255,0.7)'
  882. });
  883. this.isAddBtn = true
  884. this.isDisabled = true
  885. this.optionForm.column.forEach(its => {
  886. if (its.prop != 'remarks') {
  887. its.disabled = true
  888. } else {
  889. its.disabled = false
  890. }
  891. })
  892. this.optionContactsBack.column.forEach(its => {
  893. if (its.prop != 'remarks') {
  894. its.disabled = true
  895. } else {
  896. its.disabled = false
  897. }
  898. })
  899. loadin.close()
  900. }
  901. } else {
  902. const loading = this.$loading({
  903. lock: true,
  904. text: '加载中',
  905. spinner: 'el-icon-loading',
  906. background: 'rgba(255,255,255,0.7)'
  907. });
  908. if (this.form.status == '待发货' || this.form.status == '已发货' || this.form.status == '已取消') {
  909. const loading = this.$loading({
  910. lock: true,
  911. text: '加载中',
  912. spinner: 'el-icon-loading',
  913. background: 'rgba(255,255,255,0.7)'
  914. });
  915. this.optionForm.column.forEach(its => {
  916. if (its.prop != 'remarks') {
  917. its.disabled = true
  918. } else {
  919. its.disabled = false
  920. }
  921. })
  922. this.optionContactsBack.column.forEach(its => {
  923. if (its.prop != 'remarks') {
  924. its.disabled = true
  925. } else {
  926. its.disabled = false
  927. }
  928. })
  929. loading.close()
  930. } else if (this.form.status == '录入') {
  931. // this.$set(this.optionForm, 'disabled', false)
  932. // this.$set(this.optionContactsBack, 'disabled', false)
  933. this.$set(this.optionForm, 'disabled', false)
  934. this.$set(this.optionContactsBack, 'disabled', false)
  935. this.isContacts = true
  936. //删除按钮
  937. this.isDisabled = false
  938. // this.optionForm.column.forEach(item => {
  939. // item.disabled = false
  940. // })
  941. loading.close()
  942. } else if (this.form.status == '待确认') {
  943. this.isDisabled = true
  944. console.log('待确认');
  945. this.optionForm.column.forEach(item => {
  946. if (item.label === '仓库' || item.label === '备注' || item.label === '配送方式' || item.label === '物流公司') {
  947. this.$set(item, 'disabled', false)
  948. } else {
  949. this.$set(item, 'disabled', true)
  950. }
  951. })
  952. this.optionContactsBack.column.forEach(its => {
  953. if (its.prop == 'remarks' || its.prop == 'dot') {
  954. this.$set(its, 'disabled', false)
  955. } else {
  956. this.$set(its, 'disabled', true)
  957. }
  958. })
  959. loading.close()
  960. }
  961. // this.$set(this.form, 'shipType', '物流')
  962. // this.$set(this.form, 'receivableType', '现金')
  963. // this.optionContactsBack.column.forEach(item => {
  964. // this.$set(item, 'disabled', false)
  965. // })
  966. // this.optionContactsBack.column.forEach(item => {
  967. // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '轮胎描述') {
  968. // item.disabled = true;
  969. // }
  970. // })
  971. // this['optionContacts'] = this['optionContactsBack'];
  972. // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
  973. loading.close()
  974. }
  975. // this.$set(this.form.orderItemsList,'goodsNum',66)
  976. },
  977. generateOutbound() {
  978. if (!this.form.id) {
  979. this.$message.error('请先保存')
  980. } else {
  981. if (this.buttonText === '生成任务') {
  982. //生成任务逻辑
  983. if (this.form.orderItemsList.length <= 0) {
  984. this.$message.error('请录入明细');
  985. } else {
  986. this.$set(this.optionForm, 'disabled', true)
  987. this.$set(this.optionContactsBack, 'disabled', true)
  988. this.$refs["form"].validate((valid, done) => {
  989. done();
  990. if (valid) {
  991. const loading = this.$loading({
  992. lock: true,
  993. text: '加载中',
  994. spinner: 'el-icon-loading',
  995. background: 'rgba(255,255,255,0.7)'
  996. });
  997. // this.form.orderItemsList.forEach((items) => {
  998. // let brandName = items.brandId
  999. // items.brandId = items.brandName
  1000. // items.brandName = brandName
  1001. // let goodsName = items.goodsId
  1002. // items.goodsId = items.goodsName
  1003. // items.goodsName = goodsName
  1004. // })
  1005. generateShipTask(this.form).then(res => {
  1006. console.log(res.data);
  1007. this.refresh(res.data.data.id, true)
  1008. this.isContacts = true
  1009. // 将按钮文本更改为"撤销任务"
  1010. this.buttonText = '撤销任务';
  1011. // 将按钮颜色更改为对应的颜色
  1012. this.buttonColor = 'warning'; // 比如改为warning
  1013. this.$message.success("生成出库任务成功");
  1014. loading.close();
  1015. }).finally(() => {
  1016. loading.close();
  1017. });
  1018. } else {
  1019. this.$message.error('请选择仓库')
  1020. }
  1021. })
  1022. }
  1023. } else {
  1024. this.$refs["form"].validate((valid, done) => {
  1025. done();
  1026. console.log(valid);
  1027. if (true) {
  1028. const loading = this.$loading({
  1029. lock: true,
  1030. text: '加载中',
  1031. spinner: 'el-icon-loading',
  1032. background: 'rgba(255,255,255,0.7)'
  1033. });
  1034. // this.form.orderItemsList.forEach((items) => {
  1035. // let brandName = items.brandId
  1036. // items.brandId = items.brandName
  1037. // items.brandName = brandName
  1038. // let goodsName = items.goodsId
  1039. // items.goodsId = items.goodsName
  1040. // items.goodsName = goodsName
  1041. // })
  1042. revokeGenerateShipTask(this.form).then(res => {
  1043. // 将按钮文本更改为"生成任务"
  1044. this.buttonText = '生成任务';
  1045. // 将按钮颜色还原为success
  1046. this.buttonColor = 'success';
  1047. this.$message.success("撤销出库成功");
  1048. this.refresh(res.data.data.id)
  1049. loading.close();
  1050. }).finally(() => {
  1051. loading.close();
  1052. });
  1053. }
  1054. })
  1055. }
  1056. }
  1057. },
  1058. //联系人change
  1059. contactsChange(e) {
  1060. console.log(e);
  1061. console.log(this.contactsOption);
  1062. // 假设this.contactsOption是你的数组对象
  1063. let matchedContact = this.contactsOption.find(item => item.contacts == e);
  1064. // 判断是否找到匹配的对象
  1065. this.$set(this.form, 'phone', matchedContact.tel)
  1066. this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
  1067. },
  1068. //修改提交触发
  1069. editCustomer() {
  1070. this.$refs["form"].validate((valid, done) => {
  1071. done();
  1072. if (valid) {
  1073. const loading = this.$loading({
  1074. lock: true,
  1075. text: '加载中',
  1076. spinner: 'el-icon-loading',
  1077. background: 'rgba(255,255,255,0.7)'
  1078. });
  1079. // this.form.orderItemsList.forEach(its => {
  1080. // console.log(its.goodsId);
  1081. // console.log(its.goodsName);
  1082. // its.brandId = its.brandName
  1083. // let goodsName = its.goodsId
  1084. // its.goodsId = its.goodsName
  1085. // its.goodsName = goodsName
  1086. // })
  1087. submit({
  1088. bsType: "XS",
  1089. ...this.form
  1090. }).then(res => {
  1091. this.$message.success("保存成功");
  1092. this.refresh(res.data.data.id)
  1093. this.isDisabledTask = false
  1094. loading.close();
  1095. }).finally(() => {
  1096. loading.close();
  1097. });
  1098. } else {
  1099. return false;
  1100. }
  1101. });
  1102. },
  1103. refresh(id, type) {
  1104. const loading = this.$loading({
  1105. lock: true,
  1106. text: '加载中',
  1107. spinner: 'el-icon-loading',
  1108. background: 'rgba(255,255,255,0.7)'
  1109. })
  1110. getDetails({ id: id }).then(res => {
  1111. this.form = res.data.data
  1112. let ordForm = { srcBillNo: this.form.ordNo }
  1113. let _this = this
  1114. getList(1, 50, ordForm).then((res) => {
  1115. this.dataList = res.data.data.records ? res.data.data.records : [];
  1116. })
  1117. if (this.form.status !== '录入' && this.form.status !== '退款中' && this.form.status !== '已取消' && this.form.status !== '退款请核' && this.form.status !== '已退款') {
  1118. console.log(1);
  1119. this.isApplySettlement = false;
  1120. }
  1121. if (this.form.status == '退款中') {
  1122. this.isConfirmRefundBtn = false;
  1123. }
  1124. if (this.form.status == '已取消') {
  1125. this.isConfirmRefundBtn = true;
  1126. }
  1127. // if (this.form.status == '退款请核') {
  1128. // this.isExamineBtn = false;
  1129. // }
  1130. if (this.form.generateTask == '已生成') {
  1131. this.buttonText = '撤销任务';
  1132. this.isDisabledTask = false;
  1133. this.buttonColor = 'warning'
  1134. }
  1135. if (this.form.status == '退款请核' || this.form.status == '退款中') {
  1136. this.isRevocationRequest = false;
  1137. }
  1138. if (this.form.status == '已收货' || this.form.status == '已发货') {
  1139. this.isDisabledTask = true;
  1140. }
  1141. //成本、毛利对销售角色隐藏
  1142. this.optionForm.column.forEach(its => {
  1143. if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
  1144. if (its.prop == 'cost' || its.prop == 'grossProfit') {
  1145. this.$set(its, 'display', false)
  1146. }
  1147. }
  1148. })
  1149. this.form.orderItemsList.forEach((items) => {
  1150. if (!items.subTotalMoney) {
  1151. items.subTotalMoney = items.goodsNum * items.price
  1152. items.grossProfit = items.subTotalMoney - items.costprie
  1153. }
  1154. // let brandName = items.brandId
  1155. // items.brandId = items.brandName
  1156. // items.brandName = brandName
  1157. // let goodsName = items.goodsId
  1158. // items.goodsId = items.goodsName
  1159. // items.goodsName = goodsName
  1160. })
  1161. loading.close();
  1162. // if (this.form.businessSource == "外部销售") {
  1163. // console.log('外部销售');
  1164. // this.optionForm.column.forEach(its => {
  1165. // if (its.prop == 'customerId') {
  1166. // this.$set(its, 'disabled', true)
  1167. // }
  1168. // })
  1169. // //不能录入不能删除
  1170. // this.$set(this.optionContactsBack, "addBtn", false)
  1171. // this.isDisabled = true
  1172. // this.$set(this.form, 'shipType', '物流')
  1173. // this.$set(this.form, 'receivableType', '网络支付')
  1174. // this.optionContactsBack.column.forEach(item => {
  1175. // this.$set(item, 'disabled', true)
  1176. // if (item.label == '批次号' || item.label == '备注') {
  1177. // item.disabled = false
  1178. // }
  1179. // })
  1180. // this['optionContacts'] = this['optionContactsBack'];
  1181. // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
  1182. // this.optionContactsBack.column.forEach(item => {
  1183. // if (item.prop == 'dot') {
  1184. // this.$set(item, disabled, false)
  1185. // } else {
  1186. // this.$set(item, disabled, true)
  1187. // }
  1188. // })
  1189. // } else {
  1190. // this.$set(this.form, 'shipType', '物流')
  1191. // this.$set(this.form, 'receivableType', '现金')
  1192. // this.optionContactsBack.column.forEach(item => {
  1193. // this.$set(item, 'disabled', false)
  1194. // })
  1195. // this.optionContactsBack.column.forEach(item => {
  1196. // if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述') {
  1197. // item.disabled = true;
  1198. // }
  1199. // })
  1200. // console.log(324324);
  1201. // this['optionContacts'] = this['optionContactsBack'];
  1202. // this.delColumnData(this.getColumnName(269.1), this['optionContactsBack']);
  1203. // }
  1204. // // this.$set(this.form.orderItemsList,'goodsNum',66)
  1205. }).catch(() => {
  1206. loading.close();
  1207. })
  1208. },
  1209. //请核关闭
  1210. choceScheduleFun() {
  1211. this.checkScheduleDialog = false
  1212. },
  1213. //关闭审核
  1214. choceCheckFun() {
  1215. this.isExamineBtn = !this.isExamineBtn
  1216. this.checkDialog = false;
  1217. },
  1218. //申请退款
  1219. applySettlement(type) {
  1220. this.$confirm("您确定申请退款吗?", {
  1221. confirmButtonText: "确定",
  1222. cancelButtonText: "取消",
  1223. type: "warning"
  1224. }).then(() => {
  1225. this.$refs["form"].validate((valid, done) => {
  1226. done()
  1227. if (valid) {
  1228. const data = {
  1229. id: this.form.id,
  1230. url: '/tirePartsMall/salesManagement/saleOrder/index',
  1231. pageStatus: "this.$store.getters.domSaleStatus",
  1232. pageLabel: "销售订单",
  1233. }
  1234. const loading = this.$loading({
  1235. lock: true,
  1236. text: '加载中',
  1237. spinner: 'el-icon-loading',
  1238. background: 'rgba(255,255,255,0.7)'
  1239. });
  1240. checkOrder({ ...data }).then((res) => {
  1241. this.refresh(res.data.data.id)
  1242. this.$message.success('申请退款成功');
  1243. this.isApplySettlement = !this.isApplySettlement
  1244. loading.close();
  1245. console.log(res);
  1246. }).catch(() => { loading.close(); })
  1247. }
  1248. })
  1249. })
  1250. },
  1251. //确认退款
  1252. confirmRefundBtn() {
  1253. this.$confirm("您确定退款吗?", {
  1254. confirmButtonText: "确定",
  1255. cancelButtonText: "取消",
  1256. type: "warning"
  1257. }).then(() => {
  1258. const loading = this.$loading({
  1259. lock: true,
  1260. text: '加载中',
  1261. spinner: 'el-icon-loading',
  1262. background: 'rgba(255,255,255,0.7)'
  1263. });
  1264. // this.form.orderItemsList.forEach((items) => {
  1265. // let brandName = items.brandId
  1266. // items.brandId = items.brandName
  1267. // items.brandName = brandName
  1268. // let goodsName = items.goodsId
  1269. // items.goodsId = items.goodsName
  1270. // items.goodsName = goodsName
  1271. // })
  1272. confirmRefund({ ...this.form }).then((res) => {
  1273. loading.close()
  1274. this.$message.success('确定退款成功');
  1275. }).catch(() => { loading.close(); })
  1276. })
  1277. },
  1278. //审批
  1279. examineBtn() {
  1280. this.checkData = this.$route.query.check
  1281. this.checkDialog = true;
  1282. },
  1283. //撤销请核
  1284. revocationRequest() {
  1285. this.$confirm("您确定撤回此次申请吗?", {
  1286. confirmButtonText: "确定",
  1287. cancelButtonText: "取消",
  1288. type: "warning"
  1289. }).then(() => {
  1290. const loading = this.$loading({
  1291. lock: true,
  1292. text: '加载中',
  1293. spinner: 'el-icon-loading',
  1294. background: 'rgba(255,255,255,0.7)'
  1295. });
  1296. // this.form.orderItemsList.forEach((items) => {
  1297. // if (!items.subTotalMoney) {
  1298. // items.subTotalMoney = items.goodsNum * items.price
  1299. // items.grossProfit = items.subTotalMoney - items.costprie
  1300. // }
  1301. // let brandName = items.brandId
  1302. // items.brandId = items.brandName
  1303. // items.brandName = brandName
  1304. // let goodsName = items.goodsId
  1305. // items.goodsId = items.goodsName
  1306. // items.goodsName = goodsName
  1307. // })
  1308. revokeCheckOrder({ ...this.form }).then(res => {
  1309. this.isRevocationRequest = !this.isRevocationRequest
  1310. this.refresh(res.data.data.id)
  1311. this.$message.success('撤回成功')
  1312. loading.close();
  1313. })
  1314. })
  1315. },
  1316. rowDelBox(row, index, type) {
  1317. this.$confirm("确定将选择数据删除?", {
  1318. confirmButtonText: "确定",
  1319. cancelButtonText: "取消",
  1320. type: "warning"
  1321. }).then(() => {
  1322. if (row.id) {
  1323. delOrderItem({ ids: row.id }).then(res => {
  1324. this.form.orderItemsList.splice(index, 1);
  1325. this.$message.success("操作成功!");
  1326. });
  1327. } else {
  1328. this.form[type].splice(index, 1);
  1329. this.$message.success("操作成功!");
  1330. }
  1331. }
  1332. );
  1333. },
  1334. rowSave(form, done, loading) {
  1335. done(form)
  1336. },
  1337. rowUpdate(form, index, done, loading) {
  1338. done(form)
  1339. },
  1340. // 新增轮胎
  1341. rowAdd(row) {
  1342. if(!this.form.customerId){
  1343. this.$message.error('请选择客户')
  1344. return
  1345. }
  1346. this.optionContactsBack.column.forEach(its => {
  1347. if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
  1348. its.disabled = false
  1349. } else {
  1350. its.disabled = true
  1351. }
  1352. })
  1353. console.log('新增了', row);
  1354. this.$refs.formContacts.rowAdd()
  1355. },
  1356. //打印
  1357. handlePrint() {
  1358. this.switchDialog = !this.switchDialog;
  1359. },
  1360. onClose(val) {
  1361. this.switchDialog = val;
  1362. },
  1363. //自定义列保存
  1364. async saveColumnTwo(ref, option, optionBack, code) {
  1365. /**
  1366. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1367. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1368. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1369. */
  1370. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1371. if (inSave) {
  1372. this.$message.success("保存成功");
  1373. //关闭窗口
  1374. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1375. }
  1376. },
  1377. //自定义列重置
  1378. async resetColumnTwo(ref, option, optionBack, code) {
  1379. this[option] = this[optionBack];
  1380. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1381. if (inSave) {
  1382. this.$message.success("重置成功");
  1383. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1384. }
  1385. },
  1386. backToList(type) {
  1387. this.$emit("backToList", type);
  1388. }
  1389. }
  1390. }
  1391. </script>
  1392. <style lang="scss" scoped>
  1393. ::v-deep .el-form-item {
  1394. margin-bottom: 8px !important;
  1395. }
  1396. </style>