|
@@ -11,17 +11,86 @@
|
|
|
}}</el-button>
|
|
|
</el-card>
|
|
|
<el-card class="bottom">
|
|
|
- <by-table
|
|
|
- v-loading="loading"
|
|
|
- :data="tableList"
|
|
|
- :columns="columns"
|
|
|
- :pageNum.sync="req.pageNum"
|
|
|
- :pageSize.sync="req.pageSize"
|
|
|
+ <query
|
|
|
:selectConfig="selectConfig"
|
|
|
:req="req"
|
|
|
- :total="total"
|
|
|
- >
|
|
|
- </by-table>
|
|
|
+ :isShowMore="true"
|
|
|
+ @handleQuery="handleQuery"
|
|
|
+ @handleMore="
|
|
|
+ () => {
|
|
|
+ queryDialog = true;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ ></query>
|
|
|
+ <el-table :data="tableList" v-loading="loading">
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.productType')"
|
|
|
+ align="center"
|
|
|
+ prop="productType"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.productCode')"
|
|
|
+ align="center"
|
|
|
+ prop="productCode"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.productName')"
|
|
|
+ align="center"
|
|
|
+ prop="productName"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.productUnit')"
|
|
|
+ align="center"
|
|
|
+ prop="productUnit"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.deptId')"
|
|
|
+ align="center"
|
|
|
+ prop="deptId"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.lifeCycle')"
|
|
|
+ align="center"
|
|
|
+ prop="lifeCycle"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.cycleSales')"
|
|
|
+ align="center"
|
|
|
+ prop="cycleSales"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.jdPurchasePrice')"
|
|
|
+ align="center"
|
|
|
+ prop="jdPurchasePrice"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.sellingPrice')"
|
|
|
+ align="center"
|
|
|
+ prop="sellingPrice"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('product_material.product.purchasePrice')"
|
|
|
+ align="center"
|
|
|
+ prop="purchasePrice"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('operation')"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="handleEdit(scope.row)"
|
|
|
+ >{{ $t("edit") }}
|
|
|
+ </el-button>
|
|
|
+ <el-button type="text" @click="handleDelete(scope.row)"
|
|
|
+ >{{ $t("delete") }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
<el-dialog
|
|
|
:title="
|
|
|
titleText === 'add'
|
|
@@ -31,16 +100,213 @@
|
|
|
:visible.sync="open"
|
|
|
v-if="open"
|
|
|
width="50%"
|
|
|
+ top="60px"
|
|
|
+ >
|
|
|
+ <add-product
|
|
|
+ :form="form"
|
|
|
+ @submit="handleSubmit"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ ref="addProduct"
|
|
|
+ ></add-product>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="$t('seniorQuery')"
|
|
|
+ v-if="queryDialog"
|
|
|
+ :visible.sync="queryDialog"
|
|
|
+ width="50%"
|
|
|
+ top="60px"
|
|
|
>
|
|
|
- <test
|
|
|
- ref="form"
|
|
|
- v-model="dialogParams"
|
|
|
- :form-config="dialogForm"
|
|
|
- :insideRules="dialogRules"
|
|
|
- ></test>
|
|
|
+ <div class="search-box">
|
|
|
+ <el-form :form="req" label-position="top" label-width="100px">
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.productType')"
|
|
|
+ >
|
|
|
+ <el-radio-group v-model="req.type">
|
|
|
+ <el-radio-button label="">
|
|
|
+ {{ $t("product_material.product.all") }}
|
|
|
+ </el-radio-button>
|
|
|
+ <el-radio-button label="1">
|
|
|
+ {{
|
|
|
+ $t("product_material.product.finishedProduct")
|
|
|
+ }}</el-radio-button
|
|
|
+ >
|
|
|
+ <el-radio-button label="2">
|
|
|
+ {{
|
|
|
+ $t("product_material.product.partiallyPreparedProducts")
|
|
|
+ }}</el-radio-button
|
|
|
+ >
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.productCode')"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="req.code"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.productName')"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="req.name"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.combination')"
|
|
|
+ >
|
|
|
+ <el-radio-group v-model="req.combination">
|
|
|
+ <el-radio-button label="">
|
|
|
+ {{ $t("product_material.product.all") }}</el-radio-button
|
|
|
+ >
|
|
|
+ <el-radio-button label="1">
|
|
|
+ {{ $t("product_material.product.yes") }}
|
|
|
+ </el-radio-button>
|
|
|
+ <el-radio-button label="0">
|
|
|
+ {{ $t("product_material.product.no") }}</el-radio-button
|
|
|
+ >
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('product_material.product.deptId')">
|
|
|
+ <el-select
|
|
|
+ v-model="req.deptId"
|
|
|
+ :placeholder="$t('pleaseSelect')"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.jdPurchasePrice')"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-input
|
|
|
+ v-model="req.jdPurchasePriceMin"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" style="text-align: center"> ~ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-input
|
|
|
+ v-model="req.jdPurchasePriceMax"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.sellingPrice')"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-input
|
|
|
+ v-model="req.sellingPriceMin"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" style="text-align: center"> ~ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-input
|
|
|
+ v-model="req.sellingPriceMax"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.purchasePrice')"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-input
|
|
|
+ v-model="req.purchasePriceMin"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" style="text-align: center"> ~ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-input
|
|
|
+ v-model="req.purchasePriceMax"
|
|
|
+ :placeholder="$t('pleaseInput')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('product_material.product.lifeCycle')">
|
|
|
+ <el-radio-group v-model="req.lifeCycle">
|
|
|
+ <el-radio-button label="">
|
|
|
+ {{ $t("product_material.product.all") }}</el-radio-button
|
|
|
+ >
|
|
|
+ <el-radio-button label="1">
|
|
|
+ {{
|
|
|
+ $t("product_material.product.newProductsExpectedSales")
|
|
|
+ }}</el-radio-button
|
|
|
+ >
|
|
|
+ <el-radio-button label="2">
|
|
|
+ {{
|
|
|
+ $t("product_material.product.growUpExpectedSales")
|
|
|
+ }}</el-radio-button
|
|
|
+ >
|
|
|
+ <el-radio-button
|
|
|
+ :label="
|
|
|
+ $t('product_material.product.matureExpectedSales')
|
|
|
+ "
|
|
|
+ name="3"
|
|
|
+ ></el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ :label="$t('product_material.product.clearancePeriod')"
|
|
|
+ >
|
|
|
+ <el-date-picker
|
|
|
+ v-model="timeArr"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ @change="handleDateChange"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center; margin-top: 15px">
|
|
|
+ <el-button size="small" @click="handleReset"
|
|
|
+ >{{ $t("reset") }}
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleQuery">
|
|
|
+ {{ $t("submit") }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
- <!-- <el-dialog title="预览" :visible.sync="viewModal" width="500px">
|
|
|
- </el-dialog> -->
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -48,7 +314,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import addProduct from "./addProduct.vue";
|
|
|
+import query from "@/components/query/index.vue";
|
|
|
import tree from "./tree.vue";
|
|
|
+
|
|
|
import byTable from "@/components/by-table/index.js";
|
|
|
import test from "@/components/form-test/index.vue";
|
|
|
|
|
@@ -60,6 +329,8 @@ export default {
|
|
|
tree,
|
|
|
byTable,
|
|
|
test,
|
|
|
+ addProduct,
|
|
|
+ query,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -68,229 +339,63 @@ export default {
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
classifyId: "",
|
|
|
+ lifeCycle: "",
|
|
|
+ deptId: "",
|
|
|
+ code: "",
|
|
|
+ name: "",
|
|
|
+ purchasePriceMin: "",
|
|
|
+ purchasePriceMax: "",
|
|
|
+ sellingPriceMin: "",
|
|
|
+ sellingPriceMax: "",
|
|
|
+ jdPurchasePriceMin: "",
|
|
|
+ jdPurchasePriceMax: "",
|
|
|
+ combination: "",
|
|
|
+ beginTime: "",
|
|
|
+ endTime: "",
|
|
|
+ warehouseId: "",
|
|
|
},
|
|
|
tableList: [],
|
|
|
total: 0,
|
|
|
loading: false,
|
|
|
- open: false,
|
|
|
selectConfig: [
|
|
|
{
|
|
|
label: this.$t("product_material.product.productType"),
|
|
|
prop: "type",
|
|
|
- data: [
|
|
|
- { label: "半成品", value: 0 },
|
|
|
- { label: "成品", value: 1 },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- columns: [
|
|
|
- {
|
|
|
- label: this.$t("product_material.product.productType"),
|
|
|
- prop: "type",
|
|
|
- render: (h, params) => {
|
|
|
- const item = this.dialogForm.type.data.find(
|
|
|
- (item) => item.keyName === params.type
|
|
|
- );
|
|
|
- return <div>{item.labelName}</div>;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("product_material.product.productCode"),
|
|
|
- prop: "code",
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("product_material.product.productName"),
|
|
|
- prop: "name",
|
|
|
- },
|
|
|
- {
|
|
|
- label: this.$t("product_material.product.productUnit"),
|
|
|
- prop: "unit",
|
|
|
+ data: [],
|
|
|
},
|
|
|
{
|
|
|
- label: this.$t("product_material.product.description"),
|
|
|
- prop: "introduce",
|
|
|
+ label: this.$t("product_material.product.deptId"),
|
|
|
+ prop: "deptId",
|
|
|
+ data: [],
|
|
|
},
|
|
|
{
|
|
|
- align: "center",
|
|
|
- label: this.$t("operation"),
|
|
|
- actions: [
|
|
|
- {
|
|
|
- text: this.$t("edit"),
|
|
|
- type: "text",
|
|
|
- style: {
|
|
|
- color: "red",
|
|
|
- },
|
|
|
- fn: ({ row }) => {
|
|
|
- this.handleEdit(row);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- text: this.$t("delete"),
|
|
|
- type: "text",
|
|
|
- // disabled: true,
|
|
|
- style: {
|
|
|
- color: "red",
|
|
|
- },
|
|
|
- fn: ({ row }) => {
|
|
|
- this.handleDelete(row);
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
+ label: this.$t("product_material.product.lifeCycle"),
|
|
|
+ prop: "lifeCycle",
|
|
|
+ data: [],
|
|
|
},
|
|
|
],
|
|
|
- dialogParams: {
|
|
|
+ open: false,
|
|
|
+ form: {
|
|
|
classifyId: "",
|
|
|
+ deptId: "",
|
|
|
type: "",
|
|
|
code: "",
|
|
|
name: "",
|
|
|
unit: "",
|
|
|
- introduce: "",
|
|
|
- },
|
|
|
- dialogForm: {
|
|
|
- loadingStatus: false,
|
|
|
- classifyId: {
|
|
|
- label: this.$t("product_material.product.productClassify"),
|
|
|
- type: "cascader",
|
|
|
- props: {
|
|
|
- label: "label",
|
|
|
- value: "id",
|
|
|
- },
|
|
|
- width: "100%",
|
|
|
- data: [],
|
|
|
- },
|
|
|
- type: {
|
|
|
- label: this.$t("product_material.product.productType"),
|
|
|
- type: "select",
|
|
|
- span: 3,
|
|
|
- labelName: "labelName",
|
|
|
- keyName: "keyName",
|
|
|
- data: [
|
|
|
- {
|
|
|
- labelName: this.$t("product_material.product.finishedProduct"),
|
|
|
- keyName: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- labelName: this.$t(
|
|
|
- "product_material.product.partiallyPreparedProducts"
|
|
|
- ),
|
|
|
- keyName: 1,
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- code: {
|
|
|
- span: 3,
|
|
|
- label: this.$t("product_material.product.productCode"),
|
|
|
- type: "input",
|
|
|
- },
|
|
|
- name: {
|
|
|
- label: this.$t("product_material.product.productName"),
|
|
|
- type: "input",
|
|
|
- },
|
|
|
- // unit: {
|
|
|
- // label: this.$t("product_material.product.productUnit"),
|
|
|
- // type: "select",
|
|
|
- // span: 3,
|
|
|
- // labelName: "labelName",
|
|
|
- // keyName: "keyName",
|
|
|
- // data: [
|
|
|
- // {
|
|
|
- // labelName: this.$t("product_material.product.finishedProduct"),
|
|
|
- // keyName: 0,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // labelName: this.$t(
|
|
|
- // "product_material.product.partiallyPreparedProducts"
|
|
|
- // ),
|
|
|
- // keyName: 1,
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // },
|
|
|
- introduce: {
|
|
|
- label: this.$t("product_material.product.productDescription"),
|
|
|
- type: "input",
|
|
|
- itemType: "textarea",
|
|
|
- },
|
|
|
- // fileInfoList: {
|
|
|
- // label: this.$t("分组名称"),
|
|
|
- // type: "uploads",
|
|
|
- // data: [],
|
|
|
- // tip: "最多选择6个视频文件",
|
|
|
- // accept: ".avi,.wmv,.mkv,.mp4,.mov",
|
|
|
- // fileList: [],
|
|
|
- // },
|
|
|
- // videoClassifyId: {
|
|
|
- // label: this.$t("分组名称"),
|
|
|
- // type: "cascader",
|
|
|
- // props: {
|
|
|
- // label: "name",
|
|
|
- // value: "id",
|
|
|
- // },
|
|
|
- // data: [],
|
|
|
- // },
|
|
|
- // richText: {
|
|
|
- // label: this.$t("图文说明书"),
|
|
|
- // type: "editor",
|
|
|
- // },
|
|
|
-
|
|
|
- otherButton: {
|
|
|
- align: "center",
|
|
|
- list: [
|
|
|
- {
|
|
|
- name: this.$t("cancelText"),
|
|
|
- methodsText: "cancel",
|
|
|
- cancel: () => {
|
|
|
- this.$refs.form.reset();
|
|
|
- this.open = false;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- name: this.$t("submitText"),
|
|
|
- methodsText: "submit",
|
|
|
- type: "primary",
|
|
|
- submit: () => {
|
|
|
- this.handleSubmit();
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- },
|
|
|
- dialogRules: {
|
|
|
- classifyId: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t("product_material.product.productClassifyRules"),
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- type: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t("product_material.product.productTypeRules"),
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- code: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t("product_material.product.productCodeRules"),
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- name: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t("product_material.product.productNameRules"),
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- unit: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: this.$t("product_material.product.productUnitRules"),
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
+ combination: "",
|
|
|
+ purchasePrice: "",
|
|
|
+ sellingPrice: "",
|
|
|
+ jdPurchasePrice: "",
|
|
|
+ newProductsDay: "",
|
|
|
+ growUpDay: "",
|
|
|
+ newProductsExpectedSales: "",
|
|
|
+ growUpExpectedSales: "",
|
|
|
+ matureExpectedSales: "",
|
|
|
+ clearancePeriod: "",
|
|
|
+ productCombinationList: [],
|
|
|
},
|
|
|
+ queryDialog: false,
|
|
|
+ timeArr: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -310,6 +415,37 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleDateChange() {
|
|
|
+ this.req.beginTime = this.timeArr[0];
|
|
|
+ this.req.endTime = this.timeArr[1];
|
|
|
+ },
|
|
|
+ handleReset() {
|
|
|
+ this.req = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ classifyId: "",
|
|
|
+ lifeCycle: "",
|
|
|
+ deptId: "",
|
|
|
+ code: "",
|
|
|
+ name: "",
|
|
|
+ purchasePriceMin: "",
|
|
|
+ purchasePriceMax: "",
|
|
|
+ sellingPriceMin: "",
|
|
|
+ sellingPriceMax: "",
|
|
|
+ jdPurchasePriceMin: "",
|
|
|
+ jdPurchasePriceMax: "",
|
|
|
+ combination: "",
|
|
|
+ beginTime: "",
|
|
|
+ endTime: "",
|
|
|
+ warehouseId: "",
|
|
|
+ };
|
|
|
+ this.timeArr = [];
|
|
|
+ },
|
|
|
+ handleQuery() {
|
|
|
+ console.log(this.req, "sss");
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
API.productList(this.req).then(
|
|
@@ -331,6 +467,29 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+
|
|
|
+ handleCancel() {
|
|
|
+ this.form = {
|
|
|
+ classifyId: "",
|
|
|
+ deptId: "",
|
|
|
+ type: "",
|
|
|
+ code: "",
|
|
|
+ name: "",
|
|
|
+ unit: "",
|
|
|
+ combination: "",
|
|
|
+ purchasePrice: "",
|
|
|
+ sellingPrice: "",
|
|
|
+ jdPurchasePrice: "",
|
|
|
+ newProductsDay: "",
|
|
|
+ growUpDay: "",
|
|
|
+ newProductsExpectedSales: "",
|
|
|
+ growUpExpectedSales: "",
|
|
|
+ matureExpectedSales: "",
|
|
|
+ clearancePeriod: "",
|
|
|
+ productCombinationList: [],
|
|
|
+ };
|
|
|
+ this.open = false;
|
|
|
+ },
|
|
|
productAdd() {
|
|
|
this.titleText = "add";
|
|
|
this.open = true;
|
|
@@ -362,46 +521,45 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
handleSubmit() {
|
|
|
- this.$refs.form.$refs["form"].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.dialogForm.loadingStatus = true;
|
|
|
- if (!this.dialogParams.id) {
|
|
|
- API.productAdd(this.dialogParams).then(
|
|
|
- () => {
|
|
|
- this.msgSuccess(this.$t("addSuccess"));
|
|
|
- this.$refs.form.reset();
|
|
|
- this.open = false;
|
|
|
- this.dialogForm.loadingStatus = false;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log("productAdd: " + err);
|
|
|
- this.dialogForm.loadingStatus = false;
|
|
|
- }
|
|
|
- );
|
|
|
- } else {
|
|
|
- API.productEdit(this.dialogParams).then(
|
|
|
- () => {
|
|
|
- this.msgSuccess(this.$t("editSuccess"));
|
|
|
- this.$refs.form.reset();
|
|
|
- this.open = false;
|
|
|
- this.dialogForm.loadingStatus = false;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log("productEdit: " + err);
|
|
|
- this.dialogForm.loadingStatus = false;
|
|
|
- }
|
|
|
- );
|
|
|
+ if (this.form.id) {
|
|
|
+ API.productAdd(this.form).then(
|
|
|
+ () => {
|
|
|
+ this.msgSuccess(this.$t("addSuccess"));
|
|
|
+ this.$refs.addProduct.loading = false;
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("productAdd: " + err);
|
|
|
+ this.$refs.addProduct.loading = false;
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ API.productEdit(this.form).then(
|
|
|
+ () => {
|
|
|
+ this.msgSuccess(this.$t("editSuccess"));
|
|
|
+ this.open = false;
|
|
|
+ this.$refs.addProduct.loading = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log("productEdit: " + err);
|
|
|
+ this.$refs.addProduct.loading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.search-box {
|
|
|
+ height: calc(100vh - 280px);
|
|
|
+ overflow: auto;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
.right {
|
|
|
height: calc(100vh - 110px);
|
|
|
overflow-y: auto;
|