DirectSelling.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <div class="size-span">
  3. <div class="normal-panel container-padding">
  4. <el-button size="small" @click="onShow">预览</el-button>
  5. </div>
  6. <div id="directSelling">
  7. <div style="text-align: center;font-size: 24px">{{information.title}}</div>
  8. <div class="normal-panel container-padding">
  9. <span class="title-bold">
  10. 甲方(供方):
  11. </span>
  12. <span>
  13. {{clauseData.parta.enterprisename}}
  14. </span>
  15. </div>
  16. <div class="normal-panel container-padding">
  17. <span class="title-bold">
  18. 乙方(需方):
  19. </span>
  20. <span>
  21. {{clauseData.partb.enterprisename}}
  22. </span>
  23. </div>
  24. <div class="normal-panel container-padding">
  25. <span class="title-bold">
  26. 合同编号 :
  27. </span>
  28. <span>
  29. {{information.billno}}
  30. </span>
  31. </div>
  32. <div class="normal-panel container-padding">
  33. <span class="title-bold">
  34. 签约地点 :
  35. </span>
  36. <span>
  37. {{clauseData.parta.address}}
  38. </span>
  39. </div>
  40. <div class="normal-panel container-padding">
  41. <div style="margin-left: 30px;height: 40px">
  42. 甲乙双方在平等,自愿的基础上就班尼戈Conex|Bänninger品牌的阀门购销事宜达成一致意见,现依据《中华人民共和国民法典》的有关规定,特签定本合同,以共同遵守。
  43. </div>
  44. </div>
  45. <div class="normal-panel container-padding">
  46. <span class="title-bold">
  47. 第一条
  48. </span>
  49. <span class="title-left">
  50. 基本要求:
  51. </span>
  52. </div>
  53. <div class="normal-panel container-padding">
  54. <span >
  55. 1. 工程名称:{{information.projectname}}
  56. </span>
  57. </div>
  58. <div class="normal-panel container-padding">
  59. <span >
  60. 2. 工程地址:{{information.province + information.city + information.county + information.address}}
  61. </span>
  62. </div>
  63. <div class="normal-panel container-padding">
  64. <span >
  65. 3. 收货人:{{information.name}}
  66. </span>
  67. <span style="padding-left: 40px">
  68. 联系电话:{{information.phonenumber}}
  69. </span>
  70. </div>
  71. <div class="normal-panel container-padding">
  72. <span>
  73. 4. 付款方式:
  74. </span>
  75. <span v-if="payWaySelect">
  76. <el-select v-model="selectData.payWay" placeholder="请选择" size="mini">
  77. <el-option
  78. v-for="item in options.payWay"
  79. :key="item.value"
  80. :label="item.label"
  81. :value="item.value">
  82. </el-option>
  83. </el-select>
  84. </span>
  85. <span v-if="!payWaySelect">
  86. {{selectData.payWay}}
  87. </span>
  88. </div>
  89. <div class="normal-panel container-padding">
  90. <p v-for="(item,index) in clauseList" style="padding-left: 10px;margin-bottom: 10px">
  91. <span>
  92. 4.{{index + 1}}
  93. </span>
  94. <span>
  95. <el-input size="mini" style="width: 200px" v-model="item.value" placeholder="请输入内容"></el-input>
  96. </span>
  97. <span style="padding-left: 10px" >
  98. <el-button size="mini" icon="el-icon-plus" circle @click="clauseAdd"></el-button>
  99. </span>
  100. <span style="padding-left: 10px" v-if="clauseList.length > 1">
  101. <el-button size="mini" icon="el-icon-minus" circle></el-button>
  102. </span>
  103. </p>
  104. </div>
  105. <div class="normal-panel container-padding">
  106. <span >
  107. 3. 收货人:{{information.name}}
  108. </span>
  109. <span style="padding-left: 40px">
  110. 联系电话:{{information.phonenumber}}
  111. </span>
  112. </div>
  113. </div>
  114. </div>
  115. </template>
  116. <script>
  117. import printJS from "print-js";
  118. export default {
  119. name: "DirectSelling",
  120. data(){
  121. return {
  122. information:'',
  123. clauseData:'',
  124. input:'',
  125. payWaySelect:true,
  126. printData: {
  127. printable: 'directSelling',
  128. ignore: ['no-print']
  129. },
  130. selectData:{
  131. payWay:''
  132. },
  133. options:{
  134. payWay:[
  135. {
  136. value:'订货付款',
  137. label:'订货付款'
  138. },
  139. {
  140. value:'订单付款',
  141. label:'订单付款'
  142. }
  143. ]
  144. },
  145. clauseList:[
  146. {
  147. value:''
  148. }
  149. ]
  150. }
  151. },
  152. methods:{
  153. async queryData(){
  154. const res = await this.$api.requested({
  155. "id": 20221121195102,
  156. "content": {
  157. "sa_contractid": this.$route.query.id
  158. },
  159. })
  160. console.log(res,"合同详情")
  161. this.information = res.data
  162. },
  163. async queryClause(){
  164. const res = await this.$api.requested({
  165. "id": 20230117112102,
  166. "content": {
  167. "sa_contractid": this.$route.query.id,
  168. "sys_enterpriseid":this.$route.query.sys_enterpriseid//选择的企业
  169. }
  170. })
  171. this.clauseData = res.data
  172. console.log(this.clauseData,'合同条款')
  173. },
  174. onShow(){
  175. this.payWaySelect = false
  176. setTimeout(() => {
  177. //需要定时执行的代码
  178. this.handlePrint(this.printData)
  179. }, 500)
  180. },
  181. handlePrint(params) {
  182. /* printJS({printable:params.printable, type:'html', showModal:true})*/
  183. printJS({
  184. printable: params.printable, // 'printFrom', // 标签元素id
  185. type: params.type || 'html',
  186. header: params.header, // '表单',
  187. targetStyles: ['*'],
  188. style: '', // 可选-打印时去掉眉页眉尾
  189. ignoreElements: params.ignore || [], // ['no-print']
  190. properties: params.properties || null
  191. })
  192. this.payWaySelect = true
  193. },
  194. clauseAdd(){
  195. this.clauseList.push({
  196. value: ""
  197. })
  198. console.log(this.clauseList)
  199. }
  200. },
  201. mounted() {
  202. },
  203. created() {
  204. this.queryData()
  205. this.queryClause()
  206. }
  207. }
  208. </script>
  209. <style scoped>
  210. .title-bold{
  211. font-weight: bold;
  212. }
  213. .container-padding{
  214. position: relative;
  215. padding: 5px 16px 5px 16px;
  216. }
  217. .title-left{
  218. padding-left: 10px;
  219. }
  220. </style>