delivery_detail.blade.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. @extends('layouts.base')
  2. @section('title', trans(''))
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <style>
  6. .all { background: #eff3f6;}
  7. .el-table th.gutter{
  8. display: table-cell!important;
  9. }
  10. .vue-main-form {
  11. margin-bottom: 50px;
  12. }
  13. .vue-main-title-content {
  14. border-bottom: 1px solid #f5f5f5;
  15. padding-left: 20px;
  16. }
  17. .bill-context {
  18. background: #eeeeee;
  19. padding: 9px;
  20. color: #6f6f6e;
  21. border: 1px solid #DCDFE6;
  22. }
  23. </style>
  24. <div class="all">
  25. <div id="app" v-cloak>
  26. <el-form ref="form" >
  27. <div class="vue-main">
  28. <div class="vue-main-form">
  29. <div class="vue-main-title">
  30. <div class="vue-main-title-content">标签模板编辑</div>
  31. </div>
  32. <div style="display: flex;align-items: center;margin-bottom:20px;padding-left: 20px;">
  33. <span class="bill-context">单据宽度</span>
  34. <el-input style="width: 30%;" v-model="serarch_form.width" @blur="blurPlatformDocumentWidth"></el-input>
  35. <span class="bill-context">mm(毫米) 单据高度</span>
  36. <el-input style="width: 30%;" v-model="serarch_form.height" @blur="blurPlatformDocumentHeight"></el-input>
  37. <span class="bill-context">mm(毫米)</span>
  38. </div>
  39. <div style="display: flex;align-items: center;margin-bottom:20px;padding-left: 20px;"><span style="background: #f5f7fa;padding: 9px;color: #6f6f6e;border: 1px solid #DCDFE6;">供应商名称</span><el-input style="width: 30%;" v-model="serarch_form.supplier_name"></el-input> </div>
  40. <div style="display: flex;align-items: center;margin-bottom:20px;padding-left: 20px;"><span style="background: #f5f7fa;padding: 9px;color: #6f6f6e;border: 1px solid #DCDFE6;">供应商电话</span><el-input style="width: 30%;" v-model="serarch_form.supplier_mobile"></el-input> </div>
  41. <div style="display: flex;margin-bottom: 20px;padding-left: 20px;">
  42. <span>备注</span>
  43. <div id="dialogVisible-card" contenteditable="true" spellcheck="true" data-medium-editor-element="true" role="textbox" aria-multiline="true" style="height: 300px;border: 1px solid #dadada;width: 95%;margin-left: 20px;"></div>
  44. </div>
  45. <div style="display: flex;flex-direction: column;justify-content: center;align-items: start;margin-left:60px;">
  46. <span style="color: #333333;margin: 1% 0;">模板展示</span>
  47. <!-- <img src="{{resource_get('plugins/exhelper/assets/image/send.png')}}" alt="" style="height: 140mm;width: 93%;"> -->
  48. <div id="platform-supplier-box" style="display: flex;justify-content: center;">
  49. <div style="height: 500px;width: 1095px;display: flex;flex-direction: column;background-color: #f9fafc;" id="platformSupplier">
  50. <div style="display: flex;padding: 18px 0;">
  51. <div style="display: flex;flex-direction: column;justify-content: center;align-items: center;flex: 6;">
  52. <div style="display: flex;width: 100%;font-size: 20px;font-weight: bold;">
  53. <div style="flex: 2;margin-left: 20px;"><span style="height: 32px;padding:4px;"></span></div>
  54. <div style="flex: 5;text-align: center;"><span style="border: solid 1px #d3d3d3;height: 32px;padding:4px 13px;">供应商名称</span></div>
  55. </div>
  56. <div style="display: flex;width: 100%;margin:3% 0">
  57. <div style="flex: 2;text-align: center;"></div>
  58. <div style="flex: 5;text-align: center;display: flex;justify-content: center;align-items: center;">电话: <span style=" width: 104px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;"></span></div>
  59. </div>
  60. </div>
  61. <div style="display: flex;justify-content: center;height: 80%;overflow: hidden;flex: 2;">
  62. <div style="width: 60px;height: 60px;background-color: #eeeeee;border: solid 1px #9ba5bb;"></div>
  63. </div>
  64. </div>
  65. <div style="width:100%;display: flex;">
  66. <div style="flex: 5;display: flex;flex-direction: column;justify-content: space-around;padding-left: 2%;">
  67. <div style="display: flex;align-items: center;margin-bottom:15px">
  68. <div style="display: flex;align-items: center;"><span style="width: 70px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;padding:2px 0 0 2px;"> 姓名</span></div>
  69. <div style="margin: 0 75px;display: flex;align-items: center;">收货地址: <span style="width: 158px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;"></span></div>
  70. <div style="display: flex;align-items: center;">收货电话: <span style="width: 144px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;"></span></div>
  71. </div>
  72. <div style="display: flex;align-items: center;">收货人: <span style="width: 221px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;"></span></div>
  73. </div>
  74. <div style="flex: 2;display: flex;flex-direction: column;justify-content: space-around;">
  75. <div style="display: flex;align-items: center;">日期: <span style="width: 80px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;"></span></div>
  76. <div style="display: flex;align-items: center;">订单号: <span style="width: 80px;height: 26px;border: solid 1px #9ba5bb;display: inline-block;"></span></div>
  77. </div>
  78. </div>
  79. <div style="padding: 0 2%;margin: 1% 0;">
  80. <el-table
  81. :data="tableData"
  82. :span-method="arraySpanMethod"
  83. border
  84. :cell-style="{ borderColor:'#d3d3d3' }"
  85. :header-cell-style="{borderColor:'#d3d3d3'}"
  86. style="width: 100%;border:1px solid #d3d3d3">
  87. <el-table-column prop="trade_name" label="商品名称" width="180" align="center">
  88. <template slot-scope="scope" >
  89. <div v-if="scope.$index == 1" style="display: flex;">备注: <span style=" width: 507px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  90. <div v-if="scope.$index == 0" style="display: flex;justify-content: center;"><span style="width: 87px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop="specifications" label="规格" align="center">
  94. <template slot-scope="scope" >
  95. <div v-if="scope.$index == 0" style="display: flex;justify-content: center;"><span style="width: 87px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column prop="quantity" label="数量" align="center">
  99. <template slot-scope="scope" >
  100. <div v-if="scope.$index == 0" style="display: flex;justify-content: center;"><span style="width: 87px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column prop="company" label="单位" align="center">
  104. <template slot-scope="scope" >
  105. <div v-if="scope.$index == 0" style="display: flex;justify-content: center;"><span style="width: 87px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop="unit_price" label="单价(元)" align="center">
  109. <template slot-scope="scope" >
  110. <div v-if="scope.$index == 0" style="display: flex;justify-content: center;"><span style="width: 87px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  111. <div v-if="scope.$index == 1" style="justify-content: start;display: flex;">本页小计: <span style=" width: 80px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  112. <div v-if="scope.$index == 2" style="display: flex">合计: <span style=" width: 110px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="subtotal" label="小计(元)" align="center">
  116. <template slot="header" slot-scope="scope">
  117. <div style="display: flex;justify-content: end;">小计(元)</div>
  118. </template>
  119. <template slot-scope="scope" >
  120. <div style="display: flex;justify-content: center;"><span style="width: 87px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  121. </template>
  122. </el-table-column>
  123. </el-table>
  124. </div>
  125. <div style="height:100%;width:100%;">
  126. <div style="padding-left: 2%;padding-right: 157px;display: flex;justify-content: space-between;">
  127. <span>经手人: </span>
  128. <span>件数: </span>
  129. <span>司机: </span>
  130. <span>本次收款: </span>
  131. </div>
  132. <div style="display: flex;margin: 12px 0 20px 0;">
  133. <div style="flex: 4;display: flex;padding-left: 20px;align-items: center;display: flex;">
  134. <span>注:</span>
  135. <div style="width: 586px;height: 26px;border: solid 1px #9ba5bb;"></div>
  136. </div>
  137. <div style="flex: 1;align-items: center;display: flex;">打印时间: <span style="width: 96px;height: 26px;border: solid 1px #9ba5bb;display: inline-block"></span></div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </el-form>
  146. <div class="vue-page" >
  147. <el-row>
  148. <el-col align="center">
  149. <el-button type="primary" @click="save">保存</el-button>
  150. </el-col>
  151. </el-row>
  152. </div>
  153. </div>
  154. </div>
  155. <script>
  156. let templateInfo = {!! $templateInfo?:[] !!}
  157. var vm = new Vue({
  158. el: "#app",
  159. delimiters: ['[[', ']]'],
  160. data() {
  161. return {
  162. serarch_form:{
  163. width:"",
  164. height:"",
  165. supplier_name:"",
  166. supplier_mobile:""
  167. },
  168. tableData: [{
  169. trade_name:"商品",
  170. specifications:"规格",
  171. quantity:10,
  172. company:"芸众",
  173. unit_price:143,
  174. subtotal:205445
  175. }, {
  176. trade_name:"商品2",
  177. specifications:"规格2",
  178. quantity:10,
  179. company:"芸众2",
  180. unit_price:1043,
  181. subtotal:212
  182. }, {
  183. trade_name:"商品3",
  184. specifications:"规格3",
  185. quantity:10,
  186. company:"芸众3",
  187. unit_price:1043,
  188. subtotal:20345
  189. }],
  190. templateInfo:templateInfo
  191. }
  192. },
  193. mounted () {
  194. document.getElementById('dialogVisible-card').innerText = this.templateInfo.remark ?this.templateInfo.remark : ""
  195. this.serarch_form.width = this.templateInfo.width
  196. this.serarch_form.height = this.templateInfo.height
  197. this.serarch_form.supplier_name = this.templateInfo.supplier_name
  198. this.serarch_form.supplier_mobile = this.templateInfo.supplier_mobile
  199. // console.log(this.templateInfo,'templateInfo');
  200. },
  201. methods: {
  202. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  203. if (rowIndex == 1 || rowIndex == 2) {
  204. if (columnIndex === 0) {
  205. return [1, 4];
  206. }
  207. if (columnIndex === 4) {
  208. return [1,2];
  209. } else{
  210. return [0, 0];
  211. }
  212. }
  213. },
  214. blurPlatformDocumentWidth(){
  215. // this.$nextTick(() => {
  216. // document.getElementById('platformSupplier').style.width= this.serarch_form.width ? this.serarch_form.width * 1 + 'mm' : 220 + 'mm';
  217. // })
  218. // console.log( document.getElementById('platform-supplier-box').innerHTML,12);
  219. },
  220. blurPlatformDocumentHeight(){
  221. // this.$nextTick(() => {
  222. // document.getElementById('platformSupplier').style.height= this.serarch_form.height ? this.serarch_form.height * 1 + 'mm' : 140 + 'mm';
  223. // })
  224. },
  225. save(){
  226. this.$http.post("{!! yzWebFullUrl('plugin.exhelper.admin.delivery.templateEdit') !!}",{
  227. remark: document.getElementById('dialogVisible-card').innerText,
  228. ...this.serarch_form
  229. }).then(response => {
  230. return response.json()
  231. }).then(({result,data,msg}) => {
  232. console.log(result,data,msg,55);
  233. if (result) {
  234. this.$message.success(msg);
  235. } else {
  236. this.$message.error(msg);
  237. }
  238. }), function (res) {
  239. console.log(res);
  240. };
  241. }
  242. },
  243. });
  244. </script>
  245. @endsection