替换infopath项目,采用SharePoint SPFX框架
css
uatadmin
2024-08-21 426632e0a80fc7483ab07ec94e3d76f7bfdf2957
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<template>
  <ul class="container">
    <li class="item">
      <div class="item-label bg1">备品编号{{ props.index }}</div>
      <div class="item-content" style="flex: 0 0 110px">
        {{ props.content[0]?.Item_CD }}
      </div>
      <div class="item-label bg2">品名</div>
      <div class="item-content" style="flex: 0 0 160px">
        {{ props.content[0]?.Item_Name }}
      </div>
      <div class="item-label bg2">型号</div>
      <div class="item-content">{{ props.content[0]?.SPEC_CN }}</div>
      <div class="item-label bg2" style="flex: 0 0 60px">单位</div>
      <div class="item-content" style="flex: 0 0 100px">
        {{ props.content[0]?.Package }}
      </div>
    </li>
    <li class="item" v-for="(item, index) in computedContent" :key="index">
      <div class="item-label bg3">合作伙伴简称</div>
      <div class="item-content" style="flex: 0 0 110px">
        {{ item.Request_Vend_Name_S }}
      </div>
      <div class="item-label bg3">单价Ver &nbsp; {{ item.Reply_Count }}.0</div>
      <div class="item-content" style="flex: 0 0 160px">
        {{ item.Unit_Price }}
      </div>
      <div class="item-label bg3">币种</div>
      <div class="item-content">{{ item.Currency8 }}</div>
      <div class="item-label bg3">折USD</div>
      <div class="item-content">{{ item.Exchange_Unit_Price }}</div>
      <div class="item-label bg3" style="flex: 0 0 60px">LT</div>
      <div class="item-content" style="flex: 0 0 100px">{{ item.LT }}</div>
    </li>
    <li class="item">
      <div
        class="item-label bg4"
        v-html="'<p>选定购入</p><p>合作伙伴</p>'"
      ></div>
      <div class="item-content" style="flex: 0 0 378px">
        {{ props.content[0]?.VEND_NAME }}
      </div>
      <div class="item-label bg4">品牌</div>
      <div class="item-content">{{ props.content[0]?.Brand }}</div>
      <div class="item-label bg4" style="flex: 0 0 60px">原产地</div>
      <div class="item-content" style="flex: 0 0 100px">
        {{ props.content[0]?.Origin }}
      </div>
    </li>
    <li class="item">
      <div class="item-label bg2">经费项目</div>
      <div class="item-content">
        {{ props.content[0]?.Cost_Name }}
        <span style="float: right; margin-right: 10%; color: #409eff">
          <a
            class="link-padding"
            v-if="props.content.filter((e) => e.Attach_File1).length"
            :href="props.content.filter((e) => e.Attach_File1)[0]?.Attach_File1"
            target="_blank"
            >附件1</a
          >
          <a
            class="link-padding"
            v-if="props.content.filter((e) => e.Attach_File2).length"
            :href="props.content.filter((e) => e.Attach_File2)[0]?.Attach_File2"
            target="_blank"
            >附件2</a
          >
          <a
            class="link-padding"
            v-if="props.content.filter((e) => e.Attach_File3).length"
            :href="props.content.filter((e) => e.Attach_File3)[0]?.Attach_File3"
            target="_blank"
            >附件3</a
          >
        </span>
      </div>
    </li>
    <li class="item">
      <div class="item-label bg5">备注</div>
      <div class="item-content">{{ props.content[0]?.Comment }}</div>
    </li>
  </ul>
</template>
 
<script setup>
import { defineProps, computed } from "vue";
import { toThousands } from "../../ComponentCommon";
const props = defineProps({
  content: {
    type: Array,
    default: () => [],
  },
  index: {
    type: Number,
    default: 0,
  },
});
 
const computedContent = computed(() => {
  return props.content.map((item) => {
    let res = { ...item };
    res.Item_Name = item.Item_Name.split("/");
    res.Unit_Price =toThousands((+res.Unit_Price).toFixed(5));
    res.LT = toThousands(res.LT);
    res.Exchange_Unit_Price = (+res.Exchange_Unit_Price).toFixed(5);
    return res;
  });
});
 
const fileContet = computed(() => {
  let res = {};
  props.content.forEach((value, index) => {
    if (!res[value.Request_Vend_Name_S]) {
      res[value.Request_Vend_Name_S] = {
        path: value.PR_File_Attach_File,
        version: value.Reply_Count,
      };
    }
  });
  return res;
});
</script>
 
<style scoped lang="less">
.container {
  margin-bottom: 5px;
}
.item {
  display: flex;
  .item-label {
    border: 1px solid black;
    flex: 0 0 110px;
    margin-top: -1px;
    margin-left: -1px;
    text-align: center;
    align-content: center;
    border-collapse: collapse;
  }
 
  .item-content {
    border: 1px solid black;
    min-width: 10px;
    margin-top: -1px;
    margin-left: -1px;
    flex: 1 0 0;
    justify-content: center;
    align-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-height: 40px;
    padding: 2px 5px;
    border-collapse: collapse;
  }
 
  .link-padding {
    padding: 3px 6px;
    display: inline-block;
    color: revert;
  }
 
  .bg1 {
    background-color: rgb(255, 163, 3);
  }
 
  .bg2 {
    background-color: rgb(177, 239, 235);
  }
 
  .bg3 {
    background-color: rgb(240, 231, 141);
  }
 
  .bg4 {
    background-color: rgb(146, 236, 146);
  }
 
  .bg5 {
    background-color: #006dbb;
    color: #fff;
  }
}
</style>