123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <script>
- import { MODEIFYBUYER } from "@/api/business/purchase/task";
- export default {
- name: "ModifyBuyerDialog",
- props: {
- selectData: {
- type: [Array],
- require: true,
- },
- },
- components: {
- ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
- },
- data() {
- return {
- title: "转 派",
- visible: false,
- loading: false,
- params: { id: "", buyer: "", buyerName: "" },
- };
- },
- computed: {
- disabled: {
- get() {
- return this.selectData.length !== 1;
- },
- set() {},
- },
- },
- watch: {},
- methods: {
- //
- open(prop) {
- this.visible = true;
- this.params.id = prop.id;
- },
- //
- 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 {
- // finally
- this.loading = false;
- }
- },
- },
- created() {},
- mounted() {},
- destroyed() {},
- };
- </script>
- <template>
- <el-button
- v-bind="$attrs"
- v-on="$listeners"
- :disabled="disabled"
- @click="open(selectData[0])"
- >
- {{ title }}
- <el-dialog
- :title="title"
- :visible.sync="visible"
- width="25%"
- append-to-body
- @close="hide"
- >
- <div slot="footer">
- <el-button
- :size="$attrs.size"
- :loading="loading"
- @click="visible = false"
- >取 消</el-button
- >
- <el-button
- type="primary"
- :size="$attrs.size"
- :loading="loading"
- @click="submit(params)"
- >确 认</el-button
- >
- </div>
- <el-alert
- title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
- type="info"
- show-icon
- :closable="false"
- style="margin-bottom: 10px"
- >
- </el-alert>
- <el-form
- :size="$attrs.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>
- </el-button>
- </template>
- <style scoped></style>
|