123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <script>
- import { MODEIFYBUYER } from "@/api/business/purchase/task";
- export default {
- name: "ModifyBuyerDialog",
- components: {
- ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
- },
- data() {
- return {
- size: "mini",
- title: "转 派",
- visible: false,
- loading: false,
- params: { id: "", buyer: "", buyerName: "" },
- };
- },
- computed: {},
- watch: {},
- methods: {
- //
- open(prop) {
- this.visible = true;
- this.params.id = prop;
- },
- //
- hide() {
- this.visible = false;
- this.params.id = "";
- this.params.buyer = "";
- this.params.buyerName = "";
- },
- //
- async submit(prop) {
- try {
- // try
- this.loading = true;
- const { id, buyer, buyerName } = prop;
- const { msg, code } = await MODEIFYBUYER([
- {
- id,
- buyer,
- buyerName,
- },
- ]);
- if (code === 200) {
- this.hide();
- this.$emit("success");
- this.$notify.success({ title: msg });
- }
- } catch (err) {
- // catch
- } finally {
- // loading
- this.loading = false;
- }
- },
- },
- created() {},
- mounted() {},
- destroyed() {},
- };
- </script>
- <template>
- <el-dialog
- width="25%"
- :show-close="false"
- :visible.sync="visible"
- @close="hide"
- >
- <div
- slot="title"
- style="display: flex; justify-content: space-between; align-items: center"
- >
- <span>{{ title }}</span>
- <span>
- <el-button
- :size="size"
- :disabled="loading"
- circle
- icon="el-icon-check"
- @click="submit(params)"
- >
- </el-button>
- <el-button
- :size="size"
- :disabled="loading"
- circle
- type="danger"
- icon="el-icon-close"
- @click="visible = false"
- >
- </el-button>
- </span>
- </div>
- <el-alert
- title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
- type="info"
- show-icon
- :closable="false"
- style="margin-bottom: 10px"
- >
- </el-alert>
- <el-form
- :size="size"
- :model="params"
- label-width="0px"
- label-position="right"
- style="padding: 0"
- >
- <el-form-item prop="" label="">
- <el-popover-select-v2
- v-model="params.buyerName"
- :source.sync="params"
- :data-mapping="{ buyer: 'code', buyerName: 'name' }"
- valueKey="name"
- referName="CONTACTS_PARAM"
- >
- </el-popover-select-v2>
- </el-form-item>
- </el-form>
- </el-dialog>
- </template>
- <style scoped></style>
|