edit.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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="120">
  71. <template slot-scope="scope">
  72. <el-button class="inline-16" type="text" @click="(defaultData.re_info = scope.row,visible = false)" size="mini">选 择</el-button>
  73. <el-popconfirm
  74. title="确定删除吗?"
  75. @confirm="deleteContacts(scope.row)">
  76. <el-button class="inline-16" size="small" type="text" slot="reference">删 除</el-button>
  77. </el-popconfirm>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <div class="container" style="text-align:right">
  82. <el-pagination
  83. background
  84. small
  85. :current-page="addressparam.content.pageNumber"
  86. @current-change="addresPageChange"
  87. layout="total,prev, pager, next"
  88. :total="addresstotal">
  89. </el-pagination>
  90. </div>
  91. <el-button slot="reference" type="text" size="mini">选择其他地址</el-button>
  92. </el-popover>
  93. </div>
  94. <div class="reveive__panel normal-margin">
  95. <p><span class="inline-16"><b>{{defaultData.re_info.name}}</b></span><small>{{defaultData.re_info.phonenumber}}</small></p>
  96. <small>{{defaultData.re_info.province}}{{defaultData.re_info.city}}{{defaultData.re_info.county}}{{defaultData.re_info.address?defaultData.re_info.address:'--'}}</small>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="mt-10">
  101. <p class="normal-title inline-16">寄付方式</p>
  102. </div>
  103. <div class="mt-10 flex-align-center">
  104. <div :style="defaultData.freightstatus === '到付'?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin inline-16" @click="defaultData.freightstatus = '到付'">
  105. <p>到付</p>
  106. </div>
  107. <div :style="defaultData.freightstatus === '预付'?{background:'#d9ecff'}:{background:'#fff'}" class="reveive__panel normal-margin" @click="defaultData.freightstatus = '预付'">
  108. <p>预付</p>
  109. </div>
  110. </div>
  111. <div class="mt-10">
  112. <p class="normal-title inline-16">备注</p>
  113. </div>
  114. <el-input style="margin-bottom:10px" v-model="defaultData.remarks" type="textarea" placeholder="请输入备注"></el-input>
  115. <div class="mt-10">
  116. <div>
  117. <p class="normal-title inline-16">发货单产品</p>
  118. <!-- <el-button type="text" size="mini" @click="addMoreProduct">{{setcol === 12?'关闭选择':'添加发货产品'}}</el-button>-->
  119. </div>
  120. <el-row :gutter="10">
  121. <el-col :span="setcol">
  122. <product-list ref="prolist" :type="'edit'" :data="data" @onSuccess="onDelSuccess"></product-list>
  123. </el-col>
  124. <el-col :span="24 - setcol">
  125. <add-disProduct ref="addpro" :data="data" @onConfirm="onConfirm"></add-disProduct>
  126. </el-col>
  127. </el-row>
  128. </div>
  129. </div>
  130. <div class="fixed__btn__panel">
  131. <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
  132. <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">保存修改</el-button>
  133. </div>
  134. </el-drawer>
  135. </div>
  136. </template>
  137. <script>
  138. import previewImage from '@/components/previewImage/index.vue'
  139. import productList from './productlist.vue'
  140. import addDisProduct from '@/template/disCanUseProduct/index.vue'
  141. import addAddressInfo from '@/HManagement/marketing2/agent/details/modules/address/add'
  142. export default {
  143. props:['data'],
  144. components:{
  145. previewImage,
  146. productList,
  147. addDisProduct,
  148. addAddressInfo
  149. },
  150. data () {
  151. return {
  152. visible:false,
  153. visible1:false,
  154. drawer:false,
  155. logisticcomlist:[],
  156. receiveAddresslist:[],
  157. defaultData:{
  158. re_info:{},
  159. logist_info:{},
  160. billdate:(new Date()).toISOString().split('T')[0],
  161. freightstatus:'',
  162. remarks:''
  163. },
  164. setcol:24,
  165. pickerOptions: {
  166. disabledDate(time) {
  167. return time.getTime() < (Date.now() - 24 * 3600 * 1000);
  168. },
  169. },
  170. addressparam: {
  171. "id": "20221009155803",
  172. "content": {
  173. "nocache":true,
  174. "pageNumber":1,
  175. "pageSize":10,
  176. "sys_enterpriseid":'',
  177. "where":{
  178. "condition":"",
  179. "workaddress":1
  180. }
  181. }
  182. },
  183. addresstotal:0
  184. }
  185. },
  186. methods:{
  187. addresPageChange (n) {
  188. this.addressparam.content.pageNumber = n
  189. this.receiveAddress()
  190. },
  191. onShow () {
  192. this.receiveAddress()
  193. this.queryLogisticcom()
  194. this.defaultData.freightstatus = this.data.freightstatus
  195. this.defaultData.remarks = this.data.remarks
  196. },
  197. async deleteContacts (row) {
  198. const res = await this.$api.requested({
  199. "id": "20221009155903",
  200. "version":1,
  201. "content": {
  202. "contactsid":row.contactsid
  203. }
  204. })
  205. this.tool.showMessage(res,()=>{
  206. this.receiveAddress()
  207. })
  208. },
  209. // 收货信息:合作企业联系人
  210. async receiveAddress () {
  211. this.addressparam.content.sys_enterpriseid = this.data.sys_enterpriseid
  212. const res = await this.$api.requested(this.addressparam)
  213. this.receiveAddresslist = res.data
  214. this.addresstotal = res.total
  215. this.defaultData.re_info = this.data.recvice
  216. },
  217. // 物流企业
  218. async queryLogisticcom () {
  219. const res = await this.$api.requested({
  220. "id": "20221121135804",
  221. "content": {
  222. "pageNumber": 1,
  223. "pageSize": 100
  224. }
  225. })
  226. this.logisticcomlist = res.data
  227. this.defaultData.logist_info = this.data.logiscomp
  228. },
  229. async onSubmit() {
  230. console.log(this.data)
  231. const res = await this.$api.requested({
  232. "id": 20221114135203,
  233. "content": {
  234. "sa_dispatchid":this.data.sa_dispatchid,
  235. "sa_orderid":0,
  236. "sys_enterpriseid":this.data.sys_enterpriseid,
  237. "rec_contactsid":this.defaultData.re_info.contactsid,
  238. "billdate":this.defaultData.billdate,
  239. "freightstatus":this.defaultData.freightstatus,
  240. "remarks":this.defaultData.remarks
  241. },
  242. })
  243. this.tool.showMessage(res,()=>{
  244. this.$emit('onSuccess')
  245. this.drawer = false
  246. })
  247. },
  248. onDelSuccess () {
  249. this.$refs.addpro.listData()
  250. this.$emit('onSuccess')
  251. },
  252. addMoreProduct () {
  253. this.setcol === 12?this.setcol = 24 : this.setcol = 12
  254. },
  255. // 订单添加商品
  256. async onConfirm (data) {
  257. const res = await this.$api.requested({
  258. "id": 20221115104603,
  259. "content": {
  260. "sa_dispatchid": this.$route.query.id, //订单ID
  261. "iteminfos":data.map(e=>{
  262. e.sa_dispatch_itemsid = 0
  263. e.remarks = ''
  264. e.qty=e.undeliqty
  265. return e
  266. })
  267. },
  268. })
  269. this.tool.showMessage(res,()=>{
  270. this.$refs.prolist.listData()
  271. this.$refs.addpro.listData()
  272. this.$emit('onSuccess')
  273. })
  274. }
  275. },
  276. mounted () {
  277. }
  278. }
  279. </script>
  280. <style>
  281. </style>
  282. <style scoped>
  283. .reveive__panel{
  284. font-size: 14px;
  285. line-height: 30px;
  286. padding: 10px;
  287. background: #d9ecff;
  288. border: 1px dashed #0676e7;
  289. }
  290. .account__panel small,.reveive__panel small{
  291. color:#666
  292. }
  293. .account__panel{
  294. width: calc(33% - 26px);
  295. padding: 10px;
  296. margin-bottom:10px;
  297. border: 1px dashed #666;
  298. }
  299. .act{
  300. background: #d9ecff;
  301. border: 1px dashed #0676e7;
  302. }
  303. .image {
  304. width:40px;height:40px;margin:0px auto;
  305. }
  306. .order__note__input{
  307. border: none;
  308. outline: none;
  309. /* margin-left: 10px; */
  310. /* border-bottom: 1px solid #f1f2f3; */
  311. flex:1
  312. }
  313. </style>