edit.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <div>
  3. <el-button :disabled="data.STATUS !=='新建'" type="primary" size="mini" @click="onShow(drawer = true)">编辑</el-button>
  4. <el-drawer
  5. :visible.sync="drawer"
  6. direction="rtl"
  7. append-to-body
  8. size="80%">
  9. <div slot="title">
  10. <div class="flex-align-center">
  11. <p>编辑发货单</p>
  12. </div>
  13. </div>
  14. <div class="drawer__panel">
  15. <div class="normal-margin">发货数量:{{data.qty}}</div>
  16. <div class="normal-margin">发货金额:{{data.sumamount ? tool.formatAmount(data.sumamount,2) : '--'}}</div>
  17. <div class="mt-10">
  18. <p class="normal-title inline-16">发货时间</p>
  19. <!-- billdate -->
  20. <el-date-picker
  21. v-model="defaultData.billdate"
  22. type="date"
  23. value-format="yyyy-MM-dd"
  24. placeholder="选择发货日期"
  25. size="small"
  26. :picker-options="pickerOptions">
  27. </el-date-picker>
  28. </div>
  29. <div class="flex-align-center normal-margin">
  30. <div style="flex:1;margin-right:10px">
  31. <div class="mt-10">
  32. <p class="normal-title inline-16">收货信息</p>
  33. <el-popover
  34. placement="bottom"
  35. title="选择地址"
  36. trigger="click"
  37. v-model="visible">
  38. <div class="flex-align-center" style="justify-content:space-between;margin-bottom:10px">
  39. <el-input
  40. size="small"
  41. v-model="addressparam.content.where.condition"
  42. placeholder="请输入搜索内容"
  43. style="width:150px"
  44. @keyup.enter.native="receiveAddress(addressparam.content.pageNumber = 1)" @clear="receiveAddress(addressparam.content.pageNumber = 1)" clearable></el-input>&nbsp;
  45. <addAddressInfo style="text-align:right" @onAddSuccess="receiveAddress()" :mainData="{sys_enterpriseid:data.sys_enterpriseid}"/>
  46. </div>
  47. <el-table
  48. :data="receiveAddresslist"
  49. style="width: 100%"
  50. size="mini">
  51. <el-table-column
  52. prop="name"
  53. label="联系人"
  54. width="90">
  55. </el-table-column>
  56. <el-table-column
  57. prop="phonenumber"
  58. label="电话"
  59. width="120">
  60. </el-table-column>
  61. <el-table-column
  62. label="地址"
  63. width="360">
  64. <template slot-scope="scope">
  65. {{scope.row.province}}{{scope.row.city}}{{scope.row.county}}{{scope.row.address}}
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. label="操作"
  70. width="90">
  71. <template slot-scope="scope">
  72. <el-button type="text" @click="(defaultData.re_info = scope.row,visible = false)" size="mini">选 择</el-button>
  73. </template>
  74. </el-table-column>
  75. </el-table>
  76. <div class="container" style="text-align:right">
  77. <el-pagination
  78. background
  79. small
  80. :current-page="addressparam.content.pageNumber"
  81. @current-change="addresPageChange"
  82. layout="total,prev, pager, next"
  83. :total="addresstotal">
  84. </el-pagination>
  85. </div>
  86. <el-button slot="reference" type="text" size="mini">选择其他地址</el-button>
  87. </el-popover>
  88. </div>
  89. <div class="reveive__panel normal-margin">
  90. <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
  91. <small>{{defaultData.re_info.province}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:'--'}}</small>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="mt-10">
  96. <p class="normal-title inline-16">寄付方式</p>
  97. </div>
  98. <div class="mt-10 flex-align-center">
  99. <div :style="defaultData.freightstatus === '到付'?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin inline-16" @click="defaultData.freightstatus = '到付'">
  100. <p>到付</p>
  101. </div>
  102. <div :style="defaultData.freightstatus === '预付'?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin" @click="defaultData.freightstatus = '预付'">
  103. <p>预付</p>
  104. </div>
  105. </div>
  106. <div class="mt-10">
  107. <p class="normal-title inline-16">备注</p>
  108. </div>
  109. <el-input style="margin-bottom:10px" v-model="defaultData.remarks" type="textarea" placeholder="请输入备注"></el-input>
  110. <div class="mt-10">
  111. <div>
  112. <p class="normal-title inline-16">发货单产品</p>
  113. <!-- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加发货产品'}}</el-button>-->
  114. </div>
  115. <el-row :gutter="10">
  116. <el-col :span="setcol">
  117. <product-list ref="prolist" :type="'edit'" :data="data" @onSuccess="onDelSuccess"></product-list>
  118. </el-col>
  119. <el-col :span="24 - setcol">
  120. <add-disProduct ref="addpro" :data="data" @onConfirm="onConfirm"></add-disProduct>
  121. </el-col>
  122. </el-row>
  123. </div>
  124. </div>
  125. <div class="fixed__btn__panel">
  126. <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
  127. <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">保存修改</el-button>
  128. </div>
  129. </el-drawer>
  130. </div>
  131. </template>
  132. <script>
  133. import previewImage from '@/components/previewImage/index.vue'
  134. import productList from './productlist.vue'
  135. import addDisProduct from '@/template/disCanUseProduct/index.vue'
  136. import addAddressInfo from '@/HManagement/marketing2/agent/details/modules/address/add'
  137. export default {
  138. props:['data'],
  139. components:{
  140. previewImage,
  141. productList,
  142. addDisProduct,
  143. addAddressInfo
  144. },
  145. data () {
  146. return {
  147. visible:false,
  148. visible1:false,
  149. drawer:false,
  150. logisticcomlist:[],
  151. receiveAddresslist:[],
  152. defaultData:{
  153. re_info:{},
  154. logist_info:{},
  155. billdate:(new Date()).toISOString().split('T')[0],
  156. freightstatus:'',
  157. remarks:''
  158. },
  159. setcol:24,
  160. pickerOptions: {
  161. disabledDate(time) {
  162. return time.getTime() < (Date.now() - 24 * 3600 * 1000);
  163. },
  164. },
  165. addressparam: {
  166. "id": "20221009155803",
  167. "content": {
  168. "nocache":true,
  169. "pageNumber":1,
  170. "pageSize":10,
  171. "sys_enterpriseid":'',
  172. "where":{
  173. "condition":"",
  174. "workaddress":1
  175. }
  176. }
  177. },
  178. addresstotal:0
  179. }
  180. },
  181. methods:{
  182. addresPageChange (n) {
  183. this.addressparam.content.pageNumber = n
  184. this.receiveAddress()
  185. },
  186. onShow () {
  187. this.receiveAddress()
  188. this.queryLogisticcom()
  189. this.defaultData.freightstatus = this.data.freightstatus
  190. this.defaultData.remarks = this.data.remarks
  191. },
  192. // 收货信息:合作企业联系人
  193. async receiveAddress () {
  194. this.addressparam.content.sys_enterpriseid = this.data.sys_enterpriseid
  195. const res = await this.$api.requested(this.addressparam)
  196. this.receiveAddresslist = res.data
  197. this.addresstotal = res.total
  198. this.defaultData.re_info = this.data.recvice
  199. },
  200. // 物流企业
  201. async queryLogisticcom () {
  202. const res = await this.$api.requested({
  203. "id": "20221121135804",
  204. "content": {
  205. "pageNumber": 1,
  206. "pageSize": 100
  207. }
  208. })
  209. this.logisticcomlist = res.data
  210. this.defaultData.logist_info = this.data.logiscomp
  211. },
  212. async onSubmit() {
  213. console.log(this.data)
  214. const res = await this.$api.requested({
  215. "id": 20221114135203,
  216. "content": {
  217. "sa_dispatchid":this.data.sa_dispatchid,
  218. "sa_orderid":0,
  219. "sys_enterpriseid":this.data.sys_enterpriseid,
  220. "rec_contactsid":this.defaultData.re_info.contactsid,
  221. "billdate":this.defaultData.billdate,
  222. "freightstatus":this.defaultData.freightstatus,
  223. "remarks":this.defaultData.remarks
  224. },
  225. })
  226. this.tool.showMessage(res,()=>{
  227. this.$emit('onSuccess')
  228. this.drawer = false
  229. })
  230. },
  231. onDelSuccess () {
  232. this.$refs.addpro.listData()
  233. this.$emit('onSuccess')
  234. },
  235. addMoreProduct () {
  236. this.setcol === 12?this.setcol = 24 : this.setcol = 12
  237. },
  238. // 订单添加商品
  239. async onConfirm (data) {
  240. const res = await this.$api.requested({
  241. "id": 20221115104603,
  242. "content": {
  243. "sa_dispatchid": this.$route.query.id, //订单ID
  244. "iteminfos":data.map(e=>{
  245. e.sa_dispatch_itemsid = 0
  246. e.remarks = ''
  247. e.qty=e.undeliqty
  248. return e
  249. })
  250. },
  251. })
  252. this.tool.showMessage(res,()=>{
  253. this.$refs.prolist.listData()
  254. this.$refs.addpro.listData()
  255. this.$emit('onSuccess')
  256. })
  257. }
  258. },
  259. mounted () {
  260. }
  261. }
  262. </script>
  263. <style>
  264. </style>
  265. <style scoped>
  266. .reveive__panel{
  267. font-size: 14px;
  268. line-height: 30px;
  269. padding: 10px;
  270. background: #d9ecff;
  271. border: 1px dashed #0676e7;
  272. }
  273. .account__panel small,.reveive__panel small{
  274. color:#666
  275. }
  276. .account__panel{
  277. width: calc(33% - 26px);
  278. padding: 10px;
  279. margin-bottom:10px;
  280. border: 1px dashed #666;
  281. }
  282. .act{
  283. background: #d9ecff;
  284. border: 1px dashed #0676e7;
  285. }
  286. .image {
  287. width:40px;height:40px;margin:0px auto;
  288. }
  289. .order__note__input{
  290. border: none;
  291. outline: none;
  292. /* margin-left: 10px; */
  293. /* border-bottom: 1px solid #f1f2f3; */
  294. flex:1
  295. }
  296. </style>