TicketForm.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="main" v-show="visible">
  3. <div>
  4. <a-button type="primary" v-print="'#print-container2'" :disabled="disabled">打印</a-button>
  5. <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
  6. </div>
  7. <div id="print-container2">
  8. <div class="title">
  9. <div style="font-size:26px;"><span style="font-size:30px;font-weight:700;vertical-align: middle;letter-spacing:.2em;">{{ oldOrNew === 1 ? '时代思康':'龙岩思康' }}新材料有限公司</span></div>
  10. <div style="font-size:26px;font-weight:700">{{ type? BaseTool.Object.getField(typeMap,model.type):'材料退库' }}</div>
  11. </div>
  12. <div style="display:flex;justify-content:space-between; margin: 10px auto;width: 1030px;">
  13. <span>
  14. {{ BaseTool.Object.getField(deptYYMap,model.applyDept) }}
  15. </span>
  16. <div>维修单号:{{ model.repairNo }}</div>
  17. <div>单号:{{ model.yyId }}</div>
  18. <div>日期:{{ model.userTime }}</div>
  19. </div>
  20. <div class="tables" >
  21. <table>
  22. <tr>
  23. <td colspan="1" style="text-align:left;">
  24. {{ type? '领库':'退库' }}单位或个人:{{ model.createdUserName }}
  25. </td>
  26. <td colspan="4" style="text-align:left;">
  27. 项目:{{ model.projectName }}
  28. </td>
  29. <td colspan="3" style="text-align:left;">
  30. 成本归属:{{ model.feeFrom }}
  31. </td>
  32. </tr>
  33. <tr>
  34. <td colspan="8" style="text-align:left;">
  35. 用途:{{ model.remark }}
  36. </td>
  37. </tr>
  38. <tr>
  39. <td colspan="1" style="min-width:210px;">物料编码</td>
  40. <td colspan="1" style="min-width:120px;">物料名称</td>
  41. <td colspan="1" style="max-width:480px;">规格型号</td>
  42. <td colspan="1" style="min-width:65px;">货架号</td>
  43. <td colspan="1" style="min-width:50px;">单位</td>
  44. <td colspan="1" style="min-width:50px;">数量</td>
  45. <td colspan="1" style="min-width:50px;">仓库名称</td>
  46. <td colspan="1" style="min-width:50px;">备注</td>
  47. </tr>
  48. <tr v-for="item in model.detailList" :key="item.id">
  49. <td colspan="1">{{ item.no }}</td>
  50. <td colspan="1">{{ item.spareName }}</td>
  51. <td colspan="1" style="">{{ item.ggxh }}</td>
  52. <td colspan="1">{{ item.storePosition }}</td>
  53. <td colspan="1">{{ item.unit }}</td>
  54. <td colspan="1">{{ item.num }}</td>
  55. <td colspan="1">{{ item.storeName }}</td>
  56. <td colspan="1">{{ item.remark }}</td>
  57. </tr>
  58. <tr v-show="model.detailList.length<6" v-for="i in ((6-model.detailList.length)>0?(6-model.detailList.length):0)" :key="i">
  59. <!-- <td></td>
  60. <td></td>
  61. <td></td>
  62. <td></td>
  63. <td></td>
  64. <td></td>-->
  65. </tr>
  66. <tr>
  67. <td colspan="2">合计</td>
  68. <td colspan="1"></td>
  69. <td colspan="1"></td>
  70. <td colspan="1"></td>
  71. <td colspan="1">{{ model.detailList.reduce((num,item)=>num+=item.num,0) }}</td>
  72. <td colspan="1"></td>
  73. <td colspan="1"></td>
  74. </tr>
  75. </table>
  76. </div>
  77. <div style="display:flex;justify-content:space-between ; margin: 10px auto;width: 1030px;">
  78. <div >{{ type? '领库':'退库' }}人:{{ model.createdUserName }}</div>
  79. <div>部门主管:{{ model.applyUserName }}</div>
  80. <div style="width: 150px;">仓管:</div>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. export default {
  87. data () {
  88. return {
  89. visible: false,
  90. disabled: false,
  91. value1: 1,
  92. type: true,
  93. oldOrNew: 1,
  94. typeMap: {},
  95. deptYYMap: {},
  96. model: {
  97. 'yyId': null,
  98. 'oldOrNew': null,
  99. 'userTime': null,
  100. 'type': null,
  101. 'sbNo': null,
  102. 'sbName': null,
  103. 'sbLocation': null,
  104. 'caller': null,
  105. 'dispatcher': null,
  106. 'repairMan': null,
  107. 'content': null,
  108. 'feeFrom': null
  109. }
  110. }
  111. },
  112. created () {
  113. // 下拉框map
  114. // this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_TYPE)
  115. this.deptYYMap = { ...this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_DEPT_CODE), ...this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBB) }
  116. },
  117. methods: {
  118. base (record, type) {
  119. this.visible = true
  120. console.log(record)
  121. this.type = type
  122. this.oldOrNew = record.oldOrNew
  123. this.model = record
  124. if (record.outFlag === 1) {
  125. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_TYPE)
  126. } else {
  127. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_BACK_FORM_TYPE)
  128. }
  129. },
  130. handleCancel (values) {
  131. this.visible = false
  132. this.$emit('ok')
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="less" scoped>
  138. .main{
  139. background: #fff;
  140. }
  141. .title{
  142. text-align: center;
  143. font-size:18px;
  144. }
  145. .tables{
  146. margin: 10px auto;
  147. width: 1030px;
  148. font-size: 14px;
  149. overflow-x:auto;
  150. table {
  151. margin: 0 auto;
  152. border: 1px solid #D6D6D6;
  153. border-radius: 6px;
  154. width: 1030px;
  155. border-collapse: collapse;
  156. font-weight: 400;
  157. }
  158. th{
  159. color: #FFFFFF;
  160. background: #3762FC;
  161. }
  162. tr {
  163. min-height:26px;
  164. }
  165. th,
  166. td {
  167. border: 1px solid #D6D6D6;
  168. text-align: center;
  169. padding: 2px 10px;
  170. word-wrap:break-word;
  171. word-break:break-all;
  172. }
  173. }
  174. .check{
  175. position:absolute;
  176. left:0px;
  177. font-size:20px;
  178. }
  179. .checks{
  180. position:absolute;
  181. left:-27px;
  182. font-size:20px;
  183. }
  184. /deep/.ant-radio-inner::after ,/deep/.ant-checkbox-checked .ant-checkbox-inner{
  185. background-color:#fff;
  186. border-radius: 0;
  187. }
  188. </style>