modal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <modal v-model="modal" width="800px" class-name="vertical-center-modal">
  3. <div class="content">
  4. <div class="title">福州杰生广印工艺品有限责任公司</div>
  5. <div class="title">采购合同</div>
  6. <div class="row">
  7. <div class="col">
  8. <div class="label">合同编号:</div>
  9. <div class="value">{{ data.contractCode }}</div>
  10. </div>
  11. <div class="col">
  12. <div class="label">交货日期:</div>
  13. <div class="value">
  14. {{ $dayjs(data.deliverTime).format('YYYY-MM-DD') }}
  15. </div>
  16. </div>
  17. </div>
  18. <div class="text">
  19. <p>
  20. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  21. 兹经充分协商,买卖双方愿就以下条件达成协议,共同遵守执行,该合同对双方均有约束力,卖方在收到合同后如有异议请于三天内提出,否则视为接受合同全部条款。
  22. </p>
  23. </div>
  24. <div class="table">
  25. <table>
  26. <tr>
  27. <th>件号</th>
  28. <th>物料名称</th>
  29. <th>规格</th>
  30. <th>单位</th>
  31. <th>采购数量</th>
  32. <th>单价</th>
  33. <th>小计</th>
  34. <th>备注</th>
  35. </tr>
  36. <tr>
  37. <td>{{ data.materialCode }}</td>
  38. <td>{{ data.materialName }}</td>
  39. <td>{{ data.materialSpec }}</td>
  40. <td>{{ data.materialUnit }}</td>
  41. <td>{{ data.buyQuantity }}</td>
  42. <td>{{ data.price }}</td>
  43. <td>{{ data.buyQuantity * data.price || 0 }}</td>
  44. <td>{{ data.remark }}</td>
  45. </tr>
  46. </table>
  47. </div>
  48. <div class="text" v-if="data.categoryCode === '03.008.'">
  49. <p>
  50. 1、交货地点: 货物通过指定物流发货,到货地为福州。 收货人:17750201167
  51. 程义成。
  52. </p>
  53. <p>2、质量要求及技术指标: 以确认样和合同上的数据为准。</p>
  54. <p>
  55. 3、标签、条形码和唛头要求:
  56. 外箱,内盒上必须标明产品的规格型号,颜色,批次。
  57. </p>
  58. <p>
  59. 4、包装条件及规格要求:普通包装,以运输途中不损坏货物为标准。外包装上注明货品名称,数量,内附清单,实际到货以清单为准。
  60. </p>
  61. <p>
  62. 5、验受标准及质量索赔:
  63. 以我司验受为标准;因仅是抽检,卖方的出货品质需与成交样品品质一致,若有差异买方有权拒收货物,供方应对因产品本身质量问题产生的责任负责,包含连带损耗的纸张,面料等直接费用。
  64. </p>
  65. <p>
  66. 6、违约责任及其它事项: 合同经确认后, 如发生违约,
  67. 由违约方承担一切责任。履约地在福州。
  68. </p>
  69. <p>
  70. 7、禁止卖方向买方人员进行直接或间接的利益输送,包括但不限于任何形式的回扣、馈赠、礼物、宴请等,卖方应遵守相应的廉洁条款,若违反本约定的一经发现,买方有权单方面取消与卖方的合作,并有权追究因此引起的买方的一切损失和法律后果
  71. </p>
  72. </div>
  73. <div class="text" v-else>
  74. <p>
  75. 1、交货地点:货物通过指定物流发货,到货地为福州。物流送货上门。收货人:程义成
  76. </p>
  77. <p>
  78. 2、质量要求及技术指标:以确认样和合同上的数据为准。面料允收情况为:脏污现象每百米≤4处,抽丝每百米≤4处且米数不得超过3米,缩水门幅控制在2.5%以内。
  79. </p>
  80. <p>
  81. 3、标签、条形码和唛头要求:每卷面料外包装上需贴标签,注明面料名称、规格、米数,以便区分、查验。码单交由物流人员,随货到厂。实际到货情况以我方清点后数据为准。
  82. </p>
  83. <p>
  84. 4、包装条件及规格要求:普通包装,以运输途中不损坏货物为标准。直喷面料打卷纸管内径不得小于7.6cm。
  85. </p>
  86. <p>
  87. 5、验收标准及质量索赔:以我司验收为标准:因仅是抽检,卖方的出货品质需与成交样品品质一致,若有差异买方有权拒收货物,供方对因产品本身质量问题产生的责任负责。
  88. </p>
  89. <p>
  90. 6、违约责任及其他事项:合同经确认后,如发生违约,由违约方承担一切责任。履约地在福州。
  91. </p>
  92. <p>
  93. 7、禁止卖方向买方人员进行直接或间接的利益输送,包括但不限于任何形式的回扣、馈赠、礼物、宴请等,卖方应遵守相应的廉洁条款,若违反本约定的一经发现,买方有权单方面取消与卖方的合作,并有权追究因此引起的买方的一切损失和法律后果。
  94. </p>
  95. <p>8、价格条件:含税,含运费价格</p>
  96. <p>
  97. 9、付款条款:
  98. <Input
  99. v-model="data.accountPeriod"
  100. size="small"
  101. type="number"
  102. style="width: 60px;margin-right: 5px"
  103. />
  104. 天账期,供方提供13%增值税{{
  105. data.invoiceType === 0 ? '专用' : '普通'
  106. }}发票
  107. </p>
  108. </div>
  109. <div class="row" style="margin-bottom: 10px;">
  110. <div
  111. class="col"
  112. style="align-items: flex-start;justify-content: flex-start"
  113. >
  114. <div class="label">备注:</div>
  115. <!-- :readonly="data.contractApproveState === '待确认' ? false : true" -->
  116. <div class="value" style="flex: 1">
  117. <Input
  118. v-model="remark"
  119. type="textarea"
  120. />
  121. </div>
  122. </div>
  123. </div>
  124. <div class="row" style="margin-bottom: 10px;">
  125. <div class="col">
  126. <div class="label">需方:</div>
  127. <div class="value">福州杰生广印工艺品有限责任公司</div>
  128. </div>
  129. <div class="col">
  130. <div class="label">供方:</div>
  131. <div class="value" style="flex: 1">
  132. <Input
  133. v-if="data.status === 0"
  134. v-model="data.supplierName"
  135. search
  136. enter-button="选择供应商"
  137. size="small"
  138. @on-search="chooseGys"
  139. />
  140. <span v-else>{{ data.supplierName }}</span>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="row" style="margin-bottom: 10px;">
  145. <div class="col">
  146. <div class="label">传真:</div>
  147. <div class="value">0519-83986808</div>
  148. </div>
  149. <div class="col" style="justify-content: flex-start">
  150. <div class="label">传真:</div>
  151. <div class="value"></div>
  152. </div>
  153. </div>
  154. <div class="row" style="margin-bottom: 10px;">
  155. <div class="col"></div>
  156. <div class="col">
  157. <div class="label">签约日期:</div>
  158. <div class="value">
  159. {{ $dayjs(data.signTime).format('YYYY-MM-DD') }}
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div
  165. class="footer"
  166. v-if="data.status === 0"
  167. slot="footer"
  168. >
  169. <Button @click="cfm" class="btn" type="primary">提交</Button>
  170. <Button @click="cancel" class="btn">取消</Button>
  171. </div>
  172. <div class="footer" v-else slot="footer">
  173. <Button @click="cancel" class="btn" type="primary">关闭</Button>
  174. </div>
  175. <modal
  176. v-model="show"
  177. :footer-hide="true"
  178. width="700px"
  179. class-name="vertical-center-modal"
  180. @on-cancel="gysCancel"
  181. >
  182. <div
  183. class="title"
  184. style="text-align: center;font-size: 20px;font-weight: bold;padding-bottom: 20px;"
  185. >
  186. 选择供应商
  187. </div>
  188. <my-table
  189. :height="300"
  190. :multiple="true"
  191. :data="gysData"
  192. :columns="columns"
  193. :table-filter="tableFilter"
  194. :table-page="params"
  195. @event-handle="eventHandle"
  196. @on-change="changePage"
  197. @on-select="gysSelct"
  198. >
  199. </my-table>
  200. </modal>
  201. </modal>
  202. </template>
  203. <script>
  204. import MyTable from '_c/my-table/my-table'
  205. import { GetFacPricePageList } from '@/api/baseData'
  206. import { PurcherUpdate } from '@/api/applyPurchase'
  207. export default {
  208. name: 'my-modal',
  209. data () {
  210. return {
  211. remark: '',
  212. gys: {},
  213. gysData: [],
  214. show: false,
  215. modal: false,
  216. columns: [
  217. {
  218. type: 'selection',
  219. width: 60
  220. },
  221. {
  222. title: '序号',
  223. type: 'index',
  224. width: 60,
  225. align: 'center'
  226. },
  227. // {
  228. // title: '供应商代码',
  229. // key: 'factoryId',
  230. // minWidth: 150
  231. // },
  232. {
  233. title: '供应商名称',
  234. key: 'materialCode',
  235. minWidth: 150
  236. },
  237. {
  238. title: '供应商单价',
  239. key: 'price',
  240. minWidth: 150
  241. },
  242. {
  243. title: '账期',
  244. key: 'accountDate',
  245. minWidth: 150
  246. },
  247. {
  248. title: '账期说明',
  249. key: 'accountDateRemark',
  250. minWidth: 150
  251. }
  252. ],
  253. tableFilter: [
  254. {
  255. name: 'Input',
  256. value: 'keyword',
  257. placeholder: '请输入关键字'
  258. },
  259. {
  260. name: 'Button',
  261. type: 'primary',
  262. text: '查询',
  263. e: 'search'
  264. },
  265. {
  266. name: 'Button',
  267. type: 'primary',
  268. text: '确认',
  269. align: 'right',
  270. e: 'add'
  271. }
  272. ],
  273. params: {
  274. pageIndex: 1,
  275. pageSize: 20,
  276. total: 0
  277. }
  278. }
  279. },
  280. components: {
  281. MyTable
  282. },
  283. props: {
  284. data: {
  285. type: Object,
  286. default () {
  287. return {}
  288. }
  289. },
  290. value: {
  291. type: Boolean,
  292. default: false,
  293. require: true
  294. }
  295. },
  296. watch: {
  297. value: {
  298. handler (n) {
  299. this.modal = n
  300. },
  301. immediate: true
  302. },
  303. modal (n) {
  304. this.$emit('input', n)
  305. }
  306. },
  307. methods: {
  308. cancel () {
  309. this.remark = ''
  310. this.gys = {}
  311. this.modal = false
  312. },
  313. cfm () {
  314. if (!this.gys.id) {
  315. return this.$Message.error('请选择供应商!')
  316. }
  317. this.$post('/api/storage-restructure/contract/flowCreate',{
  318. id: this.data.contractId,
  319. supplierId:this.gys.id,
  320. accountDate:this.gys.accountDate,
  321. signTime:this.data.signTime,
  322. deliverTime:this.data.deliverTime,
  323. price:this.gys.price,
  324. quantity:this.data.buyQuantity,
  325. remark: this.remark
  326. }).then(res=>{
  327. this.$Message.info(res.msg || '提交成功!')
  328. this.cancel()
  329. this.$emit('getlist')
  330. })
  331. return
  332. PurcherUpdate({
  333. deliverTime: this.data.deliverTime,
  334. accountPeriod: this.data.accountPeriod,
  335. taxValue: 0.13,
  336. invoiceType: this.data.invoiceType,
  337. signTime: this.data.signTime,
  338. price: this.gys.price,
  339. supplierId: this.gys.factoryId,
  340. remark: this.remark
  341. }).then(res => {
  342. if (res.code === 0) {
  343. this.$Message.info(res.msg || '提交成功!')
  344. this.cancel()
  345. this.$emit('getlist')
  346. }
  347. })
  348. },
  349. // 打开选择供应商
  350. chooseGys () {
  351. this.getList()
  352. this.show = true
  353. },
  354. // 检索条件事件处理
  355. eventHandle (option) {
  356. switch (option._evnet) {
  357. case 'search':
  358. this.params.pageIndex = 1
  359. this.params.keyword = option.keyword
  360. this.getList()
  361. break
  362. case 'add':
  363. this.gysCfm()
  364. break
  365. }
  366. },
  367. gysCfm () {
  368. this.show = false
  369. console.log('select-------------------')
  370. console.log(this.gys)
  371. this.data.price = this.gys.price
  372. this.data.supplierName = this.gys.supplierName
  373. this.data.accountPeriod = this.gys.accountDate
  374. },
  375. /* 供应商弹窗取消 */
  376. gysCancel () {
  377. this.gys = {}
  378. },
  379. gysSelct (selection, data) {
  380. this.gys = { ...data }
  381. },
  382. changePage (pageIndex) {
  383. this.params.pageIndex = pageIndex
  384. this.getList()
  385. },
  386. getList () {
  387. this.$post('/api/storage-restructure/supplier/page', {
  388. ...this.params,
  389. materialId: this.data.materialId
  390. })
  391. .then((res) => {
  392. this.gysData = res.data.records
  393. this.params.total = res.data.total
  394. })
  395. }
  396. }
  397. }
  398. </script>
  399. <style lang="less" scoped>
  400. .content {
  401. padding: 0 40px;
  402. font-size: 14px;
  403. .title {
  404. font-size: 20px;
  405. font-weight: bold;
  406. text-align: center;
  407. }
  408. .row {
  409. display: flex;
  410. justify-content: space-between;
  411. align-items: center;
  412. margin-bottom: 5px;
  413. .col {
  414. flex: 1;
  415. display: flex;
  416. align-items: center;
  417. .label {
  418. }
  419. &:last-child {
  420. justify-content: flex-end;
  421. .label {
  422. width: auto;
  423. }
  424. .value {
  425. width: 100px;
  426. }
  427. }
  428. }
  429. }
  430. .text {
  431. padding: 10px 0;
  432. p {
  433. margin-bottom: 3px;
  434. }
  435. }
  436. .table {
  437. table {
  438. border-collapse: collapse;
  439. border: none;
  440. width: 100%;
  441. tr {
  442. th {
  443. background-color: #eeeeee;
  444. }
  445. td,
  446. th {
  447. padding: 5px;
  448. text-align: center;
  449. border: solid #dcdee2 1px;
  450. position: relative;
  451. font-size: 12px;
  452. }
  453. }
  454. }
  455. }
  456. }
  457. </style>