|
|
@@ -165,6 +165,29 @@
|
|
|
placeholder="请输入库存"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
+ <FormItem v-if="!isShowDetail" style="" >
|
|
|
+ <Button
|
|
|
+ type="success"
|
|
|
+ ghost
|
|
|
+ style="margin-right:10px;margin-top:35px"
|
|
|
+ @click="handleBrand(null,1)"
|
|
|
+ :disabled="type == 3 ? true : false"
|
|
|
+ >添加品牌</Button>
|
|
|
+ <Button
|
|
|
+ ghost
|
|
|
+ type="success"
|
|
|
+ style="margin-right:10px;margin-top:35px"
|
|
|
+ :disabled="type == 3 ? true : false"
|
|
|
+ @click="handleBrand(null,2)"
|
|
|
+ >编辑品牌</Button>
|
|
|
+ <Button
|
|
|
+ ghost
|
|
|
+ type="success"
|
|
|
+ style="margin-right:10px;margin-top:35px"
|
|
|
+ @click="handleBrand(null,3)"
|
|
|
+ :disabled="type == 3 ? true : false"
|
|
|
+ >删除品牌</Button>
|
|
|
+ </FormItem>
|
|
|
<!-- <FormItem label="单价(元)" v-show="isShowInfoPrice" prop="price">
|
|
|
<Input
|
|
|
type="number"
|
|
|
@@ -274,6 +297,30 @@
|
|
|
@click="removeChild(info.detail, key)"
|
|
|
>删除</Button
|
|
|
>
|
|
|
+ <Button
|
|
|
+ type="success"
|
|
|
+ ghost
|
|
|
+ style="margin-left:10px;"
|
|
|
+ :disabled="type == 3 ? true : false"
|
|
|
+ @click="handleBrand(info.detail,1,key)"
|
|
|
+ >添加品牌</Button
|
|
|
+ >
|
|
|
+ <Button
|
|
|
+ type="success"
|
|
|
+ ghost
|
|
|
+ style="margin-left:10px;"
|
|
|
+ :disabled="type == 3 ? true : false"
|
|
|
+ @click="addMaterrial(info.detail,2)"
|
|
|
+ >编辑品牌</Button
|
|
|
+ >
|
|
|
+ <Button
|
|
|
+ type="success"
|
|
|
+ ghost
|
|
|
+ style="margin-left:10px;"
|
|
|
+ :disabled="type == 3 ? true : false"
|
|
|
+ @click="addMaterrial(info.detail,3)"
|
|
|
+ >删除品牌</Button
|
|
|
+ >
|
|
|
</div>
|
|
|
</FormItem>
|
|
|
|
|
|
@@ -291,6 +338,36 @@
|
|
|
</div>
|
|
|
<div slot="footer"></div>
|
|
|
</Modal>
|
|
|
+ <Modal title="添加品牌" width='50' v-model="showBrand" @on-ok='sureBrand'>
|
|
|
+ <div class="brand_content">
|
|
|
+ <div style="height:100%;overflow:auto">
|
|
|
+ <!-- <Form class="table_content" :label-width='100'>
|
|
|
+ <FormItem label='品牌名称:'>
|
|
|
+ <Input v-model='modelBrandTitle' clearable placeholder="请输入品牌名称"/>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem>
|
|
|
+ <Button type="primary">搜索</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form> -->
|
|
|
+ <div class="add_btn">
|
|
|
+ <Button type="primary" @click="addItem">增行</Button>
|
|
|
+ </div>
|
|
|
+ <Table :data='modelTableData' :columns='modelTableColumns' border max-height='500' @on-selection-change='modelSelectData'>
|
|
|
+ <template slot="title" slot-scope="{index}">
|
|
|
+ <Select clearable v-model="modelTableData[index].brand_id" placeholder="请输入品牌名称" transfer>
|
|
|
+ <Option v-for="item in brandList" :key="item.id" :value="item.id" :label="item.title"/>
|
|
|
+ </Select>
|
|
|
+ </template>
|
|
|
+ <template slot="product_code" slot-scope="{index}">
|
|
|
+ <Input clearable v-model="modelTableData[index].code" placeholder="请输入物料编码"/>
|
|
|
+ </template>
|
|
|
+ <template slot="set" slot-scope="{index}">
|
|
|
+ <a @click="ModelDel(index)">删除</a>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -299,6 +376,18 @@ import KeyBoard from "../../components/keyboard/index";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ modelIndex:'',
|
|
|
+ modelData:[],
|
|
|
+ brandList:[],
|
|
|
+ modelTableData:[],
|
|
|
+ modelTableColumns:[
|
|
|
+ {type:'selection',align:'center',minWidth:60},
|
|
|
+ {title:'品牌名称',key:'title',align:'center',minWidth:120,slot:'title'},
|
|
|
+ {title:'物料编码',key:'code',align:'center',minWidth:120,slot:'product_code'},
|
|
|
+ {title:'操作',key:'set',slot:'set',minWidth:120,align:'center'}
|
|
|
+ ],
|
|
|
+ modelBrandTitle:'',
|
|
|
+ showBrand:false,
|
|
|
del_list:[],
|
|
|
type: 1,
|
|
|
info: {
|
|
|
@@ -355,7 +444,12 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
components: { KeyBoard },
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ //拉取品牌列表
|
|
|
+ this.axios.post('/api/brand_list').then(res=>{
|
|
|
+ this.brandList = res.data.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.type = this.$route.query.type;
|
|
|
this.id = this.$route.query.id || "";
|
|
|
@@ -429,6 +523,45 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ sureBrand(){
|
|
|
+ if(!this.isShowDetail){
|
|
|
+ this.info.detail[0].list = this.modelData;
|
|
|
+ }else{
|
|
|
+ this.info.detail[this.modelIndex].list = this.modelData;
|
|
|
+ }
|
|
|
+ console.log(this.info.detail)
|
|
|
+ },
|
|
|
+ modelSelectData(e){
|
|
|
+ this.modelData = e;
|
|
|
+ },
|
|
|
+ ModelDel(index){
|
|
|
+ this.modelTableData.splice(index,1)
|
|
|
+ },
|
|
|
+ addItem(){
|
|
|
+ let obj ={
|
|
|
+ brand_id:'',
|
|
|
+ code:''
|
|
|
+ }
|
|
|
+ this.modelTableData.push(obj)
|
|
|
+ },
|
|
|
+handleBrand(obj,type,key){
|
|
|
+ //type ==1 添加 2 编辑 3删除;
|
|
|
+ switch(type){
|
|
|
+ case 1:
|
|
|
+ case 2:
|
|
|
+ if(key){
|
|
|
+ this.modelIndex = key;
|
|
|
+ this.modelTableData = this.info.detail[key].list?this.info.detail[key].list:[];
|
|
|
+ }else{
|
|
|
+ this.modelTableData = this.info.detail[0].list?this.info.detail[0].list:[];
|
|
|
+ }
|
|
|
+
|
|
|
+ this.showBrand = true;
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+},
|
|
|
changeSate(rows,index){
|
|
|
if(!rows.is_add){
|
|
|
this.info.detail[index].is_edit = true;
|
|
|
@@ -639,4 +772,22 @@ export default {
|
|
|
top: 0px;
|
|
|
color: red;
|
|
|
}
|
|
|
+/deep/ .ivu-form-item{
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
+.brand_content{
|
|
|
+ height: 60vh;
|
|
|
+
|
|
|
+ .table_content{
|
|
|
+ margin-top:10px;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+.add_btn{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+ margin-bottom:10px;
|
|
|
+}
|
|
|
</style>
|