see-purchase-contract.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <script>
  2. export default {
  3. name: "SeePurchaseContractDrawer",
  4. data() {
  5. const arr2Obj = function (data, keyName, valueName) {
  6. return Object.fromEntries(
  7. data.map((item) => [item[keyName], item[valueName]])
  8. );
  9. };
  10. const columns = [
  11. { key: "puOrg", title: "采购组织", type: "TagSelect", require: true },
  12. { key: "code", title: "合同编码", type: "Input" },
  13. { key: "contractName", title: "合同名称", type: "Input", require: true },
  14. { key: "supplier", title: "供应商", type: "TagSelect", require: true },
  15. { key: "contractType", title: "合同类型", type: "Select", require: true },
  16. { key: "puDept", title: "采购部门", type: "TagSelect", require: true },
  17. { key: "buyer", title: "采购员", type: "TagSelect" },
  18. { key: "source", title: "合同来源", type: "Select" },
  19. {
  20. key: "signDate",
  21. title: "合同签订日期",
  22. type: "DatePicker",
  23. require: true,
  24. },
  25. {
  26. key: "effectiveDate",
  27. title: "合同生效日期",
  28. type: "DatePicker",
  29. require: true,
  30. },
  31. { key: "endDate", title: "合同终止日期", type: "DatePicker" },
  32. { key: "externalContract", title: "外部合同号", type: "Input" },
  33. { key: "refusalReasons", title: "拒绝理由", type: "Input" },
  34. { key: "enquiryCode", title: "询价单号", type: "Input" },
  35. { key: "externalFile", title: "对外附件", type: "Upload", span: 24 },
  36. { key: "puFile", title: "采购商盖章合同附件", type: "Upload", span: 24 },
  37. {
  38. key: "supplierFile",
  39. title: "供应商盖章合同附件",
  40. type: "Upload",
  41. span: 24,
  42. },
  43. { key: "projectName", title: "项目名称", type: "TagSelect" },
  44. { key: "projectCode", title: "项目编号", type: "Input" },
  45. { key: "area", title: "区域", type: "Input" },
  46. { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
  47. { key: "paymentAgreement", title: "付款协议", type: "TagSelect" },
  48. { key: "currency", title: "币种", type: "TagSelect", require: true },
  49. { key: "taxPrice", title: "价税合计", type: "InputNumber" },
  50. { key: "guaranteePeriod", title: "质保期", type: "Input" },
  51. // { key: "lastPuMoney", title: "上年度采购额" },
  52. // { key: "buyerName", title: "采购员名称" },
  53. // { key: "supplierName", title: "供应商名称" },
  54. // { key: "puMoneyYear", title: "本年度采购额" },
  55. // { key: "puDeptName", title: "采购部门名称" },
  56. // { key: "supplierTier", title: "供应商层级" },
  57. // { key: "grossRateAverage", title: "平均毛利率" },
  58. // { key: "approveFlow", title: "审批流程" },
  59. // { key: "consumableClass", title: "耗材类别" },
  60. // { key: "brandGrossRate", title: "同类品牌及毛利率" },
  61. // { key: "contractFormat", title: "合同格式" },
  62. // { key: "productName", title: "产品类别&名称" },
  63. // { key: "invoiceTax", title: "发票税率" },
  64. // { key: "emergencyDegree", title: "紧急程度" },
  65. // { key: "project", title: "项目医院" },
  66. // { key: "deliveryType", title: "交货方式" },
  67. // { key: "contractPartyc", title: "合同丙方" },
  68. // { key: "contractPartycName", title: "合同丙方名称" },
  69. // { key: "guaranteePeriodEnd", title: "质保期限" },
  70. // { key: "freightMethods", title: "运费承担方式" },
  71. // { key: "isTarget", title: "是否有指标" },
  72. // { key: "contractTarget", title: "合同指标" },
  73. // { key: "exemptionPostageCondtion", title: "包邮条件" },
  74. // { key: "isRebate", title: "是否有返利" },
  75. // { key: "rebatePolicy", title: "返利政策" },
  76. // { key: "rollbackPolicy", title: "退换货政策" },
  77. // { key: "contractContent", title: "合同主要内容" },
  78. // { key: "currencyName", title: "币种名称" },
  79. // { key: "tenantId", title: "租户号" },
  80. // { key: "revision", title: "乐观锁" },
  81. // { key: "createByName", title: "创建人" },
  82. // { key: "updateByName", title: "创建人名称" },
  83. // { key: "delFlag", title: "删除标记" },
  84. ];
  85. const initColumns = () =>
  86. columns.map((column) => {
  87. const clearable = column.clearable || true;
  88. if (column.type === "InputNumber") {
  89. return {
  90. ...column,
  91. clearable,
  92. config: { controlsPosition: "right" },
  93. };
  94. }
  95. if (column.type === "DatePicker") {
  96. return {
  97. ...column,
  98. clearable,
  99. config: { type: "date" },
  100. };
  101. }
  102. return {
  103. ...column,
  104. clearable,
  105. };
  106. });
  107. const initParams = () => arr2Obj(initColumns(), "key", "value");
  108. const tabColumns = [
  109. {
  110. title: "物料基本信息",
  111. key: "first",
  112. tableColumns: [
  113. { title: "序号", key: "" },
  114. { title: "赠品", key: "" },
  115. { title: "物料编码", key: "" },
  116. { title: "物料名称", key: "" },
  117. { title: "规格", key: "" },
  118. { title: "生产厂家", key: "" },
  119. { title: "收货客户", key: "" },
  120. { title: "品牌", key: "" },
  121. { title: "采购数量", key: "" },
  122. { title: "采购单位", key: "" },
  123. { title: "计价数量", key: "" },
  124. { title: "税率%", key: "" },
  125. { title: "含税单价", key: "" },
  126. { title: "含税金额合计", key: "" },
  127. { title: "价格有效期(起)", key: "" },
  128. { title: "计划到货日期", key: "" },
  129. { title: "来源类型", key: "" },
  130. { title: "来源单号", key: "" },
  131. { title: "需求单号", key: "" },
  132. { title: "备注", key: "" },
  133. ],
  134. },
  135. {
  136. title: "合同条款",
  137. key: "second",
  138. tableColumns: [
  139. { title: "序号", key: "" },
  140. { title: "条款编码", key: "" },
  141. { title: "条款名称", key: "" },
  142. { title: "条款内容", key: "" },
  143. { title: "变量序号", key: "" },
  144. { title: "变量内容", key: "" },
  145. { title: "备注", key: "" },
  146. ],
  147. },
  148. {
  149. title: "合同费用",
  150. key: "third",
  151. tableColumns: [
  152. { title: "序号", key: "" },
  153. { title: "费用编码", key: "" },
  154. { title: "费用名称", key: "" },
  155. { title: "费用金额", key: "" },
  156. { title: "备注", key: "" },
  157. ],
  158. },
  159. {
  160. title: "付款协议信息",
  161. key: "fourth",
  162. tableColumns: [
  163. { title: "序号", key: "" },
  164. { title: "付款阶段", key: "" },
  165. { title: "是否预付款", key: "" },
  166. { title: "是否质保金", key: "" },
  167. { title: "结算方式", key: "" },
  168. { title: "付款起点", key: "" },
  169. { title: "付款金额", key: "" },
  170. { title: "付款比例%", key: "" },
  171. { title: "账期天数", key: "" },
  172. { title: "备注", key: "" },
  173. ],
  174. },
  175. {
  176. title: "合同执行组织范围",
  177. key: "fifth",
  178. tableColumns: [
  179. { title: "序号", key: "" },
  180. { title: "组织名称", key: "" },
  181. { title: "组织编码", key: "" },
  182. ],
  183. },
  184. ];
  185. const initTabColumns = () => tabColumns;
  186. return {
  187. visible: false,
  188. columns: initColumns(),
  189. params: initParams(),
  190. options: [
  191. {
  192. value: "选项1",
  193. label: "黄金糕",
  194. },
  195. {
  196. value: "选项2",
  197. label: "双皮奶",
  198. },
  199. {
  200. value: "选项3",
  201. label: "蚵仔煎",
  202. },
  203. {
  204. value: "选项4",
  205. label: "龙须面",
  206. },
  207. {
  208. value: "选项5",
  209. label: "北京烤鸭",
  210. },
  211. ],
  212. tabColumns: initTabColumns(),
  213. tabName: "first",
  214. tabTableDatas: {
  215. first: [],
  216. second: [],
  217. third: [],
  218. fourth: [],
  219. fifth: [],
  220. },
  221. };
  222. },
  223. computed: {},
  224. watch: {},
  225. methods: {
  226. setVisible(prop) {
  227. this.visible = prop;
  228. },
  229. },
  230. created() {
  231. console.log(this.params, this.columns);
  232. },
  233. mounted() {},
  234. destroyed() {},
  235. };
  236. </script>
  237. <template>
  238. <el-drawer
  239. title="我是标题"
  240. direction="btt"
  241. size="100%"
  242. :with-header="false"
  243. :visible.sync="visible"
  244. :before-close="handleClose"
  245. >
  246. <el-card
  247. :body-style="{
  248. padding: '20px',
  249. display: 'flex',
  250. 'flex-wrap': 'wrap',
  251. }"
  252. style="margin: 10px"
  253. >
  254. <div
  255. slot="header"
  256. style="
  257. display: flex;
  258. justify-content: space-between;
  259. align-items: center;
  260. "
  261. >
  262. <h3>查看</h3>
  263. <div style="text-align: right">
  264. <el-button size="mini" @click="setVisible(false)">取消</el-button>
  265. <el-button size="mini" type="info" @click="setVisible(false)"
  266. >保存并新增</el-button
  267. >
  268. <el-button size="mini" type="danger" @click="setVisible(false)"
  269. >保存</el-button
  270. >
  271. </div>
  272. </div>
  273. <el-row>
  274. <el-form
  275. size="mini"
  276. label-position="right"
  277. label-width="150px"
  278. :model="params"
  279. >
  280. <el-col
  281. v-for="(column, index) in columns"
  282. :key="index"
  283. :span="column.span || 8"
  284. >
  285. <el-form-item
  286. :prop="column.key"
  287. :label="column.title"
  288. :required="column.required"
  289. >
  290. <el-input
  291. v-if="column.type === 'Input'"
  292. v-model="params[column.key]"
  293. :placeholder="column.placeholder"
  294. :clearable="column.clearable"
  295. style="width: 90%"
  296. ></el-input>
  297. <el-input-number
  298. v-if="column.type === 'InputNumber'"
  299. v-model="params[column.key]"
  300. :controls-position="column.config.controlsPosition"
  301. :placeholder="column.placeholder"
  302. :clearable="column.clearable"
  303. style="width: 90%"
  304. ></el-input-number>
  305. <el-select
  306. v-if="column.type === 'Select'"
  307. v-model="params[column.key]"
  308. :placeholder="column.placeholder"
  309. :clearable="column.clearable"
  310. style="width: 90%"
  311. >
  312. <el-option
  313. v-for="item in options"
  314. :key="item.value"
  315. :label="item.label"
  316. :value="item.value"
  317. >
  318. </el-option>
  319. </el-select>
  320. <el-select
  321. v-if="column.type === 'TagSelect'"
  322. v-model="params[column.key]"
  323. multiple
  324. clearable
  325. collapse-tags
  326. :placeholder="column.placeholder"
  327. :clearable="column.clearable"
  328. style="width: 90%"
  329. >
  330. <template #prefix>
  331. <el-icon
  332. class="el-icon-s-operation"
  333. style="cursor: pointer"
  334. @click.stop="$message.info(234)"
  335. ></el-icon>
  336. </template>
  337. <el-option
  338. v-for="item in options"
  339. :key="item.value"
  340. :label="item.label"
  341. :value="item.value"
  342. >
  343. </el-option>
  344. </el-select>
  345. <el-date-picker
  346. v-if="column.type === 'DatePicker'"
  347. v-model="params[column.key]"
  348. :type="column.config.type"
  349. :placeholder="column.placeholder"
  350. :clearable="column.clearable"
  351. :picker-options="column.pickerOptions"
  352. style="width: 90%"
  353. >
  354. </el-date-picker>
  355. <el-upload
  356. v-if="column.type === 'Upload'"
  357. :file-list="params[column.key]"
  358. drag
  359. action="https://jsonplaceholder.typicode.com/posts/"
  360. multiple
  361. >
  362. <i class="el-icon-upload"></i>
  363. <div class="el-upload__text">
  364. 将文件拖到此处,或<em>点击上传</em>
  365. </div>
  366. <div class="el-upload__tip" slot="tip">
  367. 只能上传jpg/png文件,且不超过500kb
  368. </div>
  369. </el-upload>
  370. </el-form-item>
  371. </el-col>
  372. </el-form>
  373. </el-row>
  374. </el-card>
  375. <el-card
  376. :body-style="{
  377. padding: '20px',
  378. display: 'flex',
  379. 'flex-wrap': 'wrap',
  380. }"
  381. style="margin: 10px"
  382. >
  383. <el-tabs v-model="tabName" @tab-click="handleClick" style="width: 100%">
  384. <el-tab-pane
  385. v-for="(column, index) in tabColumns"
  386. :key="index"
  387. :label="column.title"
  388. :name="column.key"
  389. >
  390. <el-table :data="tabTableDatas[column.key]" style="width: 100%">
  391. <el-table-column
  392. v-for="(cColumn, cIndex) in column.tableColumns"
  393. :key="cIndex"
  394. :prop="cColumn.key"
  395. :label="cColumn.title"
  396. >
  397. </el-table-column>
  398. </el-table>
  399. </el-tab-pane>
  400. </el-tabs>
  401. </el-card>
  402. </el-drawer>
  403. </template>