detailsPageEdit.vue 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <el-button v-if="detailData.seeDisabled" size="small" @click="editHandle" type="primary">编 辑</el-button>
  12. <el-button class="el-button--small-yh" type="primary" size="small" :disabled="detailData.seeDisabled"
  13. v-if="form.deliveryStatus == '已到货'" :loading="saveLoading" @click="cancelArrival">撤销到货</el-button>
  14. <el-button class="el-button--small-yh" type="primary" size="small"
  15. :disabled="detailData.seeDisabled || arrivalDisabled" v-if="form.deliveryStatus == '已收货'" :loading="saveLoading"
  16. @click="confirmArrival">确认到货</el-button>
  17. <el-button class="el-button--small-yh" type="primary" @click="revokeOutGoods" size="small"
  18. v-if="form.deliveryStatus == '已收货'" :loading="saveLoading"
  19. :disabled="detailData.seeDisabled || arrivalDisabled">撤销收货</el-button>
  20. <el-button class="el-button--small-yh" type="primary" @click="sendOutGoods" size="small"
  21. v-if="form.deliveryStatus == '录入'" :loading="saveLoading"
  22. :disabled="detailData.seeDisabled || !form.id || arrivalDisabled">确认收货</el-button>
  23. <!-- <el-button class="el-button--small-yh" size="small" type="success" @click="copyOrder" :loading="saveLoading"
  24. :disabled="detailData.seeDisabled || !form.id || arrivalDisabled">
  25. 复制单据
  26. </el-button> -->
  27. <el-button class="el-button--small-yh" type="primary"
  28. :disabled="disabled || detailData.seeDisabled || arrivalDisabled" @click="editCustomer(false)"
  29. :loading="saveLoading" size="small">保 存
  30. </el-button>
  31. </div>
  32. </div>
  33. <div class="customer-main">
  34. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  35. <containerTitle title="基础资料"></containerTitle>
  36. <basic-container>
  37. <el-row>
  38. <el-col v-for="(item, index) in basicData.column" :key="index" :span="item.span ? item.span : 8">
  39. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  40. <!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
  41. <!-- ></avue-input-tree>-->
  42. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  43. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"
  44. :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled" />
  45. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  46. size="small" type="date" placeholder="选择日期"
  47. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled" />
  48. <crop-select v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" corpType="KH"
  49. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled || form.srcOrderNo"
  50. style="width: 100%" @getCorpData="returnBack"></crop-select>
  51. <crop-select v-else-if="item.prop === 'salesCompany'" v-model="form[item.prop]" corpType="GS"
  52. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  53. @getCorpData="getGSName"></crop-select>
  54. <el-select v-else-if="item.prop === 'deliveryStatus'" v-model="form[item.prop]" placeholder="请选择"
  55. clearable filterable style="width: 100%" size="small"
  56. :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled">
  57. <el-option v-for="(item, index) in statusOption" :key="index" :label="item.dictValue"
  58. :value="item.dictValue" size="small"></el-option>
  59. </el-select>
  60. <el-select v-else-if="item.prop === 'warehouseType'" v-model="form[item.prop]" placeholder="请选择" clearable
  61. filterable style="width: 100%" size="small"
  62. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled">
  63. <el-option v-for="(item, index) in warehouseTypeOption" :key="index" :label="item.dictValue"
  64. :value="item.dictValue"></el-option>
  65. </el-select>
  66. <!-- <warehouse-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]"
  67. :configuration="configurationWarehouse" style="width: 100%" :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"/> -->
  68. <el-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]" placeholder="请选择仓库" clearable
  69. filterable style="width: 100%" size="small"
  70. :disabled="detailData.seeDisabled || item.disabled || browse">
  71. <el-option v-for="(item, index) in storageIdOption" :key="index" :label="item.cname"
  72. :value="item.id"></el-option>
  73. </el-select>
  74. <el-select v-else-if="item.prop === 'saleman'" v-model="form[item.prop]" placeholder="请选择" filterable
  75. size="small" style="width: 100%;" :disabled="detailData.seeDisabled">
  76. <el-option v-for="(item, index) in userList" :key="index" :label="item.realName"
  77. :value="item.realName"></el-option>
  78. </el-select>
  79. <el-input v-else-if="item.type == 'number'" placeholder="请输入" v-input-limit="2" size="small"
  80. :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  81. v-model.trim="form[item.prop]" />
  82. <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]" size="small"
  83. autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"></el-input>
  84. <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off"
  85. :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"></el-input>
  86. </el-form-item>
  87. </el-col>
  88. </el-row>
  89. </basic-container>
  90. <containerTitle title="商品信息"></containerTitle>
  91. <basic-container>
  92. <avue-crud :option="customerContact" v-model="contactsForm" :data="goodsShowData" ref="crudContact"
  93. @row-save="rowSave" @row-click="handleRowClick" @row-update="rowUpdate" @row-del="rowDel"
  94. @saveColumn="saveColumn('goods')" @resetColumn="resetColumn" :cell-style="goodsRowClassName" :key="crudIndex">
  95. <template slot="headerSerial">
  96. <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
  97. @click="$refs.crudContact.rowCellAdd()"></el-button>
  98. </template>
  99. <template slot="code" slot-scope="{row}">
  100. <!-- <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit || arrivalDisabled || deliverDisabled">选择</el-button>-->
  101. <span>{{ row.code }}</span>
  102. </template>
  103. <template slot="storageId" slot-scope="{row}">
  104. <div>
  105. <span >{{ row.storageName }}</span>
  106. </div>
  107. </template>
  108. <template slot-scope="{row,index}" slot="menu">
  109. <el-button type="text" size="small" @click="rowCell(row, index)"
  110. :disabled="detailData.seeDisabled || arrivalDisabled">{{ row.$cellEdit ? '保存' : '修改' }}
  111. </el-button>
  112. <!-- <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
  113. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled" v-if="!row.$cellEdit">删
  114. 除</el-button> -->
  115. </template>
  116. <template slot="menuLeft" slot-scope="{size}">
  117. <el-tabs v-model="goodsActives" @tab-click="handleClick">
  118. <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
  119. </el-tab-pane>
  120. <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
  121. </el-tab-pane>
  122. </el-tabs>
  123. <!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="marketDialog = true"
  124. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  125. v-if="goodsActives == 'goods'">录入明细
  126. </el-button>
  127. <el-button type="primary" icon="el-icon-plus" size="small" @click="commoditySelection"
  128. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  129. v-if="goodsActives == 'gift'">录入明细
  130. </el-button> -->
  131. <el-button type="info" :size="size" icon="el-icon-printer" @click.stop="openReport()">报表打印</el-button>
  132. <el-button type="warning" icon="el-icon-refresh" size="small" @click="resetStock">库存刷新</el-button>
  133. </template>
  134. <template slot="actualQuantity" slot-scope="{ row }">
  135. <!-- <el-input-->
  136. <!-- v-if="row.$cellEdit"-->
  137. <!-- v-model.trim="row.actualQuantity"-->
  138. <!-- v-input-limit="0"-->
  139. <!-- @change="actualQuantityChange(row)"-->
  140. <!-- :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"-->
  141. <!-- ></el-input>-->
  142. <!-- <span v-else>{{ row.actualQuantity | IntegerFormat }}</span>-->
  143. <span>{{ row.actualQuantity | IntegerFormat }}</span>
  144. </template>
  145. <!-- 到货数量-->
  146. <template slot="arrivalQuantity" slot-scope="{ row }">
  147. <el-input v-if="row.$cellEdit" v-model.trim="row.arrivalQuantity" v-input-limit="0"
  148. @input="arrivalQuantityChange(row)"></el-input>
  149. <span v-else>{{ row.arrivalQuantity | IntegerFormat }}</span>
  150. </template>
  151. <template slot="corpId" slot-scope="{ row, index }">
  152. <crop-select v-if="row.$cellEdit" v-model="row.corpId" :cropIndex="index" corpType="GYS"
  153. @getCorpData="getcorpId"
  154. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"></crop-select>
  155. <span v-else>{{ row.corpName }}</span>
  156. </template>
  157. </avue-crud>
  158. </basic-container>
  159. <fee-info ref="feeInfo" :orderFeesList="advantageProjectData"
  160. :disabled="detailData.seeDisabled || arrivalDisabled" :srcType="3" optionType="GN" itemType="收货"
  161. feeUrl="/blade-deliver-goods/deliveryfees/update" @beforeFinance="beforeFinance" :corpId="form.corpId" />
  162. <containerTitle title="附件上传"></containerTitle>
  163. <c-upload :data="bankOfDepositData" deleteUrl="/api/blade-deliver-goods/deliveryfiles/update"
  164. :enumerationValue="77" display />
  165. </el-form>
  166. </div>
  167. <el-dialog title="导入商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
  168. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
  169. <el-row :style="{ height: rowHeight }">
  170. <el-col :span="5" style="height: 100%;overflow-y: auto">
  171. <div>
  172. <el-scrollbar>
  173. <basic-container>
  174. <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick" />
  175. </basic-container>
  176. </el-scrollbar>
  177. </div>
  178. </el-col>
  179. <el-col :span="19">
  180. <basic-container>
  181. <avue-crud :option="optionTwo" :table-loading="loading" :data="data" ref="crud"
  182. @refresh-change="refreshChange" @selection-change="selectionChange" :page.sync="page"
  183. @search-change="goodsSearch" @on-load="onLoad"></avue-crud>
  184. </basic-container>
  185. </el-col>
  186. </el-row>
  187. <span slot="footer" class="dialog-footer">
  188. <el-button @click="dialogVisible = false">取 消</el-button>
  189. <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
  190. <el-button type="primary" @click="importChoice" v-if="commodityData === true"
  191. :disabled="tableData.length !== 1">导入</el-button>
  192. </span>
  193. </el-dialog>
  194. <el-dialog title="导入费用" append-to-body class="el-dialogDeep" :visible.sync="dialogCost" width="80%"
  195. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeFees">
  196. <el-row :style="{ height: rowHeight }">
  197. <el-col :span="5" style="height: 100%;overflow-y: auto">
  198. <div>
  199. <el-scrollbar>
  200. <basic-container>
  201. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost" />
  202. </basic-container>
  203. </el-scrollbar>
  204. </div>
  205. </el-col>
  206. <el-col :span="19">
  207. <basic-container>
  208. <avue-crud :option="optionTwoCost" :table-loading="loadingCost" :data="dataCost" ref="crud"
  209. @refresh-change="refreshChangeCost" @selection-change="selectionChangeCost" :page.sync="pageCost"
  210. @searchChange="feesSearch" @on-load="onLoadCost">
  211. </avue-crud>
  212. </basic-container>
  213. </el-col>
  214. </el-row>
  215. <span slot="footer" class="dialog-footer">
  216. <el-button @click="dialogCost = false">取 消</el-button>
  217. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  218. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  219. :disabled="tableDataCost.length !== 1">导入</el-button>
  220. </span>
  221. </el-dialog>
  222. <!-- 导入销售明细-->
  223. <el-dialog title="导入销售" append-to-body class="el-dialogDeep" :visible.sync="marketDialog" width="60%"
  224. :close-on-click-modal="false" :destroy-on-close="true" :modal-append-to-body='false' :close-on-press-escape="false"
  225. v-dialog-drag>
  226. <market-detail @importMarket="importMarket" @close="closeMarkeDialog" systemType="GN">
  227. </market-detail>
  228. </el-dialog>
  229. <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="客户收货确认"
  230. @onClose="onClose()"></report-dialog>
  231. </div>
  232. </template>
  233. <script>
  234. import {
  235. typeSave, detail,
  236. corpstypeTree,
  237. corpsattn,
  238. corpsbank,
  239. corpsitem,
  240. // getList,
  241. sendOutGoods,
  242. revokeOutGoods,
  243. confirmArrival,
  244. cancelArrival
  245. } from "@/api/basicData/deliveryNotice"
  246. import { getList } from "@/api/basicData/commodityType";
  247. import customerContact from "./configuration/customerContact.json"
  248. import advantageProject from "./configuration/advantageProject.json"
  249. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  250. import commodity from "./configuration/commodity.json"
  251. import optionTwoCost from "./configuration/mainListCost.json"
  252. import { getDeptLazyTree, getDeptLazyTreeTwo, customerList } from "@/api/basicData/basicFeesDesc";
  253. import { customerList as wareHouseType } from "@/api/basicData/basicStorageType"
  254. import { customerList as selectWareHouse } from "@/api/basicData/basicStorageDesc"
  255. import { selectGoodsNum } from "@/api/basicData/inventoryAccount"
  256. import { contrastObj, contrastList } from "@/util/contrastData";
  257. import { customerList as storageType } from "@/api/basicData/basicStorageType"
  258. import marketDetail from "@/components/procurement/market";
  259. import feeInfo from "@/components/fee-info/main";
  260. import {
  261. isDiscount,
  262. isPercentage,
  263. micrometerFormat,
  264. IntegerFormat
  265. } from "@/util/validate";
  266. import reportDialog from "@/components/report-dialog/main";
  267. import { gainUser } from "@/api/basicData/customerInquiry";
  268. import { getCurrentDate } from "@/util/date";
  269. export default {
  270. name: "detailsPage",
  271. props: {
  272. detailData: {
  273. type: Object
  274. }
  275. },
  276. components: {
  277. marketDetail,
  278. feeInfo,
  279. reportDialog,
  280. },
  281. data() {
  282. return {
  283. storageIdOption: [],
  284. configuration: {
  285. multipleChoices: false,
  286. multiple: false,
  287. collapseTags: false,
  288. placeholder: '请点击右边按钮选择',
  289. dicData: []
  290. },
  291. companyConfiguration: {
  292. multipleChoices: false,
  293. multiple: false,
  294. collapseTags: false,
  295. placeholder: '请点击右边按钮选择',
  296. dicData: []
  297. },
  298. configurationWarehouse: {
  299. multipleChoices: false,
  300. multiple: false,
  301. collapseTags: false,
  302. placeholder: "请点击右边按钮选择",
  303. dicData: [],
  304. clearable: true,
  305. },
  306. form: {
  307. businessDate: getCurrentDate()
  308. },
  309. data: [],
  310. loadingCost: false,
  311. choiceData: false,
  312. commodityData: false,
  313. dataCost: [],
  314. treeDataGoods: [],
  315. treeData: [],
  316. choiceIndex: '',
  317. dialogCost: false,
  318. treeDeptId: '',
  319. treeDeptIdCost: '',
  320. pageCost: {
  321. pageSize: 10,
  322. currentPage: 1,
  323. total: 0
  324. },
  325. page: {
  326. pageSize: 10,
  327. currentPage: 1,
  328. total: 0
  329. },
  330. loading: false,
  331. contactsForm: {},
  332. optionTwo: commodity,
  333. optionTwoCost: optionTwoCost,
  334. treeOptionCost: {
  335. nodeKey: 'id',
  336. lazy: true,
  337. treeLoad: function (node, resolve) {
  338. const parentId = (node.level === 0) ? 0 : node.data.id;
  339. getDeptLazyTree(parentId).then(res => {
  340. resolve(res.data.data.map(item => {
  341. return {
  342. ...item,
  343. leaf: !item.hasChildren
  344. }
  345. }))
  346. });
  347. },
  348. addBtn: false,
  349. menu: false,
  350. size: 'small',
  351. props: {
  352. labelText: '标题',
  353. label: 'title',
  354. value: 'value',
  355. children: 'children'
  356. }
  357. },
  358. treeOption: {
  359. nodeKey: 'id',
  360. lazy: true,
  361. treeLoad: function (node, resolve) {
  362. const parentId = (node.level === 0) ? 0 : node.data.id;
  363. getDeptLazyTreeTwo(parentId).then(res => {
  364. resolve(res.data.data.map(item => {
  365. return {
  366. ...item,
  367. leaf: !item.hasChildren
  368. }
  369. }))
  370. });
  371. },
  372. addBtn: false,
  373. menu: false,
  374. size: 'small',
  375. props: {
  376. labelText: '标题',
  377. label: 'title',
  378. value: 'value',
  379. children: 'children'
  380. }
  381. },
  382. dialogVisible: false,
  383. advantageProjectForm: {},
  384. bankOfDepositForm: {},
  385. contactsData: [],
  386. advantageProjectData: [],
  387. disabled: false,
  388. saveLoading: false,
  389. bankOfDepositData: [],
  390. tableDataCost: [],
  391. dic: [],
  392. tableData: [],
  393. customerContact: {},
  394. advantageProject: {},
  395. bankOfDeposit: bankOfDeposit,
  396. basicData: {
  397. column: [
  398. {
  399. label: '系统编号',//收货通知(点击)
  400. prop: 'sysNo',
  401. disabled: true,
  402. rules: [
  403. {
  404. required: false,
  405. message: ' ',
  406. trigger: 'blur'
  407. }
  408. ]
  409. }, {
  410. label: '客户名称',
  411. prop: 'corpId',
  412. span: 16,
  413. rules: [
  414. {
  415. required: true,
  416. message: ' ',
  417. trigger: 'blur'
  418. }
  419. ]
  420. }, {
  421. label: '单据状态',
  422. prop: 'deliveryStatus',
  423. disabled: true,
  424. rules: [
  425. {
  426. required: true,
  427. message: ' ',
  428. trigger: 'blur'
  429. }
  430. ]
  431. }, {
  432. label: '所属公司',
  433. prop: 'salesCompany', //salesCompany
  434. span: 16,
  435. rules: [
  436. {
  437. required: true,
  438. message: ' ',
  439. trigger: 'blur'
  440. }
  441. ]
  442. }, {
  443. label: '仓库类型',
  444. prop: 'warehouseType',//字典表
  445. rules: [
  446. {
  447. required: true,
  448. message: ' ',
  449. trigger: 'blur'
  450. }
  451. ]
  452. }, {
  453. label: '仓库名称',
  454. prop: 'storageId',
  455. span: 16,
  456. rules: [
  457. {
  458. required: true,
  459. message: ' ',
  460. trigger: 'blur'
  461. }
  462. ]
  463. }, {
  464. label: '匹配订单号',
  465. prop: 'srcOrderNo',
  466. disabled: true,
  467. rules: [
  468. {
  469. required: false,
  470. message: ' ',
  471. trigger: 'blur'
  472. }
  473. ]
  474. }, {
  475. label: '出库金额',
  476. prop: 'deliveryAmount',
  477. disabled: false,
  478. rules: [
  479. {
  480. required: false,
  481. message: ' ',
  482. trigger: 'blur'
  483. }
  484. ]
  485. }, {
  486. label: '出库数量',
  487. prop: 'totalQuantity',
  488. disabled: false,
  489. rules: [
  490. {
  491. required: false,
  492. message: ' ',
  493. trigger: 'blur'
  494. }
  495. ]
  496. }, {
  497. label: '出库日期',
  498. prop: 'businessDate',
  499. type: 'datetime',
  500. }, {
  501. label: '制单时间',
  502. type: 'datetime',
  503. prop: 'createTime',
  504. disabled: true,
  505. rules: [
  506. {
  507. required: false,
  508. message: ' ',
  509. trigger: 'blur'
  510. }
  511. ]
  512. }, {
  513. label: '费用合计',
  514. prop: 'totalCost',
  515. rules: [
  516. {
  517. required: false,
  518. message: ' ',
  519. trigger: 'blur'
  520. }
  521. ]
  522. }, {
  523. label: '收货地址',
  524. prop: 'arrivalAddress',
  525. rules: [
  526. {
  527. required: false,
  528. message: ' ',
  529. trigger: 'blur'
  530. }
  531. ]
  532. }, {
  533. label: '收货人',
  534. prop: 'arrivalContact',
  535. rules: [
  536. {
  537. required: false,
  538. message: ' ',
  539. trigger: 'blur'
  540. }
  541. ]
  542. }, {
  543. label: '收货电话',
  544. prop: 'arrivalTel',
  545. rules: [
  546. {
  547. required: false,
  548. message: ' ',
  549. trigger: 'blur'
  550. }
  551. ]
  552. }, {
  553. label: '包装要求',
  554. prop: 'packageRemarks',
  555. rules: [
  556. {
  557. required: false,
  558. message: ' ',
  559. trigger: 'blur'
  560. }
  561. ]
  562. }, {
  563. label: '赠送积分',
  564. prop: 'presenterIntegral',
  565. disabled: true,
  566. rules: [
  567. {
  568. required: false,
  569. message: ' ',
  570. trigger: 'blur'
  571. }
  572. ]
  573. }, {
  574. label: '兑换积分',
  575. prop: 'convertIntegral',
  576. disabled: true,
  577. rules: [
  578. {
  579. required: false,
  580. message: ' ',
  581. trigger: 'blur'
  582. }
  583. ]
  584. }, {
  585. label: '产生返利',
  586. prop: 'createProfit',
  587. disabled: false,
  588. type: 'number',
  589. rules: [
  590. {
  591. required: false,
  592. message: ' ',
  593. trigger: 'blur'
  594. }
  595. ]
  596. }, {
  597. label: '业务员',
  598. prop: 'saleman',
  599. rules: [
  600. {
  601. required: false,
  602. message: ' ',
  603. trigger: 'change'
  604. }
  605. ]
  606. },
  607. {
  608. label: '重量合计',
  609. prop: 'totalWeight',
  610. disabled: true,
  611. rules: [
  612. {
  613. required: false,
  614. message: ' ',
  615. trigger: 'blur'
  616. }
  617. ]
  618. }, {
  619. label: '体积合计',
  620. prop: 'totalVolumn',
  621. disabled: true,
  622. rules: [
  623. {
  624. required: false,
  625. message: ' ',
  626. trigger: 'blur'
  627. }
  628. ]
  629. }, {
  630. label: '使用返利',
  631. prop: 'thisUsedProfit',
  632. disabled: true,
  633. rules: [
  634. {
  635. required: false,
  636. message: ' ',
  637. trigger: 'blur'
  638. }
  639. ]
  640. },
  641. {
  642. label: "备注",
  643. span: 24,
  644. type: 'textarea',
  645. prop: "otherRemarks",
  646. mock: {
  647. type: 'county'
  648. }
  649. }
  650. ]
  651. },
  652. statusOption: [],
  653. warehouseTypeOption: [],
  654. // 仓库类型
  655. warehouseType: [],
  656. // 仓库名称
  657. warehouseName: [],
  658. maxFeeNum: 0,
  659. maxGoodsNum: 0,
  660. oldForm: {
  661. orderStatus: "录入"
  662. },
  663. oldGoodsList: [],
  664. oldGiftList: [],
  665. oldFeesList: [],
  666. oldUploadList: [],
  667. // 导入销售订单明细
  668. marketDialog: false,
  669. // 弹窗高度
  670. rowHeight: '',
  671. // 查询时loading页面
  672. pageLoading: false,
  673. goodsActives: 'goods',
  674. // 用于判断 tab是否是当前
  675. saveActives: '',
  676. goodsDisabled: false,
  677. // 赠品信息数据
  678. giftData: [],
  679. // 商品信息展示数据
  680. goodsShowData: [],
  681. // 确认收货禁用
  682. deliverDisabled: false,
  683. // 确认到货禁用
  684. arrivalDisabled: false,
  685. switchDialog: false,
  686. userList: [],
  687. crudIndex: 0,
  688. }
  689. },
  690. mounted() {
  691. this.$nextTick(() => {
  692. // 监听浏览器高度变化,改变表格高度
  693. window.onresize = () => {
  694. this.rowHeight = (window.innerHeight - 130) + 'px'
  695. }
  696. })
  697. },
  698. filters: {
  699. IntegerFormat(num) {
  700. return IntegerFormat(num);
  701. },
  702. decimalFormat(num) {
  703. return num ? Number(num).toFixed(2) : "0.00";
  704. },
  705. },
  706. //初始化查询
  707. async created() {
  708. this.rowHeight = (window.innerHeight - 130) + 'px'
  709. this.customerContact = await this.getColumnData(this.getColumnName(21), customerContact);
  710. this.advantageProject = await this.getColumnData(this.getColumnName(22), advantageProject);
  711. this.getWorkDicts("order_status").then(res => {
  712. this.statusOption = res.data.data
  713. })
  714. storageType().then(res => {
  715. this.storageIdOption = res.data.data.records
  716. })
  717. this.getWorkDicts("warehouseType").then(res => {
  718. this.warehouseTypeOption = res.data.data
  719. })
  720. this.$set(this.form, 'deliveryStatus', '录入')
  721. this.$set(this.form, 'presenterIntegral', 0)
  722. this.$set(this.form, 'convertIntegral', 0)
  723. this.$set(this.form, 'createProfit', 0)
  724. wareHouseType().then(res => {
  725. this.warehouseType = res.data.data.records
  726. this.warehouseType.forEach(item => {
  727. this.$set(item, 'label', item.cname)
  728. this.$set(item, 'value', item.id)
  729. if (item.hasChildren) {
  730. this.$set(item, 'children', [])
  731. }
  732. })
  733. let result = [], temp = {}
  734. for (let i = 0; i < this.warehouseType.length; i++) {
  735. temp[this.warehouseType[i].id] = this.warehouseType[i]
  736. }
  737. for (let j = 0; j < this.warehouseType.length; j++) {
  738. let current = this.warehouseType[j]
  739. let tempCurrentParent = temp[current.parentId]
  740. if (tempCurrentParent) {
  741. if (!tempCurrentParent["children"]) {
  742. tempCurrentParent["children"] = []
  743. }
  744. tempCurrentParent["children"].push(current)
  745. } else {
  746. result.push(current)
  747. }
  748. }
  749. this.warehouseType = result
  750. });
  751. selectWareHouse().then(res => {
  752. this.warehouseName = res.data.data.records
  753. })
  754. gainUser().then(res => {
  755. this.userList = res.data.data;
  756. });
  757. if (this.detailData.id) {
  758. let id = this.detailData.id
  759. this.queryData(id)
  760. } else if (this.detailData.form) {
  761. this.form = JSON.parse(this.detailData.form);
  762. this.$set(this.form, 'orgId', this.form.id);
  763. delete this.form.createTime
  764. delete this.form.id
  765. delete this.form.sysNo
  766. this.$set(this.form, 'deliveryStatus', '录入')
  767. this.$set(this.form, 'srcOrderNo', this.form.orgOrderNo)
  768. this.$set(this.form, 'arrivalContact', this.form.corpAttn)
  769. this.$set(this.form, 'arrivalTel', this.form.corpTel)
  770. this.$set(this.form, 'totalWeight', this.form.cartonWeight)
  771. this.$set(this.form, 'totalVolumn', this.form.cntrVolumn)
  772. this.form.orderItemsList.forEach(item => {
  773. this.$set(item, 'contractNumber', this.form.orgOrderNo)
  774. })
  775. this.contactsData = this.form.orderItemsList.filter(item => {
  776. return item.goodType == 0
  777. })
  778. this.giftData = this.form.orderItemsList.filter(item => {
  779. return item.goodType == 1
  780. })
  781. this.giftData.forEach(item => {
  782. // console.log(item);
  783. this.$set(item, 'deliveryAmount', item.amount)
  784. this.$set(item,'storageId',item.storageId)
  785. this.$set(item,'storageName',item.storageName)
  786. this.$set(item, 'specificationAndModel', item.itemType)
  787. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  788. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  789. this.$set(item, "srcId", item.id)
  790. this.$set(item, 'actualQuantity', item.orderQuantity)
  791. delete item.id
  792. delete item.pid
  793. delete item.createTime
  794. delete item.createUser
  795. delete item.status
  796. delete item.updateTime
  797. delete item.updateUser
  798. })
  799. this.goodsShowData = this.giftData;
  800. this.goodsActives = 'goods';
  801. this.handleClick({ name: this.goodsActives })
  802. // this.contactsData = this.form.orderItemsList
  803. delete this.form.orderItemsList
  804. this.configuration.dicData = this.form.corpName
  805. delete this.form.corpName
  806. this.$set(this.form, 'salesCompany', this.form.belongToCorpId)
  807. delete this.form.belongToCorpList
  808. this.$set(this.form, 'deliveryAmount', 0)
  809. this.$set(this.form, 'totalQuantity', 0)
  810. this.$set(this.form, 'totalCost', 0)
  811. this.advantageProjectData = this.form.orderFeesList;
  812. delete this.form.orderFeesList
  813. this.advantageProjectData.forEach(item => {
  814. delete item.createDept
  815. delete item.createTime
  816. delete item.createUser
  817. delete item.id
  818. delete item.isDeleted
  819. delete item.pid
  820. delete item.status
  821. delete item.tenantId
  822. delete item.updateTime
  823. delete item.updateUser
  824. })
  825. this.contactsData.forEach(item => {
  826. this.$set(item,'storageId',item.storageId)
  827. this.$set(item,'storageName',item.storageName)
  828. this.$set(item, 'containerVolume', item.cntrVolumn)
  829. this.$set(item, 'actualWeight', item.cartonWeight)
  830. this.$set(item, 'specificationAndModel', item.itemType)
  831. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  832. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  833. this.$set(item, "srcId", item.id)
  834. this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
  835. this.$set(item, "arrivalQuantity", item.actualQuantity)
  836. this.$set(item, "deliveryAmount", item.amount)
  837. this.$set(item, "purchaseTotalAmount", (Number(item.purchaseAmount) * Number(item.actualQuantity)))
  838. item.purchaseTotalAmount = item.purchaseTotalAmount.toFixed(2)
  839. this.$set(item, "inventoryNumber", item.storageQuantity)
  840. this.form.deliveryAmount += Number(item.deliveryAmount)
  841. this.form.totalQuantity += Number(item.actualQuantity)
  842. this.form.totalCost += Number(item.deliveryAmount)
  843. // 出库数量和出库金额的比例
  844. // this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
  845. delete item.id
  846. delete item.pid
  847. delete item.createTime
  848. delete item.createUser
  849. delete item.status
  850. delete item.updateTime
  851. delete item.updateUser
  852. })
  853. } else if (this.detailData.copyId) {
  854. let id = this.detailData.copyId
  855. this.queryData(id, true)
  856. }
  857. this.oldForm = Object.assign({}, this.form)
  858. this.customerContact.height = window.innerHeight - 240;
  859. this.crudIndex++;
  860. },
  861. updated() {
  862. this.$nextTick(() => {
  863. this.$refs.crudContact.doLayout();
  864. })
  865. },
  866. watch: {
  867. },
  868. methods: {
  869. queryData(id, isCopy = false, type) {
  870. this.pageLoading = true
  871. this.saveLoading = true
  872. detail(id).then(res => {
  873. this.form = res.data.data;
  874. if (this.form.deliveryStatus == '已收货') {
  875. this.deliverDisabled = true;
  876. this.arrivalDisabled = false;
  877. } else if (this.form.deliveryStatus == '已到货') {
  878. this.arrivalDisabled = true;
  879. this.deliverDisabled = false;
  880. } else {
  881. this.arrivalDisabled = false;
  882. this.deliverDisabled = false;
  883. }
  884. if (this.deliverDisabled) {
  885. this.customerContact.column.forEach(item => {
  886. if (item.prop == 'arrivalQuantity') {
  887. item.disabled = false
  888. } else {
  889. item.disabled = true
  890. }
  891. })
  892. } else {
  893. this.customerContact.column.forEach(item => {
  894. item.disabled = false
  895. })
  896. }
  897. // this.contactsData = this.form.deliveryItemsList
  898. this.contactsData = this.form.deliveryItemsList.filter(item => {
  899. return item.goodType == 0
  900. })
  901. this.giftData = this.form.deliveryItemsList.filter(item => {
  902. return item.goodType == 1
  903. })
  904. this.giftData.forEach(item => {
  905. this.$set(item, 'deliveryAmount', item.amount)
  906. })
  907. this.goodsShowData = this.giftData;
  908. this.goodsActives = 'goods';
  909. this.handleClick({ name: this.goodsActives })
  910. this.advantageProjectData = this.form.deliveryFeesList
  911. this.bankOfDepositData = this.form.deliveryFilesList
  912. this.configuration.dicData = this.form.corpName
  913. this.form.deliveryAmount = 0
  914. this.form.totalQuantity = 0
  915. this.contactsData.forEach(item => {
  916. this.form.deliveryAmount += Number(item.deliveryAmount)
  917. this.form.totalQuantity += Number(item.actualQuantity)
  918. // 出库金额和出库数量的比例
  919. // this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
  920. })
  921. if (this.form.companyName) {
  922. this.companyConfiguration.dicData = this.companyConfiguration.dicData.concat(this.form.companyName)
  923. }
  924. if (this.form.storageMap) {
  925. this.configurationWarehouse.dicData = this.form.storageMap
  926. }
  927. let feesData = []
  928. this.form.deliveryFeesList.forEach(item => {
  929. let a = {
  930. cname: item.corpName,
  931. id: item.corpId
  932. }
  933. feesData.push(a)
  934. })
  935. this.configuration.dicData = this.configuration.dicData.concat(feesData)
  936. // 去重
  937. this.removeRepeat()
  938. delete this.form.deliveryItemsList
  939. delete this.form.deliveryFeesList
  940. delete this.form.deliveryFilesList
  941. delete this.form.corpName
  942. delete this.form.companyName
  943. // 获取最大值
  944. let num = []
  945. this.advantageProjectData.forEach(item => {
  946. num.push(item.sort)
  947. })
  948. if (num.length == 0) {
  949. this.maxFeeNum = 0;
  950. } else {
  951. this.maxFeeNum = num.reduce((a, b) => {
  952. return b > a ? b : a;
  953. })
  954. }
  955. let goodsNum = []
  956. this.contactsData.forEach(item => {
  957. goodsNum.push(item.sort)
  958. })
  959. if (goodsNum.length == 0) {
  960. this.maxGoodsNum = 0;
  961. } else {
  962. this.maxGoodsNum = goodsNum.reduce((a, b) => {
  963. return b > a ? b : a;
  964. })
  965. }
  966. this.oldGoodsList = []
  967. this.oldGiftList = []
  968. this.oldFeesList = []
  969. this.oldUploadList = []
  970. this.oldForm = Object.assign({}, this.form)
  971. this.oldGoodsList = this.deepClone(this.contactsData)
  972. this.oldGiftList = this.deepClone(this.giftData)
  973. this.oldFeesList = this.deepClone(this.advantageProjectData)
  974. this.oldUploadList = this.deepClone(this.bankOfDepositData)
  975. if (isCopy) {
  976. delete this.form.sysNo
  977. delete this.form.id
  978. this.contactsData.forEach(item => {
  979. delete item.id
  980. delete item.pid
  981. delete item.itemId
  982. })
  983. this.goodsShowData.forEach(item => {
  984. delete item.id
  985. delete item.pid
  986. delete item.itemId
  987. })
  988. this.giftData.forEach(item => {
  989. delete item.id
  990. delete item.pid
  991. delete item.itemId
  992. })
  993. this.advantageProjectData.forEach(item => {
  994. delete item.id
  995. delete item.pid
  996. })
  997. this.bankOfDepositData.forEach(item => {
  998. delete item.id
  999. delete item.pid
  1000. })
  1001. this.form.deliveryStatus = '录入'
  1002. }
  1003. if (type == '收货') {
  1004. this.$nextTick(() => {
  1005. this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
  1006. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1007. this.form.deliveryFilesList = this.bankOfDepositData
  1008. if (typeof this.form.corpsTypeId == 'object') {
  1009. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1010. }
  1011. this.pageLoading = true
  1012. this.saveLoading = true
  1013. this.saveActives = ''
  1014. sendOutGoods(this.form).then(res => {
  1015. this.$message.success('收货成功')
  1016. this.queryData(res.data.data.id)
  1017. }).finally(() => {
  1018. this.pageLoading = false
  1019. this.saveLoading = false
  1020. })
  1021. })
  1022. } else if (type == '到货') {
  1023. if (this.goodsActives == 'gift') {
  1024. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1025. } else {
  1026. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1027. }
  1028. this.saveLoading = true
  1029. this.pageLoading = true
  1030. this.saveActives = ''
  1031. confirmArrival(this.form).then(res => {
  1032. this.$message.success('已确认到货')
  1033. this.queryData(this.form.id)
  1034. }).catch(() => {
  1035. this.pageLoading = false
  1036. this.saveLoading = false
  1037. })
  1038. }
  1039. }).finally(() => {
  1040. this.saveLoading = false
  1041. this.pageLoading = false
  1042. });
  1043. },
  1044. getcorpId(row) {
  1045. this.contactsData[row.index].corpId = row.id;
  1046. this.contactsData[row.index].corpName = row.cname;
  1047. },
  1048. // 出库数量变化时调用
  1049. actualQuantityChange(row) {
  1050. // if (row.scale) {
  1051. // row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
  1052. // }
  1053. if (this.goodsActives == 'goods') {
  1054. if (Number(row.actualQuantity) < Number(row.arrivalQuantity)) {
  1055. row.arrivalQuantity = row.actualQuantity
  1056. row.purchaseTotalAmount = (Number(row.arrivalQuantity) * Number(row.purchaseAmount)).toFixed(2)
  1057. row.deliveryAmount = (Number(row.arrivalQuantity) * Number(row.price)).toFixed(2)
  1058. }
  1059. this.form.deliveryAmount = 0
  1060. this.form.totalQuantity = 0
  1061. this.contactsData.forEach(item => {
  1062. this.form.deliveryAmount += Number(item.deliveryAmount)
  1063. this.form.totalQuantity += Number(item.actualQuantity)
  1064. })
  1065. } else {
  1066. row.integral = Number(row.integralMultiples) * Number(row.actualQuantity)
  1067. this.$set(this.form, 'convertIntegral', 0)
  1068. this.goodsShowData.forEach(item => {
  1069. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1070. })
  1071. }
  1072. },
  1073. // 到货数量变化计算
  1074. arrivalQuantityChange(row) {
  1075. if (this.goodsActives == 'goods') {
  1076. if (Number(row.arrivalQuantity) > Number(row.actualQuantity)) {
  1077. this.$message.error('到货数量不能超过出库数量')
  1078. row.arrivalQuantity = 0
  1079. }
  1080. row.purchaseTotalAmount = (Number(row.arrivalQuantity) * Number(row.purchaseAmount)).toFixed(2)
  1081. row.deliveryAmount = (Number(row.arrivalQuantity) * Number(row.price)).toFixed(2)
  1082. row.integral = Number(row.integralMultiples) * Number(row.arrivalQuantity)
  1083. this.$set(this.form, 'presenterIntegral', 0)
  1084. this.goodsShowData.forEach(item => {
  1085. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1086. })
  1087. }
  1088. },
  1089. // 类别变换时触发
  1090. warehouseTreeChange(id) {
  1091. this.warehouseName = []
  1092. if (this.firstComing) {
  1093. if (!this.form.storageId) {
  1094. this.$set(this.form, 'storageId', null)
  1095. } else {
  1096. this.form.storageId = null
  1097. }
  1098. }
  1099. let data = {
  1100. storageTypeId: id
  1101. }
  1102. selectWareHouse(data).then(res => {
  1103. this.warehouseName = res.data.data.records
  1104. })
  1105. this.firstComing = true
  1106. },
  1107. //点击行可编辑
  1108. handleRowClick(row, event, column) {
  1109. },
  1110. //商品编辑
  1111. rowCell(row, index) {
  1112. this.$refs.crudContact.rowCell(row, row.$index)
  1113. },
  1114. //费用编辑
  1115. rowCellTwo(row, index) {
  1116. this.$refs.crudProject.rowCell(row, row.$index)
  1117. },
  1118. //费用新增触发
  1119. costIncrease() {
  1120. this.dialogCost = !this.dialogCost
  1121. this.choiceData = false
  1122. },
  1123. //商品新增触发
  1124. commoditySelection() {
  1125. this.dialogVisible = !this.dialogVisible
  1126. this.tableData = []
  1127. this.commodityData = false
  1128. },
  1129. //点击费用明细选择触发
  1130. choice(row) {
  1131. this.dialogCost = !this.dialogCost
  1132. this.choiceData = true
  1133. this.choiceIndex = row.$index
  1134. },
  1135. //点击商品明细选择触发
  1136. commodityChoice(row) {
  1137. this.dialogVisible = !this.dialogVisible
  1138. this.commodityData = true
  1139. this.choiceIndexT = row.$index
  1140. },
  1141. //导入商品触发
  1142. importChoice() {
  1143. if (this.tableData.length === 1) {
  1144. this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
  1145. this.contactsData[this.choiceIndexT].code = this.tableData[0].code
  1146. this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
  1147. this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].typeno
  1148. this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
  1149. this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
  1150. selectGoodsNum({
  1151. goodsId: this.tableData[0].id,
  1152. itemType: this.tableData[0].typeno,
  1153. tradeType: 'GN'
  1154. }).then(res => {
  1155. this.contactsData[this.choiceIndexT].storageQuantity = res.data.data
  1156. })
  1157. }
  1158. this.dialogVisible = !this.dialogVisible
  1159. this.commodityData = false
  1160. },
  1161. //费用编辑导入触发
  1162. choiceCost() {
  1163. if (this.tableDataCost.length === 1) {
  1164. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  1165. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  1166. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  1167. }
  1168. this.dialogCost = !this.dialogCost
  1169. this.choiceData = false
  1170. },
  1171. //费用导入触发
  1172. importCost() {
  1173. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  1174. if (this.tableDataCost.length > 0) {
  1175. for (let item in this.tableDataCost) {
  1176. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  1177. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  1178. this.tableDataCost[item].sort = this.maxFeeNum + 1
  1179. this.maxFeeNum++
  1180. delete this.tableDataCost[item].id
  1181. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  1182. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  1183. }
  1184. }
  1185. this.tableDataCost = []
  1186. this.dialogCost = false
  1187. },
  1188. //确认导入触发
  1189. importGoods() {
  1190. // this.contactsData = this.contactsData.concat(this.tableData)
  1191. if (this.tableData.length > 0) {
  1192. for (let item in this.tableData) {
  1193. selectGoodsNum({
  1194. goodsId: this.tableData[item].id,
  1195. itemType: this.tableData[item].typeno,
  1196. tradeType: 'GN'
  1197. }).then(res => {
  1198. this.tableData[item].storageQuantity = res.data.data
  1199. this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].typeno)
  1200. this.tableData[item].itemId = this.tableData[item].id
  1201. this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
  1202. delete this.tableData[item].goodsTypeName
  1203. delete this.tableData[item].id
  1204. delete this.tableData[item].status
  1205. delete this.tableData[item].isDeleted
  1206. this.$set(this.tableData[item], 'inventoryNumber', 0)
  1207. this.$set(this.tableData[item], 'actualQuantity', 0)
  1208. this.$set(this.tableData[item], 'inventoryAmount', 0)
  1209. this.$set(this.tableData[item], 'deliveryAmount', 0)
  1210. this.tableData[item].price = 0
  1211. this.tableData[item].amount = 0
  1212. if (this.goodsActives == "goods") {
  1213. this.$set(this.tableData[item], 'goodType', 0)
  1214. this.arrivalQuantityChange(this.tableData[item])
  1215. } else {
  1216. this.$set(this.tableData[item], 'goodType', 1)
  1217. this.$set(this.tableData[item], 'integralMultiples', this.tableData[item].integral)
  1218. this.actualQuantityChange(this.tableData[item])
  1219. }
  1220. this.$set(this.tableData[item], 'integral', '0')
  1221. this.tableData[item].sort = this.maxGoodsNum + 1
  1222. this.maxGoodsNum++
  1223. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  1224. this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
  1225. if (this.goodsActives == "goods") {
  1226. this.arrivalQuantityChange(this.tableData[item])
  1227. } else {
  1228. this.actualQuantityChange(this.tableData[item])
  1229. }
  1230. })
  1231. }
  1232. }
  1233. this.dialogVisible = false
  1234. },
  1235. closeGoods() {
  1236. this.treeDataGoods = [];
  1237. this.treeDeptId = "";
  1238. },
  1239. closeFees() {
  1240. this.treeDeptIdCost = "";
  1241. this.treeData = [];
  1242. },
  1243. //选中触发
  1244. selectionChange(list) {
  1245. this.tableData = list
  1246. },
  1247. //费用选中触发
  1248. selectionChangeCost(list) {
  1249. this.tableDataCost = list
  1250. },
  1251. //导入页左商品类型查询
  1252. nodeClick(data) {
  1253. this.treeDeptId = data.id;
  1254. this.page.currentPage = 1;
  1255. this.onLoad(this.page);
  1256. },
  1257. //导入页左费用类型查询
  1258. nodeClickCost(data) {
  1259. this.treeDeptIdCost = data.id;
  1260. this.pageCost.currentPage = 1;
  1261. this.onLoadCost(this.pageCost);
  1262. },
  1263. //刷新触发
  1264. refreshChange() {
  1265. this.treeDeptId = '';
  1266. this.page.currentPage = 1;
  1267. this.onLoad(this.page);
  1268. },
  1269. //费用刷新触发
  1270. refreshChangeCost() {
  1271. this.treeDeptIdCost = '';
  1272. this.pageCost.currentPage = 1;
  1273. this.onLoadCost(this.pageCost);
  1274. },
  1275. //新增商品信息保存触发
  1276. rowSave(row, done, loading) {
  1277. // this.contactsData.push(row)
  1278. done()
  1279. },
  1280. //修改商品信息触发
  1281. rowUpdate(row, index, done, loading) {
  1282. done(row);
  1283. },
  1284. //删除商品信息触发
  1285. rowDel(row, index, donerowDel) {
  1286. this.$confirm("确定将选择数据删除?", {
  1287. confirmButtonText: "确定",
  1288. cancelButtonText: "取消",
  1289. type: "warning"
  1290. }).then(() => {
  1291. //商品判断是否需要调用删除接口
  1292. if (row.id) {
  1293. corpsattn(row.id).then(res => {
  1294. this.$message({
  1295. type: "success",
  1296. message: "操作成功!"
  1297. });
  1298. this.goodsShowData.splice(row.$index, 1);
  1299. // 删除时主表积分跟着改变
  1300. if (this.goodsActives == 'goods') {
  1301. this.form.presenterIntegral = 0;
  1302. this.goodsShowData.forEach(item => {
  1303. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1304. })
  1305. } else {
  1306. this.form.convertIntegral = 0;
  1307. this.goodsShowData.forEach(item => {
  1308. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1309. })
  1310. }
  1311. })
  1312. } else {
  1313. this.$message({
  1314. type: "success",
  1315. message: "操作成功!"
  1316. });
  1317. this.goodsShowData.splice(row.$index, 1);
  1318. // 删除时主表积分跟着改变
  1319. if (this.goodsActives == 'goods') {
  1320. this.form.presenterIntegral = 0;
  1321. this.goodsShowData.forEach(item => {
  1322. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1323. })
  1324. } else {
  1325. this.form.convertIntegral = 0;
  1326. this.goodsShowData.forEach(item => {
  1327. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1328. })
  1329. }
  1330. }
  1331. })
  1332. },
  1333. //新增费用明细保存触发
  1334. rowSaveProject(row, done, loading) {
  1335. // this.advantageProjectData.push(row)
  1336. done()
  1337. },
  1338. //修改费用明细触发
  1339. rowUpdateProject(row, index, done, loading) {
  1340. done(row);
  1341. },
  1342. goodsSearch(params, done) {
  1343. this.treeDeptId = '';
  1344. this.onLoad(this.page, params);
  1345. done()
  1346. },
  1347. //商品列表查询
  1348. onLoad(page, params = {}) {
  1349. this.loading = true;
  1350. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
  1351. const data = res.data.data;
  1352. this.page.total = data.total;
  1353. this.data = data.records;
  1354. this.loading = false;
  1355. });
  1356. },
  1357. // 费用查询按钮
  1358. feesSearch(params, done) {
  1359. this.treeDeptIdCost = '';
  1360. this.onLoadCost(this.pageCost, params)
  1361. done()
  1362. },
  1363. //费用查询
  1364. onLoadCost(page, params = {}) {
  1365. this.loadingCost = true;
  1366. let queryParams = Object.assign({}, params, {
  1367. pageSize: page.pageSize,
  1368. pageNum: page.currentPage,
  1369. parentId: 0,
  1370. feesTypeId: this.treeDeptIdCost
  1371. })
  1372. customerList(queryParams).then(res => {
  1373. const data = res.data.data;
  1374. this.pageCost.total = data.total;
  1375. this.dataCost = data.records;
  1376. this.loadingCost = false;
  1377. });
  1378. },
  1379. //删除费用明细触发
  1380. rowDelProject(row, index, donerowDel) {
  1381. this.$confirm("确定将选择数据删除?", {
  1382. confirmButtonText: "确定",
  1383. cancelButtonText: "取消",
  1384. type: "warning"
  1385. }).then(() => {
  1386. //费用判断是否需要调用删除接口
  1387. if (row.id) {
  1388. corpsitem(row.id).then(res => {
  1389. this.$message({
  1390. type: "success",
  1391. message: "操作成功!"
  1392. });
  1393. this.advantageProjectData.splice(row.$index, 1);
  1394. })
  1395. } else {
  1396. this.$message({
  1397. type: "success",
  1398. message: "操作成功!"
  1399. });
  1400. this.advantageProjectData.splice(row.$index, 1);
  1401. }
  1402. })
  1403. },
  1404. // 去重
  1405. removeRepeat() {
  1406. let obj = []
  1407. this.configuration.dicData = this.configuration.dicData.reduce((current, next) => {
  1408. obj[next.id] ? '' : obj[next.id] = true && current.push(next)
  1409. return current
  1410. }, [])
  1411. },
  1412. //
  1413. receiveList(data) {
  1414. this.configuration.dicData = this.configuration.dicData.concat(data)
  1415. this.removeRepeat()
  1416. },
  1417. //修改提交触发
  1418. editCustomer(isBack = false, type) {
  1419. this.$refs["form"].validate((valid) => {
  1420. if (valid) {
  1421. //商品信息
  1422. this.contactsData.forEach(item => {
  1423. this.$set(item, 'contractAmount', item.deliveryAmount)
  1424. })
  1425. if (this.goodsActives == 'gift') {
  1426. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1427. } else {
  1428. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1429. }
  1430. this.form.deliveryItemsList.forEach(item => {
  1431. if (item.orderNo) {
  1432. this.$set(item, 'contractNumber', item.orderNo)
  1433. this.$set(item, 'srcOrderNo', item.orderNo)
  1434. }
  1435. this.$set(item, 'contractAmount', item.deliveryAmount)
  1436. })
  1437. this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
  1438. // this.form.deliveryFeesList = this.advantageProjectData
  1439. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1440. this.form.deliveryFilesList = this.bankOfDepositData
  1441. if (typeof this.form.corpsTypeId == 'object') {
  1442. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1443. }
  1444. this.saveLoading = true
  1445. this.form.billType = 'FH'
  1446. // 如果有id解锁,没有跳过
  1447. // !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
  1448. typeSave(this.form).then(res => {
  1449. this.$message({ type: "success", message: this.form.id ? "修改成功!" : "新增成功!" });
  1450. // this.$set(this.detailData, 'seeDisabled', true);
  1451. if (isBack) {
  1452. //成功关闭此页面回到列表页
  1453. this.$emit("goBack");
  1454. this.leaveDetailsKey(this.$route.name)
  1455. } else {
  1456. this.saveActives = ''
  1457. this.queryData(res.data.data.id, false, type)
  1458. }
  1459. }).catch(() => {
  1460. this.pageLoading = false
  1461. this.saveLoading = false
  1462. })
  1463. } else {
  1464. return false;
  1465. }
  1466. });
  1467. },
  1468. //复制新单
  1469. copyOrder() {
  1470. this.queryData(this.form.id, true)
  1471. },
  1472. //返回列表
  1473. backToList() {
  1474. let getGoodsList = []
  1475. let getGiftList = []
  1476. let getFeeList = this.$refs.feeInfo.submitData()
  1477. if (this.goodsActives == 'gift') {
  1478. getGiftList = this.goodsShowData
  1479. getGoodsList = this.contactsData
  1480. } else {
  1481. getGoodsList = this.goodsShowData
  1482. getGiftList = this.giftData
  1483. }
  1484. if (contrastObj(this.form, this.oldForm) ||
  1485. contrastList(getGoodsList, this.oldGoodsList) ||
  1486. contrastList(getGiftList, this.oldGiftList) ||
  1487. contrastList(getFeeList, this.oldFeesList) ||
  1488. contrastList(this.bankOfDepositData, this.oldUploadList)
  1489. ) {
  1490. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1491. confirmButtonText: "确定",
  1492. cancelButtonText: "取消",
  1493. type: "warning"
  1494. }).then(() => {
  1495. this.editCustomer(true)
  1496. }).catch(() => {
  1497. !this.detailData.seeDisabled && this.form.id && this.unLock({ moduleName: 'fh', tableName: 'business_delivery', billId: this.form.id })
  1498. this.$emit("goBack");
  1499. this.leaveDetailsKey(this.$route.name)
  1500. })
  1501. } else {
  1502. !this.detailData.seeDisabled && this.form.id && this.unLock({ moduleName: 'fh', tableName: 'business_delivery', billId: this.form.id })
  1503. this.$emit("goBack");
  1504. this.leaveDetailsKey(this.$route.name)
  1505. }
  1506. },
  1507. // 确认收货
  1508. sendOutGoods() {
  1509. this.$refs["form"].validate((valid) => {
  1510. if (valid) {
  1511. if (this.contactsData.length == 0) {
  1512. return this.$message.error('商品信息为空')
  1513. }
  1514. let getGoodsList = []
  1515. let getGiftList = []
  1516. let getFeeList = this.$refs.feeInfo.submitData()
  1517. if (this.goodsActives == 'gift') {
  1518. getGiftList = this.goodsShowData
  1519. getGoodsList = this.contactsData
  1520. } else {
  1521. getGoodsList = this.goodsShowData
  1522. getGiftList = this.giftData
  1523. }
  1524. // console.log('1234',this.getGoodsList);
  1525. // console.log('5678',this.oldGoodsList);
  1526. if (
  1527. contrastObj(this.form, this.oldForm) ||
  1528. contrastList(getGoodsList, this.oldGoodsList) ||
  1529. contrastList(getGiftList, this.oldGiftList) ||
  1530. // contrastList(getFeeList, this.oldFeesList) ||
  1531. contrastList(this.bankOfDepositData, this.oldUploadList)
  1532. ) {
  1533. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1534. confirmButtonText: "确定",
  1535. cancelButtonText: "取消",
  1536. type: "warning"
  1537. }).then(async () => {
  1538. await this.editCustomer(false, '收货')
  1539. }).catch(() => {
  1540. this.$message.info('已取消')
  1541. })
  1542. } else {
  1543. //商品信息
  1544. if (this.goodsActives == 'gift') {
  1545. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1546. } else {
  1547. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1548. }
  1549. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1550. this.form.deliveryFilesList = this.bankOfDepositData
  1551. if (typeof this.form.corpsTypeId == 'object') {
  1552. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1553. }
  1554. this.pageLoading = true
  1555. this.saveActives = ''
  1556. this.saveLoading = true
  1557. sendOutGoods(this.form).then(res => {
  1558. this.$message.success('收货成功')
  1559. this.queryData(res.data.data.id)
  1560. }).finally(() => {
  1561. this.pageLoading = false
  1562. this.saveLoading = false
  1563. })
  1564. }
  1565. } else {
  1566. return false;
  1567. }
  1568. });
  1569. },
  1570. // 撤销收货
  1571. revokeOutGoods() {
  1572. this.$refs["form"].validate((valid) => {
  1573. if (valid) {
  1574. //商品信息
  1575. if (this.goodsActives == 'gift') {
  1576. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1577. } else {
  1578. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1579. }
  1580. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1581. this.form.deliveryFilesList = this.bankOfDepositData
  1582. if (typeof this.form.corpsTypeId == 'object') {
  1583. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1584. }
  1585. this.pageLoading = true
  1586. this.saveLoading = true
  1587. this.saveActives = ''
  1588. revokeOutGoods(this.form).then(res => {
  1589. this.$message.success('撤销成功')
  1590. this.queryData(res.data.data.id)
  1591. }).finally(() => {
  1592. this.pageLoading = false
  1593. this.saveLoading = false
  1594. })
  1595. } else {
  1596. return false;
  1597. }
  1598. });
  1599. },
  1600. // 确认到货
  1601. confirmArrival() {
  1602. let getGoodsList = []
  1603. let getGiftList = []
  1604. let getFeeList = this.$refs.feeInfo.submitData()
  1605. if (this.goodsActives == 'gift') {
  1606. getGiftList = this.goodsShowData
  1607. getGoodsList = this.contactsData
  1608. } else {
  1609. getGoodsList = this.goodsShowData
  1610. getGiftList = this.giftData
  1611. }
  1612. if (contrastObj(this.form, this.oldForm) ||
  1613. contrastList(getGoodsList, this.oldGoodsList) ||
  1614. contrastList(getGiftList, this.oldGiftList) ||
  1615. contrastList(getFeeList, this.oldFeesList) ||
  1616. contrastList(this.bankOfDepositData, this.oldUploadList)
  1617. ) {
  1618. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1619. confirmButtonText: "确定",
  1620. cancelButtonText: "取消",
  1621. type: "warning"
  1622. }).then(() => {
  1623. this.editCustomer(false, '到货')
  1624. }).catch(() => {
  1625. this.$message.info('已取消')
  1626. })
  1627. } else {
  1628. if (this.goodsActives == 'gift') {
  1629. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1630. } else {
  1631. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1632. }
  1633. this.pageLoading = true
  1634. this.saveLoading = true
  1635. this.saveActives = ''
  1636. confirmArrival(this.form).then(res => {
  1637. this.$message.success('已确认到货')
  1638. this.queryData(this.form.id)
  1639. }).catch(() => {
  1640. this.pageLoading = false
  1641. this.saveLoading = false
  1642. })
  1643. }
  1644. },
  1645. // 撤销到货
  1646. cancelArrival() {
  1647. if (this.goodsActives == 'gift') {
  1648. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1649. } else {
  1650. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1651. }
  1652. this.pageLoading = true
  1653. this.saveLoading = true
  1654. this.saveActives = ''
  1655. cancelArrival(this.form).then(res => {
  1656. this.$message.success('撤销到货成功')
  1657. this.queryData(this.form.id)
  1658. }).catch(() => {
  1659. this.pageLoading = false
  1660. this.saveLoading = false
  1661. })
  1662. },
  1663. // 导入销售明细
  1664. importMarket(list) {
  1665. list.forEach(item => {
  1666. item.cname = item.cname
  1667. this.$set(item, 'specificationAndModel', item.itemType)
  1668. if (this.goodsActives == 'goods') {
  1669. this.$set(item, 'deliveryAmount', item.amount)
  1670. } else {
  1671. this.$set(item, 'deliveryAmount', 0)
  1672. }
  1673. this.$set(item, 'actualQuantity', item.orderQuantity)
  1674. this.$set(item, 'inventoryNumber', item.storageQuantity)
  1675. this.$set(item, 'integral', 0)
  1676. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  1677. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  1678. this.$set(item, 'arrivalQuantity', item.actualQuantity)
  1679. this.$set(item, "srcId", item.id)
  1680. this.$set(item, "purchaseTotalAmount", (Number(item.purchaseAmount) * Number(item.actualQuantity)))
  1681. item.purchaseTotalAmount = item.purchaseTotalAmount.toFixed(2)
  1682. if (this.goodsActives == "goods") {
  1683. this.$set(item, 'goodType', 0)
  1684. } else {
  1685. this.$set(item, 'goodType', 1)
  1686. }
  1687. delete item.id
  1688. delete item.createTime
  1689. delete item.createUser
  1690. delete item.pid
  1691. this.arrivalQuantityChange(item)
  1692. this.$refs.crudContact.rowCellAdd(item);
  1693. this.arrivalQuantityChange(item)
  1694. })
  1695. this.marketDialog = false;
  1696. },
  1697. // 关闭销售弹窗
  1698. closeMarkeDialog() {
  1699. this.marketDialog = false;
  1700. },
  1701. // 保存列设置
  1702. async saveColumn(name) {
  1703. if (name == 'goods') {
  1704. const inSave = await this.saveColumnData(
  1705. this.getColumnName(21),
  1706. this.customerContact
  1707. );
  1708. if (inSave) {
  1709. this.$message.success("保存成功");
  1710. //关闭窗口
  1711. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1712. this.$nextTick(() => {
  1713. this.$refs.crudContact.doLayout()
  1714. })
  1715. }
  1716. } else if (name === 'fees') {
  1717. const inSave = await this.saveColumnData(
  1718. this.getColumnName(22),
  1719. this.advantageProject
  1720. );
  1721. if (inSave) {
  1722. this.$message.success("保存成功");
  1723. //关闭窗口
  1724. this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
  1725. }
  1726. }
  1727. },
  1728. async resetColumn() {
  1729. this.customerContact = customerContact
  1730. const inSave = await this.delColumnData(
  1731. this.getColumnName(21),
  1732. customerContact
  1733. );
  1734. if (inSave) {
  1735. this.$nextTick(() => {
  1736. this.$refs.crudContact.doLayout()
  1737. })
  1738. this.$message.success("重置成功");
  1739. //关闭窗口
  1740. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1741. }
  1742. },
  1743. // 商品表格加色
  1744. goodsRowClassName({ row, column, rowIndex, columnIndex }) {
  1745. if (Number(row.actualQuantity) > Number(row.inventoryNumber) && column.property == 'inventoryNumber') {
  1746. return "color: #fff;background:#a4cf57"
  1747. }
  1748. return '';
  1749. },
  1750. // 库存刷新
  1751. resetStock() {
  1752. this.contactsData.forEach(item => {
  1753. selectGoodsNum({
  1754. goodsId: item.itemId,
  1755. itemType: item.itemType ? item.itemType : item.typeno,
  1756. tradeType: 'GN',
  1757. storageId: this.form.storageId
  1758. }).then(res => {
  1759. item.inventoryNumber = res.data.data
  1760. })
  1761. })
  1762. this.$message.success('刷新成功')
  1763. },
  1764. // 商品信息标签页切换
  1765. handleClick(data) {
  1766. if (this.saveActives == data.name) return
  1767. this.saveActives = data.name
  1768. this.goodsDisabled = true
  1769. if (data.name == 'goods') {
  1770. this.giftData = this.goodsShowData
  1771. // 显示
  1772. this.customerContact.column.forEach(item => {
  1773. if (item.prop == 'integralMultiples') item.label = '积分倍数'
  1774. if (item.prop == 'integral') item.label = '赠送积分'
  1775. if (item.prop == 'actualQuantity') item.label = '出库数量'
  1776. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1777. || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight'
  1778. || item.prop == 'inventoryNumber' || item.prop == 'inventoryAmount'
  1779. || item.prop == 'arrivalQuantity'
  1780. ) {
  1781. item.hide = false;
  1782. item.showColumn = true;
  1783. }
  1784. })
  1785. this.goodsShowData = this.contactsData;
  1786. setTimeout(() => {
  1787. this.goodsDisabled = false
  1788. }, 500)
  1789. } else {
  1790. // 隐藏字段
  1791. this.contactsData = this.goodsShowData
  1792. this.customerContact.column.forEach(item => {
  1793. if (item.prop == 'integralMultiples') item.label = '积分单价'
  1794. if (item.prop == 'integral') item.label = '兑换积分'
  1795. if (item.prop == 'actualQuantity') item.label = '数量'
  1796. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1797. || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight' || item.prop == 'inventoryNumber'
  1798. || item.prop == 'inventoryAmount' || item.prop == 'arrivalQuantity'
  1799. ) {
  1800. item.hide = true;
  1801. item.showColumn = false;
  1802. }
  1803. })
  1804. this.goodsShowData = this.giftData;
  1805. setTimeout(() => {
  1806. this.goodsDisabled = false
  1807. }, 500)
  1808. }
  1809. },
  1810. // 报表
  1811. openReport() {
  1812. this.switchDialog = !this.switchDialog;
  1813. },
  1814. onClose(val) {
  1815. this.switchDialog = val;
  1816. },
  1817. //费用明细回调
  1818. beforeFinance(feesData, callback) {
  1819. this.advantageProjectData = feesData;
  1820. let params = {}
  1821. //暂时默认通过 之后优化
  1822. params.valid = true
  1823. params.parentId = this.form.id
  1824. params.srcOrderno = this.form.orderNo
  1825. callback(params)
  1826. },
  1827. // 编辑
  1828. editHandle() {
  1829. const data = {
  1830. moduleName: 'fh',
  1831. tableName: 'business_delivery',
  1832. billId: this.form.id,
  1833. no: localStorage.getItem('browserID'),
  1834. billNo: this.form.sysNo
  1835. }
  1836. this.saveLoading = true
  1837. this.checkLock(data).then(res => {
  1838. if (res.data.code == 200) {
  1839. this.onLock(data).then(response => {
  1840. this.saveActives = ''
  1841. this.queryData(this.form.id)
  1842. this.inDetailsKey(this.$route.name, {
  1843. moduleName: 'fh',
  1844. tableName: 'business_delivery',
  1845. billId: this.form.id,
  1846. })
  1847. this.detailData.seeDisabled = false;
  1848. })
  1849. }
  1850. }).catch(error => {
  1851. }).finally(() => {
  1852. this.saveLoading = false
  1853. })
  1854. },
  1855. returnBack(data) {
  1856. if (data.belongtocompany) {
  1857. // this.form.salesCompany = data.belongtocompany
  1858. }
  1859. },
  1860. getGSName(row) {
  1861. this.form.belongCompany = row.cname
  1862. },
  1863. }
  1864. }
  1865. </script>
  1866. <style lang="scss" scoped>
  1867. //.customer-head {
  1868. // position: fixed;
  1869. // top: 105px;
  1870. // width: 100%;
  1871. // margin-left: -10px;
  1872. // height: 62px;
  1873. // background: #ffffff;
  1874. // box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  1875. // z-index: 999;
  1876. //}
  1877. //
  1878. //.customer-back {
  1879. // cursor: pointer;
  1880. // line-height: 62px;
  1881. // font-size: 16px;
  1882. // color: #323233;
  1883. // font-weight: 400;
  1884. //}
  1885. .back-icon {
  1886. line-height: 64px;
  1887. font-size: 20px;
  1888. margin-right: 8px;
  1889. }
  1890. //.add-customer-btn {
  1891. // position: fixed;
  1892. // right: 36px;
  1893. // top: 115px;
  1894. //}
  1895. ::v-deep .el-form-item {
  1896. margin-bottom: 0;
  1897. }
  1898. .el-dialogDeep {
  1899. ::v-deep .el-dialog {
  1900. margin: 1vh auto 0 !important;
  1901. padding-bottom: 10px !important;
  1902. .el-dialog__body,
  1903. .el-dialog__footer {
  1904. padding-bottom: 0 !important;
  1905. padding-top: 0 !important;
  1906. }
  1907. }
  1908. }
  1909. .print-div {
  1910. color: #000;
  1911. }
  1912. .print_table {
  1913. table {
  1914. border-right: 1px solid #000;
  1915. border-bottom: 1px solid #000;
  1916. font-size: 12px;
  1917. margin-bottom: 5px;
  1918. }
  1919. table td {
  1920. border-left: 1px solid #000;
  1921. border-top: 1px solid #000;
  1922. vertical-align: middle;
  1923. padding: 2px;
  1924. text-align: center;
  1925. }
  1926. }
  1927. .table {
  1928. border-collapse: collapse;
  1929. border-spacing: 0;
  1930. background-color: transparent;
  1931. display: table;
  1932. width: 99%;
  1933. max-width: 100%;
  1934. margin: 0 auto;
  1935. }
  1936. .table td {
  1937. text-align: left;
  1938. vertical-align: middle;
  1939. font-size: 14px;
  1940. color: #000000;
  1941. padding: 10.5px 0 10.5px 30px;
  1942. //border: 1px solid #000;
  1943. }
  1944. ::v-deep .el-form-item {
  1945. margin-bottom: 0;
  1946. }
  1947. ::v-deep .el-form-item__content {
  1948. line-height: 32px;
  1949. }
  1950. </style>