123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <div v-loading="loading">
- <div class="form-box">
- <el-form
- label-position="top"
- :model="form"
- ref="form"
- :rules="formRules"
- label-width="100px"
- >
- <el-form-item label="跟进结果" prop="code">
- <el-radio-group v-model="form.code" size="medium">
- <el-radio-button label="1">完成</el-radio-button>
- <el-radio-button label="2">跟进中</el-radio-button>
- </el-radio-group>
- </el-form-item>
- <el-row>
- <el-col :span="8">
- <el-form-item label="跟进人" prop="code">
- <el-select
- v-model="form.inWarehouseId"
- :placeholder="$t('pleaseSelect')"
- style="width: 100%"
- >
- <el-option
- v-for="item in warehouseSelectList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="跟进时间" prop="clearancePeriod">
- <el-date-picker
- v-model="form.clearancePeriod"
- type="datetime"
- :placeholder="$t('pleaseSelect')"
- value-format="yyyy-MM-dd HH:mm:ss"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="跟进记录" prop="remark">
- <el-input
- v-model="form.remark"
- placeholder="请输入"
- type="textarea"
- :rows="3"
- >
- </el-input>
- </el-form-item>
- </el-form>
- </div>
- <div style="text-align: center; margin-top: 15px">
- <el-button size="small" @click="handleCancel"
- >{{ $t("cancel") }}
- </el-button>
- <el-button type="primary" size="small" @click="handleSubmit">
- {{ $t("submit") }}</el-button
- >
- </div>
- <!-- <el-dialog
- :title="$t('goodsSelect')"
- v-if="selectDialog"
- :visible.sync="selectDialog"
- width="80%"
- top="60px"
- >
- <selectProduct @select="handleSelect"></selectProduct>
- </el-dialog> -->
- </div>
- </template>
- <script>
- import labelTitle from "@/components/label-title/index.vue";
- import selectProduct from "@/components/select-product/index.vue";
- import { getToken } from "@/util/auth";
- export default {
- name: "addManualOutbound",
- components: { labelTitle, selectProduct },
- props: {
- form: {
- type: Object,
- default: () => {},
- },
- warehouseSelectList: {
- type: Array,
- default: () => [],
- },
- },
- data() {
- return {
- uploadHeader: {
- Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
- "Blade-Auth": "bearer " + getToken(),
- },
- loading: false,
- selectDialog: false,
- formRules: {
- quantity: [
- {
- required: true,
- message: "请输入质检合格数量",
- trigger: "blur",
- },
- ],
- outWarehouseId: [
- {
- required: true,
- message: "请选择调出仓库",
- trigger: "change",
- },
- ],
- inWarehouseId: [
- {
- required: true,
- message: "请选择调入仓库",
- trigger: "change",
- },
- ],
- },
- };
- },
- created() {},
- methods: {
- handleSubmit() {
- this.$refs.form.validate((valid) => {
- if (valid) {
- if (!this.form.changeProductList.length > 0)
- return this.msgInfo("请添加调仓明细");
- this.loading = true;
- this.$emit("submit");
- }
- });
- },
- handleCancel() {
- this.$emit("cancel");
- },
- handleAddProduct() {
- if (this.form.outWarehouseId === this.form.inWarehouseId)
- return this.msgInfo("调出和调入仓库不可一致");
- if (!(this.form.outWarehouseId && this.form.inWarehouseId))
- return this.msgInfo("请先选择要调的仓库");
- this.selectDialog = true;
- },
- handleSelect(row) {
- const flag = this.form.changeProductList.some(
- (x) => x.productId === row.id
- );
- if (flag) return this.msgInfo("该物品已经选择");
- const product = {
- productCode: row.code,
- productName: row.name,
- productId: row.id,
- quantity: "",
- };
- this.form.changeProductList.push(product);
- },
- deleteRow(index) {
- this.form.changeProductList.splice(index, 1);
- this.msgSuccess(this.$t("deleteSuccess"));
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .form-box {
- height: calc(100vh - 280px);
- overflow: auto;
- box-sizing: border-box;
- padding: 10px;
- }
- ::v-deep {
- .el-form-item {
- margin-bottom: 3px;
- }
- .el-form--label-top .el-form-item__label {
- padding: 8px 0 0 0;
- }
- }
- </style>
|