|
|
@@ -280,7 +280,7 @@
|
|
|
label-in-value
|
|
|
v-model="row.select_all_id"
|
|
|
@on-change="
|
|
|
- handleSelectProductMaterial($event,rowIndex)
|
|
|
+ handleSelectProductMaterial($event,rowIndex,row)
|
|
|
"
|
|
|
>
|
|
|
<Option
|
|
|
@@ -784,11 +784,11 @@
|
|
|
transfer
|
|
|
v-model="scope.row.remark"
|
|
|
allow-create
|
|
|
- @on-create="handleRemarkCreate"
|
|
|
+ @on-create="(val)=>handleRemarkCreate(val,scope.rowIndex)"
|
|
|
@on-change="changeEditRemark(scope.row)"
|
|
|
>
|
|
|
<Option
|
|
|
- v-for="item in support_remark"
|
|
|
+ v-for="item in scope.row.support_remark"
|
|
|
:value="item"
|
|
|
:key="item"
|
|
|
>{{ item }}</Option
|
|
|
@@ -1006,14 +1006,14 @@
|
|
|
},
|
|
|
],
|
|
|
tableData:[
|
|
|
- { id: 10001, name: 'Test1', nickname: 'T1', role: 'Develop', sex: '0', sex2: ['0'], num1: 40, age: 28, address: 'Shenzhen', date12: '', date13: '' ,is_metal:false,extArray:[{ num: 0,
|
|
|
- price: 0,
|
|
|
- total_price: 0,
|
|
|
- type:2,
|
|
|
- remark: "",
|
|
|
- title: "",
|
|
|
- id: "2",
|
|
|
- is_metal: true,}]},
|
|
|
+ // { id: 10001, name: 'Test1', nickname: 'T1', role: 'Develop', sex: '0', sex2: ['0'], num1: 40, age: 28, address: 'Shenzhen', date12: '', date13: '' ,is_metal:false,extArray:[{ num: 0,
|
|
|
+ // price: 0,
|
|
|
+ // total_price: 0,
|
|
|
+ // type:2,
|
|
|
+ // remark: "",
|
|
|
+ // title: "",
|
|
|
+ // id: "2",
|
|
|
+ // is_metal: true,}]},
|
|
|
// { id: 10002, name: 'Test2', nickname: 'T2', role: 'Designer', sex: '1', sex2: ['0', '1'], num1: 20, age: 22, address: 'Guangzhou', date12: '', date13: '2020-08-20' },
|
|
|
// { id: 10003, name: 'Test3', nickname: 'T3', role: 'Test', sex: '0', sex2: ['1'], num1: 200, age: 32, address: 'Shanghai', date12: '2020-09-10', date13: '' },
|
|
|
// { id: 10004, name: 'Test4', nickname: 'T4', role: 'Designer', sex: '1', sex2: ['1'], num1: 30, age: 23, address: 'Shenzhen', date12: '', date13: '2020-12-04' }
|
|
|
@@ -1127,53 +1127,35 @@
|
|
|
this.getProducts();
|
|
|
},
|
|
|
methods: {
|
|
|
- getMaterialName(row){
|
|
|
+getMaterialName(row){
|
|
|
console.log(row)
|
|
|
},
|
|
|
- handleSelectProductMaterial(e,index){//选择产品名称五金
|
|
|
- this.tableData[index].select_all_title = e.label
|
|
|
- let obj = {
|
|
|
- select_all_id: "", //产品五金ID
|
|
|
- product_id: "", //产品ID
|
|
|
- type_name: "", //展示用产品名称
|
|
|
- position: "", //位置
|
|
|
- over_price: "", //超标单价
|
|
|
- over_price_total:"",//超标总价
|
|
|
- unit_price: "", //单价
|
|
|
- ext_price: "", //附加金额
|
|
|
- price: "", //总金额
|
|
|
- remark: "", //备注
|
|
|
- measurement: "", //测量字段拼接
|
|
|
- total_num: "", //数量
|
|
|
- num: "", //核算数量
|
|
|
- num_formula: "", //核算数量公式
|
|
|
- url_number: "", //图号
|
|
|
- url: [], //图纸
|
|
|
- unit: "", //单位
|
|
|
- title: "", //产品名
|
|
|
- process: "", //工艺属性拼接
|
|
|
- procedure_properties: {}, //工艺属性对象
|
|
|
- overdraft: [], //超标公式
|
|
|
- measure: this._measure, //测量字段数组
|
|
|
- support_remark: this.support_remark, //备注列表
|
|
|
- is_metal: false,
|
|
|
- extArray: [
|
|
|
- {
|
|
|
- num: 0,
|
|
|
- price: 0,
|
|
|
- total_price: 0,
|
|
|
- type: 2,
|
|
|
- remark: "",
|
|
|
- title: "",
|
|
|
- id: "",
|
|
|
- is_metal: true,
|
|
|
- },
|
|
|
- ],
|
|
|
- // process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
- };
|
|
|
- this.tableData.push(obj);
|
|
|
+handleSelectProductMaterial(e,index,row){//选择产品名称五金
|
|
|
+ if(e){
|
|
|
+ this.tableData[index].select_all_title = e.label;
|
|
|
+ this.getProductInfo(e,index);
|
|
|
+ }else{
|
|
|
+ this.tableData[index].select_all_title = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ if(row.is_new){ //如果是新的一条那就加一行
|
|
|
+ this.handleTableAdd();
|
|
|
+ }
|
|
|
},
|
|
|
- footerMethod({ columns, data }) {
|
|
|
+getProductInfo(e,index){ //选择产品/五金
|
|
|
+ let product_id = e.value.split('-')[0];
|
|
|
+ this.axios("/api/order_get_product_detail_new", {
|
|
|
+ params: {
|
|
|
+ product_id,
|
|
|
+ custom_id: this.info.custom_id,
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ this.tableData[index].support_remark = res.data.support_remark; //获取每个产品的相应备注
|
|
|
+ this.tableData[index].part = res.data.part;
|
|
|
+ this.tableData[index].is_metal = false;
|
|
|
+ })
|
|
|
+},
|
|
|
+ footerMethod({ columns, data }) {
|
|
|
return [
|
|
|
columns.map((column, columnIndex) => {
|
|
|
if (columnIndex === 0) {
|
|
|
@@ -1198,7 +1180,7 @@
|
|
|
}),
|
|
|
];
|
|
|
},
|
|
|
- handleExtraDele(arr,index){
|
|
|
+handleExtraDele(arr,index){
|
|
|
arr.splice(index,1)
|
|
|
},
|
|
|
handleExtraAdd(array, type) {
|
|
|
@@ -1310,11 +1292,16 @@
|
|
|
);
|
|
|
this.clientList = JSON.parse(JSON.stringify(this.cus_list));
|
|
|
}
|
|
|
+ if(this.tableData.length==0){
|
|
|
+
|
|
|
+ this.handleTableAdd();
|
|
|
+ }
|
|
|
},
|
|
|
handleTableAdd() {
|
|
|
if (this.info.custom_id) {
|
|
|
this.currentTabIndex = "0";
|
|
|
let obj = {
|
|
|
+ is_new:true,//标记是新的
|
|
|
select_all_id: "", //产品五金ID
|
|
|
product_id: "", //产品ID
|
|
|
type_name: "", //展示用产品名称
|
|
|
@@ -1351,11 +1338,14 @@
|
|
|
is_metal: true,
|
|
|
},
|
|
|
],
|
|
|
- process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
+ // process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
};
|
|
|
- obj.process_obj.map(
|
|
|
- (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
|
|
|
- );
|
|
|
+ // obj.process_obj.map(
|
|
|
+ // (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
|
|
|
+ // );
|
|
|
+ this.tableData.forEach(v=>{
|
|
|
+ v.is_new = false //让表格只有一条是新增的
|
|
|
+ })
|
|
|
this.tableData.push(obj);
|
|
|
this.$forceUpdate();
|
|
|
} else {
|
|
|
@@ -1407,11 +1397,12 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- changeEditRemark(){
|
|
|
+ changeEditRemark(e){
|
|
|
|
|
|
},
|
|
|
- handleRemarkCreate(){
|
|
|
-
|
|
|
+ handleRemarkCreate(val,index){
|
|
|
+ console.log(index)
|
|
|
+ this.tableData[index].support_remark.push(val)
|
|
|
},
|
|
|
changeExtPrice(e, product){
|
|
|
|