index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <script>
  2. import { MODEIFYBUYER } from "@/api/business/purchase/task";
  3. export default {
  4. name: "ModifyBuyerDialog",
  5. components: {},
  6. data() {
  7. return {
  8. size: "mini",
  9. visible: false,
  10. loading: false,
  11. params: { id: "", buyer: "", buyerName: "" },
  12. };
  13. },
  14. computed: {},
  15. watch: {},
  16. methods: {
  17. //
  18. open(prop) {
  19. this.visible = true;
  20. this.params.id = prop;
  21. },
  22. //
  23. hide() {
  24. this.visible = false;
  25. this.params.id = "";
  26. this.params.buyer = "";
  27. this.params.buyerName = "";
  28. },
  29. //
  30. async submit(prop) {
  31. try {
  32. this.loading = true;
  33. const { id, buyer, buyerName } = prop;
  34. const { code, msg } = await MODEIFYBUYER([
  35. {
  36. id,
  37. buyer,
  38. buyerName,
  39. },
  40. ]);
  41. if (code === 200) {
  42. this.hide();
  43. this.$emit("success");
  44. this.$notify.success({ title: msg });
  45. } else {
  46. this.$notify.warning({ title: msg });
  47. }
  48. } catch (err) {
  49. //
  50. } finally {
  51. this.loading = false;
  52. }
  53. },
  54. },
  55. created() {},
  56. mounted() {},
  57. destroyed() {},
  58. };
  59. </script>
  60. <template>
  61. <el-dialog width="25%" :visible.sync="visible" title="转派" @close="hide">
  62. <el-alert
  63. title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
  64. type="info"
  65. show-icon
  66. :closable="false"
  67. style="margin-bottom: 10px"
  68. >
  69. </el-alert>
  70. <el-form
  71. :size="size"
  72. :model="params"
  73. label-width="0px"
  74. label-position="right"
  75. >
  76. <el-form-item prop="" label="">
  77. <dr-popover-select
  78. v-model="params.buyerName"
  79. title="转派人员"
  80. type="CONTACTS_PARAM"
  81. :data-mapping="{ buyer: 'code', buyerName: 'name' }"
  82. :source.sync="params"
  83. >
  84. </dr-popover-select>
  85. </el-form-item>
  86. </el-form>
  87. <span slot="footer">
  88. <el-button :size="size" @click="visible = false">取 消</el-button>
  89. <el-button :size="size" type="primary" @click="submit(params)"
  90. >确 定</el-button
  91. >
  92. </span>
  93. </el-dialog>
  94. </template>
  95. <style scoped></style>