|
@@ -131,6 +131,40 @@
|
|
<el-button type="primary" plain disabled>选择</el-button>
|
|
<el-button type="primary" plain disabled>选择</el-button>
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div style="width: 100%">
|
|
|
|
+ <TitleInfo content="申请物料" style="margin: 20px 0 20px 0"></TitleInfo>
|
|
|
|
+ <div style="width: 100%">
|
|
|
|
+ <el-button type="primary" plain @click="openMaterial = true">
|
|
|
|
+ 添加物料/半成品
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-table :data="formData.followData.afterSalesMaterialsList" style="margin-top: 15px">
|
|
|
|
+ <el-table-column prop="productName" label="产品名称" min-width="200" />
|
|
|
|
+ <el-table-column prop="productSpec" label="规格型号" width="120" />
|
|
|
|
+ <el-table-column prop="quantity" label="数量" width="150">
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
+ <el-form-item :prop="'afterSalesMaterialsList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
|
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.quantity" :precision="0" :controls="false" :min="0"
|
|
|
|
+ @change="changeAmount" style="width:80%" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <!-- <el-table-column prop="productRemark" label="备注" min-width="150">
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
+ <el-form-item :prop="
|
|
|
|
+ 'afterSalesMaterialsList.' + $index + '.productRemark'
|
|
|
|
+ " :rules="rules.productRemark" :inline-message="true">
|
|
|
|
+ <el-input v-model="row.productRemark" placeholder="请输入" type="textarea" :rows="3" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column> -->
|
|
|
|
+ <el-table-column prop="zip" label="操作" width="60">
|
|
|
|
+ <template #default="{ $index }">
|
|
|
|
+ <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -140,6 +174,16 @@
|
|
<el-button type="primary" @click="submitFollow()" size="large" :loading="submitLoading" v-if="!isDetail">确 定</el-button>
|
|
<el-button type="primary" @click="submitFollow()" size="large" :loading="submitLoading" v-if="!isDetail">确 定</el-button>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog v-model="openMaterial" title="选择物料/半成品" width="70%" append-to-body>
|
|
|
|
+ <SelectMaterial @handleSelect="handleSelect"></SelectMaterial>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
+ <el-button @click="openMaterial = false">取消</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -149,7 +193,8 @@ import byTable from "@/components/byTable/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import useUserStore from "@/store/modules/user";
|
|
import useUserStore from "@/store/modules/user";
|
|
import TitleInfo from "@/components/TitleInfo/index.vue";
|
|
import TitleInfo from "@/components/TitleInfo/index.vue";
|
|
-import { async } from "@antv/x6/lib/registry/marker/main";
|
|
|
|
|
|
+import SelectMaterial from "@/components/product/SelectMaterial";
|
|
|
|
+
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
const uploadData = ref({});
|
|
const uploadData = ref({});
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
@@ -163,6 +208,7 @@ const sourceList = ref({
|
|
keyword: "",
|
|
keyword: "",
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
+const openMaterial = ref(false);
|
|
const dialogVisible = ref(false);
|
|
const dialogVisible = ref(false);
|
|
const openFollow = ref(false);
|
|
const openFollow = ref(false);
|
|
const rules = ref({
|
|
const rules = ref({
|
|
@@ -178,6 +224,7 @@ const rules = ref({
|
|
afterSalesPersonId: [
|
|
afterSalesPersonId: [
|
|
{ required: true, message: "请选择售后人员", trigger: "change" },
|
|
{ required: true, message: "请选择售后人员", trigger: "change" },
|
|
],
|
|
],
|
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
});
|
|
});
|
|
const userList = ref([]);
|
|
const userList = ref([]);
|
|
const afterSalesType = ref([]);
|
|
const afterSalesType = ref([]);
|
|
@@ -589,6 +636,7 @@ const submitFollow = () => {
|
|
afterSalesRemark: formData.followData.afterSalesRemark,
|
|
afterSalesRemark: formData.followData.afterSalesRemark,
|
|
amount: formData.followData.amount,
|
|
amount: formData.followData.amount,
|
|
afterSalesRecordDetailList: arr,
|
|
afterSalesRecordDetailList: arr,
|
|
|
|
+ afterSalesMaterialsList: formData.followData.afterSalesMaterialsList,
|
|
})
|
|
})
|
|
.then(
|
|
.then(
|
|
(res) => {
|
|
(res) => {
|
|
@@ -648,6 +696,7 @@ const handleFollow = (row) => {
|
|
proxy.post("/afterSalesRecord/detail", { id: row.id }).then(async (res) => {
|
|
proxy.post("/afterSalesRecord/detail", { id: row.id }).then(async (res) => {
|
|
// 左侧售后信息
|
|
// 左侧售后信息
|
|
formData.detailData = res;
|
|
formData.detailData = res;
|
|
|
|
+
|
|
proxy
|
|
proxy
|
|
.post("/fileInfo/getList", {
|
|
.post("/fileInfo/getList", {
|
|
businessIdList: [row.id],
|
|
businessIdList: [row.id],
|
|
@@ -675,6 +724,7 @@ const handleFollow = (row) => {
|
|
}
|
|
}
|
|
formData.followData = res;
|
|
formData.followData = res;
|
|
formData.followData.id = row.id;
|
|
formData.followData.id = row.id;
|
|
|
|
+ formData.followData.afterSalesMaterialsList = [];
|
|
openFollow.value = true;
|
|
openFollow.value = true;
|
|
} else {
|
|
} else {
|
|
let arr = res.bomDetailList.map((x) => x.afterSalesRecordDetail.id);
|
|
let arr = res.bomDetailList.map((x) => x.afterSalesRecordDetail.id);
|
|
@@ -690,6 +740,7 @@ const handleFollow = (row) => {
|
|
}
|
|
}
|
|
formData.followData = res;
|
|
formData.followData = res;
|
|
formData.followData.id = row.id;
|
|
formData.followData.id = row.id;
|
|
|
|
+ formData.followData.afterSalesMaterialsList = [];
|
|
openFollow.value = true;
|
|
openFollow.value = true;
|
|
const fileObj = await proxy.post("/fileInfo/getList", {
|
|
const fileObj = await proxy.post("/fileInfo/getList", {
|
|
businessIdList: arr,
|
|
businessIdList: arr,
|
|
@@ -759,6 +810,38 @@ const handleSuccess = (any, UploadFile) => {
|
|
const onPreviewFile = (file) => {
|
|
const onPreviewFile = (file) => {
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const handleSelect = (row) => {
|
|
|
|
+ const flag = formData.followData.afterSalesMaterialsList.some(
|
|
|
|
+ (x) => x.productId === row.id
|
|
|
|
+ );
|
|
|
|
+ if (flag) {
|
|
|
|
+ return ElMessage({
|
|
|
|
+ message: "该物料已选择",
|
|
|
|
+ type: "info",
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ formData.followData.afterSalesMaterialsList.push({
|
|
|
|
+ productId: row.id,
|
|
|
|
+ productCode: row.code,
|
|
|
|
+ productName: row.name,
|
|
|
|
+ productSpec: row.spec,
|
|
|
|
+ quantity: null,
|
|
|
|
+ });
|
|
|
|
+ return ElMessage({
|
|
|
|
+ message: "选择成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handleRemove = (index, type) => {
|
|
|
|
+ formData.followData.afterSalesMaterialsList.splice(index, 1);
|
|
|
|
+ return ElMessage({
|
|
|
|
+ message: "删除成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|